Skip to content

Instantly share code, notes, and snippets.

@djg djg/level2.asm
Last active May 16, 2019

Embed
What would you like to do?
Rust Output At Different Opt Levels
example::test:
push rax
cmp rsi, 50
jbe .LBB23_1
mov eax, dword ptr [rdx]
mov dword ptr [rdi], eax
mov eax, dword ptr [rdx + 4]
mov dword ptr [rdi + 4], eax
mov eax, dword ptr [rdx + 8]
mov dword ptr [rdi + 8], eax
mov eax, dword ptr [rdx + 12]
mov dword ptr [rdi + 12], eax
mov rax, qword ptr [rdx + 16]
mov qword ptr [rdi + 16], rax
mov eax, dword ptr [rdx + 24]
mov dword ptr [rdi + 24], eax
mov eax, dword ptr [rdx + 28]
mov dword ptr [rdi + 28], eax
mov eax, dword ptr [rdx + 32]
mov byte ptr [rdi + 32], al
cmp eax, 1
jne .LBB23_4
mov rax, qword ptr [rdx + 40]
mov qword ptr [rdi + 33], rax
mov eax, dword ptr [rdx + 48]
mov dword ptr [rdi + 41], eax
lea rax, [rdx + 52]
jmp .LBB23_6
.LBB23_4:
mov rax, qword ptr [rdx + 48]
mov qword ptr [rdi + 33], rax
mov eax, dword ptr [rdx + 36]
mov dword ptr [rdi + 41], eax
lea rax, [rdx + 40]
.LBB23_6:
mov eax, dword ptr [rax]
mov dword ptr [rdi + 45], eax
cmp qword ptr [rdx + 56], 1
je .LBB23_7
mov byte ptr [rdi + 49], 0
mov al, byte ptr [rdx + 80]
mov byte ptr [rdi + 50], al
pop rax
ret
.LBB23_1:
lea rdi, [rip + .L__unnamed_34]
lea rdx, [rip + .L__unnamed_35]
jmp .LBB23_2
.LBB23_7:
mov byte ptr [rdi + 49], 1
lea rdi, [rip + .L__unnamed_34]
lea rdx, [rip + .L__unnamed_36]
.LBB23_2:
mov esi, 49
call std::panicking::begin_panic
ud2
example::test:
push rax
cmp rsi, 50
jbe .LBB23_1
movups xmm0, xmmword ptr [rdx]
movups xmmword ptr [rdi], xmm0
mov rax, qword ptr [rdx + 16]
mov qword ptr [rdi + 16], rax
mov rax, qword ptr [rdx + 24]
mov qword ptr [rdi + 24], rax
mov eax, dword ptr [rdx + 32]
mov byte ptr [rdi + 32], al
cmp eax, 1
jne .LBB23_4
mov rax, qword ptr [rdx + 40]
mov qword ptr [rdi + 33], rax
lea rax, [rdx + 48]
lea rcx, [rdx + 52]
jmp .LBB23_6
.LBB23_4:
lea rax, [rdx + 36]
mov rcx, qword ptr [rdx + 48]
mov qword ptr [rdi + 33], rcx
lea rcx, [rdx + 40]
.LBB23_6:
mov eax, dword ptr [rax]
mov ecx, dword ptr [rcx]
mov dword ptr [rdi + 41], eax
mov dword ptr [rdi + 45], ecx
cmp qword ptr [rdx + 56], 1
je .LBB23_7
mov byte ptr [rdi + 49], 0
mov al, byte ptr [rdx + 80]
mov byte ptr [rdi + 50], al
pop rax
ret
.LBB23_1:
lea rdi, [rip + .L__unnamed_34]
lea rdx, [rip + .L__unnamed_35]
mov esi, 49
call std::panicking::begin_panic
ud2
.LBB23_7:
mov byte ptr [rdi + 49], 1
lea rdi, [rip + .L__unnamed_34]
lea rdx, [rip + .L__unnamed_36]
mov esi, 49
call std::panicking::begin_panic
ud2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.