Created
October 3, 2017 09:17
-
-
Save anonymous/0089131a5e8a9466eb19f2d64cf08b96 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#include <cstdio> | |
void loop_up() { | |
for (int i = 0; i < 42; ++i) { | |
printf("Hello"); | |
} | |
} | |
void loop_down() { | |
for (int i = 42; i; --i) { | |
printf("Hello"); | |
} | |
} | |
/* | |
.LC0: | |
.string "Hello" | |
loop_up(): | |
push rbx | |
mov ebx, 42 | |
.L2: | |
xor eax, eax | |
mov edi, OFFSET FLAT:.LC0 | |
call printf | |
sub ebx, 1 | |
jne .L2 | |
pop rbx | |
ret | |
loop_down(): | |
push rbx | |
mov ebx, 42 | |
.L7: | |
xor eax, eax | |
mov edi, OFFSET FLAT:.LC0 | |
call printf | |
sub ebx, 1 | |
jne .L7 | |
pop rbx | |
ret | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment