xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t max6x_data_count_unpack(uint16_t count) {
  uint8_t *raw = (uint8_t *)&count;
  return (((uint16_t)raw[0]) << 8) | raw[1];
}


x86 assembly (clang, -O0):
<max6x_data_count_unpack>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
or     0x4(%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @max6x_data_count_unpack(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
store i32* %2, i32** %3
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = shl i32 %6, 8
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = or i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @max6x_data_count_unpack(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int rand();
void read(int v[], int n) {
  int i;
  for (i = 0; i < n; i++) {
    v[i] = rand() % n;
  }
}


x86 assembly (clang, -O0):
<read>:
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    1156 <read+0x46>
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <read+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1148 <read+0x38>
mov    %esi,%r15d
mov    %rdi,%r14
mov    %esi,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %r15d
mov    %edx,(%r14,%rbp,4)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1130 <read+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @read(i32* nocapture writeonly %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 = tail call i32 (...) @rand()
%9 = srem i32 %8, %1
%10 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 %9, i32* %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
ret void
}
/* Variables and functions */
int /*<<< orphan*/ call_solver_unix(char *, int);
void call_solver(char *fname, int check) { call_solver_unix(fname, check); }


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

x86 assembly (clang, -O2):
<call_solver>:
jmp    1030 <call_solver_unix@plt>

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

LLVM IR (-O2):
define void @call_solver(i8* %0, i32 %1) {
%3 = tail call i32 @call_solver_unix(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int *const_ret_func();
int /*<<< orphan*/ printf(char *, int const);
int main() {
  int i = 0;
  int ptr_tmp = 2;
  const int *p = const_ret_func();
  printf("%d\n", *p);
  p = &ptr_tmp;
  printf("%d\n", *p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    $0x0,%al
call   1040 <const_ret_func@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <const_ret_func@plt>
mov    (%rax),%esi
lea    0xecf(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32* (...) @const_ret_func()
%2 = load i32, i32* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
int HelpItem144(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem144() {
ret i32 0
}
int m_wait(stt)
int *stt;
{
  int pid;
  int st1;
  pid = wait(&st1);
  *stt = (unsigned)(((st1) >> 8) & 0377) + 256 * (unsigned)((st1)&0177);
  return (pid);
}


x86 assembly (clang, -O0):
<m_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <wait@plt>
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%eax
and    $0x7f,%eax
shl    $0x8,%eax
add    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_wait>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rdi
xor    %eax,%eax
call   1030 <wait@plt>
mov    0xc(%rsp),%ecx
movzbl %ch,%edx
and    $0x7f,%ecx
shl    $0x8,%ecx
or     %edx,%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @m_wait(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = call i32 (i32*, ...) bitcast (i32 (...)* @wait to i32 (i32*, ...)*)(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %4
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = load i32, i32* %4
%10 = and i32 %9, 127
%11 = mul i32 256, %10
%12 = add i32 %8, %11
%13 = load i32*, i32** %2
store i32 %12, i32* %13
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @m_wait(i32* nocapture writeonly %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 (i32*, ...) bitcast (i32 (...)* @wait to i32 (i32*, ...)*)(i32* %2)
%5 = load i32, i32* %2
%6 = lshr i32 %5, 8
%7 = and i32 %6, 255
%8 = shl i32 %5, 8
%9 = and i32 %8, 32512
%10 = or i32 %7, %9
store i32 %10, i32* %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double VOL, R, pi;
  pi = 3.14159;
  scanf("%lf", &R);
  VOL = (4.0 / 3) * pi * R * R * R;
  printf("VOLUME = %.3lf\n", VOL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    0xecd(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movsd  0xeac(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm1
movsd  0xec3(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [16 x i8] c"VOLUME = %.3lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
store double 3.141590e+00, double* %4
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%6 = load double, double* %4
%7 = fmul double 0x3FF5555555555555, %6
%8 = load double, double* %3
%9 = fmul double %7, %8
%10 = load double, double* %3
%11 = fmul double %9, %10
%12 = load double, double* %3
%13 = fmul double %11, %12
store double %13, double* %2
%14 = load double, double* %2
%15 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [16 x i8] c"VOLUME = %.3lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fmul double %4, 0x4010C1514ABD0449
%6 = fmul double %4, %5
%7 = fmul double %4, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int halt_go() {
  printf("Halting the system...\n");
  system("sudo shutdown -H 00");
  return 0;
}


x86 assembly (clang, -O0):
<halt_go>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xee0(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<halt_go>:
push   %rax
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Halting the system...\0A\00"
@.str.1 = [20 x i8] c"sudo shutdown -H 00\00"
define i32 @halt_go() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"sudo shutdown -H 00\00"
@str = [22 x i8] c"Halting the system...\00"
define i32 @halt_go() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int test_imm_D1uint8_reg(unsigned char val) {
  return ((val) & (-0xD1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D1uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff2f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D1uint8_reg>:
test   $0x2f,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D1uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -209
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_D1uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 47
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage() {
  extern char *__progname;
  fprintf(stderr, "usage: %s number_of_tables\n", __progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%rdx
lea    0xec2(%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
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdx
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"usage: %s number_of_tables\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"usage: %s number_of_tables\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ psy_dbtable_init();
void fa_psychomodel1_rom_init() { psy_dbtable_init(); }


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

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

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

LLVM IR (-O2):
define void @fa_psychomodel1_rom_init() {
%1 = tail call i32 (...) @psy_dbtable_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flockfile(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void *tf(void *a) {
  flockfile(stdout);
  return a;
}


x86 assembly (clang, -O0):
<tf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <flockfile@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tf>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <flockfile@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
define i8* @tf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = call i32 @flockfile(i32 %3)
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
@stdout = global i32 0
define i8* @tf(i8* readnone returned %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @flockfile(i32 %2)
ret i8* %0
}
/* Variables and functions */
int more(size_t rank, size_t *sizes, size_t *indices) {
  return (indices[0] < sizes[0] ? 1 : 0);
}


x86 assembly (clang, -O0):
<more>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmovb  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<more>:
mov    (%rdx),%rcx
xor    %eax,%eax
cmp    (%rsi),%rcx
setb   %al
ret

LLVM IR (-O0):
define i32 @more(i64 %0, i64* %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64*
%6 = alloca i64*
store i64 %0, i64* %4
store i64* %1, i64** %5
store i64* %2, i64** %6
%7 = load i64*, i64** %6
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = load i64*, i64** %5
%11 = getelementptr inbounds i64, i64* %10, i64 0
%12 = load i64, i64* %11
%13 = icmp ult i64 %9, %12
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 1, i32 0
ret i32 %15
}

LLVM IR (-O2):
define i32 @more(i64 %0, i64* nocapture %1, i64* nocapture %2) {
%4 = load i64, i64* %2
%5 = load i64, i64* %1
%6 = icmp ult i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print(int *array, int size) {
  int i;
  for (i = 0; i < size; i++)
    printf("%d ", array[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print>:
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    1159 <print+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %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 i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print(i32* 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 i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%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 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_frequencies();
int /*<<< orphan*/ test_histogram();
int main() {
  test_frequencies();
  test_histogram();
  printf("success\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test_frequencies@plt>
mov    $0x0,%al
call   1050 <test_histogram@plt>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_frequencies@plt>
xor    %eax,%eax
call   1050 <test_histogram@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"success\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_frequencies()
%3 = call i32 (...) @test_histogram()
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"success\00"
define i32 @main() {
%1 = tail call i32 (...) @test_frequencies()
%2 = tail call i32 (...) @test_histogram()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __dl_fpp_mutex_lock();
scalar_t__ initialized();
void fpp_mutex_lock(void) {
  if (initialized())
    __dl_fpp_mutex_lock();
}


x86 assembly (clang, -O0):
<fpp_mutex_lock>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <initialized@plt>
cmp    $0x0,%rax
je     113c <fpp_mutex_lock+0x1c>
mov    $0x0,%al
call   1030 <__dl_fpp_mutex_lock@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpp_mutex_lock>:
push   %rax
xor    %eax,%eax
call   1040 <initialized@plt>
test   %rax,%rax
je     1135 <fpp_mutex_lock+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1030 <__dl_fpp_mutex_lock@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @fpp_mutex_lock() {
%1 = call i64 (...) @initialized()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @__dl_fpp_mutex_lock()
br label %5
5: ; preds = %3, %0
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
void common_gettime(struct timespec *ts) { clock_gettime(CLOCK_MONOTONIC, ts); }


x86 assembly (clang, -O0):
<common_gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<common_gettime>:
mov    %rdi,%rsi
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
jmp    1030 <clock_gettime@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define void @common_gettime(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = load %struct.timespec*, %struct.timespec** %2
%5 = call i32 @clock_gettime(i32 %3, %struct.timespec* %4)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define void @common_gettime(%struct.timespec* %0) {
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = tail call i32 @clock_gettime(i32 %2, %struct.timespec* %0)
ret void
}
char scramble_char(const char c) { return (c + 0) & 127; }


x86 assembly (clang, -O0):
<scramble_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x0,%eax
and    $0x7f,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scramble_char>:
mov    %edi,%eax
and    $0x7f,%al
ret

LLVM IR (-O0):
define signext i8 @scramble_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = add nsw i32 %4, 0
%6 = and i32 %5, 127
%7 = trunc i32 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @scramble_char(i8 signext %0) {
%2 = and i8 %0, 127
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ handle_LWP(int /*<<< orphan*/);
int gen_LWP(void) {
  handle_LWP(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_LWP>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_LWP@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_LWP>:
push   %rax
xor    %edi,%edi
call   1030 <handle_LWP@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gen_LWP() {
%1 = call i32 @handle_LWP(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_LWP() {
%1 = tail call i32 @handle_LWP(i32 0)
ret i32 0
}
void initializeStack(int *stack, int *top) { *top = -1; }


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

x86 assembly (clang, -O2):
<initializeStack>:
movl   $0xffffffff,(%rsi)
ret

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

LLVM IR (-O2):
define void @initializeStack(i32* nocapture readnone %0, i32* nocapture writeonly %1) {
store i32 -1, i32* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char *, int);
void trace3(char *name, char *caller, char *message, int number) {
  FILE *tracef;
  tracef = fopen(name, "a");
  fprintf(tracef, "%s: %s %i\n", caller, message, number);
  fclose(tracef);
  return;
}


x86 assembly (clang, -O0):
<trace3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeae(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
lea    0xe90(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trace3>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rbp
lea    0xeb9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xeac(%rip),%rsi
mov    %rax,%rdi
mov    %rbp,%rdx
mov    %r15,%rcx
mov    %r14d,%r8d
call   1040 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@.str.1 = [11 x i8] c"%s: %s %i\0A\00"
define void @trace3(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i8*, i8** %5
%11 = call i32* @fopen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %11, i32** %9
%12 = load i32*, i32** %9
%13 = load i8*, i8** %6
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %13, i8* %14, i32 %15)
%17 = load i32*, i32** %9
%18 = call i32 @fclose(i32* %17)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
@.str.1 = [11 x i8] c"%s: %s %i\0A\00"
define void @trace3(i8* nocapture %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %1, i8* %2, i32 %3)
%7 = tail call i32 @fclose(i32* %5)
ret void
}
float fang(float x) { return 2 * x * x * x - 4 * x * x + 3 * x - 6; }


x86 assembly (clang, -O0):
<fang>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xefb(%rip),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movss  0xee0(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x4(%rbp),%xmm0
movss  0xeb0(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xe9c(%rip),%xmm1
subss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fang>:
movaps %xmm0,%xmm1
addss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
movss  0xeed(%rip),%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm0,%xmm1
mulss  0xedd(%rip),%xmm0
addss  %xmm2,%xmm1
addss  %xmm1,%xmm0
addss  0xed1(%rip),%xmm0
ret

LLVM IR (-O0):
define float @fang(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float 2.000000e+00, %3
%5 = load float, float* %2
%6 = fmul float %4, %5
%7 = load float, float* %2
%8 = load float, float* %2
%9 = fmul float 4.000000e+00, %8
%10 = load float, float* %2
%11 = fmul float %9, %10
%12 = fneg float %11
%13 = call float @llvm.fmuladd.f32(float %6, float %7, float %12)
%14 = load float, float* %2
%15 = call float @llvm.fmuladd.f32(float 3.000000e+00, float %14, float %13)
%16 = fsub float %15, 6.000000e+00
ret float %16
}

LLVM IR (-O2):
define float @fang(float %0) {
%2 = fmul float %0, 2.000000e+00
%3 = fmul float %2, %0
%4 = fmul float %0, -4.000000e+00
%5 = fmul float %4, %0
%6 = tail call float @llvm.fmuladd.f32(float %3, float %0, float %5)
%7 = tail call float @llvm.fmuladd.f32(float %0, float 3.000000e+00, float %6)
%8 = fadd float %7, -6.000000e+00
ret float %8
}
unsigned int char_to_int(char c, unsigned int i) {
  return (i * 10) + (c - '0');
}


x86 assembly (clang, -O0):
<char_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0xa,-0x8(%rbp),%eax
movsbl -0x1(%rbp),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_to_int>:
lea    (%rsi,%rsi,4),%eax
lea    (%rdi,%rax,2),%eax
add    $0xffffffd0,%eax
ret

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

LLVM IR (-O2):
define i32 @char_to_int(i8 signext %0, i32 %1) {
%3 = mul i32 %1, 10
%4 = sext i8 %0 to i32
%5 = add nsw i32 %4, -48
%6 = add i32 %5, %3
ret i32 %6
}
/* Variables and functions */
char *malloc(int);
int test1(int, int);
int test2(int);
int entrypoint() {
  char *x;
  if (test1(0xf00dbeef, 0xbeeff00d) != 0x12345678)
    return 0xdead;
  if (test2(0xf00d) != 0xd00f)
    return 0xdead;
  x = malloc(1);
  if (!x)
    return 0xdead;
  return 0xf00d;
}


x86 assembly (clang, -O0):
<entrypoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xf00dbeef,%edi
mov    $0xbeeff00d,%esi
call   1030 <test1@plt>
cmp    $0x12345678,%eax
je     115e <entrypoint+0x2e>
movl   $0xdead,-0x4(%rbp)
jmp    11ab <entrypoint+0x7b>
mov    $0xf00d,%edi
call   1050 <test2@plt>
cmp    $0xd00f,%eax
je     117f <entrypoint+0x4f>
movl   $0xdead,-0x4(%rbp)
jmp    11ab <entrypoint+0x7b>
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11a4 <entrypoint+0x74>
movl   $0xdead,-0x4(%rbp)
jmp    11ab <entrypoint+0x7b>
movl   $0xf00d,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<entrypoint>:
push   %rbx
mov    $0xf00dbeef,%edi
mov    $0xbeeff00d,%esi
call   1030 <test1@plt>
mov    %eax,%ecx
mov    $0xdead,%eax
cmp    $0x12345678,%ecx
jne    115b <entrypoint+0x3b>
mov    $0xf00d,%ebx
mov    $0xf00d,%edi
call   1040 <test2@plt>
cmp    $0xd00f,%eax
mov    $0xdead,%eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @entrypoint() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i32 @test1(i32 -267534609, i32 -1091571699)
%4 = icmp ne i32 %3, 305419896
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 57005, i32* %1
br label %16
6: ; preds = %0
%7 = call i32 @test2(i32 61453)
%8 = icmp ne i32 %7, 53263
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 57005, i32* %1
br label %16
10: ; preds = %6
%11 = call i8* @malloc(i32 1)
store i8* %11, i8** %2
%12 = load i8*, i8** %2
%13 = icmp ne i8* %12, null
br i1 %13, label %15, label %14
14: ; preds = %10
store i32 57005, i32* %1
br label %16
15: ; preds = %10
store i32 61453, i32* %1
br label %16
16: ; preds = %15, %14, %9, %5
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @entrypoint() {
%1 = tail call i32 @test1(i32 -267534609, i32 -1091571699)
%2 = icmp eq i32 %1, 305419896
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @test2(i32 61453)
%5 = icmp eq i32 %4, 53263
%6 = select i1 %5, i32 61453, i32 57005
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 57005, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
void cleanup(FILE *fp, char *ptr1, char *ptr2) {
  fclose(fp);
  free(ptr1);
  free(ptr2);
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1040 <fclose@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @cleanup(i32* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
%4 = tail call i32 @fclose(i32* %0)
%5 = tail call i32 @free(i8* %1)
%6 = tail call i32 @free(i8* %2)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int nid;
};
typedef TYPE_1__ ASN1_STRING_TABLE;

/* Variables and functions */
int table_cmp(const void *a, const void *b) {
  const ASN1_STRING_TABLE *sa = a, *sb = b;
  return sa->nid - sb->nid;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define i32 @table_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.TYPE_2__*
%6 = alloca %struct.TYPE_2__*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_2__*
store %struct.TYPE_2__* %8, %struct.TYPE_2__** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to %struct.TYPE_2__*
store %struct.TYPE_2__* %10, %struct.TYPE_2__** %6
%11 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%12 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %11, i32 0, i32 0
%13 = load i32, i32* %12
%14 = load %struct.TYPE_2__*, %struct.TYPE_2__** %6
%15 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = sub nsw i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @table_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t __attribute__((const)) max(uint32_t a, uint32_t b) {
  return a > b ? a : b;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @max(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
scalar_t__ pow(unsigned long, double);
scalar_t__ round(double);
unsigned long int inverseFractional_0745_Brightness(long unsigned int x) {
  return (unsigned long int)round(4.1083529414 * (double)pow(x, 0.745));
}


x86 assembly (clang, -O0):
<inverseFractional_0745_Brightness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
movsd  0xed0(%rip),%xmm0
call   1030 <pow@plt>
cvtsi2sd %rax,%xmm1
movsd  0xeb6(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <round@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inverseFractional_0745_Brightness>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mulsd  0xeca(%rip),%xmm0
pop    %rax
jmp    1040 <round@plt>

LLVM IR (-O0):
define i64 @inverseFractional_0745_Brightness(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @pow(i64 %3, double 7.450000e-01)
%5 = sitofp i64 %4 to double
%6 = fmul double 0x40106EF412CEF420, %5
%7 = call i64 @round(double %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @inverseFractional_0745_Brightness(i64 %0) {
%2 = tail call i64 @pow(i64 %0, double 7.450000e-01)
%3 = sitofp i64 %2 to double
%4 = fmul double %3, 0x40106EF412CEF420
%5 = tail call i64 @round(double %4)
ret i64 %5
}
void fd67(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  a:
    goto a;
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd67>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd67+0x7>

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

LLVM IR (-O0):
define void @fd67(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; preds = %13
br label %13
14: ; No predecessors!
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
br label %17
17: ; preds = %17, %14
br label %17
18: ; preds = %18
br label %18
19: ; No predecessors!
%20 = load i32, i32* %2
%21 = zext i32 %20 to i64
br label %22
22: ; preds = %22, %19
br label %22
23: ; preds = %23
br label %23
24: ; No predecessors!
%25 = load i32, i32* %2
%26 = zext i32 %25 to i64
br label %27
27: ; preds = %27, %24
br label %27
28: ; No predecessors!
%29 = load i32, i32* %2
%30 = zext i32 %29 to i64
br label %31
31: ; preds = %31, %28
br label %31
32: ; preds = %32
br label %32
33: ; No predecessors!
%34 = load i32, i32* %2
%35 = zext i32 %34 to i64
br label %36
36: ; preds = %36, %33
br label %36
37: ; preds = %37
br label %37
38: ; No predecessors!
%39 = load i32, i32* %2
%40 = zext i32 %39 to i64
br label %41
41: ; preds = %41, %38
br label %41
42: ; preds = %42
br label %42
43: ; No predecessors!
%44 = load i32, i32* %2
%45 = zext i32 %44 to i64
br label %46
46: ; preds = %46, %43
br label %46
47: ; preds = %47
br label %47
}

LLVM IR (-O2):
define void @fd67(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ test(int);
int main() {
  test(61);
  test(109);
  test(181);
  test(277);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3d,%edi
call   1030 <test@plt>
mov    $0x6d,%edi
call   1030 <test@plt>
mov    $0xb5,%edi
call   1030 <test@plt>
mov    $0x115,%edi
call   1030 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3d,%edi
call   1030 <test@plt>
mov    $0x6d,%edi
call   1030 <test@plt>
mov    $0xb5,%edi
call   1030 <test@plt>
mov    $0x115,%edi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test(i32 61)
%3 = call i32 @test(i32 109)
%4 = call i32 @test(i32 181)
%5 = call i32 @test(i32 277)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 61)
%2 = tail call i32 @test(i32 109)
%3 = tail call i32 @test(i32 181)
%4 = tail call i32 @test(i32 277)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_format0(char *, int /*<<< orphan*/);
int /*<<< orphan*/ print_format1(char *, int /*<<< orphan*/, char *);
void printf1(char *s, char *a1) { print_format0(s, print_format1(s, 0, a1)); }


x86 assembly (clang, -O0):
<printf1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <print_format1@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <print_format0@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf1>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <print_format1@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <print_format0@plt>

LLVM IR (-O0):
define void @printf1(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** %3
%7 = load i8*, i8** %4
%8 = call i32 @print_format1(i8* %6, i32 0, i8* %7)
%9 = call i32 @print_format0(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @printf1(i8* %0, i8* %1) {
%3 = tail call i32 @print_format1(i8* %0, i32 0, i8* %1)
%4 = tail call i32 @print_format0(i8* %0, i32 %3)
ret void
}
int int_cmp(const void *int1, const void *int2) {
  return *((int *)int2) - *((int *)int1);
}


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

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

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

LLVM IR (-O2):
define i32 @int_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;

/* Variables and functions */
int /*<<< orphan*/ glRenderMode(unsigned int);
GLint RenderMode(unsigned int m) { glRenderMode(m); }


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

x86 assembly (clang, -O2):
<RenderMode>:
jmp    1030 <glRenderMode@plt>

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

LLVM IR (-O2):
define i32 @RenderMode(i32 %0) {
%2 = tail call i32 @glRenderMode(i32 %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double sum(int, int, int, int, int /*<<< orphan*/);
int main(int argc, char **argv) {
  double x = sum(4, 3, 32, 22, 0);
  printf("hello world %f\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x4,%edi
mov    $0x3,%esi
mov    $0x20,%edx
mov    $0x16,%ecx
xor    %r8d,%r8d
call   1040 <sum@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
mov    $0x3,%esi
mov    $0x20,%edx
mov    $0x16,%ecx
xor    %r8d,%r8d
call   1040 <sum@plt>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"hello world %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call double @sum(i32 4, i32 3, i32 32, i32 22, i32 0)
store double %7, double* %6
%8 = load double, double* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"hello world %f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call double @sum(i32 4, i32 3, i32 32, i32 22, i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %3)
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_append_quaddobl_solution(int n, int m, double *sol) {
  int *a, fail;
  int b[2];
  b[0] = n;
  b[1] = m;
  fail = _ada_use_c2phc(396, a, b, sol);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_append_quaddobl_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
lea    -0x24(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x18c,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_append_quaddobl_solution>:
push   %rax
mov    %rdx,%rcx
mov    %edi,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%rdx
mov    $0x18c,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @solcon_append_quaddobl_solution(i32 %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca [2 x i32]
store i32 %0, i32* %4
store i32 %1, i32* %5
store double* %2, double** %6
%10 = load i32, i32* %4
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
store i32 %10, i32* %11
%12 = load i32, i32* %5
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
store i32 %12, i32* %13
%14 = load i32*, i32** %7
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%16 = load double*, double** %6
%17 = call i32 @_ada_use_c2phc(i32 396, i32* %14, i32* %15, double* %16)
store i32 %17, i32* %8
%18 = load i32, i32* %8
ret i32 %18
}

LLVM IR (-O2):
define i32 @solcon_append_quaddobl_solution(i32 %0, i32 %1, double* %2) {
%4 = alloca [2 x i32]
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 %0, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 %1, i32* %7
%8 = call i32 @_ada_use_c2phc(i32 396, i32* undef, i32* %6, double* %2)
ret i32 %8
}