xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int quot;
  int rem;
};
typedef TYPE_1__ div_t;

/* Variables and functions */
div_t div(int numer, int denom) {
  div_t result;
  int q = 0;
  while (denom * q < numer) {
    q++;
  }
  result.quot = --q;
  result.rem = numer - denom * q;
  return result;
}


x86 assembly (clang, -O0):
<div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    112f <div+0x2f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1111 <div+0x11>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
imul   -0x14(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<div>:
mov    %esi,%r8d
neg    %r8d
xor    %ecx,%ecx
mov    $0xfffffffe,%eax
nopl   (%rax)
add    %esi,%ecx
add    $0x1,%eax
lea    (%r8,%rcx,1),%edx
cmp    %edi,%edx
jl     1110 <div+0x10>
lea    (%rdi,%rsi,2),%edx
sub    %ecx,%edx
shl    $0x20,%rdx
mov    %eax,%eax
or     %rdx,%rax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32 }
define i64 @div(i32 %0, i32 %1) {
%3 = alloca %struct.TYPE_3__
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %13, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = mul nsw i32 %8, %9
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %16
13: ; preds = %7
%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* %6
%18 = add nsw i32 %17, -1
store i32 %18, i32* %6
%19 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
store i32 %18, i32* %19
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = mul nsw i32 %21, %22
%24 = sub nsw i32 %20, %23
%25 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
store i32 %24, i32* %25
%26 = bitcast %struct.TYPE_3__* %3 to i64*
%27 = load i64, i64* %26
ret i64 %27
}

LLVM IR (-O2):
define i64 @div(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %7, %3 ]
%5 = mul nsw i32 %4, %1
%6 = icmp slt i32 %5, %0
%7 = add nuw nsw i32 %4, 1
br i1 %6, label %3, label %8
8: ; preds = %3
%9 = add nsw i32 %4, -1
%10 = mul nsw i32 %9, %1
%11 = sub nsw i32 %0, %10
%12 = zext i32 %11 to i64
%13 = shl nuw i64 %12, 32
%14 = zext i32 %9 to i64
%15 = or i64 %13, %14
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
void display_usage(void) {
  puts("Usage: matcher [--no-dotfiles] [--limit num] [--manifest filename] "
       "<query>\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<display_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<display_usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [76 x i8] c"Usage: matcher [--no-dotfiles] [--limit num] [--manifest filename] <query>\0A\00"
@EXIT_FAILURE = global i32 0
define void @display_usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@.str = [76 x i8] c"Usage: matcher [--no-dotfiles] [--limit num] [--manifest filename] <query>\0A\00"
@EXIT_FAILURE = global i32 0
define void @display_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ view_check_for_updates();
void modes_periodic(void) { view_check_for_updates(); }


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

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

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

LLVM IR (-O2):
define void @modes_periodic() {
%1 = tail call i32 (...) @view_check_for_updates()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ display_str(char *);
int /*<<< orphan*/ itoa(char *, int);
void display_int(int num) {
  char buf[16];
  itoa(buf, num);
  display_str(buf);
}


x86 assembly (clang, -O0):
<display_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <itoa@plt>
lea    -0x20(%rbp),%rdi
call   1030 <display_str@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_int>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%esi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <itoa@plt>
mov    %rbx,%rdi
call   1030 <display_str@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @display_int(i32 %0) {
%2 = alloca i32
%3 = alloca [16 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @itoa(i8* %4, i32 %5)
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%8 = call i32 @display_str(i8* %7)
ret void
}

LLVM IR (-O2):
define void @display_int(i32 %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i32 @itoa(i8* %3, i32 %0)
%5 = call i32 @display_str(i8* %3)
ret void
}
/* Type definitions */
struct can_frame {
  int *data;
};

/* Variables and functions */
void sdo_toggle(struct can_frame *frame) { frame->data[0] ^= 1 << 4; }


x86 assembly (clang, -O0):
<sdo_toggle>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%ecx
xor    $0x10,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdo_toggle>:
mov    (%rdi),%rax
xorl   $0x10,(%rax)
ret

LLVM IR (-O0):
%struct.can_frame = type { i32* }
define void @sdo_toggle(%struct.can_frame* %0) {
%2 = alloca %struct.can_frame*
store %struct.can_frame* %0, %struct.can_frame** %2
%3 = load %struct.can_frame*, %struct.can_frame** %2
%4 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %3, i32 0, i32 0
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = xor i32 %7, 16
store i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
%struct.can_frame = type { i32* }
define void @sdo_toggle(%struct.can_frame* nocapture %0) {
%2 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %0, i64 0, i32 0
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = xor i32 %4, 16
store i32 %5, i32* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t sec2nanosec(double sec) { return (uint64_t)(sec * 100000000); }


x86 assembly (clang, -O0):
<sec2nanosec>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sec2nanosec>:
mulsd  0xef8(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @sec2nanosec(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.000000e+08
%5 = fptosi double %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @sec2nanosec(double %0) {
%2 = fmul double %0, 1.000000e+08
%3 = fptosi double %2 to i32
ret i32 %3
}
void path_027_expected_24(int a, int b, int c) {
  switch (a) {
  case 0:
    break;
  case 1:
    break;
  case 2:
    break;
  case 3:
    break;
  case 4:
    break;
  default:
    break;
  }
  if (b) {
  } else {
  }
  if (c) {
  } else {
  }
}


x86 assembly (clang, -O0):
<path_027_expected_24>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x4,%rax
ja     114b <path_027_expected_24+0x4b>
mov    -0x18(%rbp),%rax
lea    0xed7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    1150 <path_027_expected_24+0x50>
jmp    1150 <path_027_expected_24+0x50>
jmp    1150 <path_027_expected_24+0x50>
jmp    1150 <path_027_expected_24+0x50>
jmp    1150 <path_027_expected_24+0x50>
jmp    1150 <path_027_expected_24+0x50>
cmpl   $0x0,-0x8(%rbp)
je     115f <path_027_expected_24+0x5f>
jmp    1164 <path_027_expected_24+0x64>
jmp    1164 <path_027_expected_24+0x64>
cmpl   $0x0,-0xc(%rbp)
je     1173 <path_027_expected_24+0x73>
jmp    1178 <path_027_expected_24+0x78>
jmp    1178 <path_027_expected_24+0x78>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @path_027_expected_24(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
switch i32 %7, label %13 [
i32 0, label %8
i32 1, label %9
i32 2, label %10
i32 3, label %11
i32 4, label %12
]
8: ; preds = %3
br label %14
9: ; preds = %3
br label %14
10: ; preds = %3
br label %14
11: ; preds = %3
br label %14
12: ; preds = %3
br label %14
13: ; preds = %3
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8
%15 = load i32, i32* %5
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %14
br label %19
18: ; preds = %14
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %6
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %19
br label %24
23: ; preds = %19
br label %24
24: ; preds = %23, %22
ret void
}

LLVM IR (-O2):
define void @path_027_expected_24(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Type definitions */
typedef int u_long;

/* Variables and functions */
int /*<<< orphan*/ LogSetMaskLocal();
void log_DiscardAllLocal(u_long *mask) {
  *mask = (1 << (((24)) - 1)) | (1 << (((25)) - 1)) | (1 << (((23)) - 1));
  LogSetMaskLocal();
}


x86 assembly (clang, -O0):
<log_DiscardAllLocal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1c00000,(%rax)
mov    $0x0,%al
call   1030 <LogSetMaskLocal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_DiscardAllLocal>:
movl   $0x1c00000,(%rdi)
xor    %eax,%eax
jmp    1030 <LogSetMaskLocal@plt>

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

LLVM IR (-O2):
define void @log_DiscardAllLocal(i32* nocapture writeonly %0) {
store i32 29360128, i32* %0
%2 = tail call i32 (...) @LogSetMaskLocal()
ret void
}
/* Variables and functions */
double asin(int);
double math_acsc(double x) { return asin(1 / x); }


x86 assembly (clang, -O0):
<math_acsc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <asin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_acsc>:
movsd  0xee8(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
jmp    1030 <asin@plt>

LLVM IR (-O0):
define double @math_acsc(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
%5 = fptosi double %4 to i32
%6 = call double @asin(i32 %5)
ret double %6
}

LLVM IR (-O2):
define double @math_acsc(double %0) {
%2 = fdiv double 1.000000e+00, %0
%3 = fptosi double %2 to i32
%4 = tail call double @asin(i32 %3)
ret double %4
}
/* Variables and functions */
double fabs(double);
int is_dbl_near(double expected, double actual, double epsilon) {
  double diff = fabs(expected - actual);
  return (diff <= epsilon) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_dbl_near>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movaps 0xedc(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
xor    %eax,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmovae %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dbl_near>:
subsd  %xmm1,%xmm0
andpd  0xef4(%rip),%xmm0
xor    %eax,%eax
ucomisd %xmm0,%xmm2
setae  %al
ret

LLVM IR (-O0):
define i32 @is_dbl_near(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = load double, double* %5
%10 = fsub double %8, %9
%11 = call double @llvm.fabs.f64(double %10)
store double %11, double* %7
%12 = load double, double* %7
%13 = load double, double* %6
%14 = fcmp ole double %12, %13
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 1, i32 0
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_dbl_near(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = tail call double @llvm.fabs.f64(double %4)
%6 = fcmp ole double %5, %2
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
void *memalign(long, size_t);
void *valloc(size_t size) {
  long pagesize = -1;
  if (pagesize < 0)
    pagesize = 4096;
  return memalign(pagesize, size);
}


x86 assembly (clang, -O0):
<valloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
cmpq   $0x0,-0x10(%rbp)
jge    1137 <valloc+0x27>
movq   $0x1000,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <memalign@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valloc>:
mov    %rdi,%rsi
mov    $0x1000,%edi
jmp    1030 <memalign@plt>

LLVM IR (-O0):
define i8* @valloc(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 -1, i64* %3
%4 = load i64, i64* %3
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 4096, i64* %3
br label %7
7: ; preds = %6, %1
%8 = load i64, i64* %3
%9 = load i64, i64* %2
%10 = call i8* @memalign(i64 %8, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @valloc(i64 %0) {
%2 = tail call align 4096 i8* @memalign(i64 4096, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ libc_exit(int);
int /*<<< orphan*/ libc_printf(char *, int, double, double, double);
int /*<<< orphan*/ roots_nearZero(double);
void AssertRFail(double a, double b) {
  if (!(roots_nearZero(a - b))) {
    libc_printf(
        (char *)"error assert failed: %g should equal %g difference is %g\\n",
        58, a, b, a - b);
    libc_exit(1);
  }
}


x86 assembly (clang, -O0):
<AssertRFail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1050 <roots_nearZero@plt>
cmp    $0x0,%eax
jne    1189 <AssertRFail+0x59>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
lea    0xe8b(%rip),%rdi
mov    $0x3a,%esi
call   1030 <libc_printf@plt>
mov    $0x1,%edi
call   1040 <libc_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AssertRFail>:
sub    $0x18,%rsp
movsd  %xmm0,(%rsp)
movsd  %xmm1,0x10(%rsp)
subsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
call   1050 <roots_nearZero@plt>
test   %eax,%eax
je     1157 <AssertRFail+0x27>
add    $0x18,%rsp
ret
lea    0xea2(%rip),%rdi
mov    $0x3a,%esi
movsd  (%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
call   1030 <libc_printf@plt>
mov    $0x1,%edi
add    $0x18,%rsp
jmp    1040 <libc_exit@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"error assert failed: %g should equal %g difference is %g\\n\00"
define void @AssertRFail(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
%8 = call i32 @roots_nearZero(double %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %18, label %10
10: ; preds = %2
%11 = load double, double* %3
%12 = load double, double* %4
%13 = load double, double* %3
%14 = load double, double* %4
%15 = fsub double %13, %14
%16 = call i32 @libc_printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 58, double %11, double %12, double %15)
%17 = call i32 @libc_exit(i32 1)
br label %18
18: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c"error assert failed: %g should equal %g difference is %g\\n\00"
define void @AssertRFail(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call i32 @roots_nearZero(double %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @libc_printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 58, double %0, double %1, double %3)
%8 = tail call i32 @libc_exit(i32 1)
br label %9
9: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void throw(int error_code, char *message) {
  if (message != NULL) {
    fprintf(stderr, "ERROR: %s\n", message);
  }
  if (error_code) {
    exit(error_code);
  }
}


x86 assembly (clang, -O0):
<throw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <throw+0x33>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
cmpl   $0x0,-0x4(%rbp)
je     1165 <throw+0x45>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<throw>:
push   %rbx
mov    %edi,%ebx
test   %rsi,%rsi
je     1140 <throw+0x20>
mov    %rsi,%rdx
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
test   %ebx,%ebx
jne    1146 <throw+0x26>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @throw(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %4
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %7, %2
%12 = load i32, i32* %3
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %3
%16 = call i32 @exit(i32 %15)
unreachable
17: ; preds = %11
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @throw(i32 %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %7
7: ; preds = %4, %2
%8 = icmp eq i32 %0, 0
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = tail call i32 @exit(i32 %0)
unreachable
11: ; preds = %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void die(void) {
  int status;
  status = 1;
  exit(status);
}


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

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

LLVM IR (-O0):
define void @die() {
%1 = alloca i32
store i32 1, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
define void @die() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void ack() {
  printf("Bad token list!\n");
  exit(1);
}


x86 assembly (clang, -O0):
<ack>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ack>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Bad token list!\0A\00"
define void @ack() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [16 x i8] c"Bad token list!\00"
define void @ack() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "nullfs: -d -w nthreads mount-point\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"nullfs: -d -w nthreads mount-point\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"nullfs: -d -w nthreads mount-point\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
void genadd() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, char *);
void RNDResponseSink_AVTransport_GetTransportSettings(
    struct UPnPService *Service, int ErrorCode, void *User, char *PlayMode,
    char *RecQualityMode) {
  printf("RND Invoke Response: "
         "AVTransport/GetTransportSettings[ErrorCode:%d](%s,%s)\r\n",
         ErrorCode, PlayMode, RecQualityMode);
}


x86 assembly (clang, -O0):
<RNDResponseSink_AVTransport_GetTransportSettings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNDResponseSink_AVTransport_GetTransportSettings>:
lea    0xee9(%rip),%rdi
mov    %rcx,%rdx
mov    %r8,%rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [77 x i8] c"RND Invoke Response: AVTransport/GetTransportSettings[ErrorCode:%d](%s,%s)\0D\0A\00"
define void @RNDResponseSink_AVTransport_GetTransportSettings(%struct.UPnPService* %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca %struct.UPnPService*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i32, i32* %7
%12 = load i8*, i8** %9
%13 = load i8*, i8** %10
%14 = call i32 @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [77 x i8] c"RND Invoke Response: AVTransport/GetTransportSettings[ErrorCode:%d](%s,%s)\0D\0A\00"
define void @RNDResponseSink_AVTransport_GetTransportSettings(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* %3, i8* %4) {
%6 = tail call i32 @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %3, i8* %4)
ret void
}
/* Variables and functions */
int fib2_helper(unsigned int, unsigned int *);
int /*<<< orphan*/ printf(char *, unsigned int, ...);
unsigned int fib2(unsigned int n) {
  unsigned int nchamadas = 0;
  int resultado = fib2_helper(n, &nchamadas);
  printf("\nfib() foi chamado %d vezes.\n", nchamadas);
  printf("O número fibonacci de ordem %d é %d.\n", n, resultado);
  return resultado;
}


x86 assembly (clang, -O0):
<fib2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1040 <fib2_helper@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib2>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1040 <fib2_helper@plt>
mov    %eax,%ebp
mov    0x4(%rsp),%esi
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"\0Afib() foi chamado %d vezes.\0A\00"
@.str.1 = [40 x i8] c"O n\C3\BAmero fibonacci de ordem %d \C3\A9 %d.\0A\00"
define i32 @fib2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%5 = load i32, i32* %2
%6 = call i32 @fib2_helper(i32 %5, i32* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %3
%8 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = load i32, i32* %4
%11 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10)
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
@.str = [30 x i8] c"\0Afib() foi chamado %d vezes.\0A\00"
@.str.1 = [40 x i8] c"O n\C3\BAmero fibonacci de ordem %d \C3\A9 %d.\0A\00"
define i32 @fib2(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @fib2_helper(i32 %0, i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 %4)
ret i32 %4
}
void check_read_buffer(struct nandsim_private *ns, int line) {}


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

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

LLVM IR (-O0):
%struct.nandsim_private = type opaque
define void @check_read_buffer(%struct.nandsim_private* %0, i32 %1) {
%3 = alloca %struct.nandsim_private*
%4 = alloca i32
store %struct.nandsim_private* %0, %struct.nandsim_private** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.nandsim_private = type opaque
define void @check_read_buffer(%struct.nandsim_private* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fmt_err_exit(char *);
void *malloc(size_t);
void *alloc_buff(size_t size) {
  void *buff;
  buff = malloc(size);
  if (!buff)
    fmt_err_exit("virtual memory exhausted");
  return buff;
}


x86 assembly (clang, -O0):
<alloc_buff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <alloc_buff+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <fmt_err_exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_buff>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <alloc_buff+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fmt_err_exit@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [25 x i8] c"virtual memory exhausted\00"
define noalias i8* @alloc_buff(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fmt_err_exit(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int q_sortByG(const void *pp, const void *qp) {
  return (*(unsigned int *)pp & 0x0000FF00) -
         (*(unsigned int *)qp & 0x0000FF00);
}


x86 assembly (clang, -O0):
<q_sortByG>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xff00,%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
and    $0xff00,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<q_sortByG>:
movzbl 0x1(%rdi),%eax
shl    $0x8,%eax
movzbl 0x1(%rsi),%ecx
shl    $0x8,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @q_sortByG(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = and i32 %7, 65280
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = and i32 %11, 65280
%13 = sub i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @q_sortByG(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = and i32 %4, 65280
%6 = bitcast i8* %1 to i32*
%7 = load i32, i32* %6
%8 = and i32 %7, 65280
%9 = sub nsw i32 %5, %8
ret i32 %9
}
void EthernetIntEnable(unsigned long ulBase, unsigned long ulIntFlags) {
  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000004))) |= ulIntFlags;
}


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

x86 assembly (clang, -O2):
<EthernetIntEnable>:
or     %rsi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @EthernetIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 4
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @EthernetIntEnable(i64 %0, i64 %1) {
%3 = add i64 %0, 4
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = or i64 %5, %1
store volatile i64 %6, i64* %4
ret void
}
/* Variables and functions */
char *read_until_char(char **, char *);
char *read_packagename(char **buf, char *end) {
  return read_until_char(buf, end);
}


x86 assembly (clang, -O0):
<read_packagename>:
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 <read_until_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_packagename>:
jmp    1030 <read_until_char@plt>

LLVM IR (-O0):
define i8* @read_packagename(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 i8* @read_until_char(i8** %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @read_packagename(i8** %0, i8* %1) {
%3 = tail call i8* @read_until_char(i8** %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ get_sockinfo(int, char **, int *);
int get_sockport(int sock) {
  char *addr;
  int port;
  get_sockinfo(sock, &addr, &port);
  return port;
}


x86 assembly (clang, -O0):
<get_sockport>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <get_sockinfo@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sockport>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1030 <get_sockinfo@plt>
mov    0xc(%rsp),%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @get_sockport(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = bitcast i8** %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @get_sockinfo(i32 %0, i8** %2, i32* %3)
%7 = load i32, i32* %3
ret i32 %7
}
void foo0() {}


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

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

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

LLVM IR (-O2):
define void @foo0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bye() { printf("Bye,Bye\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"Bye,Bye\00"
define void @bye() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void movsx_reg32_8preg32pimm32(int reg1, int reg2, unsigned int imm32) {
  put8(0x0F);
  put8(0xBE);
  put8((reg1 << 3) | reg2 | 0x80);
  put32(imm32);
}


x86 assembly (clang, -O0):
<movsx_reg32_8preg32pimm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0xbe,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     -0x8(%rbp),%edi
or     $0x80,%edi
call   1030 <put8@plt>
mov    -0xc(%rbp),%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<movsx_reg32_8preg32pimm32>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0xbe,%edi
call   1030 <put8@plt>
shl    $0x3,%ebx
or     %ebp,%ebx
or     $0x80,%ebx
mov    %ebx,%edi
call   1030 <put8@plt>
mov    %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @movsx_reg32_8preg32pimm32(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 = call i32 @put8(i32 15)
%8 = call i32 @put8(i32 190)
%9 = load i32, i32* %4
%10 = shl i32 %9, 3
%11 = load i32, i32* %5
%12 = or i32 %10, %11
%13 = or i32 %12, 128
%14 = call i32 @put8(i32 %13)
%15 = load i32, i32* %6
%16 = call i32 @put32(i32 %15)
ret void
}

LLVM IR (-O2):
define void @movsx_reg32_8preg32pimm32(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @put8(i32 15)
%5 = tail call i32 @put8(i32 190)
%6 = shl i32 %0, 3
%7 = or i32 %6, %1
%8 = or i32 %7, 128
%9 = tail call i32 @put8(i32 %8)
%10 = tail call i32 @put32(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void WatchdogUnlock(unsigned long ulBase) {
  DEBUG_ASSERT((ulBase == 0x40000000) || (ulBase == 0x40001000));
  (*((volatile unsigned long *)(ulBase + 0x00000C00))) = 0x1ACCE551;
}


x86 assembly (clang, -O0):
<WatchdogUnlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x40000000,-0x8(%rbp)
40
mov    %al,-0x9(%rbp)
je     113d <WatchdogUnlock+0x2d>
cmpq   $0x40001000,-0x8(%rbp)
40
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
movq   $0x1acce551,0xc00(%rax)
51 e5 cc 1a
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogUnlock>:
push   %rbx
mov    %rdi,%rbx
mov    %rdi,%rax
and    $0xffffffffffffefff,%rax
xor    %edi,%edi
cmp    $0x40000000,%rax
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
movq   $0x1acce551,0xc00(%rbx)
51 e5 cc 1a
pop    %rbx
ret

LLVM IR (-O0):
define void @WatchdogUnlock(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1073741824
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 1073745920
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @DEBUG_ASSERT(i32 %10)
%12 = load i64, i64* %2
%13 = add i64 %12, 3072
%14 = inttoptr i64 %13 to i64*
store volatile i64 449635665, i64* %14
ret void
}

LLVM IR (-O2):
define void @WatchdogUnlock(i64 %0) {
%2 = and i64 %0, -4097
%3 = icmp eq i64 %2, 1073741824
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = add i64 %0, 3072
%7 = inttoptr i64 %6 to i64*
store volatile i64 449635665, i64* %7
ret void
}
void clear_arr(char line[]) {
  int i = 0;
  for (i = 0; line[i] != '\0'; i++)
    line[i] = ' ';
  line[i] = ' ';
}


x86 assembly (clang, -O0):
<clear_arr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1145 <clear_arr+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <clear_arr+0x16>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_arr>:
cmpb   $0x0,(%rdi)
je     1124 <clear_arr+0x24>
cs nopw 0x0(%rax,%rax,1)
nop
movb   $0x20,(%rdi)
lea    0x1(%rdi),%rax
cmpb   $0x0,0x1(%rdi)
mov    %rax,%rdi
jne    1110 <clear_arr+0x10>
movb   $0x20,(%rax)
ret
movb   $0x20,(%rdi)
ret

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

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

/* Variables and functions */
int sumN(struct TreeNode *, int /*<<< orphan*/);
int sumNumbers(struct TreeNode *root) { return sumN(root, 0); }


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

x86 assembly (clang, -O2):
<sumNumbers>:
xor    %esi,%esi
jmp    1030 <sumN@plt>

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

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define i32 @sumNumbers(%struct.TreeNode* %0) {
%2 = tail call i32 @sumN(%struct.TreeNode* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
size_t strlen(char const *);
size_t strlen_ptr(const char *s) {
  if (!s)
    return 0;
  return strlen(s);
}


x86 assembly (clang, -O0):
<strlen_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <strlen_ptr+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1141 <strlen_ptr+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen_ptr>:
test   %rdi,%rdi
je     111a <strlen_ptr+0xa>
jmp    1030 <strlen@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @strlen_ptr(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i64 0, i64* %2
br label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i64 @strlen(i8* %8)
store i64 %9, i64* %2
br label %10
10: ; preds = %7, %6
%11 = load i64, i64* %2
ret i64 %11
}

LLVM IR (-O2):
define i64 @strlen_ptr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ %4, %3 ], [ 0, %1 ]
ret i64 %6
}
char *langDbgRegsYmf262() { return "YMF262 Registers"; }


x86 assembly (clang, -O0):
<langDbgRegsYmf262>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langDbgRegsYmf262>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"YMF262 Registers\00"
define i8* @langDbgRegsYmf262() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [17 x i8] c"YMF262 Registers\00"
define i8* @langDbgRegsYmf262() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
double errcheck(int /*<<< orphan*/, char *);
int /*<<< orphan*/ pow(double, double);
double Pow(double x, double y) { return errcheck(pow(x, y), "expotentiation"); }


x86 assembly (clang, -O0):
<Pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <pow@plt>
mov    %eax,%edi
lea    0xeb6(%rip),%rsi
call   1030 <errcheck@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pow>:
push   %rax
call   1040 <pow@plt>
lea    0xed3(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1030 <errcheck@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"expotentiation\00"
define double @Pow(double %0, double %1) {
%3 = tail call i32 @pow(double %0, double %1)
%4 = tail call double @errcheck(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret double %4
}
void dash2DASH() {}


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

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

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

LLVM IR (-O2):
define void @dash2DASH() {
ret void
}
/* Variables and functions */
int encode_julday(int, int, int, int);
void encode_juldaysec(int calendar, int year, int month, int day, int hour,
                      int minute, int second, int *julday, int *secofday) {
  *julday = encode_julday(calendar, year, month, day);
  *secofday = (hour * 60 + minute) * 60 + second;
}


x86 assembly (clang, -O0):
<encode_juldaysec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
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),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <encode_julday@plt>
mov    %eax,%ecx
mov    0x18(%rbp),%rax
mov    %ecx,(%rax)
imul   $0x3c,-0x14(%rbp),%eax
add    -0x18(%rbp),%eax
imul   $0x3c,%eax,%ecx
add    0x10(%rbp),%ecx
mov    0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_juldaysec>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r9d,%ebx
mov    %r8d,%ebp
mov    0x40(%rsp),%r14
mov    0x38(%rsp),%r15
call   1030 <encode_julday@plt>
mov    %eax,(%r15)
imul   $0x3c,%ebp,%eax
add    %ebx,%eax
imul   $0x3c,%eax,%eax
add    0x30(%rsp),%eax
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @encode_juldaysec(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32* %7, i32* %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32*
%18 = alloca i32*
store i32 %0, i32* %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32* %7, i32** %17
store i32* %8, i32** %18
%19 = load i32, i32* %10
%20 = load i32, i32* %11
%21 = load i32, i32* %12
%22 = load i32, i32* %13
%23 = call i32 @encode_julday(i32 %19, i32 %20, i32 %21, i32 %22)
%24 = load i32*, i32** %17
store i32 %23, i32* %24
%25 = load i32, i32* %14
%26 = mul nsw i32 %25, 60
%27 = load i32, i32* %15
%28 = add nsw i32 %26, %27
%29 = mul nsw i32 %28, 60
%30 = load i32, i32* %16
%31 = add nsw i32 %29, %30
%32 = load i32*, i32** %18
store i32 %31, i32* %32
ret void
}

LLVM IR (-O2):
define void @encode_juldaysec(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32* nocapture writeonly %7, i32* nocapture writeonly %8) {
%10 = tail call i32 @encode_julday(i32 %0, i32 %1, i32 %2, i32 %3)
store i32 %10, i32* %7
%11 = mul nsw i32 %4, 60
%12 = add nsw i32 %11, %5
%13 = mul nsw i32 %12, 60
%14 = add nsw i32 %13, %6
store i32 %14, i32* %8
ret void
}
char do_call(char c, char (*fun)(char)) { return fun(c); }


x86 assembly (clang, -O0):
<do_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl -0x1(%rbp),%edi
call   *%rax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_call>:
jmp    *%rsi

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

LLVM IR (-O2):
define signext i8 @do_call(i8 signext %0, i8 (i8)* nocapture %1) {
%3 = tail call signext i8 %1(i8 signext %0)
ret i8 %3
}