I have created a other test, where with a global variable i can toggle between the c and the asm version thats how it looks in code
Code:
.text:000000014001C66A mov eax, cs:g_test
.text:000000014001C670 mov rcx, [rcx+18h]
.text:000000014001C674 test eax, eax
.text:000000014001C676 jnz Sbie_InvokeSyscall5_asm
.text:000000014001C67C jmp Sbie_InvokeSyscall5
The dispatch function is compiled with optimization and as it does not need local variables the compiler optimized the calls away.
I checked again that Sbie_InvokeSyscall5_asm and Sbie_InvokeSyscall5 are binary same, and they are.
Still toggling the variable breaks 32 bit apps.
At this point its just wired, I mean the "calling" convention is the same and the functions are the same yet the result is not, WTF :/