So I found a mistake in my assembly code. Now when I use the new version, Matlab crashes again but with crash dialog where it says on which address of the DLL is the problem. It always crashes at the first instruction that uses two 128 bit registers (xmm). I tried to remove the line, and it again crashed at the next instruction. And then again.
Have no idea where's the problem because in .exe file + dbg the code works fine.