gcc -O2 -o keytest.asm -masm=intel -S -Wall -march=pentium keytest.c
keycmp .p2align 4,,15 .def _keycmp; .scl 3; .type 32; .endef _keycmp: push ebp mov ebp, esp push edi push esi push ebx |
keycmp_new .p2align 4,,15 .def _keycmp_new; .scl 3; .type 32; .endef _keycmp_new: push ebp mov ebp, esp push edi push esi push ebx sub esp, 12 mov eax, DWORD PTR [ebp+8] mov edx, DWORD PTR [ebp+12] mov edi, DWORD PTR [eax+4] mov esi, DWORD PTR [eax] mov ecx, DWORD PTR [edx] mov ebx, DWORD PTR [edx+4] mov eax, esi mov edx, edi xor edx, ebx xor eax, ecx or edx, eax jne L67 mov eax, DWORD PTR [ebp+8] mov edx, DWORD PTR [ebp+12] mov edi, DWORD PTR [eax+12] mov esi, DWORD PTR [eax+8] mov ecx, DWORD PTR [edx+8] mov ebx, DWORD PTR [edx+12] mov eax, esi mov edx, edi xor edx, ebx xor eax, ecx or edx, eax jne L67 mov eax, DWORD PTR [ebp+8] mov edx, DWORD PTR [ebp+12] mov edi, DWORD PTR [eax+20] mov esi, DWORD PTR [eax+16] mov ecx, DWORD PTR [edx+16] mov ebx, DWORD PTR [edx+20] mov eax, esi mov edx, edi xor edx, ebx xor eax, ecx or edx, eax je L49 .p2align 4,,7 L67: mov eax, 1 cmp edi, ebx ja L61 jb L62 cmp esi, ecx L63: ja L61 .p2align 4,,7 L62: xor eax, eax L61: mov ecx, eax L34: add esp, 12 mov eax, ecx pop ebx pop esi pop edi pop ebp ret .p2align 4,,7 L49: mov edx, DWORD PTR [ebp+8] mov ecx, 2 mov eax, DWORD PTR [edx+24] mov edx, DWORD PTR [edx+28] mov DWORD PTR [ebp-24], eax mov DWORD PTR [ebp-20], edx mov eax, DWORD PTR [ebp+12] mov edx, DWORD PTR [ebp-20] mov ebx, DWORD PTR [eax+24] mov esi, DWORD PTR [eax+28] mov eax, DWORD PTR [ebp-24] xor edx, esi xor eax, ebx or edx, eax je L34 mov eax, 1 cmp DWORD PTR [ebp-20], esi ja L61 jb L62 cmp DWORD PTR [ebp-24], ebx jmp L63 |