xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ print_steps_taken_and_exit();
void __attribute__((noreturn)) int_handler(int sig __attribute__((unused))) {
  print_steps_taken_and_exit();
}


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

x86 assembly (clang, -O2):
<int_handler>:
push   %rax
xor    %eax,%eax
call   1030 <print_steps_taken_and_exit@plt>

LLVM IR (-O0):
define void @int_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @print_steps_taken_and_exit()
unreachable
}

LLVM IR (-O2):
define void @int_handler(i32 %0) {
%2 = tail call i32 (...) @print_steps_taken_and_exit()
unreachable
}
unsigned short test_03(int x) {
  if (x < 58 && x > 47)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<test_03>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x3a,-0x8(%rbp)
jge    1126 <test_03+0x26>
cmpl   $0x2f,-0x8(%rbp)
jle    1126 <test_03+0x26>
movw   $0x1,-0x2(%rbp)
jmp    112c <test_03+0x2c>
movw   $0x0,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_03>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define zeroext i16 @test_03(i32 %0) {
%2 = alloca i16
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 58
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 47
br i1 %8, label %9, label %10
9: ; preds = %6
store i16 1, i16* %2
br label %11
10: ; preds = %6, %1
store i16 0, i16* %2
br label %11
11: ; preds = %10, %9
%12 = load i16, i16* %2
ret i16 %12
}

LLVM IR (-O2):
define zeroext i16 @test_03(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i16
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ bar_x();
int main() { bar_x(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bar_x()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgsub(void) { gen("sub\tax,cx"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"sub\09ax,cx\00"
define void @cgsub() {
%1 = call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"sub\09ax,cx\00"
define void @cgsub() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ box_partition(int /*<<< orphan*/, int const, int,
                                 int const **, int ***);
void box_partition_rcb(const int np, const int root_box[3][2],
                       int pbox[][3][2]) {
  box_partition(0, np, 2, root_box, pbox);
}


x86 assembly (clang, -O0):
<box_partition_rcb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
xor    %edi,%edi
mov    $0x2,%edx
call   1030 <box_partition@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<box_partition_rcb>:
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %edi,%esi
xor    %edi,%edi
mov    $0x2,%edx
jmp    1030 <box_partition@plt>

LLVM IR (-O0):
define void @box_partition_rcb(i32 %0, [2 x i32]* %1, [3 x [2 x i32]]* %2) {
%4 = alloca i32
%5 = alloca [2 x i32]*
%6 = alloca [3 x [2 x i32]]*
store i32 %0, i32* %4
store [2 x i32]* %1, [2 x i32]** %5
store [3 x [2 x i32]]* %2, [3 x [2 x i32]]** %6
%7 = load i32, i32* %4
%8 = load [2 x i32]*, [2 x i32]** %5
%9 = bitcast [2 x i32]* %8 to i32**
%10 = load [3 x [2 x i32]]*, [3 x [2 x i32]]** %6
%11 = bitcast [3 x [2 x i32]]* %10 to i32***
%12 = call i32 @box_partition(i32 0, i32 %7, i32 2, i32** %9, i32*** %11)
ret void
}

LLVM IR (-O2):
define void @box_partition_rcb(i32 %0, [2 x i32]* %1, [3 x [2 x i32]]* %2) {
%4 = bitcast [2 x i32]* %1 to i32**
%5 = bitcast [3 x [2 x i32]]* %2 to i32***
%6 = tail call i32 @box_partition(i32 0, i32 %0, i32 2, i32** %4, i32*** %5)
ret void
}
/* Variables and functions */
double fabs(double);
double area_triangle(double x1, double y1, double x2, double y2, double x3,
                     double y3) {
  return 0.5 * fabs(x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2));
}


x86 assembly (clang, -O0):
<area_triangle>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
subsd  -0x30(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm3
subsd  -0x10(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
subsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movaps 0xea6(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xe8a(%rip),%xmm0
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<area_triangle>:
movapd %xmm3,%xmm6
subsd  %xmm5,%xmm6
subsd  %xmm1,%xmm5
mulsd  %xmm2,%xmm5
mulsd  %xmm6,%xmm0
addsd  %xmm5,%xmm0
subsd  %xmm3,%xmm1
mulsd  %xmm4,%xmm1
addsd  %xmm1,%xmm0
andpd  0xed4(%rip),%xmm0
mulsd  0xedc(%rip),%xmm0
ret

LLVM IR (-O0):
define double @area_triangle(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %7
%14 = load double, double* %10
%15 = load double, double* %12
%16 = fsub double %14, %15
%17 = load double, double* %9
%18 = load double, double* %12
%19 = load double, double* %8
%20 = fsub double %18, %19
%21 = fmul double %17, %20
%22 = call double @llvm.fmuladd.f64(double %13, double %16, double %21)
%23 = load double, double* %11
%24 = load double, double* %8
%25 = load double, double* %10
%26 = fsub double %24, %25
%27 = call double @llvm.fmuladd.f64(double %23, double %26, double %22)
%28 = call double @llvm.fabs.f64(double %27)
%29 = fmul double 5.000000e-01, %28
ret double %29
}

LLVM IR (-O2):
define double @area_triangle(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fsub double %3, %5
%8 = fsub double %5, %1
%9 = fmul double %8, %2
%10 = tail call double @llvm.fmuladd.f64(double %0, double %7, double %9)
%11 = fsub double %1, %3
%12 = tail call double @llvm.fmuladd.f64(double %4, double %11, double %10)
%13 = tail call double @llvm.fabs.f64(double %12)
%14 = fmul double %13, 5.000000e-01
ret double %14
}
void INT_Excep_DMACA_DMAC0I(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_DMACA_DMAC0I() {
ret void
}
/* Type definitions */
struct group {
  scalar_t__ gr_gid;
};

/* Variables and functions */
scalar_t__ errno;
struct group *getgrnam(char *);
int groupid(char *name) {
  struct group *grp;
  errno = 0;
  grp = getgrnam(name);
  if (grp == NULL || errno)
    return -1;
  return (int)grp->gr_gid;
}


x86 assembly (clang, -O0):
<groupid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ebd(%rip),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <getgrnam@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1153 <groupid+0x43>
mov    0x2e97(%rip),%rax
cmpq   $0x0,(%rax)
je     115f <groupid+0x4f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <groupid+0x59>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<groupid>:
push   %rbx
mov    0x2ec8(%rip),%rbx
movq   $0x0,(%rbx)
call   1030 <getgrnam@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1139 <groupid+0x29>
cmpq   $0x0,(%rbx)
jne    1139 <groupid+0x29>
mov    (%rcx),%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.group = type { i64 }
@errno = global i64 0
define i32 @groupid(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.group*
store i8* %0, i8** %3
store i64 0, i64* @errno
%5 = load i8*, i8** %3
%6 = call %struct.group* @getgrnam(i8* %5)
store %struct.group* %6, %struct.group** %4
%7 = load %struct.group*, %struct.group** %4
%8 = icmp eq %struct.group* %7, null
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load i64, i64* @errno
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9, %1
store i32 -1, i32* %2
br label %18
13: ; preds = %9
%14 = load %struct.group*, %struct.group** %4
%15 = getelementptr inbounds %struct.group, %struct.group* %14, i32 0, i32 0
%16 = load i64, i64* %15
%17 = trunc i64 %16 to i32
store i32 %17, i32* %2
br label %18
18: ; preds = %13, %12
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
%struct.group = type { i64 }
@errno = global i64 0
define i32 @groupid(i8* %0) {
store i64 0, i64* @errno
%2 = tail call %struct.group* @getgrnam(i8* %0)
%3 = icmp eq %struct.group* %2, null
%4 = load i64, i64* @errno
%5 = icmp ne i64 %4, 0
%6 = select i1 %3, i1 true, i1 %5
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = getelementptr inbounds %struct.group, %struct.group* %2, i64 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
br label %11
11: ; preds = %1, %7
%12 = phi i32 [ %10, %7 ], [ -1, %1 ]
ret i32 %12
}
void g_scanner_eof() {}


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

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

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

LLVM IR (-O2):
define void @g_scanner_eof() {
ret void
}
/* Variables and functions */
int __munmap(void *, size_t);
int munmap_no_record(void *start, size_t length) {
  return __munmap(start, length);
}


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

x86 assembly (clang, -O2):
<munmap_no_record>:
jmp    1030 <__munmap@plt>

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

LLVM IR (-O2):
define i32 @munmap_no_record(i8* %0, i64 %1) {
%3 = tail call i32 @__munmap(i8* %0, i64 %1)
ret i32 %3
}
/* Variables and functions */
int dcloadsyscall(int, int, int, int);
int lseek(int file, int ptr, int dir) {
  if (*(unsigned int *)0x8c004004 == 0xdeadbeef)
    return dcloadsyscall(9, file, ptr, dir);
  else
    return -1;
}


x86 assembly (clang, -O0):
<lseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x8c004004,%eax
cmpl   $0xdeadbeef,(%rax)
jne    114d <lseek+0x3d>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0x9,%edi
call   1030 <dcloadsyscall@plt>
mov    %eax,-0x4(%rbp)
jmp    1154 <lseek+0x44>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lseek>:
mov    $0x8c004004,%eax
cmpl   $0xdeadbeef,(%rax)
jne    112d <lseek+0x1d>
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x9,%edi
jmp    1030 <dcloadsyscall@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* inttoptr (i64 2348826628 to i32*)
%9 = icmp eq i32 %8, -559038737
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = call i32 @dcloadsyscall(i32 9, i32 %11, i32 %12, i32 %13)
store i32 %14, i32* %4
br label %16
15: ; preds = %3
store i32 -1, i32* %4
br label %16
16: ; preds = %15, %10
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* inttoptr (i64 2348826628 to i32*)
%5 = icmp eq i32 %4, -559038737
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @dcloadsyscall(i32 9, i32 %0, i32 %1, i32 %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ -1, %3 ]
ret i32 %9
}
void XGetModifierMapping() {}


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

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

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

LLVM IR (-O2):
define void @XGetModifierMapping() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void progFreeDefault(void *vp) {
  if (vp != NULL) {
    free(vp);
  }
}


x86 assembly (clang, -O0):
<progFreeDefault>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <progFreeDefault+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @progFreeDefault(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @progFreeDefault(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("PASS\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"PASS\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
void rand_init(const int seed) {
  srand(seed >= 0 ? (unsigned int)seed : (unsigned int)time(NULL));
}


x86 assembly (clang, -O0):
<rand_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1140 <rand_init+0x20>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    114c <rand_init+0x2c>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_init>:
test   %edi,%edi
js     1129 <rand_init+0x9>
jmp    1030 <srand@plt>
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %rax,%rdi
add    $0x8,%rsp
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @rand_init(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* %2
br label %10
7: ; preds = %1
%8 = call i64 @time(i32* null)
%9 = trunc i64 %8 to i32
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %6, %5 ], [ %9, %7 ]
%12 = call i32 @srand(i32 %11)
ret void
}

LLVM IR (-O2):
define void @rand_init(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i64 @time(i32* null)
%5 = trunc i64 %4 to i32
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ %0, %1 ]
%8 = tail call i32 @srand(i32 %7)
ret void
}
/* Variables and functions */
int tuner_i2c_read(void *, unsigned char, int, unsigned char *, int);
int fc8080_read(void *handle, unsigned char addr, unsigned char *data) {
  int res;
  res = tuner_i2c_read(handle, addr, 1, data, 1);
  return res;
}


x86 assembly (clang, -O0):
<fc8080_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    $0x1,%r8d
movzbl %al,%esi
mov    %r8d,%edx
call   1030 <tuner_i2c_read@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc8080_read>:
mov    %rdx,%rcx
mov    $0x1,%edx
mov    $0x1,%r8d
jmp    1030 <tuner_i2c_read@plt>

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

LLVM IR (-O2):
define i32 @fc8080_read(i8* %0, i8 zeroext %1, i8* %2) {
%4 = tail call i32 @tuner_i2c_read(i8* %0, i8 zeroext %1, i32 1, i8* %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int fives(int);
int test_fives() {
  return 0 == fives(19) && 1 == fives(20) && 2 == fives(50) && 3 == fives(250);
}


x86 assembly (clang, -O0):
<test_fives>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x13,%edi
call   1030 <fives@plt>
mov    %eax,%edx
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    1188 <test_fives+0x78>
mov    $0x14,%edi
call   1030 <fives@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    1188 <test_fives+0x78>
mov    $0x32,%edi
call   1030 <fives@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x2,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    1188 <test_fives+0x78>
mov    $0xfa,%edi
call   1030 <fives@plt>
mov    %eax,%ecx
mov    $0x3,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fives>:
push   %rbx
mov    $0x13,%edi
call   1030 <fives@plt>
xor    %ebx,%ebx
test   %eax,%eax
jne    1151 <test_fives+0x41>
mov    $0x14,%edi
call   1030 <fives@plt>
cmp    $0x1,%eax
jne    1151 <test_fives+0x41>
mov    $0x32,%edi
call   1030 <fives@plt>
cmp    $0x2,%eax
jne    1151 <test_fives+0x41>
mov    $0xfa,%edi
call   1030 <fives@plt>
xor    %ebx,%ebx
cmp    $0x3,%eax
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_fives() {
%1 = call i32 @fives(i32 19)
%2 = icmp eq i32 0, %1
br i1 %2, label %3, label %12
3: ; preds = %0
%4 = call i32 @fives(i32 20)
%5 = icmp eq i32 1, %4
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = call i32 @fives(i32 50)
%8 = icmp eq i32 2, %7
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = call i32 @fives(i32 250)
%11 = icmp eq i32 3, %10
br label %12
12: ; preds = %9, %6, %3, %0
%13 = phi i1 [ false, %6 ], [ false, %3 ], [ false, %0 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @test_fives() {
%1 = tail call i32 @fives(i32 19)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %13
3: ; preds = %0
%4 = tail call i32 @fives(i32 20)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = tail call i32 @fives(i32 50)
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = tail call i32 @fives(i32 250)
%11 = icmp eq i32 %10, 3
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %9, %6, %3, %0
%14 = phi i32 [ 0, %6 ], [ 0, %3 ], [ 0, %0 ], [ %12, %9 ]
ret i32 %14
}
/* Variables and functions */
uintptr_t __attribute__((no, const)) bar(int ***p) { return (uintptr_t)p; }


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

x86 assembly (clang, -O2):
<bar>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @bar(i32*** %0) {
%2 = alloca i32***
store i32*** %0, i32**** %2
%3 = load i32***, i32**** %2
%4 = ptrtoint i32*** %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @bar(i32*** %0) {
%2 = ptrtoint i32*** %0 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ mvprintw(int, int, char *);
int draw_clear_block(int col, int row) {
  attron(COLOR_PAIR(20));
  mvprintw(row, col, " ");
  return 0;
  return -1;
}


x86 assembly (clang, -O0):
<draw_clear_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x14,%edi
call   1040 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attron@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
lea    0xea4(%rip),%rdx
call   1050 <mvprintw@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_clear_block>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x14,%edi
call   1040 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attron@plt>
lea    0xeb1(%rip),%rdx
mov    %ebx,%edi
mov    %ebp,%esi
call   1050 <mvprintw@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define i32 @draw_clear_block(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @COLOR_PAIR(i32 20)
%6 = call i32 @attron(i32 %5)
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = call i32 @mvprintw(i32 %7, i32 %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define i32 @draw_clear_block(i32 %0, i32 %1) {
%3 = tail call i32 @COLOR_PAIR(i32 20)
%4 = tail call i32 @attron(i32 %3)
%5 = tail call i32 @mvprintw(i32 %1, i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct ttrie__choice_table {
  int dummy;
};

/* Variables and functions */
int choice_table_row_count(struct ttrie__choice_table *);
bool choice_table_full(struct ttrie__choice_table *ct) {
  int depth = choice_table_row_count(ct);
  if (depth == 256)
    return true;
  else
    return false;
}


x86 assembly (clang, -O0):
<choice_table_full>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <choice_table_row_count@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x100,-0x14(%rbp)
jne    1141 <choice_table_full+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <choice_table_full+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<choice_table_full>:
push   %rax
call   1030 <choice_table_row_count@plt>
xor    %ecx,%ecx
cmp    $0x100,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ttrie__choice_table = type { i32 }
define i32 @choice_table_full(%struct.ttrie__choice_table* %0) {
%2 = alloca i32
%3 = alloca %struct.ttrie__choice_table*
%4 = alloca i32
store %struct.ttrie__choice_table* %0, %struct.ttrie__choice_table** %3
%5 = load %struct.ttrie__choice_table*, %struct.ttrie__choice_table** %3
%6 = call i32 @choice_table_row_count(%struct.ttrie__choice_table* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 256
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.ttrie__choice_table = type { i32 }
define i32 @choice_table_full(%struct.ttrie__choice_table* %0) {
%2 = tail call i32 @choice_table_row_count(%struct.ttrie__choice_table* %0)
%3 = icmp eq i32 %2, 256
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int IPC_CREAT;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
scalar_t__ semget(int, int, int);
int main() {
  int semid;
  if (semid = semget(0x24, 5, IPC_CREAT | 0666) < 0) {
    perror("");
    exit(1);
  }
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edx
or     $0x1b6,%edx
mov    $0x24,%edi
mov    $0x5,%esi
call   1030 <semget@plt>
cmp    $0x0,%rax
setl   %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x8(%rbp)
test   $0x1,%al
jne    117c <main+0x4c>
jmp    1192 <main+0x62>
lea    0xe7d(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    1197 <main+0x67>
jmp    1197 <main+0x67>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    $0x1b6,%edx
or     (%rax),%edx
mov    $0x24,%edi
mov    $0x5,%esi
call   1030 <semget@plt>
test   %rax,%rax
js     1162 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
jmp    1160 <main+0x30>
lea    0xe97(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@IPC_CREAT = global i32 0
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @IPC_CREAT
%4 = or i32 %3, 438
%5 = call i64 @semget(i32 36, i32 5, i32 %4)
%6 = icmp slt i64 %5, 0
%7 = zext i1 %6 to i32
store i32 %7, i32* %2
br i1 %6, label %8, label %11
8: ; preds = %0
%9 = call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %0
br label %12
12: ; preds = %11, %12
br label %12
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = load i32, i32* @IPC_CREAT
%2 = or i32 %1, 438
%3 = tail call i64 @semget(i32 36, i32 5, i32 %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = tail call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %0, %8
br label %8
}
int heater_position_to_sensor_position(int i) {
  int k = i / 5;
  int ret = 5 * i - 24 * k;
  return ret;
}


x86 assembly (clang, -O0):
<heater_position_to_sensor_position>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
imul   $0x5,-0x4(%rbp),%eax
imul   $0x18,-0x8(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<heater_position_to_sensor_position>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x21,%rcx
add    %edx,%ecx
lea    (%rax,%rax,4),%eax
shl    $0x3,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @heater_position_to_sensor_position(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 5
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = mul nsw i32 5, %7
%9 = load i32, i32* %3
%10 = mul nsw i32 24, %9
%11 = sub nsw i32 %8, %10
store i32 %11, i32* %4
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
define i32 @heater_position_to_sensor_position(i32 %0) {
%2 = sdiv i32 %0, 5
%3 = mul nsw i32 %0, 5
%4 = mul i32 %2, -24
%5 = add i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int close(int);
int closeTCPConnection(int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<closeTCPConnection>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @closeTCPConnection(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
void RTMemEfDupNP(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMemEfDupNP() {
ret void
}
/* Variables and functions */
int O_APPEND;
int O_CREAT;
int O_WRONLY;
int open(char const *, int, int);
int open_append(const char *filename) {
  return open(filename, O_WRONLY | 0 | O_APPEND | O_CREAT, 0600);
}


x86 assembly (clang, -O0):
<open_append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
or     $0x0,%esi
mov    0x2e95(%rip),%rax
or     (%rax),%esi
mov    0x2ebc(%rip),%rax
or     (%rax),%esi
mov    $0x180,%edx
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_append>:
mov    0x2eb9(%rip),%rax
mov    0x2eaa(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2ecf(%rip),%rax
or     (%rax),%esi
mov    $0x180,%edx
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_APPEND = global i32 0
@O_CREAT = global i32 0
define i32 @open_append(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_WRONLY
%5 = or i32 %4, 0
%6 = load i32, i32* @O_APPEND
%7 = or i32 %5, %6
%8 = load i32, i32* @O_CREAT
%9 = or i32 %7, %8
%10 = call i32 @open(i8* %3, i32 %9, i32 384)
ret i32 %10
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_APPEND = global i32 0
@O_CREAT = global i32 0
define i32 @open_append(i8* nocapture %0) {
%2 = load i32, i32* @O_WRONLY
%3 = load i32, i32* @O_APPEND
%4 = or i32 %3, %2
%5 = load i32, i32* @O_CREAT
%6 = or i32 %4, %5
%7 = tail call i32 @open(i8* %0, i32 %6, i32 384)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ test_check_fail_add_test();
void test_check_fail_add_test_constructor(void) { test_check_fail_add_test(); }


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

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

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

LLVM IR (-O2):
define void @test_check_fail_add_test_constructor() {
%1 = tail call i32 (...) @test_check_fail_add_test()
ret void
}
hitbottom() {}


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

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

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

LLVM IR (-O2):
define i32 @hitbottom() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int tam;
  printf("\ndigite tam: ");
  scanf("%d", &tam);
  int vet[tam];
  printf("%d", vet[0]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
lea    0xf(,%rcx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x18(%rbp)
mov    (%rax),%esi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%r14
lea    0x4(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    %rsp,%rbx
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rsp
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"\0Adigite tam: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i8* @llvm.stacksave()
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 undef)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int sqlite3_exec(int /*<<< orphan*/ *, char const *, int /*<<< orphan*/,
                 int /*<<< orphan*/, int /*<<< orphan*/);
int create_table(sqlite3 *db) {
  const char *sql = "CREATE TABLE IF NOT EXISTS blobs("
                    "file_name TEXT PRIMARY KEY,"
                    "data BLOB)";
  return sqlite3_exec(db, sql, 0, 0, 0);
}


x86 assembly (clang, -O0):
<create_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <sqlite3_exec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_table>:
lea    0xee9(%rip),%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <sqlite3_exec@plt>

LLVM IR (-O0):
@.str = [71 x i8] c"CREATE TABLE IF NOT EXISTS blobs(file_name TEXT PRIMARY KEY,data BLOB)\00"
define i32 @create_table(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
store i32* %0, i32** %2
store i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i32*, i32** %2
%5 = load i8*, i8** %3
%6 = call i32 @sqlite3_exec(i32* %4, i8* %5, i32 0, i32 0, i32 0)
ret i32 %6
}

LLVM IR (-O2):
@.str = [71 x i8] c"CREATE TABLE IF NOT EXISTS blobs(file_name TEXT PRIMARY KEY,data BLOB)\00"
define i32 @create_table(i32* %0) {
%2 = tail call i32 @sqlite3_exec(i32* %0, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0)
ret i32 %2
}
int is_there_enough_args(int argc) { return ((argc == 3) || (argc == 4)); }


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

x86 assembly (clang, -O2):
<is_there_enough_args>:
add    $0xfffffffd,%edi
xor    %eax,%eax
cmp    $0x2,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_there_enough_args(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 3
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 4
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 @is_there_enough_args(i32 %0) {
%2 = add i32 %0, -3
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
void spi_init() {
  *(unsigned char *)0x5200 = 0;
  *(unsigned char *)0x5200 |= (1 << 5);
  *(unsigned char *)0x5200 &= ~((1 << 1) | (1 << 0) | (1 << 7));
  *(unsigned char *)0x5201 = 0;
  *(unsigned char *)0x5201 |= (1 << 1) | (1 << 0);
  *(unsigned char *)0x5200 |= (1 << 6) | (1 << 2);
}


x86 assembly (clang, -O0):
<spi_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5200,%eax
movb   $0x0,(%rax)
mov    $0x5200,%eax
movzbl (%rax),%eax
or     $0x20,%eax
mov    %al,%cl
mov    $0x5200,%eax
mov    %cl,(%rax)
mov    $0x5200,%eax
movzbl (%rax),%eax
and    $0xffffff7c,%eax
mov    %al,%cl
mov    $0x5200,%eax
mov    %cl,(%rax)
mov    $0x5201,%eax
movb   $0x0,(%rax)
mov    $0x5201,%eax
movzbl (%rax),%eax
or     $0x3,%eax
mov    %al,%cl
mov    $0x5201,%eax
mov    %cl,(%rax)
mov    $0x5200,%eax
movzbl (%rax),%eax
or     $0x44,%eax
mov    %al,%cl
mov    $0x5200,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_init>:
movb   $0x20,0x5200
20
movb   $0x3,0x5201
03
orb    $0x44,0x5200
44
ret

LLVM IR (-O0):
define void @spi_init() {
store i8 0, i8* inttoptr (i64 20992 to i8*)
%1 = load i8, i8* inttoptr (i64 20992 to i8*)
%2 = zext i8 %1 to i32
%3 = or i32 %2, 32
%4 = trunc i32 %3 to i8
store i8 %4, i8* inttoptr (i64 20992 to i8*)
%5 = load i8, i8* inttoptr (i64 20992 to i8*)
%6 = zext i8 %5 to i32
%7 = and i32 %6, -132
%8 = trunc i32 %7 to i8
store i8 %8, i8* inttoptr (i64 20992 to i8*)
store i8 0, i8* inttoptr (i64 20993 to i8*)
%9 = load i8, i8* inttoptr (i64 20993 to i8*)
%10 = zext i8 %9 to i32
%11 = or i32 %10, 3
%12 = trunc i32 %11 to i8
store i8 %12, i8* inttoptr (i64 20993 to i8*)
%13 = load i8, i8* inttoptr (i64 20992 to i8*)
%14 = zext i8 %13 to i32
%15 = or i32 %14, 68
%16 = trunc i32 %15 to i8
store i8 %16, i8* inttoptr (i64 20992 to i8*)
ret void
}

LLVM IR (-O2):
define void @spi_init() {
store i8 32, i8* inttoptr (i64 20992 to i8*)
store i8 3, i8* inttoptr (i64 20993 to i8*)
%1 = load i8, i8* inttoptr (i64 20992 to i8*)
%2 = or i8 %1, 68
store i8 %2, i8* inttoptr (i64 20992 to i8*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void myhandler(int signo __attribute__((unused)),
               siginfo_t *info __attribute__((unused)),
               void *context __attribute__((unused))) {
  printf("Inside dummy handler\n");
}


x86 assembly (clang, -O0):
<myhandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"Inside dummy handler\0A\00"
define void @myhandler(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"Inside dummy handler\00"
define void @myhandler(i32 %0, i32* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct chunk {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dimension_chunk(struct chunk *);
int /*<<< orphan*/ free(int /*<<< orphan*/);
void dimension_free(struct chunk *chunk) { free(dimension_chunk(chunk)); }


x86 assembly (clang, -O0):
<dimension_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <dimension_chunk@plt>
mov    %eax,%edi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dimension_free>:
push   %rax
call   1040 <dimension_chunk@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.chunk = type { i32 }
define void @dimension_free(%struct.chunk* %0) {
%2 = alloca %struct.chunk*
store %struct.chunk* %0, %struct.chunk** %2
%3 = load %struct.chunk*, %struct.chunk** %2
%4 = call i32 @dimension_chunk(%struct.chunk* %3)
%5 = call i32 @free(i32 %4)
ret void
}

LLVM IR (-O2):
%struct.chunk = type { i32 }
define void @dimension_free(%struct.chunk* %0) {
%2 = tail call i32 @dimension_chunk(%struct.chunk* %0)
%3 = tail call i32 @free(i32 %2)
ret void
}
int do_144() { return 144; }


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

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

LLVM IR (-O0):
define i32 @do_144() {
ret i32 144
}

LLVM IR (-O2):
define i32 @do_144() {
ret i32 144
}
/* Type definitions */
struct proctal {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ proctal_implementation_scan_region_start(struct proctal *);
void proctal_scan_region_start(struct proctal *p) {
  proctal_implementation_scan_region_start(p);
}


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

x86 assembly (clang, -O2):
<proctal_scan_region_start>:
jmp    1030 <proctal_implementation_scan_region_start@plt>

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

LLVM IR (-O2):
%struct.proctal = type { i32 }
define void @proctal_scan_region_start(%struct.proctal* %0) {
%2 = tail call i32 @proctal_implementation_scan_region_start(%struct.proctal* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ barrier();
void flush(void) {
  while (((*(volatile unsigned char *)(0x82500010)) & 4) == 0)
    barrier();
}


x86 assembly (clang, -O0):
<flush>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <flush+0x9>
mov    $0x82500010,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x4,%eax
cmp    $0x0,%eax
jne    113b <flush+0x2b>
mov    $0x0,%al
call   1030 <barrier@plt>
jmp    1119 <flush+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush>:
push   %rbx
mov    $0x82500010,%ebx
testb  $0x4,(%rbx)
jne    112c <flush+0x1c>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <barrier@plt>
testb  $0x4,(%rbx)
je     1120 <flush+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @flush() {
br label %1
1: ; preds = %6, %0
%2 = load volatile i8, i8* inttoptr (i64 2186280976 to i8*)
%3 = zext i8 %2 to i32
%4 = and i32 %3, 4
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @barrier()
br label %1
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @flush() {
%1 = load volatile i8, i8* inttoptr (i64 2186280976 to i8*)
%2 = and i8 %1, 4
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %0, %4
%5 = tail call i32 (...) @barrier()
%6 = load volatile i8, i8* inttoptr (i64 2186280976 to i8*)
%7 = and i8 %6, 4
%8 = icmp eq i8 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4, %0
ret void
}
/* Variables and functions */
int wordcount(char *);
int key_length(char phrase[]) { return wordcount(phrase) * 4; }


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

x86 assembly (clang, -O2):
<key_length>:
push   %rax
call   1030 <wordcount@plt>
shl    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @key_length(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @wordcount(i8* %3)
%5 = mul nsw i32 %4, 4
ret i32 %5
}

LLVM IR (-O2):
define i32 @key_length(i8* %0) {
%2 = tail call i32 @wordcount(i8* %0)
%3 = shl nsw i32 %2, 2
ret i32 %3
}
/* Variables and functions */
int ascii_tolower(int);
int ensure_lowercase(int c) { return ascii_tolower(c); }


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

x86 assembly (clang, -O2):
<ensure_lowercase>:
jmp    1030 <ascii_tolower@plt>

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

LLVM IR (-O2):
define i32 @ensure_lowercase(i32 %0) {
%2 = tail call i32 @ascii_tolower(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ print_string(char *);
int /*<<< orphan*/ print_string_hex(char *, int);
int main(void) {
  char *a;
  a = "Hello World.";
  char b[15] = "Hello World";
  print_string_hex(b, 15);
  b[2] = 'c';
  print_string(b);
  char *c;
  c = b;
  c[2] = 'd';
  print_string(c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x17(%rbp)
mov    0xed1(%rip),%eax
mov    %eax,-0xf(%rbp)
mov    0xecb(%rip),%ax
mov    %ax,-0xb(%rbp)
mov    0xec3(%rip),%al
mov    %al,-0x9(%rbp)
lea    -0x17(%rbp),%rdi
mov    $0xf,%esi
call   1040 <print_string_hex@plt>
movb   $0x63,-0x15(%rbp)
lea    -0x17(%rbp),%rdi
call   1030 <print_string@plt>
lea    -0x17(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x64,0x2(%rax)
mov    -0x20(%rbp),%rdi
call   1030 <print_string@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x6f57206f6c6c6548,%rax
20 57 6f
mov    %rax,(%rsp)
movq   $0x646c726f,0x7(%rsp)
6c 64
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xf,%esi
call   1040 <print_string_hex@plt>
movb   $0x63,0x2(%rsp)
mov    %rbx,%rdi
call   1030 <print_string@plt>
movb   $0x64,0x2(%rsp)
mov    %rbx,%rdi
call   1030 <print_string@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World.\00"
@__const.main.b = [15 x i8] c"Hello World\00\00\00\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca [15 x i8]
%3 = alloca i8*
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %1
%4 = bitcast [15 x i8]* %2 to i8*
%5 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%6 = call i32 @print_string_hex(i8* %5, i32 15)
%7 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 2
store i8 99, i8* %7
%8 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%9 = call i32 @print_string(i8* %8)
%10 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 2
store i8 100, i8* %12
%13 = load i8*, i8** %3
%14 = call i32 @print_string(i8* %13)
ret i32 0
}

LLVM IR (-O2):
@__const.main.b = [15 x i8] c"Hello World\00\00\00\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = call i32 @print_string_hex(i8* %2, i32 15)
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 2
store i8 99, i8* %4
%5 = call i32 @print_string(i8* %2)
store i8 100, i8* %4
%6 = call i32 @print_string(i8* %2)
ret i32 0
}