Last active
August 29, 2015 14:02
-
-
Save retep998/d4f93cd931ebcfa46220 to your computer and use it in GitHub Desktop.
Rust vs C++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nl::bench::recurse_sub: | |
009312E0 push ebp | |
009312E1 mov ebp,esp | |
009312E3 and esp,0FFFFFFF8h | |
009312E6 sub esp,14h | |
009312E9 mov eax,dword ptr [ebp+8] | |
009312EC push ebx | |
009312ED push esi | |
009312EE push edi | |
009312EF mov ebx,dword ptr [eax] | |
009312F1 mov edi,1 | |
009312F6 mov edx,dword ptr [eax+4] | |
009312F9 mov dword ptr [esp+14h],ecx | |
009312FD mov dword ptr [esp+10h],edx | |
00931301 test ebx,ebx | |
00931303 jne 00931309 | |
00931305 xor esi,esi | |
00931307 jmp 00931315 | |
00931309 mov eax,dword ptr [ebx+4] | |
0093130C lea ecx,[eax+eax*4] | |
0093130F mov eax,dword ptr [edx+4] | |
00931312 lea esi,[eax+ecx*4] | |
00931315 test ebx,ebx | |
00931317 je 0093132F | |
00931319 movzx eax,word ptr [ebx+8] | |
0093131D add eax,dword ptr [ebx+4] | |
00931320 lea ecx,[eax+eax*4] | |
00931323 mov eax,dword ptr [ebp+8] | |
00931326 mov eax,dword ptr [eax+4] | |
00931329 mov eax,dword ptr [eax+4] | |
0093132C lea ebx,[eax+ecx*4] | |
0093132F cmp esi,ebx | |
00931331 je 00931356 | |
00931333 mov ecx,dword ptr [esp+14h] | |
00931337 lea eax,[esp+18h] | |
0093133B push eax | |
0093133C mov dword ptr [esp+1Ch],esi | |
00931340 mov dword ptr [esp+20h],edx | |
00931344 call 009312E0 | |
00931349 mov edx,dword ptr [esp+10h] | |
0093134D add esi,14h | |
00931350 add edi,eax | |
00931352 cmp esi,ebx | |
00931354 jne 00931333 | |
00931356 mov eax,edi | |
00931358 pop edi | |
00931359 pop esi | |
0093135A pop ebx | |
0093135B mov esp,ebp | |
0093135D pop ebp | |
0093135E ret 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nl::bench::recurse_sub: | |
00007FF692D01220 mov qword ptr [rsp+10h],rbx | |
00007FF692D01225 mov qword ptr [rsp+18h],rbp | |
00007FF692D0122A mov qword ptr [rsp+20h],rsi | |
00007FF692D0122F mov qword ptr [rsp+8],rcx | |
00007FF692D01234 push rdi | |
00007FF692D01235 sub rsp,30h | |
00007FF692D01239 mov r8,qword ptr [rdx] | |
00007FF692D0123C mov rbp,qword ptr [rdx+8] | |
00007FF692D01240 xor esi,esi | |
00007FF692D01242 mov r9,rdx | |
00007FF692D01245 mov r10,rcx | |
00007FF692D01248 mov edi,1 | |
00007FF692D0124D test r8,r8 | |
00007FF692D01250 jne 00007FF692D01256 | |
00007FF692D01252 mov ebx,esi | |
00007FF692D01254 jmp 00007FF692D01266 | |
00007FF692D01256 mov eax,dword ptr [r8+4] | |
00007FF692D0125A lea rcx,[rax+rax*4] | |
00007FF692D0125E mov rax,qword ptr [rbp+8] | |
00007FF692D01262 lea rbx,[rax+rcx*4] | |
00007FF692D01266 test r8,r8 | |
00007FF692D01269 je 00007FF692D01287 | |
00007FF692D0126B mov eax,dword ptr [r8+4] | |
00007FF692D0126F movzx ecx,word ptr [r8+8] | |
00007FF692D01274 add rcx,rax | |
00007FF692D01277 mov rax,qword ptr [r9+8] | |
00007FF692D0127B lea rdx,[rcx+rcx*4] | |
00007FF692D0127F mov rcx,qword ptr [rax+8] | |
00007FF692D01283 lea rsi,[rcx+rdx*4] | |
00007FF692D01287 cmp rbx,rsi | |
00007FF692D0128A je 00007FF692D012B8 | |
00007FF692D0128C nop dword ptr [rax] | |
00007FF692D01290 lea rdx,[rsp+20h] | |
00007FF692D01295 mov rcx,r10 | |
00007FF692D01298 mov qword ptr [rsp+20h],rbx | |
00007FF692D0129D mov qword ptr [rsp+28h],rbp | |
00007FF692D012A2 call 00007FF692D01220 | |
00007FF692D012A7 mov r10,qword ptr [rsp+40h] | |
00007FF692D012AC add rbx,14h | |
00007FF692D012B0 add rdi,rax | |
00007FF692D012B3 cmp rbx,rsi | |
00007FF692D012B6 jne 00007FF692D01290 | |
00007FF692D012B8 mov rbx,qword ptr [rsp+48h] | |
00007FF692D012BD mov rbp,qword ptr [rsp+50h] | |
00007FF692D012C2 mov rsi,qword ptr [rsp+58h] | |
00007FF692D012C7 mov rax,rdi | |
00007FF692D012CA add rsp,30h | |
00007FF692D012CE pop rdi | |
00007FF692D012CF ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.def __ZN7recurse20h9b5fad914f8cd2f5Gka4v0.0E; | |
.scl 3; | |
.type 32; | |
.endef | |
.align 16, 0x90 | |
__ZN7recurse20h9b5fad914f8cd2f5Gka4v0.0E: | |
.cfi_startproc | |
cmp esp, dword ptr fs:[20] | |
ja LBB3_2 | |
push 4 | |
push 20 | |
call ___morestack | |
ret | |
LBB3_2: | |
push ebp | |
Ltmp1: | |
.cfi_def_cfa_offset 8 | |
push ebx | |
Ltmp2: | |
.cfi_def_cfa_offset 12 | |
push edi | |
Ltmp3: | |
.cfi_def_cfa_offset 16 | |
push esi | |
Ltmp4: | |
.cfi_def_cfa_offset 20 | |
push eax | |
Ltmp5: | |
.cfi_def_cfa_offset 24 | |
Ltmp6: | |
.cfi_offset esi, -20 | |
Ltmp7: | |
.cfi_offset edi, -16 | |
Ltmp8: | |
.cfi_offset ebx, -12 | |
Ltmp9: | |
.cfi_offset ebp, -8 | |
mov esi, edx | |
mov edi, 1 | |
test si, si | |
je LBB3_5 | |
mov ebx, dword ptr [esp + 24] | |
mov eax, dword ptr [ebx + 8] | |
imul ecx, ecx, 20 | |
lea ebp, dword ptr [eax + ecx + 8] | |
mov edi, 1 | |
.align 16, 0x90 | |
LBB3_4: | |
mov ecx, dword ptr [ebp - 4] | |
movzx edx, word ptr [ebp] | |
mov dword ptr [esp], ebx | |
call __ZN7recurse20h9b5fad914f8cd2f5Gka4v0.0E | |
add edi, eax | |
add ebp, 20 | |
dec si | |
jne LBB3_4 | |
LBB3_5: | |
mov eax, edi | |
add esp, 4 | |
pop esi | |
pop edi | |
pop ebx | |
pop ebp | |
ret | |
.cfi_endproc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment