xunge/DecIR huggingface dataset:
/* Variables and functions */
int dlg_count_argv(char **argv) {
  int result = 0;
  if (argv != 0) {
    while (argv[result] != 0)
      ++result;
  }
  return result;
}


x86 assembly (clang, -O0):
<dlg_count_argv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1145 <dlg_count_argv+0x45>
jmp    111f <dlg_count_argv+0x1f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1140 <dlg_count_argv+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <dlg_count_argv+0x1f>
jmp    1145 <dlg_count_argv+0x45>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlg_count_argv>:
test   %rdi,%rdi
je     111e <dlg_count_argv+0x1e>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <dlg_count_argv+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @dlg_count_argv(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
%4 = load i8**, i8*** %2
%5 = icmp ne i8** %4, null
br i1 %5, label %6, label %18
6: ; preds = %1
br label %7
7: ; preds = %14, %6
%8 = load i8**, i8*** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8*, i8** %8, i64 %10
%12 = load i8*, i8** %11
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %17
14: ; preds = %7
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %7
17: ; preds = %7
br label %18
18: ; preds = %17, %1
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @dlg_count_argv(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Type definitions */
struct vec4 {
  int dummy;
};

/* Variables and functions */
int vec4_is_nearly_equal(float *, float *, float);
__attribute__((always_)) bool
psvec4_is_nearly_equal(struct vec4 *a, struct vec4 *b, float epsilon) {
  return vec4_is_nearly_equal((float *)a, (float *)b, epsilon);
}


x86 assembly (clang, -O0):
<psvec4_is_nearly_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movss  -0x14(%rbp),%xmm0
call   1030 <vec4_is_nearly_equal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec4_is_nearly_equal>:
jmp    1030 <vec4_is_nearly_equal@plt>

LLVM IR (-O0):
%struct.vec4 = type { i32 }
define i32 @psvec4_is_nearly_equal(%struct.vec4* %0, %struct.vec4* %1, float %2) {
%4 = alloca %struct.vec4*
%5 = alloca %struct.vec4*
%6 = alloca float
store %struct.vec4* %0, %struct.vec4** %4
store %struct.vec4* %1, %struct.vec4** %5
store float %2, float* %6
%7 = load %struct.vec4*, %struct.vec4** %4
%8 = bitcast %struct.vec4* %7 to float*
%9 = load %struct.vec4*, %struct.vec4** %5
%10 = bitcast %struct.vec4* %9 to float*
%11 = load float, float* %6
%12 = call i32 @vec4_is_nearly_equal(float* %8, float* %10, float %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.vec4 = type { i32 }
define i32 @psvec4_is_nearly_equal(%struct.vec4* %0, %struct.vec4* %1, float %2) {
%4 = bitcast %struct.vec4* %0 to float*
%5 = bitcast %struct.vec4* %1 to float*
%6 = tail call i32 @vec4_is_nearly_equal(float* %4, float* %5, float %2)
ret i32 %6
}
void rcu_preempt_check_callbacks(int cpu) {}


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

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

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

LLVM IR (-O2):
define void @rcu_preempt_check_callbacks(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ ts(int /*<<< orphan*/);
scalar_t__ tu(int /*<<< orphan*/);
main() {
  if (ts(0) || tu(0))
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1050 <ts@plt>
cmp    $0x0,%rax
jne    1171 <main+0x31>
xor    %edi,%edi
call   1040 <tu@plt>
cmp    $0x0,%rax
je     1178 <main+0x38>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <ts@plt>
test   %rax,%rax
jne    1160 <main+0x20>
xor    %edi,%edi
call   1040 <tu@plt>
test   %rax,%rax
jne    1160 <main+0x20>
xor    %edi,%edi
call   1060 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @ts(i32 0)
%3 = icmp ne i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = call i64 @tu(i32 0)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4, %0
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %4
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @ts(i32 0)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i64 @tu(i32 0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3, %0
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %3
%9 = tail call i32 @exit(i32 0)
unreachable
}
void swap(char *i, char *j) {
  char t;
  t = *i;
  *i = *j;
  *j = t;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
/* Variables and functions */
int edit_distance(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char a[] = "sailn";
  char b[] = "failing";
  printf("%d\n", edit_distance(a, b));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x6(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0x2(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0xe(%rbp)
lea    -0x6(%rbp),%rdi
lea    -0xe(%rbp),%rsi
call   1040 <edit_distance@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movw   $0x6e,0xc(%rsp)
movl   $0x6c696173,0x8(%rsp)
6c
movabs $0x676e696c696166,%rax
mov    %rax,0x10(%rsp)
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1040 <edit_distance@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [6 x i8] c"sailn\00"
@__const.main.b = [8 x i8] c"failing\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca [8 x i8]
%3 = bitcast [6 x i8]* %1 to i8*
%4 = bitcast [8 x i8]* %2 to i8*
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%7 = call i32 @edit_distance(i8* %5, i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [6 x i8] c"sailn\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca i64
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%4 = bitcast i64* %2 to i8*
store i64 29113321670664550, i64* %2
%5 = call i32 @edit_distance(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ invalid_phase(char *);
void phase_3(char *input) { invalid_phase("3a"); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"3a\00"
define void @phase_3(i8* nocapture readnone %0) {
%2 = tail call i32 @invalid_phase(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int i;
  for (i = 0; i <= 255; i++) {
    printf("\x1b[38;5;%dmHello World\x1b[0m\n", i);
  }
}


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)
movl   $0x0,-0x14(%rbp)
cmpl   $0xff,-0x14(%rbp)
jg     1157 <main+0x47>
mov    -0x14(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [27 x i8] c"\1B[38;5;%dmHello World\1B[0m\0A\00"
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
store i32 0, i32* %6
br label %7
7: ; preds = %13, %2
%8 = load i32, i32* %6
%9 = icmp sle i32 %8, 255
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
store i32 %15, i32* %6
br label %7
16: ; preds = %7
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [27 x i8] c"\1B[38;5;%dmHello World\1B[0m\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %6, %3 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 256
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ log_finalize();
int /*<<< orphan*/ log_init();
int /*<<< orphan*/ log_normalize();
int /*<<< orphan*/ log_printf(char *);
int /*<<< orphan*/ sleep(int);
int main() {
  log_init();
  log_printf("hi");
  log_normalize();
  log_printf("ok");
  sleep(2);
  log_printf("bye");
  log_finalize();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <log_init@plt>
lea    0xe9e(%rip),%rdi
call   1040 <log_printf@plt>
mov    $0x0,%al
call   1050 <log_normalize@plt>
lea    0xe8e(%rip),%rdi
call   1040 <log_printf@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
lea    0xe7b(%rip),%rdi
call   1040 <log_printf@plt>
mov    $0x0,%al
call   1060 <log_finalize@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <log_init@plt>
lea    0xea1(%rip),%rdi
call   1040 <log_printf@plt>
xor    %eax,%eax
call   1050 <log_normalize@plt>
lea    0xe91(%rip),%rdi
call   1040 <log_printf@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
lea    0xe7e(%rip),%rdi
call   1040 <log_printf@plt>
xor    %eax,%eax
call   1060 <log_finalize@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"hi\00"
@.str.1 = [3 x i8] c"ok\00"
@.str.2 = [4 x i8] c"bye\00"
define i32 @main() {
%1 = call i32 (...) @log_init()
%2 = call i32 @log_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @log_normalize()
%4 = call i32 @log_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @sleep(i32 2)
%6 = call i32 @log_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (...) @log_finalize()
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"hi\00"
@.str.1 = [3 x i8] c"ok\00"
@.str.2 = [4 x i8] c"bye\00"
define i32 @main() {
%1 = tail call i32 (...) @log_init()
%2 = tail call i32 @log_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @log_normalize()
%4 = tail call i32 @log_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @sleep(i32 2)
%6 = tail call i32 @log_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 (...) @log_finalize()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int bar() {
  printf("Hello C");
  return 2;
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"Hello C\00"
define i32 @bar() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 2
}

LLVM IR (-O2):
@.str = [8 x i8] c"Hello C\00"
define i32 @bar() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ nocall(char *);
void configure(void) { nocall("configure"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"configure\00"
define void @configure() {
%1 = call i32 @nocall(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"configure\00"
define void @configure() {
%1 = tail call i32 @nocall(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
void f(void) {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <f+0x9>
jmp    1109 <f+0x9>

x86 assembly (clang, -O2):
<f>:
jmp    1100 <f>

LLVM IR (-O0):
define void @f() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @f() {
br label %1
1: ; preds = %1, %0
br label %1
}
void rop3_143_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D & S;
  stk2 = ~stk2;
  stk1 = T & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_143_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %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
movzbl -0xa(%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    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%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_143_1_1>:
mov    (%rdi),%al
mov    %eax,%ecx
and    %sil,%cl
or     %dl,%sil
not    %sil
or     %cl,%sil
and    %dl,%al
or     %sil,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_143_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = and i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8, i8* %6
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = and i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = xor i32 %27, -1
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = zext i8 %30 to i32
%32 = load i8, i8* %5
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8, i8* %6
%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 = load i8*, i8** %4
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = load i8, i8* %6
%51 = zext i8 %50 to i32
%52 = and i32 %49, %51
%53 = or i32 %46, %52
%54 = trunc i32 %53 to i8
%55 = load i8*, i8** %4
store i8 %54, i8* %55
ret void
}

LLVM IR (-O2):
define void @rop3_143_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
%6 = or i8 %2, %1
%7 = xor i8 %6, -1
%8 = or i8 %5, %7
%9 = and i8 %4, %2
%10 = or i8 %8, %9
store i8 %10, i8* %0
ret void
}
unsigned long native_save_fl(void) {
  unsigned long flags;
  asm volatile("# __raw_save_flags\n\t"
               "pushf ; pop %0"
               : "=g"(flags)
               :
               : "memory");
  return flags;
}


x86 assembly (clang, -O0):
<native_save_fl>:
push   %rbp
mov    %rsp,%rbp
pushf
pop    -0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<native_save_fl>:
pushf
pop    -0x8(%rsp)
mov    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @native_save_fl() {
%1 = alloca i64
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @native_save_fl() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = load i64, i64* %1
ret i64 %3
}
int test18(int a, int b, int c, int d, int e, int f) {
  int x = a != b;
  int y = c != 0;
  int z = d == e;
  return x == y && x == z;
}


x86 assembly (clang, -O0):
<test18>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0xc(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%ecx
xor    %eax,%eax
cmp    -0x20(%rbp),%ecx
mov    %al,-0x25(%rbp)
jne    1166 <test18+0x66>
mov    -0x1c(%rbp),%eax
cmp    -0x24(%rbp),%eax
sete   %al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test18>:
cmp    %esi,%edi
setne  %al
test   %edx,%edx
sete   %dl
cmp    %r8d,%ecx
setne  %cl
xor    %al,%dl
xor    %al,%cl
and    %dl,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @test18(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = icmp ne i32 %16, %17
%19 = zext i1 %18 to i32
store i32 %19, i32* %13
%20 = load i32, i32* %9
%21 = icmp ne i32 %20, 0
%22 = zext i1 %21 to i32
store i32 %22, i32* %14
%23 = load i32, i32* %10
%24 = load i32, i32* %11
%25 = icmp eq i32 %23, %24
%26 = zext i1 %25 to i32
store i32 %26, i32* %15
%27 = load i32, i32* %13
%28 = load i32, i32* %14
%29 = icmp eq i32 %27, %28
br i1 %29, label %30, label %34
30: ; preds = %6
%31 = load i32, i32* %13
%32 = load i32, i32* %15
%33 = icmp eq i32 %31, %32
br label %34
34: ; preds = %30, %6
%35 = phi i1 [ false, %6 ], [ %33, %30 ]
%36 = zext i1 %35 to i32
ret i32 %36
}

LLVM IR (-O2):
define i32 @test18(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = icmp ne i32 %0, %1
%8 = icmp eq i32 %2, 0
%9 = icmp ne i32 %3, %4
%10 = xor i1 %7, %8
%11 = xor i1 %7, %9
%12 = and i1 %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
unsigned fingerprint(unsigned h) {
  h = h >> 16;
  return h ? h : 1;
}


x86 assembly (clang, -O0):
<fingerprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1125 <fingerprint+0x25>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <fingerprint+0x32>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <fingerprint+0x32>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fingerprint>:
mov    %edi,%ecx
shr    $0x10,%ecx
cmp    $0x10000,%edi
mov    $0x1,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fingerprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 16
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* %2
br label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %7
%11 = phi i32 [ %8, %7 ], [ 1, %9 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @fingerprint(i32 %0) {
%2 = lshr i32 %0, 16
%3 = icmp ult i32 %0, 65536
%4 = select i1 %3, i32 1, i32 %2
ret i32 %4
}
/* Type definitions */
struct sockaddr_in6 {
  int dummy;
};
struct addrinfo {
  int /*<<< orphan*/ ai_addrlen;
  int /*<<< orphan*/ ai_addr;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(struct sockaddr_in6 *, int /*<<< orphan*/,
                          int /*<<< orphan*/);
void get_addr(struct addrinfo *ai_use, struct sockaddr_in6 *addr) {
  memcpy(addr, ai_use->ai_addr, ai_use->ai_addrlen);
}


x86 assembly (clang, -O0):
<get_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_addr>:
mov    %rsi,%rax
mov    (%rdi),%edx
mov    0x4(%rdi),%esi
mov    %rax,%rdi
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
%struct.addrinfo = type { i32, i32 }
%struct.sockaddr_in6 = type { i32 }
define void @get_addr(%struct.addrinfo* %0, %struct.sockaddr_in6* %1) {
%3 = alloca %struct.addrinfo*
%4 = alloca %struct.sockaddr_in6*
store %struct.addrinfo* %0, %struct.addrinfo** %3
store %struct.sockaddr_in6* %1, %struct.sockaddr_in6** %4
%5 = load %struct.sockaddr_in6*, %struct.sockaddr_in6** %4
%6 = load %struct.addrinfo*, %struct.addrinfo** %3
%7 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %6, i32 0, i32 1
%8 = load i32, i32* %7
%9 = load %struct.addrinfo*, %struct.addrinfo** %3
%10 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @memcpy(%struct.sockaddr_in6* %5, i32 %8, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.addrinfo = type { i32, i32 }
%struct.sockaddr_in6 = type { i32 }
define void @get_addr(%struct.addrinfo* nocapture %0, %struct.sockaddr_in6* %1) {
%3 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %0, i64 0, i32 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @memcpy(%struct.sockaddr_in6* %1, i32 %4, i32 %6)
ret void
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
double drand() { return ((double)rand() / (RAND_MAX)); }


x86 assembly (clang, -O0):
<drand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<drand>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @drand() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
ret double %4
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @drand() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
ret double %4
}
/* Variables and functions */
int wdog_sudirribe(char *, unsigned int, unsigned int *);
int wdog_pmon_sudirribe(char *label, int timeout, int *ack) {
  return wdog_sudirribe(label, (unsigned int)timeout, (unsigned int *)ack);
}


x86 assembly (clang, -O0):
<wdog_pmon_sudirribe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <wdog_sudirribe@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wdog_pmon_sudirribe>:
jmp    1030 <wdog_sudirribe@plt>

LLVM IR (-O0):
define i32 @wdog_pmon_sudirribe(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i32 @wdog_sudirribe(i8* %7, i32 %8, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @wdog_pmon_sudirribe(i8* %0, i32 %1, i32* %2) {
%4 = tail call i32 @wdog_sudirribe(i8* %0, i32 %1, i32* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printw(char *, char const *const);
void prword(const char *const base[], int indx) { printw("%s", base[indx]); }


x86 assembly (clang, -O0):
<prword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xece(%rip),%rdi
call   1030 <printw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prword>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rsi
lea    0xee2(%rip),%rdi
jmp    1030 <printw@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @prword(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = load i8**, i8*** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8*, i8** %5, i64 %7
%9 = load i8*, i8** %8
%10 = call i32 @printw(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @prword(i8** nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = tail call i32 @printw(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void intro(void) {
  puts("Four in a Row\n---- -- - ---\n"
       "Stack X's and O's in order to make 4 in a row either vertically,\n"
       "horizontally diagonally before your opponent does.\n");
}


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

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

LLVM IR (-O0):
@.str = [145 x i8] c"Four in a Row\0A---- -- - ---\0AStack X's and O's in order to make 4 in a row either vertically,\0Ahorizontally diagonally before your opponent does.\0A\00"
define void @intro() {
%1 = call i32 @puts(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [145 x i8] c"Four in a Row\0A---- -- - ---\0AStack X's and O's in order to make 4 in a row either vertically,\0Ahorizontally diagonally before your opponent does.\0A\00"
define void @intro() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned long int unpacku32(unsigned char *buf) {
  return ((unsigned long int)buf[0] << 24) | ((unsigned long int)buf[1] << 16) |
         ((unsigned long int)buf[2] << 8) | buf[3];
}


x86 assembly (clang, -O0):
<unpacku32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpacku32>:
mov    (%rdi),%eax
shl    $0x20,%rax
bswap  %rax
ret

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

LLVM IR (-O2):
define i64 @unpacku32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = shl nuw nsw i64 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = shl nuw nsw i64 %7, 16
%9 = or i64 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
%13 = shl nuw nsw i64 %12, 8
%14 = or i64 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i64
%18 = or i64 %14, %17
ret i64 %18
}
long dt_dhms_to_time(long d, long h, long m, long s) {
  return ((((d * 24) + h) * 60) + m) * 60 + s;
}


x86 assembly (clang, -O0):
<dt_dhms_to_time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
imul   $0x18,-0x8(%rbp),%rax
add    -0x10(%rbp),%rax
imul   $0x3c,%rax,%rax
add    -0x18(%rbp),%rax
imul   $0x3c,%rax,%rax
add    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dt_dhms_to_time>:
lea    (%rdi,%rdi,2),%rax
lea    (%rsi,%rax,8),%rax
imul   $0x3c,%rax,%rax
add    %rdx,%rax
imul   $0x3c,%rax,%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @dt_dhms_to_time(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = mul nsw i64 %9, 24
%11 = load i64, i64* %6
%12 = add nsw i64 %10, %11
%13 = mul nsw i64 %12, 60
%14 = load i64, i64* %7
%15 = add nsw i64 %13, %14
%16 = mul nsw i64 %15, 60
%17 = load i64, i64* %8
%18 = add nsw i64 %16, %17
ret i64 %18
}

LLVM IR (-O2):
define i64 @dt_dhms_to_time(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = mul nsw i64 %0, 24
%6 = add nsw i64 %5, %1
%7 = mul nsw i64 %6, 60
%8 = add nsw i64 %7, %2
%9 = mul nsw i64 %8, 60
%10 = add nsw i64 %9, %3
ret i64 %10
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
float fabsf(float x) {
  union {
    float f;
    uint32_t i;
  } u = {x};
  u.i &= 0x7fffffff;
  return u.f;
}


x86 assembly (clang, -O0):
<fabsf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x7fffffff,%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabsf>:
andps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @fabsf(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = bitcast %union.anon* %3 to float*
%5 = load float, float* %2
store float %5, float* %4
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
%8 = and i32 %7, 2147483647
store i32 %8, i32* %6
%9 = bitcast %union.anon* %3 to float*
%10 = load float, float* %9
ret float %10
}

LLVM IR (-O2):
define float @fabsf(float %0) {
%2 = bitcast float %0 to i32
%3 = and i32 %2, 2147483647
%4 = bitcast i32 %3 to float
ret float %4
}
/* Type definitions */
struct agent_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ agent_info_free(struct agent_info *);
struct agent_info *agent_info_new();
int /*<<< orphan*/ agent_main_loop(struct agent_info *);
int /*<<< orphan*/ parse_args(int, char **, struct agent_info *);
int main(int argc, char *argv[]) {
  struct agent_info *s = NULL;
  s = agent_info_new();
  parse_args(argc, argv, s);
  agent_main_loop(s);
  agent_info_free(s);
  return 0;
}


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)
movq   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <agent_info_new@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <parse_args@plt>
mov    -0x18(%rbp),%rdi
call   1060 <agent_main_loop@plt>
mov    -0x18(%rbp),%rdi
call   1050 <agent_info_free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <agent_info_new@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rax,%rdx
call   1040 <parse_args@plt>
mov    %rbx,%rdi
call   1060 <agent_main_loop@plt>
mov    %rbx,%rdi
call   1050 <agent_info_free@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.agent_info = type { i32 }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.agent_info*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.agent_info* null, %struct.agent_info** %6
%7 = call %struct.agent_info* (...) @agent_info_new()
store %struct.agent_info* %7, %struct.agent_info** %6
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = load %struct.agent_info*, %struct.agent_info** %6
%11 = call i32 @parse_args(i32 %8, i8** %9, %struct.agent_info* %10)
%12 = load %struct.agent_info*, %struct.agent_info** %6
%13 = call i32 @agent_main_loop(%struct.agent_info* %12)
%14 = load %struct.agent_info*, %struct.agent_info** %6
%15 = call i32 @agent_info_free(%struct.agent_info* %14)
ret i32 0
}

LLVM IR (-O2):
%struct.agent_info = type { i32 }
define i32 @main(i32 %0, i8** %1) {
%3 = tail call %struct.agent_info* (...) @agent_info_new()
%4 = tail call i32 @parse_args(i32 %0, i8** %1, %struct.agent_info* %3)
%5 = tail call i32 @agent_main_loop(%struct.agent_info* %3)
%6 = tail call i32 @agent_info_free(%struct.agent_info* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fb_hDateDecodeSerial(double, int *, int /*<<< orphan*/,
                                        int /*<<< orphan*/);
int fb_Year(double serial) {
  int year;
  fb_hDateDecodeSerial(serial, &year, 0, 0);
  return year;
}


x86 assembly (clang, -O0):
<fb_Year>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0xc(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <fb_hDateDecodeSerial@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_Year>:
push   %rax
lea    0x4(%rsp),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <fb_hDateDecodeSerial@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fb_Year(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 @fb_hDateDecodeSerial(double %4, i32* %3, i32 0, i32 0)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @fb_Year(double %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fb_hDateDecodeSerial(double %0, i32* %2, i32 0, i32 0)
%5 = load i32, i32* %2
ret i32 %5
}
void MatrixTranslate4x4(float *matrix, float dx, float dy, float dz) {
  *(matrix + 12) += dx;
  *(matrix + 13) += dy;
  *(matrix + 14) += dz;
}


x86 assembly (clang, -O0):
<MatrixTranslate4x4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
addss  0x30(%rax),%xmm0
movss  %xmm0,0x30(%rax)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
addss  0x34(%rax),%xmm0
movss  %xmm0,0x34(%rax)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
addss  0x38(%rax),%xmm0
movss  %xmm0,0x38(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<MatrixTranslate4x4>:
addss  0x30(%rdi),%xmm0
movss  %xmm0,0x30(%rdi)
addss  0x34(%rdi),%xmm1
movss  %xmm1,0x34(%rdi)
addss  0x38(%rdi),%xmm2
movss  %xmm2,0x38(%rdi)
ret

LLVM IR (-O0):
define void @MatrixTranslate4x4(float* %0, float %1, float %2, float %3) {
%5 = alloca float*
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float* %0, float** %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %6
%10 = load float*, float** %5
%11 = getelementptr inbounds float, float* %10, i64 12
%12 = load float, float* %11
%13 = fadd float %12, %9
store float %13, float* %11
%14 = load float, float* %7
%15 = load float*, float** %5
%16 = getelementptr inbounds float, float* %15, i64 13
%17 = load float, float* %16
%18 = fadd float %17, %14
store float %18, float* %16
%19 = load float, float* %8
%20 = load float*, float** %5
%21 = getelementptr inbounds float, float* %20, i64 14
%22 = load float, float* %21
%23 = fadd float %22, %19
store float %23, float* %21
ret void
}

LLVM IR (-O2):
define void @MatrixTranslate4x4(float* nocapture %0, float %1, float %2, float %3) {
%5 = getelementptr inbounds float, float* %0, i64 12
%6 = load float, float* %5
%7 = fadd float %6, %1
store float %7, float* %5
%8 = getelementptr inbounds float, float* %0, i64 13
%9 = load float, float* %8
%10 = fadd float %9, %2
store float %10, float* %8
%11 = getelementptr inbounds float, float* %0, i64 14
%12 = load float, float* %11
%13 = fadd float %12, %3
store float %13, float* %11
ret void
}
int gpio_valid(int gpio) {
  if (gpio < 0)
    return -1;
  if (gpio < 192)
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
<gpio_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <gpio_valid+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    113d <gpio_valid+0x3d>
cmpl   $0xc0,-0x8(%rbp)
jge    1136 <gpio_valid+0x36>
movl   $0x0,-0x4(%rbp)
jmp    113d <gpio_valid+0x3d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_valid>:
xor    %eax,%eax
cmp    $0xc0,%edi
adc    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @gpio_valid(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 192
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 0, i32* %2
br label %12
11: ; preds = %7
store i32 -1, i32* %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @gpio_valid(i32 %0) {
%2 = icmp ugt i32 %0, 191
%3 = sext i1 %2 to i32
ret i32 %3
}
void MergeUVRow_Any_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @MergeUVRow_Any_SSE2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void main() { exit(0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char *);
char getTopicTag(char const *topic) {
  if (!strcmp(topic, "compass"))
    return 0;
  return 0;
}


x86 assembly (clang, -O0):
<getTopicTag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    113e <getTopicTag+0x2e>
movb   $0x0,-0x1(%rbp)
jmp    1142 <getTopicTag+0x32>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"compass\00"
define signext i8 @getTopicTag(i8* %0) {
%2 = alloca i8
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strcmp(i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i8 0, i8* %2
br label %9
8: ; preds = %1
store i8 0, i8* %2
br label %9
9: ; preds = %8, %7
%10 = load i8, i8* %2
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @getTopicTag(i8* nocapture readnone %0) {
ret i8 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int corner_read(unsigned char *cornertable, FILE *input) {
  int read;
  read = fread(cornertable, 1, 44089920, input);
  if (read < 44089920) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<corner_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
mov    $0x2a0c240,%edx
call   1030 <fread@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x2a0c240,-0x1c(%rbp)
jge    1153 <corner_read+0x43>
movl   $0x0,-0x4(%rbp)
jmp    115a <corner_read+0x4a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<corner_read>:
push   %rax
mov    %rsi,%rcx
mov    $0x1,%esi
mov    $0x2a0c240,%edx
call   1030 <fread@plt>
xor    %ecx,%ecx
cmp    $0x2a0c240,%eax
setge  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @corner_read(i8* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
store i8* %0, i8** %4
store i32* %1, i32** %5
%7 = load i8*, i8** %4
%8 = load i32*, i32** %5
%9 = call i32 @fread(i8* %7, i32 1, i32 44089920, i32* %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 44089920
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 0, i32* %3
br label %14
13: ; preds = %2
store i32 1, i32* %3
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @corner_read(i8* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @fread(i8* %0, i32 1, i32 44089920, i32* %1)
%4 = icmp sgt i32 %3, 44089919
%5 = zext i1 %4 to i32
ret i32 %5
}
void InternalHSOscillatorOff(void) {}


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

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

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

LLVM IR (-O2):
define void @InternalHSOscillatorOff() {
ret void
}
void foo() {
  int N = 2;
  int slots[N];
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
store i32 2, i32* %1
%4 = load i32, i32* %1
%5 = zext i32 %4 to i64
%6 = call i8* @llvm.stacksave()
store i8* %6, i8** %2
%7 = alloca i32, i64 %5
store i64 %5, i64* %3
%8 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
int execvp(char const *, char *const *);
int c_execvp(const char *file, char *const argv[]) {
  return execvp(file, argv);
}


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

x86 assembly (clang, -O2):
<c_execvp>:
jmp    1030 <execvp@plt>

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

LLVM IR (-O2):
define i32 @c_execvp(i8* %0, i8** %1) {
%3 = tail call i32 @execvp(i8* %0, i8** %1)
ret i32 %3
}
int IsNumber(char x) {
  if (x >= '0' && x <= '9')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<IsNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <IsNumber+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <IsNumber+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <IsNumber+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsNumber>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @IsNumber(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @IsNumber(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XButtonEvent;

/* Variables and functions */
void set_XButtonEvent_type(void *_p, int _v) {
  ((XButtonEvent *)_p)->type = (int)_v;
}


x86 assembly (clang, -O0):
<set_XButtonEvent_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XButtonEvent_type>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XButtonEvent_type(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XButtonEvent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}