xunge/DecIR huggingface dataset:
void cimaged11_omp_set_num_threads(int n) {}


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

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

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

LLVM IR (-O2):
define void @cimaged11_omp_set_num_threads(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ printf(char *, int, int);
scalar_t__ pthread_self();
int /*<<< orphan*/ sleep(int);
void *mytask(void *arg) {
  printf("thread 0x%x is working on task %d\n", (int)pthread_self(),
         *(int *)arg);
  sleep(1);
  free(arg);
  return NULL;
}


x86 assembly (clang, -O0):
<mytask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %eax,%esi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mytask>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
mov    (%rbx),%edx
lea    0xeac(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"thread 0x%x is working on task %d\0A\00"
define i8* @mytask(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i64 (...) @pthread_self()
%4 = trunc i64 %3 to i32
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %7)
%9 = call i32 @sleep(i32 1)
%10 = load i8*, i8** %2
%11 = call i32 @free(i8* %10)
ret i8* null
}

LLVM IR (-O2):
@.str = [35 x i8] c"thread 0x%x is working on task %d\0A\00"
define noalias i8* @mytask(i8* nocapture %0) {
%2 = tail call i64 (...) @pthread_self()
%3 = trunc i64 %2 to i32
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5)
%7 = tail call i32 @sleep(i32 1)
%8 = tail call i32 @free(i8* %0)
ret i8* null
}
/* Variables and functions */
unsigned sizeof_uintptr(void) { return (unsigned)sizeof(uintptr_t); }


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

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

LLVM IR (-O0):
define i32 @sizeof_uintptr() {
ret i32 8
}

LLVM IR (-O2):
define i32 @sizeof_uintptr() {
ret i32 8
}
int float2int(float x) { return (int)((x < 0) ? (x - 0.5f) : (x + 0.5f)); }


x86 assembly (clang, -O0):
<float2int>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1131 <float2int+0x31>
movss  -0x4(%rbp),%xmm0
movss  0xedd(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1143 <float2int+0x43>
movss  0xec7(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<float2int>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
lea    0xeee(%rip),%rcx
addss  (%rcx,%rax,4),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @float2int(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = fsub float %6, 5.000000e-01
br label %11
8: ; preds = %1
%9 = load float, float* %2
%10 = fadd float %9, 5.000000e-01
br label %11
11: ; preds = %8, %5
%12 = phi float [ %7, %5 ], [ %10, %8 ]
%13 = fptosi float %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @float2int(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = select i1 %2, float -5.000000e-01, float 5.000000e-01
%4 = fadd float %3, %0
%5 = fptosi float %4 to i32
ret i32 %5
}
const char *cargo_get_version() {
  return "0"
         "."
         "1"
         "."
         "0"
         "-alpha";
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"0.1.0-alpha\00"
define i8* @cargo_get_version() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"0.1.0-alpha\00"
define i8* @cargo_get_version() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
long CountSupers(long cols, long *node) {
  long i, supers;
  supers = 0;
  for (i = 0; i < cols; i += node[i])
    supers++;
  return (supers);
}


x86 assembly (clang, -O0):
<CountSupers>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    114f <CountSupers+0x4f>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    111c <CountSupers+0x1c>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CountSupers>:
xor    %eax,%eax
test   %rdi,%rdi
jle    111d <CountSupers+0x1d>
xor    %ecx,%ecx
nopl   0x0(%rax)
add    $0x1,%rax
add    (%rsi,%rcx,8),%rcx
cmp    %rdi,%rcx
jl     1110 <CountSupers+0x10>
ret

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

LLVM IR (-O2):
define i64 @CountSupers(i64 %0, i64* nocapture %1) {
%3 = icmp sgt i64 %0, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ 0, %2 ]
%6 = phi i64 [ %10, %4 ], [ 0, %2 ]
%7 = add nuw nsw i64 %5, 1
%8 = getelementptr inbounds i64, i64* %1, i64 %6
%9 = load i64, i64* %8
%10 = add nsw i64 %9, %6
%11 = icmp slt i64 %10, %0
br i1 %11, label %4, label %12
12: ; preds = %4, %2
%13 = phi i64 [ 0, %2 ], [ %7, %4 ]
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ HplAtmRfa1TimerMacP__CompareA__start();
void AtmegaCompareP__0__AtmegaCompare__start(void) {
  HplAtmRfa1TimerMacP__CompareA__start();
}


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

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

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

LLVM IR (-O2):
define void @AtmegaCompareP__0__AtmegaCompare__start() {
%1 = tail call i32 (...) @HplAtmRfa1TimerMacP__CompareA__start()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
void SimpleRandDemo(int n) {
  int i;
  for (i = 0; i < n; i++)
    printf("%10d\n", rand());
}


x86 assembly (clang, -O0):
<SimpleRandDemo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1161 <SimpleRandDemo+0x41>
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <SimpleRandDemo+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SimpleRandDemo>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1156 <SimpleRandDemo+0x36>
mov    %edi,%ebx
lea    0xecf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <rand@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1140 <SimpleRandDemo+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%10d\0A\00"
define void @SimpleRandDemo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = call i32 (...) @rand()
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%10d\0A\00"
define void @SimpleRandDemo(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = tail call i32 (...) @rand()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_message_get_cookie(void *m, uint64_t *cookie) {
  return -EINVAL;
}


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

x86 assembly (clang, -O2):
<sd_bus_message_get_cookie>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_message_get_cookie(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_get_cookie(i8* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
void gtk_input_dialog_new() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ chr1setBank2(int);
void m65setParamsB002(uint16_t addr, uint8_t val) {
  (void)addr;
  chr1setBank2(val << 10);
}


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

x86 assembly (clang, -O2):
mov    %esi,%edi
shl    $0xa,%edi
jmp    1030 <chr1setBank2@plt>

LLVM IR (-O0):
define void @m65setParamsB002(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %6, 10
%8 = call i32 @chr1setBank2(i32 %7)
ret void
}

LLVM IR (-O2):
define void @m65setParamsB002(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = tail call i32 @chr1setBank2(i32 %3)
ret void
}
/* Variables and functions */
int ex_put_all_var_param(int, int, int, int, int *, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int ex_put_concat_var_param(int exoid, int num_g, int num_n, int num_e,
                            int num_elem_blk, int *elem_var_tab) {
  return ex_put_all_var_param(exoid, num_g, num_n, num_e, elem_var_tab, 0, 0, 0,
                              0);
}


x86 assembly (clang, -O0):
<ex_put_concat_var_param>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x20(%rbp),%r8
xor    %r9d,%r9d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
call   1030 <ex_put_all_var_param@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex_put_concat_var_param>:
push   %rax
mov    %r9,%r8
sub    $0x8,%rsp
xor    %r9d,%r9d
push   $0x0
push   $0x0
push   $0x0
call   1030 <ex_put_all_var_param@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ex_put_concat_var_param(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32* %5, i32** %12
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i32*, i32** %12
%18 = call i32 @ex_put_all_var_param(i32 %13, i32 %14, i32 %15, i32 %16, i32* %17, i32 0, i32 0, i32 0, i32 0)
ret i32 %18
}

LLVM IR (-O2):
define i32 @ex_put_concat_var_param(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32* %5) {
%7 = tail call i32 @ex_put_all_var_param(i32 %0, i32 %1, i32 %2, i32 %3, i32* %5, i32 0, i32 0, i32 0, i32 0)
ret i32 %7
}
int returns(int x) {
  return x > 4 || x < 10;
  return x < 2 && x > 5;
  return x != 1 || x != 3;
  return x == 1 && x == 2;
  return x < 1 || x != 0;
}


x86 assembly (clang, -O0):
<returns>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x4,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jg     1120 <returns+0x20>
cmpl   $0xa,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @returns(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 4
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 10
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @returns(i32 %0) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ calloc(int, int);
int /*<<< orphan*/ fork();
int main(void) {
  pid_t p;
  fork();
  fork();
  for (;;) {
    calloc(4096, 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    $0x0,%al
call   1040 <fork@plt>
mov    $0x1000,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
jmp    113d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
xor    %eax,%eax
call   1040 <fork@plt>
nop
mov    $0x1000,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @fork()
%4 = call i32 (...) @fork()
br label %5
5: ; preds = %5, %0
%6 = call i32 @calloc(i32 4096, i32 1)
br label %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = tail call i32 (...) @fork()
br label %3
3: ; preds = %3, %0
%4 = tail call i32 @calloc(i32 4096, i32 1)
br label %3
}
/* Variables and functions */
double pop();
int /*<<< orphan*/ push(double);
void copy() {
  double temp = pop();
  push(temp);
  push(temp);
}


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

x86 assembly (clang, -O2):
<copy>:
push   %rax
xor    %eax,%eax
call   1030 <pop@plt>
movsd  %xmm0,(%rsp)
call   1040 <push@plt>
movsd  (%rsp),%xmm0
pop    %rax
jmp    1040 <push@plt>

LLVM IR (-O0):
define void @copy() {
%1 = alloca double
%2 = call double (...) @pop()
store double %2, double* %1
%3 = load double, double* %1
%4 = call i32 @push(double %3)
%5 = load double, double* %1
%6 = call i32 @push(double %5)
ret void
}

LLVM IR (-O2):
define void @copy() {
%1 = tail call double (...) @pop()
%2 = tail call i32 @push(double %1)
%3 = tail call i32 @push(double %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hook1(void) { printf("atexit hook 1\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"atexit hook 1\00"
define void @hook1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void delay_us(uint32_t us) {
  for (volatile int i = 0; i < us * 10; i++) {
  }
}


x86 assembly (clang, -O0):
<delay_us>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   $0xa,-0x4(%rbp),%ecx
cmp    %ecx,%eax
jge    1130 <delay_us+0x30>
jmp    1122 <delay_us+0x22>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <delay_us+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_us>:
movl   $0x0,-0x4(%rsp)
add    %edi,%edi
lea    (%rdi,%rdi,4),%eax
nopl   (%rax)
mov    -0x4(%rsp),%ecx
cmp    %eax,%ecx
jge    111f <delay_us+0x1f>
addl   $0x1,-0x4(%rsp)
jmp    1110 <delay_us+0x10>
ret

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

LLVM IR (-O2):
define void @delay_us(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 0, i32* %2
%4 = mul nsw i32 %0, 10
%5 = load volatile i32, i32* %2
%6 = icmp slt i32 %5, %4
br i1 %6, label %8, label %7
7: ; preds = %8, %1
ret void
8: ; preds = %1, %8
%9 = load volatile i32, i32* %2
%10 = add nsw i32 %9, 1
store volatile i32 %10, i32* %2
%11 = load volatile i32, i32* %2
%12 = icmp slt i32 %11, %4
br i1 %12, label %8, label %7
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int copy_dobldobl_start_solutions_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(257, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<copy_dobldobl_start_solutions_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x101,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_dobldobl_start_solutions_to_container>:
mov    $0x101,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_dobldobl_start_solutions_to_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 257, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_dobldobl_start_solutions_to_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 257, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Type definitions */
typedef scalar_t__ socklen_t;

/* Variables and functions */
int getsockopt(int, int, int, char *, scalar_t__ *);
int qemu_getsockopt(int sock, int level, int optname, void *optval,
                    size_t *optlen) {
  socklen_t len = (socklen_t)*optlen;
  int ret = getsockopt(sock, level, optname, (char *)optval, &len);
  *optlen = (size_t)len;
  return ret;
}


x86 assembly (clang, -O0):
<qemu_getsockopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    -0x28(%rbp),%r8
call   1030 <getsockopt@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qemu_getsockopt>:
push   %rbx
sub    $0x10,%rsp
mov    %r8,%rbx
mov    (%r8),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%r8
call   1030 <getsockopt@plt>
mov    0x8(%rsp),%rcx
mov    %rcx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @qemu_getsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i64* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64*
%11 = alloca i64
%12 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i64* %4, i64** %10
%13 = load i64*, i64** %10
%14 = load i64, i64* %13
store i64 %14, i64* %11
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = load i8*, i8** %9
%19 = call i32 @getsockopt(i32 %15, i32 %16, i32 %17, i8* %18, i64* %11)
store i32 %19, i32* %12
%20 = load i64, i64* %11
%21 = load i64*, i64** %10
store i64 %20, i64* %21
%22 = load i32, i32* %12
ret i32 %22
}

LLVM IR (-O2):
define i32 @qemu_getsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i64* nocapture %4) {
%6 = alloca i64
%7 = bitcast i64* %6 to i8*
%8 = load i64, i64* %4
store i64 %8, i64* %6
%9 = call i32 @getsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i64* %6)
%10 = load i64, i64* %6
store i64 %10, i64* %4
ret i32 %9
}
/* Variables and functions */
int to_unicode(short *, int);
unsigned short int rtf_to_unicode(int code, short int *charset) {
  int cc = code;
  if (code < 0 || (cc = to_unicode(charset, code)) < 0)
    return 0xFEFF;
  return cc;
}


x86 assembly (clang, -O0):
<rtf_to_unicode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1147 <rtf_to_unicode+0x37>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <to_unicode@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1152 <rtf_to_unicode+0x42>
movw   $0xfeff,-0x2(%rbp)
jmp    1159 <rtf_to_unicode+0x49>
mov    -0x14(%rbp),%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtf_to_unicode>:
test   %edi,%edi
js     1132 <rtf_to_unicode+0x22>
push   %rax
mov    %edi,%eax
mov    %rsi,%rdi
mov    %eax,%esi
call   1030 <to_unicode@plt>
mov    %eax,%ecx
test   %eax,%eax
mov    $0xfeff,%eax
cmovns %ecx,%eax
add    $0x8,%rsp
ret
mov    $0xfeff,%ax
ret

LLVM IR (-O0):
define zeroext i16 @rtf_to_unicode(i32 %0, i16* %1) {
%3 = alloca i16
%4 = alloca i32
%5 = alloca i16*
%6 = alloca i32
store i32 %0, i32* %4
store i16* %1, i16** %5
%7 = load i32, i32* %4
store i32 %7, i32* %6
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %2
%11 = load i16*, i16** %5
%12 = load i32, i32* %4
%13 = call i32 @to_unicode(i16* %11, i32 %12)
store i32 %13, i32* %6
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %10, %2
store i16 -257, i16* %3
br label %19
16: ; preds = %10
%17 = load i32, i32* %6
%18 = trunc i32 %17 to i16
store i16 %18, i16* %3
br label %19
19: ; preds = %16, %15
%20 = load i16, i16* %3
ret i16 %20
}

LLVM IR (-O2):
define zeroext i16 @rtf_to_unicode(i32 %0, i16* %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i32 @to_unicode(i16* %1, i32 %0)
%6 = icmp slt i32 %5, 0
%7 = trunc i32 %5 to i16
%8 = select i1 %6, i16 -257, i16 %7
br label %9
9: ; preds = %4, %2
%10 = phi i16 [ -257, %2 ], [ %8, %4 ]
ret i16 %10
}
/* Type definitions */
struct field {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __print_bin(struct field const *, char *, int);
void print_mac(const struct field *field) { __print_bin(field, ":", false); }


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

x86 assembly (clang, -O2):
<print_mac>:
lea    0xee9(%rip),%rsi
xor    %edx,%edx
jmp    1030 <__print_bin@plt>

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

LLVM IR (-O2):
%struct.field = type { i32 }
@.str = [2 x i8] c":\00"
define void @print_mac(%struct.field* %0) {
%2 = tail call i32 @__print_bin(%struct.field* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
size_t fi_mem_best_size(size_t desired, size_t sz) {
  size_t best = 0, s = 0, bound = 0;
  s = desired > sz ? desired : sz;
  do
    best = 1 << bound++;
  while (best < s);
  return best;
}


x86 assembly (clang, -O0):
<fi_mem_best_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    113f <fi_mem_best_size+0x3f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1147 <fi_mem_best_size+0x47>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jb     114f <fi_mem_best_size+0x4f>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fi_mem_best_size>:
cmp    %rsi,%rdi
cmova  %rdi,%rsi
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    $0x1,%eax
shl    %cl,%eax
cltq
add    $0x1,%ecx
cmp    %rax,%rsi
ja     1110 <fi_mem_best_size+0x10>
ret

LLVM IR (-O0):
define i64 @fi_mem_best_size(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
store i64 0, i64* %5
store i64 0, i64* %6
store i64 0, i64* %7
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = icmp ugt i64 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i64, i64* %3
br label %15
13: ; preds = %2
%14 = load i64, i64* %4
br label %15
15: ; preds = %13, %11
%16 = phi i64 [ %12, %11 ], [ %14, %13 ]
store i64 %16, i64* %6
br label %17
17: ; preds = %23, %15
%18 = load i64, i64* %7
%19 = add i64 %18, 1
store i64 %19, i64* %7
%20 = trunc i64 %18 to i32
%21 = shl i32 1, %20
%22 = sext i32 %21 to i64
store i64 %22, i64* %5
br label %23
23: ; preds = %17
%24 = load i64, i64* %5
%25 = load i64, i64* %6
%26 = icmp ult i64 %24, %25
br i1 %26, label %17, label %27
27: ; preds = %23
%28 = load i64, i64* %5
ret i64 %28
}

LLVM IR (-O2):
define i64 @fi_mem_best_size(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
br label %5
5: ; preds = %5, %2
%6 = phi i64 [ 0, %2 ], [ %7, %5 ]
%7 = add i64 %6, 1
%8 = trunc i64 %6 to i32
%9 = shl nuw i32 1, %8
%10 = sext i32 %9 to i64
%11 = icmp ugt i64 %4, %10
br i1 %11, label %5, label %12
12: ; preds = %5
ret i64 %10
}
/* Type definitions */
struct prompt {
  int dummy;
};

/* Variables and functions */
scalar_t__ getpgrp();
int /*<<< orphan*/ log_DeactivatePrompt(struct prompt *);
int /*<<< orphan*/ prompt_TtyOldMode(struct prompt *);
scalar_t__ prompt_pgrp(struct prompt *);
void prompt_Suspend(struct prompt *p) {
  if (getpgrp() == prompt_pgrp(p)) {
    prompt_TtyOldMode(p);
    log_DeactivatePrompt(p);
  }
}


x86 assembly (clang, -O0):
<prompt_Suspend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getpgrp@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <prompt_pgrp@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
jne    1182 <prompt_Suspend+0x42>
mov    -0x8(%rbp),%rdi
call   1050 <prompt_TtyOldMode@plt>
mov    -0x8(%rbp),%rdi
call   1030 <log_DeactivatePrompt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt_Suspend>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <getpgrp@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1060 <prompt_pgrp@plt>
cmp    %rax,%r14
jne    1175 <prompt_Suspend+0x35>
mov    %rbx,%rdi
call   1050 <prompt_TtyOldMode@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <log_DeactivatePrompt@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.prompt = type { i32 }
define void @prompt_Suspend(%struct.prompt* %0) {
%2 = alloca %struct.prompt*
store %struct.prompt* %0, %struct.prompt** %2
%3 = call i64 (...) @getpgrp()
%4 = load %struct.prompt*, %struct.prompt** %2
%5 = call i64 @prompt_pgrp(%struct.prompt* %4)
%6 = icmp eq i64 %3, %5
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load %struct.prompt*, %struct.prompt** %2
%9 = call i32 @prompt_TtyOldMode(%struct.prompt* %8)
%10 = load %struct.prompt*, %struct.prompt** %2
%11 = call i32 @log_DeactivatePrompt(%struct.prompt* %10)
br label %12
12: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
%struct.prompt = type { i32 }
define void @prompt_Suspend(%struct.prompt* %0) {
%2 = tail call i64 (...) @getpgrp()
%3 = tail call i64 @prompt_pgrp(%struct.prompt* %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @prompt_TtyOldMode(%struct.prompt* %0)
%7 = tail call i32 @log_DeactivatePrompt(%struct.prompt* %0)
br label %8
8: ; preds = %5, %1
ret void
}
/* Variables and functions */
int f120(int *);
int f121(int *p) { return f120(p); }


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

x86 assembly (clang, -O2):
<f121>:
jmp    1030 <f120@plt>

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

LLVM IR (-O2):
define i32 @f121(i32* %0) {
%2 = tail call i32 @f120(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ MV_SetVolume(int);
void FX_SetVolume(int volume) { MV_SetVolume(volume); }


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

x86 assembly (clang, -O2):
<FX_SetVolume>:
jmp    1030 <MV_SetVolume@plt>

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

LLVM IR (-O2):
define void @FX_SetVolume(i32 %0) {
%2 = tail call i32 @MV_SetVolume(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: tee [-ai] [FILE]...\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 = [28 x i8] c"usage: tee [-ai] [FILE]...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"usage: tee [-ai] [FILE]...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ CG_generateFilename();
int /*<<< orphan*/ trap_SendConsoleCommand(int /*<<< orphan*/);
int /*<<< orphan*/ va(char *, int /*<<< orphan*/);
void CG_autoRecord_f(void) {
  trap_SendConsoleCommand(va("record %s\n", CG_generateFilename()));
}


x86 assembly (clang, -O0):
<CG_autoRecord_f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <CG_generateFilename@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1040 <va@plt>
mov    %eax,%edi
call   1050 <trap_SendConsoleCommand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_autoRecord_f>:
push   %rax
xor    %eax,%eax
call   1030 <CG_generateFilename@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <va@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <trap_SendConsoleCommand@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"record %s\0A\00"
define void @CG_autoRecord_f() {
%1 = call i32 (...) @CG_generateFilename()
%2 = call i32 @va(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @trap_SendConsoleCommand(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"record %s\0A\00"
define void @CG_autoRecord_f() {
%1 = tail call i32 (...) @CG_generateFilename()
%2 = tail call i32 @va(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @trap_SendConsoleCommand(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ my_abort();
int /*<<< orphan*/ stderr;
void pfree(void *p) {
  if (p == NULL) {
    fprintf(stderr, "Freeing a NULL pointer is not permitted.");
    my_abort();
  }
  free(p);
}


x86 assembly (clang, -O0):
<pfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1163 <pfree+0x33>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xea9(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1050 <my_abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pfree>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    1155 <pfree+0x25>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xeb7(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1050 <my_abort@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"Freeing a NULL pointer is not permitted.\00"
define void @pfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @my_abort()
br label %9
9: ; preds = %5, %1
%10 = load i8*, i8** %2
%11 = call i32 @free(i8* %10)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"Freeing a NULL pointer is not permitted.\00"
define void @pfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @my_abort()
br label %7
7: ; preds = %3, %1
%8 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int mpu_write_mem(int, int, unsigned char *);
int dmp_set_pedometer_step_count(unsigned long count) {
  unsigned char tmp[4];
  tmp[0] = (unsigned char)((count >> 24) & 0xFF);
  tmp[1] = (unsigned char)((count >> 16) & 0xFF);
  tmp[2] = (unsigned char)((count >> 8) & 0xFF);
  tmp[3] = (unsigned char)(count & 0xFF);
  return mpu_write_mem((768 + 0x60), 4, tmp);
}


x86 assembly (clang, -O0):
<dmp_set_pedometer_step_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
and    $0xff,%rax
mov    %al,-0x9(%rbp)
lea    -0xc(%rbp),%rdx
mov    $0x360,%edi
mov    $0x4,%esi
call   1030 <mpu_write_mem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmp_set_pedometer_step_count>:
push   %rax
bswap  %edi
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x360,%edi
mov    $0x4,%esi
call   1030 <mpu_write_mem@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dmp_set_pedometer_step_count(i64 %0) {
%2 = alloca i64
%3 = alloca [4 x i8]
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = lshr i64 %4, 24
%6 = and i64 %5, 255
%7 = trunc i64 %6 to i8
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
store i8 %7, i8* %8
%9 = load i64, i64* %2
%10 = lshr i64 %9, 16
%11 = and i64 %10, 255
%12 = trunc i64 %11 to i8
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 %12, i8* %13
%14 = load i64, i64* %2
%15 = lshr i64 %14, 8
%16 = and i64 %15, 255
%17 = trunc i64 %16 to i8
%18 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 %17, i8* %18
%19 = load i64, i64* %2
%20 = and i64 %19, 255
%21 = trunc i64 %20 to i8
%22 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 %21, i8* %22
%23 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%24 = call i32 @mpu_write_mem(i32 864, i32 4, i8* %23)
ret i32 %24
}

LLVM IR (-O2):
define i32 @dmp_set_pedometer_step_count(i64 %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = lshr i64 %0, 24
%5 = trunc i64 %4 to i8
store i8 %5, i8* %3
%6 = lshr i64 %0, 16
%7 = trunc i64 %6 to i8
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
store i8 %7, i8* %8
%9 = lshr i64 %0, 8
%10 = trunc i64 %9 to i8
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
store i8 %10, i8* %11
%12 = trunc i64 %0 to i8
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
store i8 %12, i8* %13
%14 = call i32 @mpu_write_mem(i32 864, i32 4, i8* %3)
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void fail(char *message) {
  fprintf(stderr, "Error: %s\n", message);
  exit(1);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
define void @fail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
define void @fail(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int _random_int_func(int, int);
int32_t _random_32_from_int(int32_t min, int32_t max) {
  int ret = _random_int_func((int)min, (int)max);
  return (int32_t)ret;
}


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

x86 assembly (clang, -O2):
<_random_32_from_int>:
push   %rax
call   1030 <_random_int_func@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @_random_32_from_int(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = trunc i64 %6 to i32
%8 = load i64, i64* %4
%9 = trunc i64 %8 to i32
%10 = call i32 @_random_int_func(i32 %7, i32 %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
ret i64 %12
}

LLVM IR (-O2):
define i64 @_random_32_from_int(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = trunc i64 %1 to i32
%5 = tail call i32 @_random_int_func(i32 %3, i32 %4)
%6 = sext i32 %5 to i64
ret i64 %6
}
float decode_hires_altitude(unsigned short alt) { return (float)alt / 100.0; }


x86 assembly (clang, -O0):
<decode_hires_altitude>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee1(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_hires_altitude>:
cvtsi2sd %edi,%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @decode_hires_altitude(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = uitofp i16 %3 to float
%5 = fpext float %4 to double
%6 = fdiv double %5, 1.000000e+02
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @decode_hires_altitude(i16 zeroext %0) {
%2 = uitofp i16 %0 to double
%3 = fdiv double %2, 1.000000e+02
%4 = fptrunc double %3 to float
ret float %4
}
reply(ok) {
  if (ok)
    send(0xa5, 0);
  else {
    send(0xff, 0);
    _halt_(0xbad);
  }
}


x86 assembly (clang, -O0):
<reply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1148 <reply+0x28>
mov    $0xa5,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <send@plt>
jmp    1162 <reply+0x42>
mov    $0xff,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <send@plt>
mov    $0xbad,%edi
mov    $0x0,%al
call   1040 <_halt_@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reply>:
push   %rax
test   %edi,%edi
je     1135 <reply+0x15>
mov    $0xa5,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <send@plt>
pop    %rcx
ret
mov    $0xff,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <send@plt>
mov    $0xbad,%edi
xor    %eax,%eax
call   1040 <_halt_@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @reply(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (i32, i32, ...) bitcast (i32 (...)* @send to i32 (i32, i32, ...)*)(i32 165, i32 0)
br label %11
8: ; preds = %1
%9 = call i32 (i32, i32, ...) bitcast (i32 (...)* @send to i32 (i32, i32, ...)*)(i32 255, i32 0)
%10 = call i32 (i32, ...) bitcast (i32 (...)* @_halt_ to i32 (i32, ...)*)(i32 2989)
br label %11
11: ; preds = %8, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @reply(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @send to i32 (i32, i32, ...)*)(i32 165, i32 0)
br label %8
5: ; preds = %1
%6 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @send to i32 (i32, i32, ...)*)(i32 255, i32 0)
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @_halt_ to i32 (i32, ...)*)(i32 2989)
br label %8
8: ; preds = %5, %3
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ setupVICVAC();
main() { setupVICVAC(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @setupVICVAC()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setupVICVAC()
ret i32 0
}
/* Type definitions */
struct termios {
  unsigned long c_lflag;
};

/* Variables and functions */
scalar_t__ ICANON;
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ TCSANOW;
int /*<<< orphan*/ tcgetattr(int /*<<< orphan*/, struct termios *);
int /*<<< orphan*/ tcsetattr(int /*<<< orphan*/, int /*<<< orphan*/,
                             struct termios *);
void use_unbuffered_input(void) {
  struct termios ctrl;
  tcgetattr(STDIN_FILENO, &ctrl);
  ctrl.c_lflag &= (unsigned long)~ICANON;
  tcsetattr(STDIN_FILENO, TCSANOW, &ctrl);
}


x86 assembly (clang, -O0):
<use_unbuffered_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <tcgetattr@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%rax
xor    $0xffffffffffffffff,%rax
and    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1040 <tcsetattr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<use_unbuffered_input>:
push   %r14
push   %rbx
push   %rax
mov    0x2ead(%rip),%rbx
mov    (%rbx),%edi
mov    %rsp,%r14
mov    %r14,%rsi
call   1030 <tcgetattr@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%rax
not    %rax
and    %rax,(%rsp)
mov    (%rbx),%edi
mov    0x2e96(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdx
call   1040 <tcsetattr@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.termios = type { i64 }
@STDIN_FILENO = global i32 0
@ICANON = global i64 0
@TCSANOW = global i32 0
define void @use_unbuffered_input() {
%1 = alloca %struct.termios
%2 = load i32, i32* @STDIN_FILENO
%3 = call i32 @tcgetattr(i32 %2, %struct.termios* %1)
%4 = load i64, i64* @ICANON
%5 = xor i64 %4, -1
%6 = getelementptr inbounds %struct.termios, %struct.termios* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = and i64 %7, %5
store i64 %8, i64* %6
%9 = load i32, i32* @STDIN_FILENO
%10 = load i32, i32* @TCSANOW
%11 = call i32 @tcsetattr(i32 %9, i32 %10, %struct.termios* %1)
ret void
}

LLVM IR (-O2):
%struct.termios = type { i64 }
@STDIN_FILENO = global i32 0
@ICANON = global i64 0
@TCSANOW = global i32 0
define void @use_unbuffered_input() {
%1 = alloca %struct.termios
%2 = bitcast %struct.termios* %1 to i8*
%3 = load i32, i32* @STDIN_FILENO
%4 = call i32 @tcgetattr(i32 %3, %struct.termios* %1)
%5 = load i64, i64* @ICANON
%6 = xor i64 %5, -1
%7 = getelementptr inbounds %struct.termios, %struct.termios* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = and i64 %8, %6
store i64 %9, i64* %7
%10 = load i32, i32* @STDIN_FILENO
%11 = load i32, i32* @TCSANOW
%12 = call i32 @tcsetattr(i32 %10, i32 %11, %struct.termios* %1)
ret void
}