xunge/DecIR huggingface dataset:
unsigned clp2(unsigned x) {
  x = x - 1;
  x = x | (x >> 1);
  x = x | (x >> 2);
  x = x | (x >> 4);
  x = x | (x >> 8);
  x = x | (x >> 16);
  return x + 1;
}


x86 assembly (clang, -O0):
<clp2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clp2>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
shr    %ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
shr    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
shr    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @clp2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = lshr i32 %6, 1
%8 = or i32 %5, %7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = load i32, i32* %2
%11 = lshr i32 %10, 2
%12 = or i32 %9, %11
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = load i32, i32* %2
%15 = lshr i32 %14, 4
%16 = or i32 %13, %15
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = load i32, i32* %2
%19 = lshr i32 %18, 8
%20 = or i32 %17, %19
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = load i32, i32* %2
%23 = lshr i32 %22, 16
%24 = or i32 %21, %23
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add i32 %25, 1
ret i32 %26
}

LLVM IR (-O2):
define i32 @clp2(i32 %0) {
%2 = add i32 %0, -1
%3 = lshr i32 %2, 1
%4 = or i32 %3, %2
%5 = lshr i32 %4, 2
%6 = or i32 %5, %4
%7 = lshr i32 %6, 4
%8 = or i32 %7, %6
%9 = lshr i32 %8, 8
%10 = or i32 %9, %8
%11 = lshr i32 %10, 16
%12 = or i32 %11, %10
%13 = add i32 %12, 1
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ log_assert(char const *, char const *, unsigned int,
                              char const *, char *);
__attribute__((noreturn)) void log_assert_failed_unreachable(const char *text,
                                                             const char *file,
                                                             unsigned int line,
                                                             const char *func) {
  log_assert(
      text, file, line, func,
      "Code should not be reached '%s' at %s:%u, function %s(). Aborting.");
}


x86 assembly (clang, -O0):
<log_assert_failed_unreachable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
lea    0xec3(%rip),%r8
call   1030 <log_assert@plt>

x86 assembly (clang, -O2):
<log_assert_failed_unreachable>:
push   %rax
lea    0xee8(%rip),%r8
call   1030 <log_assert@plt>

LLVM IR (-O0):
@.str = [67 x i8] c"Code should not be reached '%s' at %s:%u, function %s(). Aborting.\00"
define void @log_assert_failed_unreachable(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i8*, i8** %8
%13 = call i32 @log_assert(i8* %9, i8* %10, i32 %11, i8* %12, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@.str = [67 x i8] c"Code should not be reached '%s' at %s:%u, function %s(). Aborting.\00"
define void @log_assert_failed_unreachable(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 @log_assert(i8* %0, i8* %1, i32 %2, i8* %3, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int sesc_prof_fork_successor(int id) {
  fprintf(
      stderr,
      "Versioning simulator is needed to execute sesc_prof_fork_successor\n");
  return 0;
}


x86 assembly (clang, -O0):
<sesc_prof_fork_successor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    0xed5(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sesc_prof_fork_successor>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [68 x i8] c"Versioning simulator is needed to execute sesc_prof_fork_successor\0A\00"
define i32 @sesc_prof_fork_successor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [68 x i8] c"Versioning simulator is needed to execute sesc_prof_fork_successor\0A\00"
define i32 @sesc_prof_fork_successor(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int StrUtils_getDigitsForNumber(int number) {
  int digits = 1;
  double count_for_digits = number;
  while (true) {
    count_for_digits = count_for_digits / 10;
    if (count_for_digits < 1) {
      break;
    };
    digits++;
  }
  return digits;
}


x86 assembly (clang, -O0):
<StrUtils_getDigitsForNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xee3(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeca(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1146 <StrUtils_getDigitsForNumber+0x46>
jmp    1154 <StrUtils_getDigitsForNumber+0x54>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1118 <StrUtils_getDigitsForNumber+0x18>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrUtils_getDigitsForNumber>:
cvtsi2sd %edi,%xmm0
xor    %eax,%eax
movsd  0xef2(%rip),%xmm1
movsd  0xef2(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
divsd  %xmm1,%xmm0
add    $0x1,%eax
ucomisd %xmm0,%xmm2
jbe    1120 <StrUtils_getDigitsForNumber+0x20>
ret

LLVM IR (-O0):
define i32 @StrUtils_getDigitsForNumber(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %2
store i32 1, i32* %3
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to double
store double %6, double* %4
br label %7
7: ; preds = %1, %13
%8 = load double, double* %4
%9 = fdiv double %8, 1.000000e+01
store double %9, double* %4
%10 = load double, double* %4
%11 = fcmp olt double %10, 1.000000e+00
br i1 %11, label %12, label %13
12: ; preds = %7
br label %16
13: ; preds = %7
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %7
16: ; preds = %12
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @StrUtils_getDigitsForNumber(i32 %0) {
%2 = sitofp i32 %0 to double
br label %3
3: ; preds = %3, %1
%4 = phi i32 [ 1, %1 ], [ %8, %3 ]
%5 = phi double [ %2, %1 ], [ %6, %3 ]
%6 = fdiv double %5, 1.000000e+01
%7 = fcmp olt double %6, 1.000000e+00
%8 = add nuw nsw i32 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
ret i32 %4
}
int TestTimeValue(int val, int sollk, int sollg) {
  if (val < sollk || val > sollg)
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<TestTimeValue>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1125 <TestTimeValue+0x25>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1131 <TestTimeValue+0x31>
movl   $0x0,-0x4(%rbp)
jmp    1138 <TestTimeValue+0x38>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestTimeValue>:
cmp    %esi,%edi
setge  %al
cmp    %edx,%edi
setle  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @TestTimeValue(i32 %0, i32 %1, i32 %2) {
%4 = icmp sge i32 %0, %1
%5 = icmp sle i32 %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
void files_init() {}


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

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

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

LLVM IR (-O2):
define void @files_init() {
ret void
}
int feldspar_taskpool_hook(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @feldspar_taskpool_hook() {
ret i32 0
}
/* Variables and functions */
char *realpath(char *, int /*<<< orphan*/ *);
char *strdup(char *);
char *get_real_name(char *executable) {
  char *s;
  s = realpath(executable, NULL);
  if (s == NULL) {
    return strdup(executable);
  } else {
    return s;
  }
}


x86 assembly (clang, -O0):
<get_real_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <realpath@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115a <get_real_name+0x3a>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    1162 <get_real_name+0x42>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_real_name>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <realpath@plt>
test   %rax,%rax
je     1132 <get_real_name+0x12>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strdup@plt>

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

LLVM IR (-O2):
define i8* @get_real_name(i8* nocapture %0) {
%2 = tail call i8* @realpath(i8* %0, i32* null)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @strdup(i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ %2, %1 ]
ret i8* %7
}
void SPI1_RX_ISR(void) {}


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

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

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

LLVM IR (-O2):
define void @SPI1_RX_ISR() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef unsigned short volatile uint16_t;
typedef unsigned short int16_t;

/* Variables and functions */
void I2SWclkCounterConfigure(uint32_t ui32Base, int16_t i16Value) {
  uint16_t ui16MinusValue;
  ;
  if (i16Value >= 0) {
    (*((volatile unsigned short *)(0x40021000 + 0x00000054))) = i16Value;
  } else {
    ui16MinusValue = (uint16_t)(-i16Value);
    (*((volatile unsigned short *)(0x40021000 + 0x00000054))) =
        (*((volatile unsigned short *)(0x40021000 + 0x00000044))) -
        ui16MinusValue;
  }
}


x86 assembly (clang, -O0):
<I2SWclkCounterConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
cmp    $0x0,%eax
jl     112c <I2SWclkCounterConfigure+0x2c>
mov    -0x6(%rbp),%cx
mov    $0x40021054,%eax
mov    %cx,(%rax)
jmp    1157 <I2SWclkCounterConfigure+0x57>
movzwl -0x6(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %ax,-0x8(%rbp)
mov    $0x40021044,%eax
mov    (%rax),%ax
movzwl %ax,%eax
mov    -0x8(%rbp),%cx
movzwl %cx,%ecx
sub    %ecx,%eax
mov    %ax,%cx
mov    $0x40021054,%eax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2SWclkCounterConfigure>:
mov    %si,0x40021054
40
ret

LLVM IR (-O0):
define void @I2SWclkCounterConfigure(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
%5 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%6 = load i16, i16* %4
%7 = zext i16 %6 to i32
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i16, i16* %4
store volatile i16 %10, i16* inttoptr (i64 1073877076 to i16*)
br label %22
11: ; preds = %2
%12 = load i16, i16* %4
%13 = zext i16 %12 to i32
%14 = sub nsw i32 0, %13
%15 = trunc i32 %14 to i16
store volatile i16 %15, i16* %5
%16 = load volatile i16, i16* inttoptr (i64 1073877060 to i16*)
%17 = zext i16 %16 to i32
%18 = load volatile i16, i16* %5
%19 = zext i16 %18 to i32
%20 = sub nsw i32 %17, %19
%21 = trunc i32 %20 to i16
store volatile i16 %21, i16* inttoptr (i64 1073877076 to i16*)
br label %22
22: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
define void @I2SWclkCounterConfigure(i32 %0, i16 zeroext %1) {
store volatile i16 %1, i16* inttoptr (i64 1073877076 to i16*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __dmtimer0_init();
int /*<<< orphan*/ __dmtimer1_init();
void _init_timer(int clock_source) {
  switch (clock_source) {
  case 0:
    __dmtimer0_init();
    break;
  case 1:
    __dmtimer1_init();
    break;
  default:
    __dmtimer1_init();
  }
}


x86 assembly (clang, -O0):
<_init_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     114f <_init_timer+0x2f>
jmp    113e <_init_timer+0x1e>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     115b <_init_timer+0x3b>
jmp    1167 <_init_timer+0x47>
mov    $0x0,%al
call   1030 <__dmtimer0_init@plt>
jmp    116e <_init_timer+0x4e>
mov    $0x0,%al
call   1040 <__dmtimer1_init@plt>
jmp    116e <_init_timer+0x4e>
mov    $0x0,%al
call   1040 <__dmtimer1_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_init_timer>:
cmp    $0x1,%edi
je     1130 <_init_timer+0x10>
test   %edi,%edi
jne    1130 <_init_timer+0x10>
xor    %eax,%eax
jmp    1030 <__dmtimer0_init@plt>
xor    %eax,%eax
jmp    1040 <__dmtimer1_init@plt>

LLVM IR (-O0):
define void @_init_timer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %8 [
i32 0, label %4
i32 1, label %6
]
4: ; preds = %1
%5 = call i32 (...) @__dmtimer0_init()
br label %10
6: ; preds = %1
%7 = call i32 (...) @__dmtimer1_init()
br label %10
8: ; preds = %1
%9 = call i32 (...) @__dmtimer1_init()
br label %10
10: ; preds = %8, %6, %4
ret void
}

LLVM IR (-O2):
define void @_init_timer(i32 %0) {
switch i32 %0, label %6 [
i32 0, label %2
i32 1, label %4
]
2: ; preds = %1
%3 = tail call i32 (...) @__dmtimer0_init()
br label %8
4: ; preds = %1
%5 = tail call i32 (...) @__dmtimer1_init()
br label %8
6: ; preds = %1
%7 = tail call i32 (...) @__dmtimer1_init()
br label %8
8: ; preds = %6, %4, %2
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t do_get_tsc(void) {
  uint64_t t;
  __asm__ volatile(".byte 0x0f, 0x31" : "=A"(t));
  return t;
}


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

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

LLVM IR (-O0):
define i8* @do_get_tsc() {
%1 = alloca i8*
%2 = call i8* asm sideeffect ".byte 0x0f, 0x31", "=A,~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @do_get_tsc() {
%1 = tail call i8* asm sideeffect ".byte 0x0f, 0x31", "=A,~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(char *name) {
  printf("Usage for program %s\n", name);
  printf("1 arguments required: 1) the x to be inverse squared.\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedd(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Usage for program %s\0A\00"
@.str.1 = [55 x i8] c"1 arguments required: 1) the x to be inverse squared.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Usage for program %s\0A\00"
@str = [54 x i8] c"1 arguments required: 1) the x to be inverse squared.\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
ret void
}
void str_array_free(char **arr) {
  char **_arr = arr;
  while (arr && *arr) {
    free(*arr);
    *arr = 0;
    arr++;
  }
  free(_arr);
  _arr = 0;
}


x86 assembly (clang, -O0):
<str_array_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     1142 <str_array_free+0x32>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1152 <str_array_free+0x42>
jmp    117a <str_array_free+0x6a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    1124 <str_array_free+0x14>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x10(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_array_free>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %rdi,%rdi
je     1149 <str_array_free+0x39>
mov    (%r14),%rdi
test   %rdi,%rdi
je     1149 <str_array_free+0x39>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
movq   $0x0,-0x8(%rbx)
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <str_array_free+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @str_array_free(i8** %0) {
%2 = alloca i8**
%3 = alloca i8**
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
store i8** %4, i8*** %3
br label %5
5: ; preds = %14, %1
%6 = load i8**, i8*** %2
%7 = icmp ne i8** %6, null
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i8**, i8*** %2
%10 = load i8*, i8** %9
%11 = icmp ne i8* %10, null
br label %12
12: ; preds = %8, %5
%13 = phi i1 [ false, %5 ], [ %11, %8 ]
br i1 %13, label %14, label %20
14: ; preds = %12
%15 = load i8**, i8*** %2
%16 = load i8*, i8** %15
%17 = load i8**, i8*** %2
store i8* null, i8** %17
%18 = load i8**, i8*** %2
%19 = getelementptr inbounds i8*, i8** %18, i32 1
store i8** %19, i8*** %2
br label %5
20: ; preds = %12
%21 = load i8**, i8*** %3
%22 = bitcast i8** %21 to i8*
store i8** null, i8*** %3
ret void
}

LLVM IR (-O2):
define void @str_array_free(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %12, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %10, %6 ], [ %4, %3 ]
%8 = phi i8** [ %9, %6 ], [ %0, %3 ]
tail call void @free(i8* %7)
store i8* null, i8** %8
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %6
12: ; preds = %6, %3, %1
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void ui_destroy() { endwin(); }


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

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

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

LLVM IR (-O2):
define void @ui_destroy() {
%1 = tail call i32 (...) @endwin()
ret void
}
void IRQ_Trap(void) {
  for (;;)
    ;
}


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

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

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

LLVM IR (-O2):
define void @IRQ_Trap() {
br label %1
1: ; preds = %1, %0
br label %1
}
double atan(double x) { return x; }


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

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

LLVM IR (-O0):
define double @atan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
ret double %3
}

LLVM IR (-O2):
define double @atan(double returned %0) {
ret double %0
}
void INT_Excep_DMACA_DMAC1I(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_DMACA_DMAC1I() {
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long long getms() {
  struct timeval tv;
  int r = gettimeofday(&tv, NULL);
  return r == 0 ? tv.tv_sec * 1000 + tv.tv_usec / 1000 : 0;
}


x86 assembly (clang, -O0):
<getms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1156 <getms+0x46>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
jmp    1160 <getms+0x50>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    1160 <getms+0x50>
mov    -0x10(%rbp),%eax
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getms>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %eax,%eax
jne    1152 <getms+0x42>
movslq 0x8(%rsp),%rax
imul   $0x3e8,%rax,%rax
movslq 0xc(%rsp),%rcx
imul   $0x10624dd3,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
movslq %ecx,%rbx
add    %rax,%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @getms() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %0
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 1000
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%11 = load i32, i32* %10
%12 = sdiv i32 %11, 1000
%13 = add nsw i32 %9, %12
br label %15
14: ; preds = %0
br label %15
15: ; preds = %14, %6
%16 = phi i32 [ %13, %6 ], [ 0, %14 ]
%17 = sext i32 %16 to i64
ret i64 %17
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @getms() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %0
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 1000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%10 = load i32, i32* %9
%11 = sdiv i32 %10, 1000
%12 = add nsw i32 %11, %8
%13 = sext i32 %12 to i64
br label %14
14: ; preds = %0, %5
%15 = phi i64 [ %13, %5 ], [ 0, %0 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ stdscr;
int /*<<< orphan*/ waddnstr(int /*<<< orphan*/, char *, int);
void display_write_chars(char *str, int len) { waddnstr(stdscr, str, len); }


x86 assembly (clang, -O0):
<display_write_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <waddnstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_write_chars>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ecc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <waddnstr@plt>

LLVM IR (-O0):
@stdscr = global i32 0
define void @display_write_chars(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdscr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @waddnstr(i32 %5, i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
define void @display_write_chars(i8* %0, i32 %1) {
%3 = load i32, i32* @stdscr
%4 = tail call i32 @waddnstr(i32 %3, i8* %0, i32 %1)
ret void
}
extern void put_fs_word(short val, short *addr) {
  __asm__("movw %0,%%fs:%1" ::"r"(val), "m"(*addr));
}


x86 assembly (clang, -O0):
<put_fs_word>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x10(%rbp),%rcx
mov    %ax,%fs:(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_fs_word>:
mov    %di,%fs:(%rsi)
ret

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

LLVM IR (-O2):
define void @put_fs_word(i16 signext %0, i16* %1) {
tail call void asm sideeffect "movw $0,%fs:$1", "r,*m,~{dirflag},~{fpsr},~{flags}"(i16 %0, i16* elementtype(i16) %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ foo();
main() {
  if (foo() == 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
cmp    $0x0,%rax
jne    1147 <main+0x27>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
test   %rax,%rax
je     1131 <main+0x11>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @foo()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @foo()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Type definitions */
struct GameMap {
  int dummy;
};

/* Variables and functions */
int map_leftop(struct GameMap *const);
int /*<<< orphan*/ map_rotate_left(struct GameMap *const, int);
int map_downop(struct GameMap *const map) {
  map_rotate_left(map, 3);
  int actions = map_leftop(map);
  map_rotate_left(map, 1);
  return actions;
}


x86 assembly (clang, -O0):
<map_downop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
call   1030 <map_rotate_left@plt>
mov    -0x8(%rbp),%rdi
call   1040 <map_leftop@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <map_rotate_left@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_downop>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x3,%esi
call   1030 <map_rotate_left@plt>
mov    %rbx,%rdi
call   1040 <map_leftop@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <map_rotate_left@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.GameMap = type { i32 }
define i32 @map_downop(%struct.GameMap* %0) {
%2 = alloca %struct.GameMap*
%3 = alloca i32
store %struct.GameMap* %0, %struct.GameMap** %2
%4 = load %struct.GameMap*, %struct.GameMap** %2
%5 = call i32 @map_rotate_left(%struct.GameMap* %4, i32 3)
%6 = load %struct.GameMap*, %struct.GameMap** %2
%7 = call i32 @map_leftop(%struct.GameMap* %6)
store i32 %7, i32* %3
%8 = load %struct.GameMap*, %struct.GameMap** %2
%9 = call i32 @map_rotate_left(%struct.GameMap* %8, i32 1)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
%struct.GameMap = type { i32 }
define i32 @map_downop(%struct.GameMap* %0) {
%2 = tail call i32 @map_rotate_left(%struct.GameMap* %0, i32 3)
%3 = tail call i32 @map_leftop(%struct.GameMap* %0)
%4 = tail call i32 @map_rotate_left(%struct.GameMap* %0, i32 1)
ret i32 %3
}
void free_double_matrix(double **matrix, int maxCols) {
  int i;
  for (i = 0; i < maxCols; i++)
    free(matrix[i]);
  free(matrix);
}


x86 assembly (clang, -O0):
<free_double_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free_double_matrix+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_double_matrix+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_double_matrix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_double_matrix+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_double_matrix+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_double_matrix(double** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double*, double** %0, i64 %7
%9 = bitcast double** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast double** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Variables and functions */
void *newState_2(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @newState_2() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @newState_2() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr, "Usage: test_stats"
                        " source destination\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    $0x1,%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    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"Usage: test_stats source destination\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"Usage: test_stats source destination\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void print_help(void) {
  printf("%s\n%s\n", "-h\t--help\t\tShow this help page, then exit",
         "-f\t--filef\t\tFilename of the file to read");
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"%s\0A%s\0A\00"
@.str.1 = [42 x i8] c"-h\09--help\09\09Show this help page, then exit\00"
@.str.2 = [41 x i8] c"-f\09--filef\09\09Filename of the file to read\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s\0A%s\0A\00"
@.str.1 = [42 x i8] c"-h\09--help\09\09Show this help page, then exit\00"
@.str.2 = [41 x i8] c"-f\09--filef\09\09Filename of the file to read\00"
define void @print_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
float logf(float const);
float Maths_Log(const float number) { return logf(number); }


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

x86 assembly (clang, -O2):
<Maths_Log>:
jmp    1030 <logf@plt>

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

LLVM IR (-O2):
define float @Maths_Log(float %0) {
%2 = tail call float @logf(float %0)
ret float %2
}
/* Variables and functions */
int EXIT_SUCCESS;
int M(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 12;
  int b = 123;
  printf("the larger one is %d\n", M(a, b));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0x8(%rbp)
movl   $0x7b,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <M@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc,%edi
mov    $0x7b,%esi
call   1040 <M@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"the larger one is %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 12, i32* %2
store i32 123, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 @M(i32 %4, i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@.str = [22 x i8] c"the larger one is %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @M(i32 12, i32 123)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Variables and functions */
int EOF;
scalar_t__ feof(int /*<<< orphan*/);
int fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int _discard(void) {
  int c;
  while ((c = fgetc(stdin)) != EOF)
    ;
  return feof(stdin) ? 0 : 2;
}


x86 assembly (clang, -O0):
<_discard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
call   1030 <fgetc@plt>
mov    %eax,-0x4(%rbp)
mov    0x2ea0(%rip),%rcx
cmp    (%rcx),%eax
je     114d <_discard+0x2d>
jmp    1128 <_discard+0x8>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <feof@plt>
mov    %rax,%rdx
mov    $0x2,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_discard>:
push   %r14
push   %rbx
push   %rax
mov    0x2ebd(%rip),%r14
mov    0x2eae(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14),%edi
call   1030 <fgetc@plt>
cmp    (%rbx),%eax
jne    1140 <_discard+0x20>
mov    (%r14),%edi
call   1040 <feof@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
add    %ecx,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdin = global i32 0
@EOF = global i32 0
define i32 @_discard() {
%1 = alloca i32
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* @stdin
%4 = call i32 @fgetc(i32 %3)
store i32 %4, i32* %1
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %2
br label %2
8: ; preds = %2
%9 = load i32, i32* @stdin
%10 = call i64 @feof(i32 %9)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 0, i32 2
ret i32 %13
}

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i32 0
define i32 @_discard() {
br label %1
1: ; preds = %1, %0
%2 = load i32, i32* @stdin
%3 = tail call i32 @fgetc(i32 %2)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = load i32, i32* @stdin
%8 = tail call i64 @feof(i32 %7)
%9 = icmp eq i64 %8, 0
%10 = select i1 %9, i32 2, i32 0
ret i32 %10
}
int isProbablePrime(long oddNumber) {
  long i;
  for (i = 3; i < 51; i += 2)
    if (oddNumber == i)
      return 1;
    else if (oddNumber % i == 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isProbablePrime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x3,-0x18(%rbp)
cmpq   $0x33,-0x18(%rbp)
jge    1170 <isProbablePrime+0x70>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1135 <isProbablePrime+0x35>
movl   $0x1,-0x4(%rbp)
jmp    1177 <isProbablePrime+0x77>
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
cmp    $0x0,%rdx
jne    1155 <isProbablePrime+0x55>
movl   $0x0,-0x4(%rbp)
jmp    1177 <isProbablePrime+0x77>
jmp    115a <isProbablePrime+0x5a>
jmp    115f <isProbablePrime+0x5f>
mov    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
jmp    1110 <isProbablePrime+0x10>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isProbablePrime>:
mov    $0x1,%r8d
cmp    $0x3,%rdi
je     115f <isProbablePrime+0x5f>
mov    $0x5,%esi
sub    %rdi,%rsi
mov    $0x3,%ecx
nopl   0x0(%rax)
mov    %rdi,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     1140 <isProbablePrime+0x40>
mov    %rdi,%rax
cqto
idiv   %rcx
test   %rdx,%rdx
jne    114b <isProbablePrime+0x4b>
jmp    1163 <isProbablePrime+0x63>
nopl   0x0(%rax,%rax,1)
mov    %edi,%eax
xor    %edx,%edx
div    %ecx
test   %rdx,%rdx
je     1163 <isProbablePrime+0x63>
cmp    $0x30,%rcx
ja     115f <isProbablePrime+0x5f>
lea    (%rsi,%rcx,1),%rax
add    $0x2,%rcx
cmp    $0x3,%rax
jne    1120 <isProbablePrime+0x20>
mov    %r8d,%eax
ret
xor    %r8d,%r8d
mov    %r8d,%eax
ret

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

LLVM IR (-O2):
define i32 @isProbablePrime(i64 %0) {
%2 = icmp eq i64 %0, 3
br i1 %2, label %12, label %7
3: ; preds = %7
%4 = icmp ugt i64 %8, 48
%5 = icmp eq i64 %11, %0
%6 = or i1 %4, %5
br i1 %6, label %12, label %7
7: ; preds = %1, %3
%8 = phi i64 [ %11, %3 ], [ 3, %1 ]
%9 = srem i64 %0, %8
%10 = icmp eq i64 %9, 0
%11 = add nuw nsw i64 %8, 2
br i1 %10, label %12, label %3
12: ; preds = %7, %3, %1
%13 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %7 ]
ret i32 %13
}
void cpum_run() {}


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

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

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

LLVM IR (-O2):
define void @cpum_run() {
ret void
}
int fun273() { return 273; }


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

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

LLVM IR (-O0):
define i32 @fun273() {
ret i32 273
}

LLVM IR (-O2):
define i32 @fun273() {
ret i32 273
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void package_dump_day(char *buffer, unsigned char day_back) {
  memset(buffer, 0, 17 - 1);
  buffer[0x00] = 0x5a;
  buffer[0x01] = 0x43;
  buffer[0x02] = day_back;
}


x86 assembly (clang, -O0):
<package_dump_day>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
movb   $0x5a,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x43,0x1(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<package_dump_day>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
movw   $0x435a,(%rbx)
mov    %bpl,0x2(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @package_dump_day(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = call i32 @memset(i8* %5, i32 0, i32 16)
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 90, i8* %8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8 67, i8* %10
%11 = load i8, i8* %4
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 2
store i8 %11, i8* %13
ret void
}

LLVM IR (-O2):
define void @package_dump_day(i8* %0, i8 zeroext %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 16)
store i8 90, i8* %0
%4 = getelementptr inbounds i8, i8* %0, i64 1
store i8 67, i8* %4
%5 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %1, i8* %5
ret void
}
/* Type definitions */
typedef scalar_t__ evutil_socket_t;

/* Variables and functions */
scalar_t__ SIGHUP;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ load_distributed_files(char const *);
void handle_sighup_cb(evutil_socket_t signum, short what, void *arg) {
  assert(signum == SIGHUP);
  const char *workdir = arg;
  load_distributed_files(workdir);
}


x86 assembly (clang, -O0):
<handle_sighup_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2eae(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <load_distributed_files@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_sighup_cb>:
push   %rbx
mov    %rdx,%rbx
mov    0x2ec5(%rip),%rcx
xor    %eax,%eax
cmp    %rdi,(%rcx)
sete   %al
mov    %eax,%edi
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <load_distributed_files@plt>

LLVM IR (-O0):
@SIGHUP = global i64 0
define void @handle_sighup_cb(i64 %0, i16 signext %1, i8* %2) {
%4 = alloca i64
%5 = alloca i16
%6 = alloca i8*
%7 = alloca i8*
store i64 %0, i64* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%8 = load i64, i64* %4
%9 = load i64, i64* @SIGHUP
%10 = icmp eq i64 %8, %9
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i8*, i8** %6
store i8* %13, i8** %7
%14 = load i8*, i8** %7
%15 = call i32 @load_distributed_files(i8* %14)
ret void
}

LLVM IR (-O2):
@SIGHUP = global i64 0
define void @handle_sighup_cb(i64 %0, i16 signext %1, i8* %2) {
%4 = load i64, i64* @SIGHUP
%5 = icmp eq i64 %4, %0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @load_distributed_files(i8* %2)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int div_u64_by_15625(int);
uint64_t div_u64_by_1000000(uint64_t val) { return div_u64_by_15625(val) >> 6; }


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

x86 assembly (clang, -O2):
push   %rax
call   1030 <div_u64_by_15625@plt>
sar    $0x6,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @div_u64_by_1000000(i32 %0) {
%2 = tail call i32 @div_u64_by_15625(i32 %0)
%3 = ashr i32 %2, 6
ret i32 %3
}