xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_cancel(int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
void *func2(void *arg) {
  pthread_t th = *(pthread_t *)arg;
  sleep(2);
  pthread_cancel(th);
  return NULL;
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x2,%edi
call   1040 <sleep@plt>
mov    -0xc(%rbp),%edi
call   1030 <pthread_cancel@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
push   %rbx
mov    (%rdi),%ebx
mov    $0x2,%edi
call   1040 <sleep@plt>
mov    %ebx,%edi
call   1030 <pthread_cancel@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @func2(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = call i32 @sleep(i32 2)
%8 = load i32, i32* %3
%9 = call i32 @pthread_cancel(i32 %8)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @func2(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @sleep(i32 2)
%5 = tail call i32 @pthread_cancel(i32 %3)
ret i8* null
}
void rop3_74_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = S | *D;
  stk2 = T & stk3;
  stk1 = *D ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_74_0_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 -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%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)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_74_0_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* %5
%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* %6
%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 = load i8*, i8** %4
store i8 %30, i8* %31
ret void
}

LLVM IR (-O2):
define void @rop3_74_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %1
%6 = and i8 %5, %2
%7 = xor i8 %6, %4
store i8 %7, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t multiply_32x32_rshift32(int32_t a, int32_t b) {}


x86 assembly (clang, -O0):
<multiply_32x32_rshift32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @multiply_32x32_rshift32(i32 %0, i32 %1) {
ret i32 undef
}
void f(void) {
  struct foo {
    int a;
    int b;
  };
}


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

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

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

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ yldisp_led_blink(int, int /*<<< orphan*/);
void yldisp_led_on() { yldisp_led_blink(1, 0); }


x86 assembly (clang, -O0):
<yldisp_led_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <yldisp_led_blink@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<yldisp_led_on>:
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <yldisp_led_blink@plt>

LLVM IR (-O0):
define void @yldisp_led_on() {
%1 = call i32 @yldisp_led_blink(i32 1, i32 0)
ret void
}

LLVM IR (-O2):
define void @yldisp_led_on() {
%1 = tail call i32 @yldisp_led_blink(i32 1, i32 0)
ret void
}
int c(int x, int y) {
  int z;
  if ((y == 1) || (y == x + 1))
    return 1;
  z = c(x - 1, y - 1) + c(x - 1, y);
  return z;
}


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     1139 <c+0x29>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jne    1145 <c+0x35>
movl   $0x1,-0x4(%rbp)
jmp    1177 <c+0x67>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
call   1030 <c@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x1,%esi
je     1162 <c+0x52>
mov    %esi,%r14d
mov    %edi,%ebx
lea    0x1(%rbx),%eax
cmp    %esi,%eax
je     1162 <c+0x52>
mov    $0x1,%r15d
sub    %r14d,%r15d
add    $0xffffffff,%r14d
add    $0xffffffff,%ebx
xor    %ebp,%ebp
nop
mov    %ebx,%edi
mov    %r14d,%esi
call   1030 <c@plt>
add    %eax,%ebp
lea    (%r15,%rbx,1),%eax
add    $0xffffffff,%eax
mov    %ebx,%ecx
add    $0xffffffff,%ecx
mov    %ecx,%ebx
cmp    $0xffffffff,%eax
jne    1140 <c+0x30>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @c(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = icmp eq i32 %7, 1
br i1 %8, label %14, label %9
9: ; preds = %2
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
%13 = icmp eq i32 %10, %12
br i1 %13, label %14, label %15
14: ; preds = %9, %2
store i32 1, i32* %3
br label %27
15: ; preds = %9
%16 = load i32, i32* %4
%17 = sub nsw i32 %16, 1
%18 = load i32, i32* %5
%19 = sub nsw i32 %18, 1
%20 = call i32 @c(i32 %17, i32 %19)
%21 = load i32, i32* %4
%22 = sub nsw i32 %21, 1
%23 = load i32, i32* %5
%24 = call i32 @c(i32 %22, i32 %23)
%25 = add nsw i32 %20, %24
store i32 %25, i32* %6
%26 = load i32, i32* %6
store i32 %26, i32* %3
br label %27
27: ; preds = %15, %14
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @c(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 1
%4 = add nsw i32 %0, 1
%5 = icmp eq i32 %4, %1
%6 = select i1 %3, i1 true, i1 %5
br i1 %6, label %18, label %7
7: ; preds = %2
%8 = add nsw i32 %1, -1
br label %9
9: ; preds = %7, %9
%10 = phi i32 [ %0, %7 ], [ %12, %9 ]
%11 = phi i32 [ 0, %7 ], [ %14, %9 ]
%12 = add nsw i32 %10, -1
%13 = tail call i32 @c(i32 %12, i32 %8)
%14 = add nsw i32 %13, %11
%15 = icmp eq i32 %10, %1
br i1 %15, label %16, label %9
16: ; preds = %9
%17 = add i32 %14, 1
br label %18
18: ; preds = %16, %2
%19 = phi i32 [ 1, %2 ], [ %17, %16 ]
ret i32 %19
}
/* Type definitions */
struct termios {
  int /*<<< orphan*/ c_ispeed;
};
typedef int /*<<< orphan*/ speed_t;

/* Variables and functions */
speed_t _cfgetispeed(const struct termios *termios_p) {
  return termios_p->c_ispeed;
}


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

x86 assembly (clang, -O2):
<_cfgetispeed>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
define i32 @_cfgetispeed(%struct.termios* %0) {
%2 = alloca %struct.termios*
store %struct.termios* %0, %struct.termios** %2
%3 = load %struct.termios*, %struct.termios** %2
%4 = getelementptr inbounds %struct.termios, %struct.termios* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.termios = type { i32 }
define i32 @_cfgetispeed(%struct.termios* nocapture %0) {
%2 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int test(double);
int main() {
  assert(test(1.0) == 1);
  assert(test(2.0) == 1);
  assert(test(-1.0) == 0);
  assert(test(0) == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movsd  0xee4(%rip),%xmm0
call   1040 <test@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  0xebf(%rip),%xmm0
call   1040 <test@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  0xe9a(%rip),%xmm0
call   1040 <test@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xorps  %xmm0,%xmm0
call   1040 <test@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1040 <test@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1030 <assert@plt>
movsd  0xec4(%rip),%xmm0
call   1040 <test@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1030 <assert@plt>
movsd  0xeb1(%rip),%xmm0
call   1040 <test@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
xorps  %xmm0,%xmm0
call   1040 <test@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @test(double 1.000000e+00)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
%5 = call i32 @test(double 2.000000e+00)
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 @test(double -1.000000e+00)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = call i32 @test(double 0.000000e+00)
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(double 1.000000e+00)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @test(double 2.000000e+00)
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @test(double -1.000000e+00)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @test(double 0.000000e+00)
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
ret i32 0
}
/* Variables and functions */
scalar_t__ g();
scalar_t__ h();
int /*<<< orphan*/ printf(char *);
int main(void) {
  if (h() == g())
    printf("OK\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <h@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <g@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
jne    116d <main+0x3d>
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <h@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <g@plt>
cmp    %rax,%rbx
jne    1153 <main+0x23>
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"OK\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @h()
%3 = call i64 (...) @g()
%4 = icmp eq i64 %2, %3
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
ret i32 0
}

LLVM IR (-O2):
@str = [3 x i8] c"OK\00"
define i32 @main() {
%1 = tail call i64 (...) @h()
%2 = tail call i64 (...) @g()
%3 = icmp eq i64 %1, %2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int __infer_nondet_int();
int isprint(int x) { return __infer_nondet_int(); }


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

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

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @__infer_nondet_int()
ret i32 %3
}

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = tail call i32 (...) @__infer_nondet_int()
ret i32 %2
}
void glutSpecialFunc(void (*func)(int key, int x, int y)) {}


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

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

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

LLVM IR (-O2):
define void @glutSpecialFunc(void (i32, i32, i32)* nocapture %0) {
ret void
}
void else_then_ifs(int i) {
  if (i == 1) {
  } else {
    if (i == 2) {
    } else {
      if (i == 3) {
      } else {
        if (i == 4) {
        } else {
          if (i == 5) {
          }
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<else_then_ifs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1116 <else_then_ifs+0x16>
jmp    1166 <else_then_ifs+0x66>
cmpl   $0x2,-0x4(%rbp)
jne    1125 <else_then_ifs+0x25>
jmp    1161 <else_then_ifs+0x61>
cmpl   $0x3,-0x4(%rbp)
jne    1134 <else_then_ifs+0x34>
jmp    115c <else_then_ifs+0x5c>
cmpl   $0x4,-0x4(%rbp)
jne    1143 <else_then_ifs+0x43>
jmp    1157 <else_then_ifs+0x57>
cmpl   $0x5,-0x4(%rbp)
jne    1152 <else_then_ifs+0x52>
jmp    1152 <else_then_ifs+0x52>
jmp    1157 <else_then_ifs+0x57>
jmp    115c <else_then_ifs+0x5c>
jmp    1161 <else_then_ifs+0x61>
jmp    1166 <else_then_ifs+0x66>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @else_then_ifs(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(int /*<<< orphan*/ const *, int /*<<< orphan*/, int,
                          int /*<<< orphan*/ *);
int frame_data_write(const uint64_t *data, ssize_t size, FILE *file) {
  assert(data != NULL);
  assert(file != NULL);
  fwrite(data, size, 1, file);
  return 0;
}


x86 assembly (clang, -O0):
<frame_data_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1040 <fwrite@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frame_data_write>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
xor    %edi,%edi
test   %rbp,%rbp
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @frame_data_write(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = icmp ne i32* %7, null
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32*, i32** %6
%12 = icmp ne i32* %11, null
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32*, i32** %4
%16 = load i32, i32* %5
%17 = load i32*, i32** %6
%18 = call i32 @fwrite(i32* %15, i32 %16, i32 1, i32* %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @frame_data_write(i32* %0, i32 %1, i32* %2) {
%4 = icmp ne i32* %0, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = icmp ne i32* %2, null
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = tail call i32 @fwrite(i32* %0, i32 %1, i32 1, i32* %2)
ret i32 0
}
/* Variables and functions */
int gpio_write(int, int);
int output_disable() {
  if (-1 == gpio_write(4, 1)) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<output_disable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
mov    $0x1,%esi
call   1030 <gpio_write@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    1142 <output_disable+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <output_disable+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_disable>:
push   %rax
mov    $0x4,%edi
mov    $0x1,%esi
call   1030 <gpio_write@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @output_disable() {
%1 = alloca i32
%2 = call i32 @gpio_write(i32 4, i32 1)
%3 = icmp eq i32 -1, %2
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @output_disable() {
%1 = tail call i32 @gpio_write(i32 4, i32 1)
%2 = icmp eq i32 %1, -1
%3 = zext i1 %2 to i32
ret i32 %3
}
void g_io_add_watch() {}


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

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

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

LLVM IR (-O2):
define void @g_io_add_watch() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ __stdfix_sat_lr(int /*<<< orphan*/);
int32_t __stdfix_sneg_lr(int32_t x) { return (__stdfix_sat_lr((int64_t)-x)); }


x86 assembly (clang, -O0):
<__stdfix_sneg_lr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %eax,%edi
call   1030 <__stdfix_sat_lr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__stdfix_sneg_lr>:
neg    %edi
jmp    1030 <__stdfix_sat_lr@plt>

LLVM IR (-O0):
define i64 @__stdfix_sneg_lr(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub nsw i64 0, %3
%5 = trunc i64 %4 to i32
%6 = call i64 @__stdfix_sat_lr(i32 %5)
ret i64 %6
}

LLVM IR (-O2):
define i64 @__stdfix_sneg_lr(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = sub i32 0, %2
%4 = tail call i64 @__stdfix_sat_lr(i32 %3)
ret i64 %4
}
int base256(int val) {
  int sum = 0;
  int scale = 1;
  int i;
  for (i = 0; i < 8; i++) {
    int bit = val & 1;
    sum = sum + bit * scale;
    val <<= 1;
    scale *= 256;
  }
  return sum;
}


x86 assembly (clang, -O0):
<base256>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    115e <base256+0x5e>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x14(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111c <base256+0x1c>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base256>:
mov    %edi,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @base256(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 1, i32* %4
store i32 0, i32* %5
br label %7
7: ; preds = %22, %1
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 8
br i1 %9, label %10, label %25
10: ; preds = %7
%11 = load i32, i32* %2
%12 = and i32 %11, 1
store i32 %12, i32* %6
%13 = load i32, i32* %3
%14 = load i32, i32* %6
%15 = load i32, i32* %4
%16 = mul nsw i32 %14, %15
%17 = add nsw i32 %13, %16
store i32 %17, i32* %3
%18 = load i32, i32* %2
%19 = shl i32 %18, 1
store i32 %19, i32* %2
%20 = load i32, i32* %4
%21 = mul nsw i32 %20, 256
store i32 %21, i32* %4
br label %22
22: ; preds = %10
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %7
25: ; preds = %7
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @base256(i32 %0) {
%2 = and i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void troff(char *s) { printf("%s\n", s); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @troff(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct fc_sockaddr_list_link {
  int dummy;
};
struct fc_sockaddr_list {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_tail(struct genlist const *);
struct fc_sockaddr_list_link *
fc_sockaddr_list_tail(const struct fc_sockaddr_list *tthis) {
  return (struct fc_sockaddr_list_link *)genlist_tail(
      (const struct genlist *)tthis);
}


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

x86 assembly (clang, -O2):
<fc_sockaddr_list_tail>:
jmp    1030 <genlist_tail@plt>

LLVM IR (-O0):
%struct.fc_sockaddr_list_link = type { i32 }
%struct.fc_sockaddr_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.fc_sockaddr_list_link* @fc_sockaddr_list_tail(%struct.fc_sockaddr_list* %0) {
%2 = alloca %struct.fc_sockaddr_list*
store %struct.fc_sockaddr_list* %0, %struct.fc_sockaddr_list** %2
%3 = load %struct.fc_sockaddr_list*, %struct.fc_sockaddr_list** %2
%4 = bitcast %struct.fc_sockaddr_list* %3 to %struct.genlist*
%5 = call i64 @genlist_tail(%struct.genlist* %4)
%6 = inttoptr i64 %5 to %struct.fc_sockaddr_list_link*
ret %struct.fc_sockaddr_list_link* %6
}

LLVM IR (-O2):
%struct.fc_sockaddr_list_link = type { i32 }
%struct.fc_sockaddr_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.fc_sockaddr_list_link* @fc_sockaddr_list_tail(%struct.fc_sockaddr_list* %0) {
%2 = bitcast %struct.fc_sockaddr_list* %0 to %struct.genlist*
%3 = tail call i64 @genlist_tail(%struct.genlist* %2)
%4 = inttoptr i64 %3 to %struct.fc_sockaddr_list_link*
ret %struct.fc_sockaddr_list_link* %4
}
/* Type definitions */
struct md5_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ md5_final(struct md5_s *);
void DVDEndMD5(struct md5_s *h) { md5_final(h); }


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

x86 assembly (clang, -O2):
<DVDEndMD5>:
jmp    1030 <md5_final@plt>

LLVM IR (-O0):
%struct.md5_s = type { i32 }
define void @DVDEndMD5(%struct.md5_s* %0) {
%2 = alloca %struct.md5_s*
store %struct.md5_s* %0, %struct.md5_s** %2
%3 = load %struct.md5_s*, %struct.md5_s** %2
%4 = call i32 @md5_final(%struct.md5_s* %3)
ret void
}

LLVM IR (-O2):
%struct.md5_s = type { i32 }
define void @DVDEndMD5(%struct.md5_s* %0) {
%2 = tail call i32 @md5_final(%struct.md5_s* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;
typedef int /*<<< orphan*/ dev_t;
typedef unsigned long long dev;

/* Variables and functions */
int INLINE_SYSCALL(int (*)(char const *, int /*<<< orphan*/,
                           int /*<<< orphan*/),
                   int, char const *, int /*<<< orphan*/, unsigned int);
int mknod(const char *path, mode_t mode, dev_t dev) {
  unsigned long long int k_dev;
  k_dev = (dev) & ((1ULL << 32) - 1);
  return INLINE_SYSCALL(mknod, 3, path, mode, (unsigned int)k_dev);
}


x86 assembly (clang, -O0):
<mknod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movslq -0x10(%rbp),%rax
movabs $0xffffffff,%rcx
and    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %eax,%r8d
mov    0x2e94(%rip),%rdi
mov    $0x3,%esi
call   1030 <INLINE_SYSCALL@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mknod>:
mov    %edx,%r8d
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2ec1(%rip),%rdi
mov    $0x3,%esi
jmp    1030 <INLINE_SYSCALL@plt>

LLVM IR (-O0):
define i32 @mknod(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = and i64 %9, 4294967295
store i64 %10, i64* %7
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = load i64, i64* %7
%14 = trunc i64 %13 to i32
%15 = call i32 @INLINE_SYSCALL(i32 (i8*, i32, i32)* @mknod, i32 3, i8* %11, i32 %12, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @mknod(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @INLINE_SYSCALL(i32 (i8*, i32, i32)* @mknod, i32 3, i8* %0, i32 %1, i32 %2)
ret i32 %4
}
void reserve_ibft_region(void) {}


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

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

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

LLVM IR (-O2):
define void @reserve_ibft_region() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ caddr_t;

/* Variables and functions */
caddr_t _sbrk(int incr) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_sbrk(i32 %0) {
ret i32 0
}
gmatch(s, p) char *s, *p;
{
  if (*s == '.' && *p != '.')
    return (0);
  return (amatch(s, p));
}


x86 assembly (clang, -O0):
<gmatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    114c <gmatch+0x3c>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     114c <gmatch+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    115e <gmatch+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <amatch@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmatch>:
cmpb   $0x2e,(%rdi)
jne    111a <gmatch+0xa>
cmpb   $0x2e,(%rsi)
jne    1121 <gmatch+0x11>
xor    %eax,%eax
jmp    1030 <amatch@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @gmatch(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 46
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i8, i8* %1
%7 = icmp eq i8 %6, 46
br i1 %7, label %8, label %10
8: ; preds = %5, %2
%9 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @amatch to i32 (i8*, i8*, ...)*)(i8* %0, i8* %1)
br label %10
10: ; preds = %5, %8
%11 = phi i32 [ %9, %8 ], [ 0, %5 ]
ret i32 %11
}
int sched_restore_ticks() {}


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

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

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

LLVM IR (-O2):
define i32 @sched_restore_ticks() {
ret i32 undef
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long serial;
};
typedef TYPE_1__ XNoExposeEvent;

/* Variables and functions */
void set_XNoExposeEvent_serial(void *_p, unsigned long _v) {
  ((XNoExposeEvent *)_p)->serial = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XNoExposeEvent_serial(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %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 i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XNoExposeEvent_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ptr_set_to_zero(int **);
void call_by_arr_good() {
  int arr[10];
  ptr_set_to_zero(&arr);
  arr[arr[0]] = 123;
}


x86 assembly (clang, -O0):
<call_by_arr_good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
call   1030 <ptr_set_to_zero@plt>
movslq -0x30(%rbp),%rax
movl   $0x7b,-0x30(%rbp,%rax,4)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_by_arr_good>:
sub    $0x28,%rsp
mov    %rsp,%rdi
call   1030 <ptr_set_to_zero@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @call_by_arr_good() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i32**
%3 = call i32 @ptr_set_to_zero(i32** %2)
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %6
store i32 123, i32* %7
ret void
}

LLVM IR (-O2):
define void @call_by_arr_good() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = bitcast [10 x i32]* %1 to i32**
%4 = call i32 @ptr_set_to_zero(i32** %3)
ret void
}
void mr_track(void) {}


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

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

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

LLVM IR (-O2):
define void @mr_track() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wait1Msec(float);
int waitUser(float duration) {
  wait1Msec(duration * 1.1);
  return 1;
}


x86 assembly (clang, -O0):
<waitUser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed2(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <wait1Msec@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitUser>:
push   %rax
cvtss2sd %xmm0,%xmm0
mulsd  0xee3(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <wait1Msec@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @waitUser(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 1.100000e+00
%6 = fptrunc double %5 to float
%7 = call i32 @wait1Msec(float %6)
ret i32 1
}

LLVM IR (-O2):
define i32 @waitUser(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 1.100000e+00
%4 = fptrunc double %3 to float
%5 = tail call i32 @wait1Msec(float %4)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void showhelp(void) {
  fprintf(stdout, "vrintf");
  return;
}


x86 assembly (clang, -O0):
<showhelp>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<showhelp>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [7 x i8] c"vrintf\00"
define void @showhelp() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [7 x i8] c"vrintf\00"
define void @showhelp() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ aterm();
int /*<<< orphan*/ aterms();
void xterm() {
  aterm();
  aterms();
}


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

x86 assembly (clang, -O2):
<xterm>:
push   %rax
xor    %eax,%eax
call   1040 <aterm@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <aterms@plt>

LLVM IR (-O0):
define void @xterm() {
%1 = call i32 (...) @aterm()
%2 = call i32 (...) @aterms()
ret void
}

LLVM IR (-O2):
define void @xterm() {
%1 = tail call i32 (...) @aterm()
%2 = tail call i32 (...) @aterms()
ret void
}
int fun_call_base_3(int *a, char *b) { return *a + *b; }


x86 assembly (clang, -O0):
<fun_call_base_3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_call_base_3>:
movsbl (%rsi),%eax
add    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @fun_call_base_3(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @fun_call_base_3(i32* nocapture %0, i8* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = add nsw i32 %3, %5
ret i32 %6
}
int nvg__maxi(int a, int b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<nvg__maxi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <nvg__maxi+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <nvg__maxi+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvg__maxi>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @nvg__maxi(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @nvg__maxi(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ remove(char *);
int DoDeleteFile(char *filename) { return filename ? !remove(filename) : 0; }


x86 assembly (clang, -O0):
<DoDeleteFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1145 <DoDeleteFile+0x35>
mov    -0x8(%rbp),%rdi
call   1030 <remove@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
jmp    114f <DoDeleteFile+0x3f>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    114f <DoDeleteFile+0x3f>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoDeleteFile>:
test   %rdi,%rdi
je     1129 <DoDeleteFile+0x19>
push   %rax
call   1030 <remove@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @DoDeleteFile(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @remove(i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
br label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %5
%13 = phi i32 [ %10, %5 ], [ 0, %11 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @DoDeleteFile(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @remove(i8* %0)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
size_t msg_get_header_length(void) { return (2 + 4); }


x86 assembly (clang, -O0):
<msg_get_header_length>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_get_header_length>:
mov    $0x6,%eax
ret

LLVM IR (-O0):
define i64 @msg_get_header_length() {
ret i64 6
}

LLVM IR (-O2):
define i64 @msg_get_header_length() {
ret i64 6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void usage(void) { exit(1); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @usage() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat_nomap_nolog(char const *, struct stat *);
int real_stat(const char *path, struct stat *statbuf) {
  int r;
  r = stat_nomap_nolog(path, statbuf);
  return (r);
}


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

x86 assembly (clang, -O2):
<real_stat>:
jmp    1030 <stat_nomap_nolog@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @real_stat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
%5 = alloca i32
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%6 = load i8*, i8** %3
%7 = load %struct.stat*, %struct.stat** %4
%8 = call i32 @stat_nomap_nolog(i8* %6, %struct.stat* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @real_stat(i8* %0, %struct.stat* %1) {
%3 = tail call i32 @stat_nomap_nolog(i8* %0, %struct.stat* %1)
ret i32 %3
}
double distanceGetVelocity(double T) { return 331.0 + 0.6 * T; }


x86 assembly (clang, -O0):
<distanceGetVelocity>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<distanceGetVelocity>:
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @distanceGetVelocity(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fmuladd.f64(double 6.000000e-01, double %3, double 3.310000e+02)
ret double %4
}

LLVM IR (-O2):
define double @distanceGetVelocity(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 6.000000e-01, double 3.310000e+02)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ G_Error(char *);
int /*<<< orphan*/ Q_strncpyz(char *, char const *, int);
int strlen(char *);
void Q_strcat(char *dest, int size, const char *src) {
  int l1;
  l1 = strlen(dest);
  if (l1 >= size) {
    G_Error("Q_strcat: already overflowed");
  }
  Q_strncpyz(dest + l1, src, size - l1);
}


x86 assembly (clang, -O0):
<Q_strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1167 <Q_strcat+0x37>
lea    0xe9e(%rip),%rdi
call   1040 <G_Error@plt>
mov    -0x8(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
sub    -0x1c(%rbp),%edx
call   1050 <Q_strncpyz@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_strcat>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%r15d
cmp    %ebp,%eax
jl     1157 <Q_strcat+0x27>
lea    0xeae(%rip),%rdi
call   1040 <G_Error@plt>
movslq %r15d,%rax
add    %rax,%rbx
sub    %r15d,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <Q_strncpyz@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Q_strcat: already overflowed\00"
define void @Q_strcat(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = load i32, i32* %5
%12 = icmp sge i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @G_Error(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %3
%16 = load i8*, i8** %4
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8*, i8** %6
%21 = load i32, i32* %5
%22 = load i32, i32* %7
%23 = sub nsw i32 %21, %22
%24 = call i32 @Q_strncpyz(i8* %19, i8* %20, i32 %23)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Q_strcat: already overflowed\00"
define void @Q_strcat(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp slt i32 %4, %1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @G_Error(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
%9 = sext i32 %4 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = sub nsw i32 %1, %4
%12 = tail call i32 @Q_strncpyz(i8* %10, i8* %2, i32 %11)
ret void
}
int ack(int m, int n) {
  if (m == 0) {
    return n + 1;
  } else {
    if (n == 0) {
      return ack(m - 1, 1);
    } else {
      return ack(m - 1, ack(m, n - 1));
    }
  }
}


x86 assembly (clang, -O0):
<ack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1136 <ack+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    117c <ack+0x6c>
cmpl   $0x0,-0xc(%rbp)
jne    1158 <ack+0x48>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    $0x1,%esi
call   1030 <ack@plt>
mov    %eax,-0x4(%rbp)
jmp    117c <ack+0x6c>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <ack@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1030 <ack@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ack>:
push   %rbx
mov    %esi,%eax
test   %edi,%edi
je     113f <ack+0x2f>
mov    %edi,%ebx
jmp    112a <ack+0x1a>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%eax
add    $0xffffffff,%ebx
je     113f <ack+0x2f>
test   %eax,%eax
je     1120 <ack+0x10>
add    $0xffffffff,%eax
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <ack@plt>
add    $0xffffffff,%ebx
jne    112a <ack+0x1a>
add    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ack(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %26
11: ; preds = %2
%12 = load i32, i32* %5
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, 1
%17 = call i32 @ack(i32 %16, i32 1)
store i32 %17, i32* %3
br label %26
18: ; preds = %11
%19 = load i32, i32* %4
%20 = sub nsw i32 %19, 1
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = sub nsw i32 %22, 1
%24 = call i32 @ack(i32 %21, i32 %23)
%25 = call i32 @ack(i32 %20, i32 %24)
store i32 %25, i32* %3
br label %26
26: ; preds = %18, %14, %8
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @ack(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %11, %2
%5 = phi i32 [ %1, %2 ], [ %12, %11 ]
%6 = add nsw i32 %5, 1
ret i32 %6
7: ; preds = %2, %11
%8 = phi i32 [ %12, %11 ], [ %1, %2 ]
%9 = phi i32 [ %13, %11 ], [ %0, %2 ]
%10 = icmp eq i32 %8, 0
br i1 %10, label %11, label %15
11: ; preds = %7, %15
%12 = phi i32 [ %17, %15 ], [ 1, %7 ]
%13 = add nsw i32 %9, -1
%14 = icmp eq i32 %13, 0
br i1 %14, label %4, label %7
15: ; preds = %7
%16 = add nsw i32 %8, -1
%17 = tail call i32 @ack(i32 %9, i32 %16)
br label %11
}
void sync_dsp(void) {}


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

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

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

LLVM IR (-O2):
define void @sync_dsp() {
ret void
}
/* Variables and functions */
scalar_t__ round(double);
long int lround(double x) { return (long int)round(x); }


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

x86 assembly (clang, -O2):
<lround>:
jmp    1030 <round@plt>

LLVM IR (-O0):
define i64 @lround(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @round(double %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @lround(double %0) {
%2 = tail call i64 @round(double %0)
ret i64 %2
}