xunge/DecIR huggingface dataset:
toobig_2(int amt) { return (1 >> amt); }


x86 assembly (clang, -O0):
<toobig_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toobig_2>:
mov    %edi,%ecx
mov    $0x1,%eax
shr    %cl,%eax
ret

LLVM IR (-O0):
define i32 @toobig_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 1, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @toobig_2(i32 %0) {
%2 = lshr i32 1, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
void linux_perror_(char *string) { perror(string); }


x86 assembly (clang, -O0):
<linux_perror_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linux_perror_>:
jmp    1030 <perror@plt>

LLVM IR (-O0):
define void @linux_perror_(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
ret void
}

LLVM IR (-O2):
define void @linux_perror_(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ msgErro(char *);
void erroVal() { msgErro("Falta informar o valor!"); }


x86 assembly (clang, -O0):
<erroVal>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <msgErro@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<erroVal>:
lea    0xee9(%rip),%rdi
jmp    1030 <msgErro@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Falta informar o valor!\00"
define void @erroVal() {
%1 = call i32 @msgErro(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Falta informar o valor!\00"
define void @erroVal() {
%1 = tail call i32 @msgErro(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
int systemlib() { return 0; }


x86 assembly (clang, -O0):
<systemlib>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<systemlib>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @systemlib() {
ret i32 0
}

LLVM IR (-O2):
define i32 @systemlib() {
ret i32 0
}
int xtensa_not_simm12(v)
int v;
{ return !xtensa_simm12(v); }


x86 assembly (clang, -O0):
<xtensa_not_simm12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <xtensa_simm12@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xtensa_not_simm12>:
push   %rax
xor    %eax,%eax
call   1030 <xtensa_simm12@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @xtensa_not_simm12(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @xtensa_simm12 to i32 (i32, ...)*)(i32 %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @xtensa_not_simm12(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @xtensa_simm12 to i32 (i32, ...)*)(i32 %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int);
void sync(void) { syscall(36); }


x86 assembly (clang, -O0):
<sync>:
push   %rbp
mov    %rsp,%rbp
mov    $0x24,%edi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync>:
mov    $0x24,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define void @sync() {
%1 = call i32 @syscall(i32 36)
ret void
}

LLVM IR (-O2):
define void @sync() {
%1 = tail call i32 @syscall(i32 36)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flip_board();
void cmd_flip(void) { flip_board(); }


x86 assembly (clang, -O0):
<cmd_flip>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <flip_board@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_flip>:
xor    %eax,%eax
jmp    1030 <flip_board@plt>

LLVM IR (-O0):
define void @cmd_flip() {
%1 = call i32 (...) @flip_board()
ret void
}

LLVM IR (-O2):
define void @cmd_flip() {
%1 = tail call i32 (...) @flip_board()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bill(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main() {
  bill("Hello World");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <bill@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <bill@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @bill(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @bill(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ terminal_initialize();
int /*<<< orphan*/ terminal_readline();
int /*<<< orphan*/ terminal_writestring(char *);
void kernel_main() {
  terminal_initialize();
  terminal_writestring("!#:");
  terminal_readline();
}


x86 assembly (clang, -O0):
<kernel_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <terminal_initialize@plt>
lea    0xebe(%rip),%rdi
call   1030 <terminal_writestring@plt>
mov    $0x0,%al
call   1050 <terminal_readline@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_main>:
push   %rax
xor    %eax,%eax
call   1040 <terminal_initialize@plt>
lea    0xec1(%rip),%rdi
call   1030 <terminal_writestring@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <terminal_readline@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"!#:\00"
define void @kernel_main() {
%1 = call i32 (...) @terminal_initialize()
%2 = call i32 @terminal_writestring(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @terminal_readline()
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"!#:\00"
define void @kernel_main() {
%1 = tail call i32 (...) @terminal_initialize()
%2 = tail call i32 @terminal_writestring(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @terminal_readline()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ japi_setnolayout(int);
void j_setnolayout(int arg0) { japi_setnolayout(arg0); }


x86 assembly (clang, -O0):
<j_setnolayout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <japi_setnolayout@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_setnolayout>:
jmp    1030 <japi_setnolayout@plt>

LLVM IR (-O0):
define void @j_setnolayout(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @japi_setnolayout(i32 %3)
ret void
}

LLVM IR (-O2):
define void @j_setnolayout(i32 %0) {
%2 = tail call i32 @japi_setnolayout(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parenth(char *, int /*<<< orphan*/, int, int);
void main() {
  char str[6] = {0};
  parenth(str, 0, 3, 3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x6(%rbp),%rdi
xor    %esi,%esi
mov    $0x6,%edx
call   1030 <memset@plt>
lea    -0x6(%rbp),%rdi
xor    %esi,%esi
mov    $0x3,%ecx
mov    %ecx,%edx
call   1040 <parenth@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x3,%edx
mov    $0x3,%ecx
call   1030 <parenth@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca [6 x i8]
%2 = bitcast [6 x i8]* %1 to i8*
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%4 = call i32 @parenth(i8* %3, i32 0, i32 3, i32 3)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @parenth(i8* %2, i32 0, i32 3, i32 3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int /*<<< orphan*/ *);
void input_Pl_N(int64_t *p) { scanf("%ld", p); }


x86 assembly (clang, -O0):
<input_Pl_N>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <scanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_Pl_N>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <scanf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
define void @input_Pl_N(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define void @input_Pl_N(i32* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %0)
ret void
}
unsigned right_node(unsigned i) { return (i << 1) + 1; }


x86 assembly (clang, -O0):
<right_node>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<right_node>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @right_node(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
%5 = add i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @right_node(i32 %0) {
%2 = shl i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("\x1b["
       "3"
       "7"
       "m"
       "[ "
       "\x1b["
       "3"
       "2"
       ";"
       "1"
       "m"
       "OKAY"
       "\x1b["
       "3"
       "7"
       ";"
       "22"
       "m"
       " ]"
       "\x1b["
       "0"
       "m"
       " "
       "Everything is fine"
       "\n"
       "\x1b["
       "3"
       "7"
       "m"
       "[ "
       "\x1b["
       "3"
       "3"
       ";"
       "1"
       "m"
       "WARN"
       "\x1b["
       "3"
       "7"
       ";"
       "22"
       "m"
       " ]"
       "\x1b["
       "0"
       "m"
       " "
       "Final warning..."
       "\n"
       "\x1b["
       "3"
       "7"
       "m"
       "[ "
       "\x1b["
       "3"
       "1"
       ";"
       "1"
       "m"
       "FAIL"
       "\x1b["
       "3"
       "7"
       ";"
       "22"
       "m"
       " ]"
       "\x1b["
       "0"
       "m"
       " "
       "Exterminate!"
       "\n");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [149 x i8] c"\1B[37m[ \1B[32;1mOKAY\1B[37;22m ]\1B[0m Everything is fine\0A\1B[37m[ \1B[33;1mWARN\1B[37;22m ]\1B[0m Final warning...\0A\1B[37m[ \1B[31;1mFAIL\1B[37;22m ]\1B[0m Exterminate!\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@.str = [149 x i8] c"\1B[37m[ \1B[32;1mOKAY\1B[37;22m ]\1B[0m Everything is fine\0A\1B[37m[ \1B[33;1mWARN\1B[37;22m ]\1B[0m Final warning...\0A\1B[37m[ \1B[31;1mFAIL\1B[37;22m ]\1B[0m Exterminate!\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([149 x i8], [149 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int say(int, char **);
int main(int argc, char *argv[]) {
  int ret;
  ret = say(argc - 1, argv + 1);
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1030 <say@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
add    $0xffffffff,%edi
add    $0x8,%rsi
jmp    1030 <say@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = call i32 @say(i32 %8, i8** %10)
store i32 %11, i32* %6
%12 = load i32, i32* %6
ret i32 %12
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = add nsw i32 %0, -1
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = tail call i32 @say(i32 %3, i8** %4)
ret i32 %5
}
/* Variables and functions */
double FDLIBM___ieee754_lgamma_r(double, int *);
double FDLIBM___ieee754_gamma_r(double x, int *signgamp) {
  return FDLIBM___ieee754_lgamma_r(x, signgamp);
}


x86 assembly (clang, -O0):
<FDLIBM___ieee754_gamma_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
call   1030 <FDLIBM___ieee754_lgamma_r@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FDLIBM___ieee754_gamma_r>:
jmp    1030 <FDLIBM___ieee754_lgamma_r@plt>

LLVM IR (-O0):
define double @FDLIBM___ieee754_gamma_r(double %0, i32* %1) {
%3 = alloca double
%4 = alloca i32*
store double %0, double* %3
store i32* %1, i32** %4
%5 = load double, double* %3
%6 = load i32*, i32** %4
%7 = call double @FDLIBM___ieee754_lgamma_r(double %5, i32* %6)
ret double %7
}

LLVM IR (-O2):
define double @FDLIBM___ieee754_gamma_r(double %0, i32* %1) {
%3 = tail call double @FDLIBM___ieee754_lgamma_r(double %0, i32* %1)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_add_epi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_add_epi16(__m128i A, __m128i B) { return _mm_add_epi16(A, B); }


x86 assembly (clang, -O0):
<test_mm_add_epi16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <_mm_add_epi16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_add_epi16>:
jmp    1030 <_mm_add_epi16@plt>

LLVM IR (-O0):
define i32 @test_mm_add_epi16(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @_mm_add_epi16(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_add_epi16(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_add_epi16(i32 %0, i32 %1)
ret i32 %3
}
int rl_copy_region_to_kill(count, ignore)
int count __attribute__((unused)), ignore __attribute__((unused));
{ return (region_kill_internal(0)); }


x86 assembly (clang, -O0):
<rl_copy_region_to_kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %edi,%edi
mov    $0x0,%al
call   1030 <region_kill_internal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rl_copy_region_to_kill>:
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <region_kill_internal@plt>

LLVM IR (-O0):
define i32 @rl_copy_region_to_kill(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (i32, ...) bitcast (i32 (...)* @region_kill_internal to i32 (i32, ...)*)(i32 0)
ret i32 %5
}

LLVM IR (-O2):
define i32 @rl_copy_region_to_kill(i32 %0, i32 %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @region_kill_internal to i32 (i32, ...)*)(i32 0)
ret i32 %3
}
unsigned reverse(unsigned x) {
  x = ((x & 0x55555555) << 1) | ((x >> 1) & 0x55555555);
  x = ((x & 0x33333333) << 2) | ((x >> 2) & 0x33333333);
  x = ((x & 0x0F0F0F0F) << 4) | ((x >> 4) & 0x0F0F0F0F);
  x = (x << 24) | ((x & 0xFF00) << 8) | ((x >> 8) & 0xFF00) | (x >> 24);
  return x;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x55555555,%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x55555555,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
shl    $0x2,%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
and    $0x33333333,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0f0f0f,%eax
shl    $0x4,%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
and    $0xf0f0f0f,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
bswap  %edi
mov    %edi,%eax
and    $0xf0f0f0f,%eax
shl    $0x4,%eax
shr    $0x4,%edi
and    $0xf0f0f0f,%edi
or     %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
lea    (%rdi,%rax,4),%eax
mov    %eax,%ecx
and    $0x55555555,%ecx
shr    %eax
and    $0x55555555,%eax
lea    (%rax,%rcx,2),%eax
ret

LLVM IR (-O0):
define i32 @reverse(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1431655765
%5 = shl i32 %4, 1
%6 = load i32, i32* %2
%7 = lshr i32 %6, 1
%8 = and i32 %7, 1431655765
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = and i32 %10, 858993459
%12 = shl i32 %11, 2
%13 = load i32, i32* %2
%14 = lshr i32 %13, 2
%15 = and i32 %14, 858993459
%16 = or i32 %12, %15
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = and i32 %17, 252645135
%19 = shl i32 %18, 4
%20 = load i32, i32* %2
%21 = lshr i32 %20, 4
%22 = and i32 %21, 252645135
%23 = or i32 %19, %22
store i32 %23, i32* %2
%24 = load i32, i32* %2
%25 = shl i32 %24, 24
%26 = load i32, i32* %2
%27 = and i32 %26, 65280
%28 = shl i32 %27, 8
%29 = or i32 %25, %28
%30 = load i32, i32* %2
%31 = lshr i32 %30, 8
%32 = and i32 %31, 65280
%33 = or i32 %29, %32
%34 = load i32, i32* %2
%35 = lshr i32 %34, 24
%36 = or i32 %33, %35
store i32 %36, i32* %2
%37 = load i32, i32* %2
ret i32 %37
}

LLVM IR (-O2):
define i32 @reverse(i32 %0) {
%2 = tail call i32 @llvm.bitreverse.i32(i32 %0)
ret i32 %2
}
void gtk_selection_data_set() {}


x86 assembly (clang, -O0):
<gtk_selection_data_set>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtk_selection_data_set>:
ret

LLVM IR (-O0):
define void @gtk_selection_data_set() {
ret void
}

LLVM IR (-O2):
define void @gtk_selection_data_set() {
ret void
}
/* Type definitions */
struct s_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ move_cart(struct s_info *, struct s_info *);
void unload_drive_on_shutdown(struct s_info *src, struct s_info *dest) {
  if (!dest)
    return;
  ;
  move_cart(src, dest);
}


x86 assembly (clang, -O0):
<unload_drive_on_shutdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1130 <unload_drive_on_shutdown+0x20>
jmp    113d <unload_drive_on_shutdown+0x2d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <move_cart@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unload_drive_on_shutdown>:
test   %rsi,%rsi
je     111a <unload_drive_on_shutdown+0xa>
jmp    1030 <move_cart@plt>
ret

LLVM IR (-O0):
%struct.s_info = type { i32 }
define void @unload_drive_on_shutdown(%struct.s_info* %0, %struct.s_info* %1) {
%3 = alloca %struct.s_info*
%4 = alloca %struct.s_info*
store %struct.s_info* %0, %struct.s_info** %3
store %struct.s_info* %1, %struct.s_info** %4
%5 = load %struct.s_info*, %struct.s_info** %4
%6 = icmp ne %struct.s_info* %5, null
br i1 %6, label %8, label %7
7: ; preds = %2
br label %12
8: ; preds = %2
%9 = load %struct.s_info*, %struct.s_info** %3
%10 = load %struct.s_info*, %struct.s_info** %4
%11 = call i32 @move_cart(%struct.s_info* %9, %struct.s_info* %10)
br label %12
12: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
%struct.s_info = type { i32 }
define void @unload_drive_on_shutdown(%struct.s_info* %0, %struct.s_info* %1) {
%3 = icmp eq %struct.s_info* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @move_cart(%struct.s_info* %0, %struct.s_info* %1)
br label %6
6: ; preds = %2, %4
ret void
}
void rop3_157_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T | *D;
  stk2 = S & stk3;
  stk1 = *D ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_157_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_157_1_0>:
mov    (%rdi),%al
or     %al,%dl
and    %sil,%dl
xor    %al,%dl
or     %sil,%dl
not    %dl
and    %sil,%al
or     %dl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_157_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = or i32 %11, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = load i8, i8* %8
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = zext i8 %30 to i32
%32 = xor i32 %31, -1
%33 = trunc i32 %32 to i8
store i8 %33, i8* %7
%34 = load i8, i8* %7
%35 = zext i8 %34 to i32
%36 = load i8, i8* %5
%37 = zext i8 %36 to i32
%38 = xor i32 %37, -1
%39 = and i32 %35, %38
%40 = load i8*, i8** %4
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = load i8, i8* %5
%44 = zext i8 %43 to i32
%45 = and i32 %42, %44
%46 = or i32 %39, %45
%47 = trunc i32 %46 to i8
%48 = load i8*, i8** %4
store i8 %47, i8* %48
ret void
}

LLVM IR (-O2):
define void @rop3_157_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %2
%6 = and i8 %5, %1
%7 = xor i8 %6, %4
%8 = or i8 %7, %1
%9 = xor i8 %8, -1
%10 = and i8 %4, %1
%11 = or i8 %10, %9
store i8 %11, i8* %0
ret void
}
__attribute__((no, noclone)) short foo3(short arg) {
  short ret = -1;
  if (arg + 1 < ((!0) ? -(1L << (sizeof(short) * 8 - 1)) : 0) + 1 ||
      arg + 1 > 100)
    return ret;
  arg = arg + -1;
  ret = (char)arg;
  return arg;
}


x86 assembly (clang, -O0):
<foo3>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movw   $0xffff,-0x6(%rbp)
movswl -0x4(%rbp),%eax
add    $0x1,%eax
cltq
cmp    $0xffffffffffff8001,%rax
jl     1136 <foo3+0x36>
movswl -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x64,%eax
jle    1143 <foo3+0x43>
mov    -0x6(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    1161 <foo3+0x61>
movswl -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
movsbl %al,%eax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo3>:
lea    -0x1(%rdi),%ecx
cmp    $0x64,%di
mov    $0xffff,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @foo3(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 -1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = icmp slt i64 %8, -32767
br i1 %9, label %15, label %10
10: ; preds = %1
%11 = load i16, i16* %3
%12 = sext i16 %11 to i32
%13 = add nsw i32 %12, 1
%14 = icmp sgt i32 %13, 100
br i1 %14, label %15, label %17
15: ; preds = %10, %1
%16 = load i16, i16* %4
store i16 %16, i16* %2
br label %26
17: ; preds = %10
%18 = load i16, i16* %3
%19 = sext i16 %18 to i32
%20 = add nsw i32 %19, -1
%21 = trunc i32 %20 to i16
store i16 %21, i16* %3
%22 = load i16, i16* %3
%23 = trunc i16 %22 to i8
%24 = sext i8 %23 to i16
store i16 %24, i16* %4
%25 = load i16, i16* %3
store i16 %25, i16* %2
br label %26
26: ; preds = %17, %15
%27 = load i16, i16* %2
ret i16 %27
}

LLVM IR (-O2):
define signext i16 @foo3(i16 signext %0) {
%2 = icmp sgt i16 %0, 99
%3 = add i16 %0, -1
%4 = select i1 %2, i16 -1, i16 %3
ret i16 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ AES_KEY;

/* Variables and functions */
int /*<<< orphan*/ AES_set_decrypt_key(unsigned char *, unsigned int,
                                       int /*<<< orphan*/ *);
int /*<<< orphan*/ AES_set_encrypt_key(unsigned char *, unsigned int,
                                       int /*<<< orphan*/ *);
void aes_key_mgmt(AES_KEY *akey, unsigned char *key, unsigned int key_length,
                  int direction) {
  if (direction == 1) {
    AES_set_encrypt_key(key, key_length, akey);
  } else {
    AES_set_decrypt_key(key, key_length, akey);
  }
}


x86 assembly (clang, -O0):
<aes_key_mgmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
jne    1155 <aes_key_mgmt+0x35>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x8(%rbp),%rdx
call   1030 <AES_set_encrypt_key@plt>
jmp    1165 <aes_key_mgmt+0x45>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x8(%rbp),%rdx
call   1040 <AES_set_decrypt_key@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes_key_mgmt>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rax,%rdx
cmp    $0x1,%ecx
jne    1135 <aes_key_mgmt+0x15>
jmp    1030 <AES_set_encrypt_key@plt>
jmp    1040 <AES_set_decrypt_key@plt>

LLVM IR (-O0):
define void @aes_key_mgmt(i32* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %16
11: ; preds = %4
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = load i32*, i32** %5
%15 = call i32 @AES_set_encrypt_key(i8* %12, i32 %13, i32* %14)
br label %21
16: ; preds = %4
%17 = load i8*, i8** %6
%18 = load i32, i32* %7
%19 = load i32*, i32** %5
%20 = call i32 @AES_set_decrypt_key(i8* %17, i32 %18, i32* %19)
br label %21
21: ; preds = %16, %11
ret void
}

LLVM IR (-O2):
define void @aes_key_mgmt(i32* %0, i8* %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 1
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @AES_set_encrypt_key(i8* %1, i32 %2, i32* %0)
br label %10
8: ; preds = %4
%9 = tail call i32 @AES_set_decrypt_key(i8* %1, i32 %2, i32* %0)
br label %10
10: ; preds = %8, %6
ret void
}
/* Variables and functions */
int f217(int *);
int f218(int *p) { return f217(p); }


x86 assembly (clang, -O0):
<f218>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <f217@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f218>:
jmp    1030 <f217@plt>

LLVM IR (-O0):
define i32 @f218(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @f217(i32* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @f218(i32* %0) {
%2 = tail call i32 @f217(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void clear() { printf("\033[2J"); }


x86 assembly (clang, -O0):
<clear>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
define void @clear() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
define void @clear() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
void delay_us(int us) {
  timer0_reset();
  timer0_start();
  while (timer0_get_us() < us) {
    asm volatile("NOP");
  }
  timer0_stop();
}


x86 assembly (clang, -O0):
<delay_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <timer0_reset@plt>
mov    $0x0,%al
call   1060 <timer0_start@plt>
mov    $0x0,%al
call   1050 <timer0_get_us@plt>
cmp    -0x4(%rbp),%eax
jge    116f <delay_us+0x2f>
nop
jmp    1159 <delay_us+0x19>
mov    $0x0,%al
call   1030 <timer0_stop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_us>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <timer0_reset@plt>
xor    %eax,%eax
call   1060 <timer0_start@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <timer0_get_us@plt>
cmp    %ebx,%eax
jge    116e <delay_us+0x2e>
nop
jmp    1160 <delay_us+0x20>
xor    %eax,%eax
pop    %rbx
jmp    1030 <timer0_stop@plt>

LLVM IR (-O0):
define void @delay_us(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @timer0_reset()
%4 = call i32 (...) @timer0_start()
br label %5
5: ; preds = %9, %1
%6 = call i32 (...) @timer0_get_us()
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
%11 = call i32 (...) @timer0_stop()
ret void
}

LLVM IR (-O2):
define void @delay_us(i32 %0) {
%2 = tail call i32 (...) @timer0_reset()
%3 = tail call i32 (...) @timer0_start()
%4 = tail call i32 (...) @timer0_get_us()
%5 = icmp slt i32 %4, %0
br i1 %5, label %6, label %9
6: ; preds = %1, %6
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
%7 = tail call i32 (...) @timer0_get_us()
%8 = icmp slt i32 %7, %0
br i1 %8, label %6, label %9
9: ; preds = %6, %1
%10 = tail call i32 (...) @timer0_stop()
ret void
}
/* Type definitions */
struct collection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ collection_add(struct collection *, int /*<<< orphan*/ *);
int /*<<< orphan*/ collection_delete(struct collection *);
struct collection *collection_new();
int /*<<< orphan*/ ctest_assert_pass(char *);
int test_collection_03() {
  struct collection *col = NULL;
  col = collection_new();
  collection_add(col, NULL);
  collection_delete(col);
  char *assert_message = "Testing collection for new/add(null)/delete..";
  ctest_assert_pass(assert_message);
  return 0;
}


x86 assembly (clang, -O0):
<test_collection_03>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <collection_new@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <collection_add@plt>
mov    -0x8(%rbp),%rdi
call   1060 <collection_delete@plt>
lea    0xe88(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <ctest_assert_pass@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_collection_03>:
push   %rbx
xor    %eax,%eax
call   1030 <collection_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
call   1040 <collection_add@plt>
mov    %rbx,%rdi
call   1060 <collection_delete@plt>
lea    0xe9c(%rip),%rdi
call   1050 <ctest_assert_pass@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.collection = type { i32 }
@.str = [46 x i8] c"Testing collection for new/add(null)/delete..\00"
define i32 @test_collection_03() {
%1 = alloca %struct.collection*
%2 = alloca i8*
store %struct.collection* null, %struct.collection** %1
%3 = call %struct.collection* (...) @collection_new()
store %struct.collection* %3, %struct.collection** %1
%4 = load %struct.collection*, %struct.collection** %1
%5 = call i32 @collection_add(%struct.collection* %4, i32* null)
%6 = load %struct.collection*, %struct.collection** %1
%7 = call i32 @collection_delete(%struct.collection* %6)
store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8** %2
%8 = load i8*, i8** %2
%9 = call i32 @ctest_assert_pass(i8* %8)
ret i32 0
}

LLVM IR (-O2):
%struct.collection = type { i32 }
@.str = [46 x i8] c"Testing collection for new/add(null)/delete..\00"
define i32 @test_collection_03() {
%1 = tail call %struct.collection* (...) @collection_new()
%2 = tail call i32 @collection_add(%struct.collection* %1, i32* null)
%3 = tail call i32 @collection_delete(%struct.collection* %1)
%4 = tail call i32 @ctest_assert_pass(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int STDIN_FILENO;
int fcntl(int, int /*<<< orphan*/, int);
int async_keyboard(void) {
  fcntl(STDIN_FILENO, F_SETFL, fcntl(STDIN_FILENO, F_GETFL, 0) | O_NONBLOCK);
  return STDIN_FILENO;
}


x86 assembly (clang, -O0):
<async_keyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    %eax,%edx
mov    0x2e90(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<async_keyboard>:
push   %rbp
push   %r14
push   %rbx
mov    0x2ead(%rip),%r14
mov    (%r14),%ebx
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebp
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    0x2ea8(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   1030 <fcntl@plt>
mov    (%r14),%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
@F_SETFL = global i32 0
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @async_keyboard() {
%1 = load i32, i32* @STDIN_FILENO
%2 = load i32, i32* @F_SETFL
%3 = load i32, i32* @STDIN_FILENO
%4 = load i32, i32* @F_GETFL
%5 = call i32 @fcntl(i32 %3, i32 %4, i32 0)
%6 = load i32, i32* @O_NONBLOCK
%7 = or i32 %5, %6
%8 = call i32 @fcntl(i32 %1, i32 %2, i32 %7)
%9 = load i32, i32* @STDIN_FILENO
ret i32 %9
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
@F_SETFL = global i32 0
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @async_keyboard() {
%1 = load i32, i32* @STDIN_FILENO
%2 = load i32, i32* @F_SETFL
%3 = load i32, i32* @F_GETFL
%4 = tail call i32 @fcntl(i32 %1, i32 %3, i32 0)
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %5, %4
%7 = tail call i32 @fcntl(i32 %1, i32 %2, i32 %6)
%8 = load i32, i32* @STDIN_FILENO
ret i32 %8
}
/* Variables and functions */
void *pubrealloc(void *, size_t, char *);
void *realloc(void *ptr, size_t size) {
  return (pubrealloc(ptr, size, " in realloc():"));
}


x86 assembly (clang, -O0):
<realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdx
call   1030 <pubrealloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realloc>:
lea    0xee9(%rip),%rdx
jmp    1030 <pubrealloc@plt>

LLVM IR (-O0):
@.str = [15 x i8] c" in realloc():\00"
define i8* @realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @pubrealloc(i8* %5, i64 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i8* %7
}

LLVM IR (-O2):
@.str = [15 x i8] c" in realloc():\00"
define i8* @realloc(i8* %0, i64 %1) {
%3 = tail call i8* @pubrealloc(i8* %0, i64 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
void vibrate(int strength) { return; }


x86 assembly (clang, -O0):
<vibrate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vibrate>:
ret

LLVM IR (-O0):
define void @vibrate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @vibrate(i32 %0) {
ret void
}
/* Type definitions */
struct lxt2_wr_trace {
  int dummy;
};

/* Variables and functions */
int lxt2_wr_emit_u32z(struct lxt2_wr_trace *, int);
int lxt2_wr_emit_u64z(struct lxt2_wr_trace *lt, int valueh, int valuel) {
  int rc;
  if ((rc = lxt2_wr_emit_u32z(lt, valueh))) {
    rc = lxt2_wr_emit_u32z(lt, valuel);
  }
  return (rc);
}


x86 assembly (clang, -O0):
<lxt2_wr_emit_u64z>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <lxt2_wr_emit_u32z@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1149 <lxt2_wr_emit_u64z+0x39>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <lxt2_wr_emit_u32z@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lxt2_wr_emit_u64z>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
call   1030 <lxt2_wr_emit_u32z@plt>
test   %eax,%eax
je     1131 <lxt2_wr_emit_u64z+0x21>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <lxt2_wr_emit_u32z@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.lxt2_wr_trace = type { i32 }
define i32 @lxt2_wr_emit_u64z(%struct.lxt2_wr_trace* %0, i32 %1, i32 %2) {
%4 = alloca %struct.lxt2_wr_trace*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store %struct.lxt2_wr_trace* %0, %struct.lxt2_wr_trace** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load %struct.lxt2_wr_trace*, %struct.lxt2_wr_trace** %4
%9 = load i32, i32* %5
%10 = call i32 @lxt2_wr_emit_u32z(%struct.lxt2_wr_trace* %8, i32 %9)
store i32 %10, i32* %7
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %3
%13 = load %struct.lxt2_wr_trace*, %struct.lxt2_wr_trace** %4
%14 = load i32, i32* %6
%15 = call i32 @lxt2_wr_emit_u32z(%struct.lxt2_wr_trace* %13, i32 %14)
store i32 %15, i32* %7
br label %16
16: ; preds = %12, %3
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
%struct.lxt2_wr_trace = type { i32 }
define i32 @lxt2_wr_emit_u64z(%struct.lxt2_wr_trace* %0, i32 %1, i32 %2) {
%4 = tail call i32 @lxt2_wr_emit_u32z(%struct.lxt2_wr_trace* %0, i32 %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @lxt2_wr_emit_u32z(%struct.lxt2_wr_trace* %0, i32 %2)
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ %7, %6 ], [ 0, %3 ]
ret i32 %9
}
void FFTABLEIN(unsigned char *tab, int g, unsigned char *data) {
  *(((int *)tab) + g) = *((int *)data);
  *(((int *)tab) + 32 + g) = *(((int *)data) + 1);
}


x86 assembly (clang, -O0):
<FFTABLEIN>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,0x80(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FFTABLEIN>:
mov    (%rdx),%eax
movslq %esi,%rcx
mov    %eax,(%rdi,%rcx,4)
mov    0x4(%rdx),%eax
mov    %eax,0x80(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define void @FFTABLEIN(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
store i32 %9, i32* %14
%15 = load i8*, i8** %6
%16 = bitcast i8* %15 to i32*
%17 = getelementptr inbounds i32, i32* %16, i64 1
%18 = load i32, i32* %17
%19 = load i8*, i8** %4
%20 = bitcast i8* %19 to i32*
%21 = getelementptr inbounds i32, i32* %20, i64 32
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
store i32 %18, i32* %24
ret void
}

LLVM IR (-O2):
define void @FFTABLEIN(i8* nocapture writeonly %0, i32 %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32*
%5 = load i32, i32* %4
%6 = bitcast i8* %0 to i32*
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i32, i32* %6, i64 %7
store i32 %5, i32* %8
%9 = getelementptr inbounds i8, i8* %2, i64 4
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = getelementptr inbounds i8, i8* %0, i64 128
%13 = bitcast i8* %12 to i32*
%14 = getelementptr inbounds i32, i32* %13, i64 %7
store i32 %11, i32* %14
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __hashmap_free(const void *ptr) { free((void *)ptr); }


x86 assembly (clang, -O0):
<__hashmap_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hashmap_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @__hashmap_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
ret void
}

LLVM IR (-O2):
define void @__hashmap_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void func5() {
  int val = 0, val2 = 23;
  int *x = &val;
  x = &val2;
  val = 27;
}


x86 assembly (clang, -O0):
<func5>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x17,-0x8(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1b,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<func5>:
ret

LLVM IR (-O0):
define void @func5() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 23, i32* %2
store i32* %1, i32** %3
store i32* %2, i32** %3
store i32 27, i32* %1
ret void
}

LLVM IR (-O2):
define void @func5() {
ret void
}
/* Variables and functions */
int f349(int *);
int f350(int *p) { return f349(p); }


x86 assembly (clang, -O0):
<f350>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <f349@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f350>:
jmp    1030 <f349@plt>

LLVM IR (-O0):
define i32 @f350(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @f349(i32* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @f350(i32* %0) {
%2 = tail call i32 @f349(i32* %0)
ret i32 %2
}
/* Variables and functions */
int add_numbers_asm(int, int);
int counter(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("%d\n", add_numbers_asm(7, 8));
  printf("%d\n", counter(9, 8));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x7,%edi
mov    $0x8,%esi
call   1040 <add_numbers_asm@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x9,%edi
mov    $0x8,%esi
call   1050 <counter@plt>
mov    %eax,%esi
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x7,%edi
mov    $0x8,%esi
call   1040 <add_numbers_asm@plt>
lea    0xeb9(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x9,%edi
mov    $0x8,%esi
call   1050 <counter@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @add_numbers_asm(i32 7, i32 8)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @counter(i32 9, i32 8)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @add_numbers_asm(i32 7, i32 8)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @counter(i32 9, i32 8)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int cephes_isfinite(x)
double x;
{
  union {
    double d;
    unsigned short s[4];
    unsigned int i[2];
  } u;
  u.d = x;
  if (sizeof(int) == 4) {
    if ((u.i[1] & 0x7ff00000) != 0x7ff00000)
      return 1;
    return (0);
  } else {
    if ((u.s[3] & 0x7ff0) != 0x7ff0)
      return 1;
    return (0);
  }
}


x86 assembly (clang, -O0):
<cephes_isfinite>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
and    $0x7ff00000,%eax
cmp    $0x7ff00000,%eax
je     1132 <cephes_isfinite+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1139 <cephes_isfinite+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cephes_isfinite>:
movq   %xmm0,%rcx
not    %rcx
movabs $0x7ff0000000000000,%rdx
xor    %eax,%eax
test   %rdx,%rcx
setne  %al
ret

LLVM IR (-O0):
%union.anon = type { double }
define i32 @cephes_isfinite(double %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca %union.anon
store double %0, double* %3
%5 = load double, double* %3
%6 = bitcast %union.anon* %4 to double*
store double %5, double* %6
%7 = bitcast %union.anon* %4 to [2 x i32]*
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%9 = load i32, i32* %8
%10 = and i32 %9, 2146435072
%11 = icmp ne i32 %10, 2146435072
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 1, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @cephes_isfinite(double %0) {
%2 = bitcast double %0 to i64
%3 = and i64 %2, 9218868437227405312
%4 = icmp ne i64 %3, 9218868437227405312
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int foo(int, int, int);
int main() { return foo(1, 2, 3); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
jmp    1030 <foo@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 1, i32 2, i32 3)
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1, i32 2, i32 3)
ret i32 %1
}