xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int open(char const *, int /*<<< orphan*/);
int open_a_file(const char *name) {
  int f = -1;
  f = open(name, O_RDONLY);
  return f;
}


x86 assembly (clang, -O0):
<open_a_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_a_file>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <open@plt>

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

LLVM IR (-O2):
@O_RDONLY = global i32 0
define i32 @open_a_file(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
ret i32 %3
}
int g(int i) { return i <= (i + 2); }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @g(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 2
%6 = icmp sle i32 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @g(i32 %0) {
ret i32 1
}
/* Type definitions */
struct Graph {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ createGraph(struct Graph *, int, int);
void creator2(struct Graph *graph) {
  createGraph(graph, 0, 1);
  createGraph(graph, 0, 2);
  createGraph(graph, 1, 2);
  createGraph(graph, 1, 3);
  createGraph(graph, 2, 3);
}


x86 assembly (clang, -O0):
<creator2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <createGraph@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <createGraph@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <createGraph@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
mov    $0x3,%edx
call   1030 <createGraph@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <createGraph@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<creator2>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <createGraph@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <createGraph@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <createGraph@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x3,%edx
call   1030 <createGraph@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
pop    %rbx
jmp    1030 <createGraph@plt>

LLVM IR (-O0):
%struct.Graph = type { i32 }
define void @creator2(%struct.Graph* %0) {
%2 = alloca %struct.Graph*
store %struct.Graph* %0, %struct.Graph** %2
%3 = load %struct.Graph*, %struct.Graph** %2
%4 = call i32 @createGraph(%struct.Graph* %3, i32 0, i32 1)
%5 = load %struct.Graph*, %struct.Graph** %2
%6 = call i32 @createGraph(%struct.Graph* %5, i32 0, i32 2)
%7 = load %struct.Graph*, %struct.Graph** %2
%8 = call i32 @createGraph(%struct.Graph* %7, i32 1, i32 2)
%9 = load %struct.Graph*, %struct.Graph** %2
%10 = call i32 @createGraph(%struct.Graph* %9, i32 1, i32 3)
%11 = load %struct.Graph*, %struct.Graph** %2
%12 = call i32 @createGraph(%struct.Graph* %11, i32 2, i32 3)
ret void
}

LLVM IR (-O2):
%struct.Graph = type { i32 }
define void @creator2(%struct.Graph* %0) {
%2 = tail call i32 @createGraph(%struct.Graph* %0, i32 0, i32 1)
%3 = tail call i32 @createGraph(%struct.Graph* %0, i32 0, i32 2)
%4 = tail call i32 @createGraph(%struct.Graph* %0, i32 1, i32 2)
%5 = tail call i32 @createGraph(%struct.Graph* %0, i32 1, i32 3)
%6 = tail call i32 @createGraph(%struct.Graph* %0, i32 2, i32 3)
ret void
}
void testStoreRegister() {}


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

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

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

LLVM IR (-O2):
define void @testStoreRegister() {
ret void
}
/* Variables and functions */
double estimate_gininvCeff(int);
double pow(double, double);
double estimate_io_btr_opt(unsigned nbstages_opt, double sCeff) {
  double btr_opt, ginmininvCeff;
  ginmininvCeff = estimate_gininvCeff(1.);
  btr_opt = pow((sCeff / ginmininvCeff), (1.0 / (double)nbstages_opt));
  return btr_opt;
}


x86 assembly (clang, -O0):
<estimate_io_btr_opt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    $0x1,%edi
call   1030 <estimate_gininvCeff@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm2
movsd  0xea3(%rip),%xmm1
divsd  %xmm2,%xmm1
call   1040 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<estimate_io_btr_opt>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %edi,%ebx
mov    $0x1,%edi
call   1030 <estimate_gininvCeff@plt>
movsd  0x8(%rsp),%xmm2
divsd  %xmm0,%xmm2
mov    %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0xead(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm2,%xmm0
add    $0x10,%rsp
pop    %rbx
jmp    1040 <pow@plt>

LLVM IR (-O0):
define double @estimate_io_btr_opt(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%7 = call double @estimate_gininvCeff(i32 1)
store double %7, double* %6
%8 = load double, double* %4
%9 = load double, double* %6
%10 = fdiv double %8, %9
%11 = load i32, i32* %3
%12 = uitofp i32 %11 to double
%13 = fdiv double 1.000000e+00, %12
%14 = call double @pow(double %10, double %13)
store double %14, double* %5
%15 = load double, double* %5
ret double %15
}

LLVM IR (-O2):
define double @estimate_io_btr_opt(i32 %0, double %1) {
%3 = tail call double @estimate_gininvCeff(i32 1)
%4 = fdiv double %1, %3
%5 = uitofp i32 %0 to double
%6 = fdiv double 1.000000e+00, %5
%7 = tail call double @pow(double %4, double %6)
ret double %7
}
int test_64_4(int *mem) { return __atomic_fetch_nand(mem + 0, 1, 4); }


x86 assembly (clang, -O0):
<test_64_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x18(%rbp)
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%esi
mov    %eax,%edx
and    %esi,%edx
mov    %edx,-0x28(%rbp)
not    %edx
lock cmpxchg %edx,(%rcx)
sete   %cl
mov    %eax,-0x24(%rbp)
test   $0x1,%cl
mov    %eax,-0x14(%rbp)
jne    1150 <test_64_4+0x50>
jmp    1122 <test_64_4+0x22>
mov    -0x24(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_64_4>:
mov    (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
not    %ecx
or     $0xfffffffe,%ecx
lock cmpxchg %ecx,(%rdi)
jne    1110 <test_64_4+0x10>
ret

LLVM IR (-O0):
define i32 @test_64_4(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
store i32 1, i32* %3
%7 = load i32, i32* %3
%8 = atomicrmw nand i32* %6, i32 %7 acq_rel
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_64_4(i32* nocapture %0) {
%2 = atomicrmw nand i32* %0, i32 1 acq_rel
ret i32 %2
}
void dbgprintf() {}


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

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

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

LLVM IR (-O2):
define void @dbgprintf() {
ret void
}
void nothing0() { return; }


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

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

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

LLVM IR (-O2):
define void @nothing0() {
ret void
}
int gritou(const char *str) { return str[0] == 'c'; }


x86 assembly (clang, -O0):
<gritou>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x63,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gritou>:
xor    %eax,%eax
cmpb   $0x63,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @gritou(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 99
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @gritou(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 99
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_F6uint32_mem(unsigned int *val) {
  return ((*val) & (0xF6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F6uint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xf6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F6uint32_mem>:
testb  $0xf6,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F6uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 246
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __nr_to_section(unsigned long);
int valid_section(int /*<<< orphan*/);
__attribute__((always_)) int valid_section_nr(unsigned long nr) {
  return valid_section(__nr_to_section(nr));
}


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

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

LLVM IR (-O0):
define i32 @valid_section_nr(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @__nr_to_section(i64 %3)
%5 = call i32 @valid_section(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @valid_section_nr(i64 %0) {
%2 = tail call i32 @__nr_to_section(i64 %0)
%3 = tail call i32 @valid_section(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ next_el(int **);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int A[] = {10, 20, 30};
  int *p = A;
  next_el(&p);
  printf("*p = %d\n", *p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
call   1040 <next_el@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1040 <next_el@plt>
mov    (%rsp),%rax
mov    (%rax),%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.A = [3 x i32] [i32 10, i32 20, i32 30]
@.str = [9 x i8] c"*p = %d\0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca i32*
%3 = bitcast [3 x i32]* %1 to i8*
%4 = bitcast i32** %2 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
store i32* %5, i32** %2
%6 = call i32 @next_el(i32** %2)
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}
void right_case_3(struct rbt *tree, struct node *node, struct node *sibling) {}


x86 assembly (clang, -O0):
<right_case_3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.rbt = type opaque
%struct.node = type opaque
define void @right_case_3(%struct.rbt* %0, %struct.node* %1, %struct.node* %2) {
%4 = alloca %struct.rbt*
%5 = alloca %struct.node*
%6 = alloca %struct.node*
store %struct.rbt* %0, %struct.rbt** %4
store %struct.node* %1, %struct.node** %5
store %struct.node* %2, %struct.node** %6
ret void
}

LLVM IR (-O2):
%struct.rbt = type opaque
%struct.node = type opaque
define void @right_case_3(%struct.rbt* nocapture %0, %struct.node* nocapture %1, %struct.node* nocapture %2) {
ret void
}
/* Variables and functions */
int getpid();
int lib_c(int mask) { return getpid() % mask; }


x86 assembly (clang, -O0):
<lib_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lib_c>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @lib_c(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getpid()
%4 = load i32, i32* %2
%5 = srem i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @lib_c(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = srem i32 %2, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int file_exists(const char *filename) {
  FILE *f = fopen(filename, "r");
  fclose(f);
  return f != NULL;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rbx
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
test   %rbx,%rbx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @file_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @fclose(i32* %6)
%8 = load i32*, i32** %3
%9 = icmp ne i32* %8, null
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @file_exists(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @fclose(i32* %2)
%4 = icmp ne i32* %2, null
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ft_strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void ft_putstr(char const *str) { write(1, str, ft_strlen(str)); }


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @ft_putstr(i8* %0) {
%2 = tail call i32 @ft_strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
ret void
}
int functionName_good(int a) {
#pragma critTer : 2 : resources / functionName.c:
  return a;
#pragma critTer : 3 : resources / functionName.c:
}


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

x86 assembly (clang, -O2):
<functionName_good>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @functionName_good(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
double log(int);
double atanh(double x) { return 0.5 * log((1. + x) / (1. - x)); }


x86 assembly (clang, -O0):
<atanh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  0xeb1(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atanh>:
push   %rax
movsd  0xee7(%rip),%xmm1
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
subsd  %xmm0,%xmm1
divsd  %xmm1,%xmm2
cvttsd2si %xmm2,%edi
call   1030 <log@plt>
mulsd  0xece(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @atanh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double 1.000000e+00, %3
%5 = load double, double* %2
%6 = fsub double 1.000000e+00, %5
%7 = fdiv double %4, %6
%8 = fptosi double %7 to i32
%9 = call double @log(i32 %8)
%10 = fmul double 5.000000e-01, %9
ret double %10
}

LLVM IR (-O2):
define double @atanh(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fsub double 1.000000e+00, %0
%4 = fdiv double %2, %3
%5 = fptosi double %4 to i32
%6 = tail call double @log(i32 %5)
%7 = fmul double %6, 5.000000e-01
ret double %7
}
/* Variables and functions */
void *tlsf_malloc(size_t, void *);
void *tlsf_calloc(size_t nelem, size_t elem_size, void *mem_pool) {
  void *ptr;
  if (nelem <= 0 || elem_size <= 0)
    return NULL;
  if (!(ptr = tlsf_malloc(nelem * elem_size, mem_pool)))
    return NULL;
  return ptr;
}


x86 assembly (clang, -O0):
<tlsf_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jbe    113a <tlsf_calloc+0x2a>
cmpq   $0x0,-0x18(%rbp)
ja     1147 <tlsf_calloc+0x37>
movq   $0x0,-0x8(%rbp)
jmp    117c <tlsf_calloc+0x6c>
mov    -0x10(%rbp),%rdi
imul   -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <tlsf_malloc@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    1174 <tlsf_calloc+0x64>
movq   $0x0,-0x8(%rbp)
jmp    117c <tlsf_calloc+0x6c>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlsf_calloc>:
test   %rdi,%rdi
je     1129 <tlsf_calloc+0x19>
test   %rsi,%rsi
je     1129 <tlsf_calloc+0x19>
imul   %rdi,%rsi
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <tlsf_malloc@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @tlsf_calloc(i64 %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
store i64 %0, i64* %5
store i64 %1, i64* %6
store i8* %2, i8** %7
%9 = load i64, i64* %5
%10 = icmp ule i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %3
%12 = load i64, i64* %6
%13 = icmp ule i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %11, %3
store i8* null, i8** %4
br label %25
15: ; preds = %11
%16 = load i64, i64* %5
%17 = load i64, i64* %6
%18 = mul i64 %16, %17
%19 = load i8*, i8** %7
%20 = call i8* @tlsf_malloc(i64 %18, i8* %19)
store i8* %20, i8** %8
%21 = icmp ne i8* %20, null
br i1 %21, label %23, label %22
22: ; preds = %15
store i8* null, i8** %4
br label %25
23: ; preds = %15
%24 = load i8*, i8** %8
store i8* %24, i8** %4
br label %25
25: ; preds = %23, %22, %14
%26 = load i8*, i8** %4
ret i8* %26
}

LLVM IR (-O2):
define i8* @tlsf_calloc(i64 %0, i64 %1, i8* %2) {
%4 = icmp eq i64 %0, 0
%5 = icmp eq i64 %1, 0
%6 = or i1 %4, %5
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = mul i64 %1, %0
%9 = tail call i8* @tlsf_malloc(i64 %8, i8* %2)
br label %10
10: ; preds = %7, %3
%11 = phi i8* [ null, %3 ], [ %9, %7 ]
ret i8* %11
}
/* Type definitions */
typedef int /*<<< orphan*/ speed_t;

/* Variables and functions */
int _osmo_serial_set_baudrate(int, int /*<<< orphan*/);
int /*<<< orphan*/ osmo_serial_clear_custom_baudrate(int);
int osmo_serial_set_baudrate(int fd, speed_t baudrate) {
  osmo_serial_clear_custom_baudrate(fd);
  return _osmo_serial_set_baudrate(fd, baudrate);
}


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

x86 assembly (clang, -O2):
<osmo_serial_set_baudrate>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <osmo_serial_clear_custom_baudrate@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_osmo_serial_set_baudrate@plt>

LLVM IR (-O0):
define i32 @osmo_serial_set_baudrate(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 = call i32 @osmo_serial_clear_custom_baudrate(i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @_osmo_serial_set_baudrate(i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @osmo_serial_set_baudrate(i32 %0, i32 %1) {
%3 = tail call i32 @osmo_serial_clear_custom_baudrate(i32 %0)
%4 = tail call i32 @_osmo_serial_set_baudrate(i32 %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __bitmap_shift_right(unsigned long *, unsigned long const *,
                                        int, int);
__attribute__((always_)) void bitmap_shift_right(unsigned long *dst,
                                                 const unsigned long *src,
                                                 int n, int nbits) {
  if (nbits <= 32)
    *dst = *src >> n;
  else
    __bitmap_shift_right(dst, src, n, nbits);
}


x86 assembly (clang, -O0):
<bitmap_shift_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
cmpl   $0x20,-0x18(%rbp)
jg     114c <bitmap_shift_right+0x3c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x14(%rbp),%ecx
shr    %cl,%rax
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    115f <bitmap_shift_right+0x4f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <__bitmap_shift_right@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_shift_right>:
cmp    $0x20,%ecx
jg     1121 <bitmap_shift_right+0x11>
mov    (%rsi),%rax
mov    %edx,%ecx
shr    %cl,%rax
mov    %rax,(%rdi)
ret
jmp    1030 <__bitmap_shift_right@plt>

LLVM IR (-O0):
define void @bitmap_shift_right(i64* %0, i64* %1, i32 %2, i32 %3) {
%5 = alloca i64*
%6 = alloca i64*
%7 = alloca i32
%8 = alloca i32
store i64* %0, i64** %5
store i64* %1, i64** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = icmp sle i32 %9, 32
br i1 %10, label %11, label %18
11: ; preds = %4
%12 = load i64*, i64** %6
%13 = load i64, i64* %12
%14 = load i32, i32* %7
%15 = zext i32 %14 to i64
%16 = lshr i64 %13, %15
%17 = load i64*, i64** %5
store i64 %16, i64* %17
br label %24
18: ; preds = %4
%19 = load i64*, i64** %5
%20 = load i64*, i64** %6
%21 = load i32, i32* %7
%22 = load i32, i32* %8
%23 = call i32 @__bitmap_shift_right(i64* %19, i64* %20, i32 %21, i32 %22)
br label %24
24: ; preds = %18, %11
ret void
}

LLVM IR (-O2):
define void @bitmap_shift_right(i64* %0, i64* %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %3, 33
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = load i64, i64* %1
%8 = zext i32 %2 to i64
%9 = lshr i64 %7, %8
store i64 %9, i64* %0
br label %12
10: ; preds = %4
%11 = tail call i32 @__bitmap_shift_right(i64* %0, i64* %1, i32 %2, i32 %3)
br label %12
12: ; preds = %10, %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void CreateIOCTLSampleHeader(FILE *File) {
  fprintf(File,
          "#ifndef\tPPJOY_IOCTL_DEVNAME\n"
          "#define\tPPJOY_IOCTL_DEVNAME\t\"\\\\\\\\.\\\\"
          "PPJoyIOCTL%d"
          "\"\n"
          "#endif\n",
          1);
}


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

x86 assembly (clang, -O2):
<CreateIOCTLSampleHeader>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [86 x i8] c"#ifndef\09PPJOY_IOCTL_DEVNAME\0A#define\09PPJOY_IOCTL_DEVNAME\09\22\\\\\\\\.\\\\PPJoyIOCTL%d\22\0A#endif\0A\00"
define void @CreateIOCTLSampleHeader(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [86 x i8] c"#ifndef\09PPJOY_IOCTL_DEVNAME\0A#define\09PPJOY_IOCTL_DEVNAME\09\22\\\\\\\\.\\\\PPJoyIOCTL%d\22\0A#endif\0A\00"
define void @CreateIOCTLSampleHeader(i32* nocapture %0) {
%2 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ convexHullDestroy();
int /*<<< orphan*/ exportHull();
void convexDestroyHull() {
  convexHullDestroy();
  exportHull();
}


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

x86 assembly (clang, -O2):
<convexDestroyHull>:
push   %rax
xor    %eax,%eax
call   1040 <convexHullDestroy@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <exportHull@plt>

LLVM IR (-O0):
define void @convexDestroyHull() {
%1 = call i32 (...) @convexHullDestroy()
%2 = call i32 (...) @exportHull()
ret void
}

LLVM IR (-O2):
define void @convexDestroyHull() {
%1 = tail call i32 (...) @convexHullDestroy()
%2 = tail call i32 (...) @exportHull()
ret void
}
void mat3_identity(float *dst) {
  dst[0] = 1;
  dst[1] = 0;
  dst[2] = 0;
  dst[3] = 0;
  dst[4] = 1;
  dst[5] = 0;
  dst[6] = 0;
  dst[7] = 0;
  dst[8] = 1;
}


x86 assembly (clang, -O0):
<mat3_identity>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  0xeec(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
movss  0xeb8(%rip),%xmm0
movss  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x14(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x1c(%rax)
mov    -0x8(%rbp),%rax
movss  0xe83(%rip),%xmm0
movss  %xmm0,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat3_identity>:
movss  0xef8(%rip),%xmm0
movups %xmm0,(%rdi)
movups %xmm0,0x10(%rdi)
movl   $0x3f800000,0x20(%rdi)
ret

LLVM IR (-O0):
define void @mat3_identity(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
store float 1.000000e+00, float* %4
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 1
store float 0.000000e+00, float* %6
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 2
store float 0.000000e+00, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 3
store float 0.000000e+00, float* %10
%11 = load float*, float** %2
%12 = getelementptr inbounds float, float* %11, i64 4
store float 1.000000e+00, float* %12
%13 = load float*, float** %2
%14 = getelementptr inbounds float, float* %13, i64 5
store float 0.000000e+00, float* %14
%15 = load float*, float** %2
%16 = getelementptr inbounds float, float* %15, i64 6
store float 0.000000e+00, float* %16
%17 = load float*, float** %2
%18 = getelementptr inbounds float, float* %17, i64 7
store float 0.000000e+00, float* %18
%19 = load float*, float** %2
%20 = getelementptr inbounds float, float* %19, i64 8
store float 1.000000e+00, float* %20
ret void
}

LLVM IR (-O2):
define void @mat3_identity(float* nocapture writeonly %0) {
%2 = bitcast float* %0 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00>, <4 x float>* %2
%3 = getelementptr inbounds float, float* %0, i64 4
%4 = bitcast float* %3 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00>, <4 x float>* %4
%5 = getelementptr inbounds float, float* %0, i64 8
store float 1.000000e+00, float* %5
ret void
}
/* Type definitions */
struct array {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ array_add(struct array *, int);
int /*<<< orphan*/ array_init(struct array *, int);
void pqmax_init(struct array *a) {
  array_init(a, 10);
  array_add(a, -1);
}


x86 assembly (clang, -O0):
<pqmax_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1040 <array_init@plt>
mov    -0x8(%rbp),%rdi
mov    $0xffffffff,%esi
call   1030 <array_add@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pqmax_init>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%esi
call   1040 <array_init@plt>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
pop    %rbx
jmp    1030 <array_add@plt>

LLVM IR (-O0):
%struct.array = type { i32 }
define void @pqmax_init(%struct.array* %0) {
%2 = alloca %struct.array*
store %struct.array* %0, %struct.array** %2
%3 = load %struct.array*, %struct.array** %2
%4 = call i32 @array_init(%struct.array* %3, i32 10)
%5 = load %struct.array*, %struct.array** %2
%6 = call i32 @array_add(%struct.array* %5, i32 -1)
ret void
}

LLVM IR (-O2):
%struct.array = type { i32 }
define void @pqmax_init(%struct.array* %0) {
%2 = tail call i32 @array_init(%struct.array* %0, i32 10)
%3 = tail call i32 @array_add(%struct.array* %0, i32 -1)
ret void
}
void REMR3DisasEnableStepping(void) {}


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

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

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

LLVM IR (-O2):
define void @REMR3DisasEnableStepping() {
ret void
}
char *strlwr(char *s) {
  if (s == ((void *)0)) {
    assert(0);
    return s;
  }
  while (*s) {
    *s = tolower(*s);
    s++;
  }
  return s;
}


x86 assembly (clang, -O0):
<strlwr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114d <strlwr+0x2d>
xor    %edi,%edi
mov    $0x0,%al
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    118c <strlwr+0x6c>
jmp    1152 <strlwr+0x32>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1184 <strlwr+0x64>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1152 <strlwr+0x32>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlwr>:
push   %rbx
test   %rdi,%rdi
je     1148 <strlwr+0x28>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1153 <strlwr+0x33>
nop
movsbl %al,%edi
call   1040 <tolower@plt>
mov    %al,(%rbx)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strlwr+0x10>
jmp    1153 <strlwr+0x33>
xor    %ebx,%ebx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @strlwr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 0)
%8 = load i8*, i8** %3
store i8* %8, i8** %2
br label %25
9: ; preds = %1
br label %10
10: ; preds = %14, %9
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %23
14: ; preds = %10
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = call i32 @tolower(i32 %17)
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %3
store i8 %19, i8* %20
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
br label %10
23: ; preds = %10
%24 = load i8*, i8** %3
store i8* %24, i8** %2
br label %25
25: ; preds = %23, %6
%26 = load i8*, i8** %2
ret i8* %26
}

LLVM IR (-O2):
define i8* @strlwr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %17, label %8
6: ; preds = %1
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 0)
br label %17
8: ; preds = %3, %8
%9 = phi i8 [ %15, %8 ], [ %4, %3 ]
%10 = phi i8* [ %14, %8 ], [ %0, %3 ]
%11 = sext i8 %9 to i32
%12 = tail call i32 @tolower(i32 %11)
%13 = trunc i32 %12 to i8
store i8 %13, i8* %10
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %8
17: ; preds = %8, %3, %6
%18 = phi i8* [ null, %6 ], [ %0, %3 ], [ %14, %8 ]
ret i8* %18
}
/* Variables and functions */
int /*<<< orphan*/ test(char **);
int main(int argc, char *argv[]) {
  char *str[] = {"ya", "ng", "ch", "en"};
  test(str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2cd3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2cd0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2ccd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cca(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <test@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0x2cf5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0x2cd9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <test@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"ya\00"
@.str.1 = [3 x i8] c"ng\00"
@.str.2 = [3 x i8] c"ch\00"
@.str.3 = [3 x i8] c"en\00"
@__const.main.str = [4 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i32 0, i32 0)]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [4 x i8*]* %6 to i8*
%8 = getelementptr inbounds [4 x i8*], [4 x i8*]* %6, i64 0, i64 0
%9 = call i32 @test(i8** %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"ya\00"
@.str.1 = [3 x i8] c"ng\00"
@.str.2 = [3 x i8] c"ch\00"
@.str.3 = [3 x i8] c"en\00"
@__const.main.str = [4 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i32 0, i32 0)]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [4 x i8*]
%4 = bitcast [4 x i8*]* %3 to i8*
%5 = getelementptr inbounds [4 x i8*], [4 x i8*]* %3, i64 0, i64 0
%6 = call i32 @test(i8** %5)
ret i32 0
}
unsigned int rowcol2index(unsigned int row, unsigned int col) {
  return row * 4 + col;
}


x86 assembly (clang, -O0):
<rowcol2index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rowcol2index>:
lea    (%rsi,%rdi,4),%eax
ret

LLVM IR (-O0):
define i32 @rowcol2index(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 = mul i32 %5, 4
%7 = load i32, i32* %4
%8 = add i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @rowcol2index(i32 %0, i32 %1) {
%3 = shl i32 %0, 2
%4 = add i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int adder(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("printf:%d\n", adder(1, 2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <adder@plt>
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"printf:%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @adder(i32 1, i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void words(const char *sentence, void (*callback)(const char *, void *),
           void *memo) {
  (*callback)(sentence, memo);
}


x86 assembly (clang, -O0):
<words>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<words>:
mov    %rsi,%rax
mov    %rdx,%rsi
jmp    *%rax

LLVM IR (-O0):
define void @words(i8* %0, void (i8*, i8*)* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca void (i8*, i8*)*
%6 = alloca i8*
store i8* %0, i8** %4
store void (i8*, i8*)* %1, void (i8*, i8*)** %5
store i8* %2, i8** %6
%7 = load void (i8*, i8*)*, void (i8*, i8*)** %5
%8 = load i8*, i8** %4
%9 = load i8*, i8** %6
ret void
}

LLVM IR (-O2):
define void @words(i8* %0, void (i8*, i8*)* nocapture %1, i8* %2) {
tail call void %1(i8* %0, i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
int xrand(char, char);
int write_text(FILE *file) {
  int size;
  int i;
  size = xrand(4, 8);
  for (i = 0; i < size; i++) {
    fputc(xrand('a', 'z'), file);
  }
  return size;
}


x86 assembly (clang, -O0):
<write_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
mov    $0x8,%esi
call   1040 <xrand@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1179 <write_text+0x59>
mov    $0x61,%edi
mov    $0x7a,%esi
call   1040 <xrand@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1145 <write_text+0x25>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_text>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%edi
mov    $0x8,%esi
call   1040 <xrand@plt>
mov    %eax,%r14d
test   %eax,%eax
jle    115e <write_text+0x3e>
mov    %r14d,%ebp
mov    $0x61,%edi
mov    $0x7a,%esi
call   1040 <xrand@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebp
jne    1140 <write_text+0x20>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @write_text(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = call i32 @xrand(i8 signext 4, i8 signext 8)
store i32 %5, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %14, %1
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = call i32 @xrand(i8 signext 97, i8 signext 122)
%12 = load i32*, i32** %2
%13 = call i32 @fputc(i32 %11, i32* %12)
br label %14
14: ; preds = %10
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
br label %6
17: ; preds = %6
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @write_text(i32* nocapture %0) {
%2 = tail call i32 @xrand(i8 signext 4, i8 signext 8)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = tail call i32 @xrand(i8 signext 97, i8 signext 122)
%7 = tail call i32 @fputc(i32 %6, i32* %0)
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %8, %2
br i1 %9, label %10, label %4
10: ; preds = %4, %1
ret i32 %2
}
/* Type definitions */
struct utsname {
  int /*<<< orphan*/ nodename;
};

/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
int /*<<< orphan*/ uname(struct utsname *);
int gethostname(char *name, size_t namelen) {
  struct utsname uts;
  uname(&uts);
  strcpy(name, uts.nodename);
  return 0;
}


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

x86 assembly (clang, -O2):
<gethostname>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
call   1040 <uname@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.utsname = type { i32 }
define i32 @gethostname(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca %struct.utsname
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = call i32 @uname(%struct.utsname* %5)
%7 = load i8*, i8** %3
%8 = getelementptr inbounds %struct.utsname, %struct.utsname* %5, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i32 @strcpy(i8* %7, i32 %9)
ret i32 0
}

LLVM IR (-O2):
%struct.utsname = type { i32 }
define i32 @gethostname(i8* %0, i64 %1) {
%3 = alloca %struct.utsname
%4 = bitcast %struct.utsname* %3 to i8*
%5 = call i32 @uname(%struct.utsname* %3)
%6 = getelementptr inbounds %struct.utsname, %struct.utsname* %3, i64 0, i32 0
%7 = load i32, i32* %6
%8 = tail call i32 @strcpy(i8* %0, i32 %7)
ret i32 0
}
/* Type definitions */
struct MHD_Daemon {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
void run_mhd_poll_loop(struct MHD_Daemon *daemon) {
  (void)daemon;
  abort();
}


x86 assembly (clang, -O0):
<run_mhd_poll_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

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

LLVM IR (-O0):
%struct.MHD_Daemon = type { i32 }
define void @run_mhd_poll_loop(%struct.MHD_Daemon* %0) {
%2 = alloca %struct.MHD_Daemon*
store %struct.MHD_Daemon* %0, %struct.MHD_Daemon** %2
%3 = load %struct.MHD_Daemon*, %struct.MHD_Daemon** %2
%4 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct.MHD_Daemon = type { i32 }
define void @run_mhd_poll_loop(%struct.MHD_Daemon* nocapture readnone %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t pes_get_length(const uint8_t *p_pes) {
  return (p_pes[4] << 8) | p_pes[5];
}


x86 assembly (clang, -O0):
<pes_get_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0x14(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pes_get_length>:
mov    0x10(%rdi),%eax
shl    $0x8,%eax
or     0x14(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @pes_get_length(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i32, i32* %0, i64 5
%6 = load i32, i32* %5
%7 = or i32 %4, %6
ret i32 %7
}
unsigned int get_byte(char b, unsigned int pos) { return (b & (1 << pos)); }


x86 assembly (clang, -O0):
<get_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_byte>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @get_byte(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = and i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @get_byte(i8 signext %0, i32 %1) {
%3 = sext i8 %0 to i32
%4 = shl nuw i32 1, %1
%5 = and i32 %4, %3
ret i32 %5
}