xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned char dxl_read_byte(unsigned char, int);
unsigned char hasRegisteredInstruction(unsigned char id) {
  return dxl_read_byte(id, (44));
}


x86 assembly (clang, -O0):
<hasRegisteredInstruction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x2c,%esi
movzbl -0x1(%rbp),%edi
call   1030 <dxl_read_byte@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasRegisteredInstruction>:
mov    $0x2c,%esi
jmp    1030 <dxl_read_byte@plt>

LLVM IR (-O0):
define zeroext i8 @hasRegisteredInstruction(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call zeroext i8 @dxl_read_byte(i8 zeroext %3, i32 44)
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @hasRegisteredInstruction(i8 zeroext %0) {
%2 = tail call zeroext i8 @dxl_read_byte(i8 zeroext %0, i32 44)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
uge() {
  ol("CMP  BX,AX");
  ol("MOV  AX,1");
  ol("JAE  $+5");
  ol("MOV  AX,0");
}


x86 assembly (clang, -O0):
<uge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
lea    0xee0(%rip),%rdi
call   1030 <ol@plt>
lea    0xede(%rip),%rdi
call   1030 <ol@plt>
lea    0xedb(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uge>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <ol@plt>
lea    0xee7(%rip),%rdi
call   1030 <ol@plt>
lea    0xee5(%rip),%rdi
call   1030 <ol@plt>
lea    0xee2(%rip),%rdi
pop    %rax
jmp    1030 <ol@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"CMP BX,AX\00"
@.str.1 = [10 x i8] c"MOV AX,1\00"
@.str.2 = [9 x i8] c"JAE $+5\00"
@.str.3 = [10 x i8] c"MOV AX,0\00"
define i32 @uge() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @ol(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@.str = [11 x i8] c"CMP BX,AX\00"
@.str.1 = [10 x i8] c"MOV AX,1\00"
@.str.2 = [9 x i8] c"JAE $+5\00"
@.str.3 = [10 x i8] c"MOV AX,0\00"
define i32 @uge() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @ol(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  char *server_port = "5555";
  char *server_ip = "twood02.koding.io";
  printf("Done.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xecd(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%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 = [5 x i8] c"5555\00"
@.str.1 = [18 x i8] c"twood02.koding.io\00"
@.str.2 = [7 x i8] c"Done.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8** %7
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"Done.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct forf_env {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abs(int /*<<< orphan*/);
int /*<<< orphan*/ forf_pop_num(struct forf_env *);
int /*<<< orphan*/ forf_push_num(struct forf_env *, int /*<<< orphan*/);
void forf_proc_abs(struct forf_env *env) {
  forf_push_num(env, abs(forf_pop_num(env)));
}


x86 assembly (clang, -O0):
<forf_proc_abs>:
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 <forf_pop_num@plt>
mov    %eax,%edi
call   1030 <abs@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1050 <forf_push_num@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forf_proc_abs>:
push   %rbx
mov    %rdi,%rbx
call   1030 <forf_pop_num@plt>
mov    %eax,%esi
neg    %esi
cmovs  %eax,%esi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <forf_push_num@plt>

LLVM IR (-O0):
%struct.forf_env = type { i32 }
define void @forf_proc_abs(%struct.forf_env* %0) {
%2 = alloca %struct.forf_env*
store %struct.forf_env* %0, %struct.forf_env** %2
%3 = load %struct.forf_env*, %struct.forf_env** %2
%4 = load %struct.forf_env*, %struct.forf_env** %2
%5 = call i32 @forf_pop_num(%struct.forf_env* %4)
%6 = call i32 @abs(i32 %5)
%7 = call i32 @forf_push_num(%struct.forf_env* %3, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.forf_env = type { i32 }
define void @forf_proc_abs(%struct.forf_env* %0) {
%2 = tail call i32 @forf_pop_num(%struct.forf_env* %0)
%3 = tail call i32 @llvm.abs.i32(i32 %2, i1 true)
%4 = tail call i32 @forf_push_num(%struct.forf_env* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ QuickSort(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ print(int *, int);
int main() {
  int arr[] = {3, 4, 1, 2, 7};
  print(arr, 5);
  QuickSort(arr, 0, 4);
  print(arr, 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1030 <print@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <QuickSort@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xee5(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <print@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <QuickSort@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [5 x i32] [i32 3, i32 4, i32 1, i32 2, i32 7]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
store i32 0, i32* %1
%3 = bitcast [5 x i32]* %2 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%5 = call i32 @print(i32* %4, i32 5)
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%7 = call i32 @QuickSort(i32* %6, i32 0, i32 4)
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%9 = call i32 @print(i32* %8, i32 5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [5 x i32] [i32 3, i32 4, i32 1, i32 2, i32 7]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @print(i32* %3, i32 5)
%5 = call i32 @QuickSort(i32* %3, i32 0, i32 4)
%6 = call i32 @print(i32* %3, i32 5)
ret i32 0
}
/* Variables and functions */
int foo();
int bar() { return foo(); }


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

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

LLVM IR (-O0):
define i32 @bar() {
%1 = call i32 (...) @foo()
ret i32 %1
}

LLVM IR (-O2):
define i32 @bar() {
%1 = tail call i32 (...) @foo()
ret i32 %1
}
int atm_proc_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @atm_proc_init() {
ret i32 0
}
void set_zero(int v[], int n) {
  int i;
  for (i = 0; i < n; i++)
    v[i] = 0;
}


x86 assembly (clang, -O0):
<set_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <set_zero+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <set_zero+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_zero>:
test   %esi,%esi
jle    1126 <set_zero+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @set_zero(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
void rop3_115_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~T;
  stk2 = *D | stk3;
  stk1 = S & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_115_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_115_1_0>:
not    %sil
or     %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_115_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = or i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = xor i32 %28, -1
%30 = trunc i32 %29 to i8
store i8 %30, i8* %7
%31 = load i8, i8* %7
%32 = zext i8 %31 to i32
%33 = load i8, i8* %5
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = load i8*, i8** %4
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = load i8, i8* %5
%41 = zext i8 %40 to i32
%42 = and i32 %39, %41
%43 = or i32 %36, %42
%44 = trunc i32 %43 to i8
%45 = load i8*, i8** %4
store i8 %44, i8* %45
ret void
}

LLVM IR (-O2):
define void @rop3_115_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %1, -1
%6 = or i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
float __infer_nondet_float();
float fmaf(float x, float y, float z) { return __infer_nondet_float(); }


x86 assembly (clang, -O0):
<fmaf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define float @fmaf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = call float (...) @__infer_nondet_float()
ret float %7
}

LLVM IR (-O2):
define float @fmaf(float %0, float %1, float %2) {
%4 = tail call float (...) @__infer_nondet_float()
ret float %4
}
int test(x, m)
int x, m;
{ return ((x & m) ? 1 : 0); }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
and    -0x8(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
xor    %eax,%eax
test   %edi,%esi
setne  %al
ret

LLVM IR (-O0):
define i32 @test(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = and i32 %5, %6
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void test_teardown(void) {}


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

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

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

LLVM IR (-O2):
define void @test_teardown() {
ret void
}
void DBGFR3RegFormatValue(void) {}


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

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

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

LLVM IR (-O2):
define void @DBGFR3RegFormatValue() {
ret void
}
/* Variables and functions */
int dump_proto_sram(char const *);
int proto_sram_op(int argc, char *argv[], int start_arg, const char *iff_name) {
  if (argc == start_arg)
    return dump_proto_sram(iff_name);
  return -1;
}


x86 assembly (clang, -O0):
<proto_sram_op>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    1143 <proto_sram_op+0x33>
mov    -0x20(%rbp),%rdi
call   1030 <dump_proto_sram@plt>
mov    %eax,-0x4(%rbp)
jmp    114a <proto_sram_op+0x3a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proto_sram_op>:
cmp    %edx,%edi
jne    111c <proto_sram_op+0xc>
mov    %rcx,%rdi
jmp    1030 <dump_proto_sram@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @proto_sram_op(i32 %0, i8** nocapture readnone %1, i32 %2, i8* %3) {
%5 = icmp eq i32 %0, %2
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @dump_proto_sram(i8* %3)
br label %8
8: ; preds = %4, %6
%9 = phi i32 [ %7, %6 ], [ -1, %4 ]
ret i32 %9
}
void setval_177(unsigned *p) { *p = 3682910921U; }


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

x86 assembly (clang, -O2):
<setval_177>:
movl   $0xdb84c2c9,(%rdi)
ret

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

LLVM IR (-O2):
define void @setval_177(i32* nocapture writeonly %0) {
store i32 -612056375, i32* %0
ret void
}
/* Variables and functions */
int A(int);
int C(int x) { return A(x | ~0xff); }


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

x86 assembly (clang, -O2):
<C>:
or     $0xffffff00,%edi
jmp    1030 <A@plt>

LLVM IR (-O0):
define i32 @C(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = or i32 %3, -256
%5 = call i32 @A(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @C(i32 %0) {
%2 = or i32 %0, -256
%3 = tail call i32 @A(i32 %2)
ret i32 %3
}
int SCEDA_heap_max_degree(unsigned int n) {
  int res = 0;
  while (n != 0) {
    n >>= 1;
    res++;
  }
  res += res >> 1;
  return res;
}


x86 assembly (clang, -O0):
<SCEDA_heap_max_degree>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <SCEDA_heap_max_degree+0x2f>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <SCEDA_heap_max_degree+0xe>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SCEDA_heap_max_degree>:
xor    %ecx,%ecx
test   %edi,%edi
je     111c <SCEDA_heap_max_degree+0x1c>
mov    %edi,%eax
nopl   0x0(%rax,%rax,1)
shr    %eax
add    $0x1,%ecx
cmp    $0x1,%edi
mov    %eax,%edi
ja     1110 <SCEDA_heap_max_degree+0x10>
mov    %ecx,%eax
shr    %eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @SCEDA_heap_max_degree(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
%11 = lshr i32 %10, 1
%12 = add nuw nsw i32 %11, %10
ret i32 %12
}
/* Variables and functions */
int square(int);
shit(int a) { return square(a) + square(a); }


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

x86 assembly (clang, -O2):
<shit>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <square@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <square@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @shit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @square(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @square(i32 %5)
%7 = add nsw i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @shit(i32 %0) {
%2 = tail call i32 @square(i32 %0)
%3 = tail call i32 @square(i32 %0)
%4 = add nsw i32 %3, %2
ret i32 %4
}
void panic_halt_system() {}


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

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

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

LLVM IR (-O2):
define void @panic_halt_system() {
ret void
}
/* Type definitions */
struct drm_file {
  int dummy;
};
struct drm_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ DRM_DEBUG(char *);
int /*<<< orphan*/ LOCK_TEST_WITH_RETURN(struct drm_device *,
                                         struct drm_file *);
int radeon_do_engine_reset(struct drm_device *);
int radeon_engine_reset(struct drm_device *dev, void *data,
                        struct drm_file *file_priv) {
  DRM_DEBUG("\n");
  LOCK_TEST_WITH_RETURN(dev, file_priv);
  return radeon_do_engine_reset(dev);
}


x86 assembly (clang, -O0):
<radeon_engine_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xeb5(%rip),%rdi
call   1050 <DRM_DEBUG@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <LOCK_TEST_WITH_RETURN@plt>
mov    -0x8(%rbp),%rdi
call   1040 <radeon_do_engine_reset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radeon_engine_reset>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
lea    0xebf(%rip),%rdi
call   1050 <DRM_DEBUG@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <LOCK_TEST_WITH_RETURN@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <radeon_do_engine_reset@plt>

LLVM IR (-O0):
%struct.drm_device = type { i32 }
%struct.drm_file = type { i32 }
@.str = [2 x i8] c"\0A\00"
define i32 @radeon_engine_reset(%struct.drm_device* %0, i8* %1, %struct.drm_file* %2) {
%4 = alloca %struct.drm_device*
%5 = alloca i8*
%6 = alloca %struct.drm_file*
store %struct.drm_device* %0, %struct.drm_device** %4
store i8* %1, i8** %5
store %struct.drm_file* %2, %struct.drm_file** %6
%7 = call i32 @DRM_DEBUG(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = load %struct.drm_device*, %struct.drm_device** %4
%9 = load %struct.drm_file*, %struct.drm_file** %6
%10 = call i32 @LOCK_TEST_WITH_RETURN(%struct.drm_device* %8, %struct.drm_file* %9)
%11 = load %struct.drm_device*, %struct.drm_device** %4
%12 = call i32 @radeon_do_engine_reset(%struct.drm_device* %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.drm_device = type { i32 }
%struct.drm_file = type { i32 }
@.str = [2 x i8] c"\0A\00"
define i32 @radeon_engine_reset(%struct.drm_device* %0, i8* nocapture readnone %1, %struct.drm_file* %2) {
%4 = tail call i32 @DRM_DEBUG(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @LOCK_TEST_WITH_RETURN(%struct.drm_device* %0, %struct.drm_file* %2)
%6 = tail call i32 @radeon_do_engine_reset(%struct.drm_device* %0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
void sprint_ret(char *str) { sprintf(str, "RET                             "); }


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

x86 assembly (clang, -O2):
<sprint_ret>:
movups 0xf09(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movups 0xeee(%rip),%xmm0
movups %xmm0,(%rdi)
movb   $0x0,0x20(%rdi)
ret

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

LLVM IR (-O2):
@.str = [33 x i8] c"RET \00"
define void @sprint_ret(i8* nocapture writeonly %0) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(33) %0, i8* align 1 dereferenceable(33) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 33, i1 false)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  printf("A question mark: %c\n", '?');
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [21 x i8] c"A question mark: %c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8 signext 63)
ret i32 0
}
/* Variables and functions */
void *malloc(int);
void init_mo(int nb) {
  void *p;
  int i, j;
  for (i = 0; i < nb; i++) {
    for (j = 0; j < (1 << 20); j += (1 << 12)) {
      p = malloc((1 << 12) - 16);
    }
  }
}


x86 assembly (clang, -O0):
<init_mo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1173 <init_mo+0x63>
movl   $0x0,-0x18(%rbp)
cmpl   $0x100000,-0x18(%rbp)
jge    1160 <init_mo+0x50>
mov    $0xff0,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1000,%eax
mov    %eax,-0x18(%rbp)
jmp    1135 <init_mo+0x25>
jmp    1165 <init_mo+0x55>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1122 <init_mo+0x12>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @init_mo(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
br label %6
6: ; preds = %20, %1
%7 = load i32, i32* %4
%8 = load i32, i32* %2
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %23
10: ; preds = %6
store i32 0, i32* %5
br label %11
11: ; preds = %16, %10
%12 = load i32, i32* %5
%13 = icmp slt i32 %12, 1048576
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = call i8* @malloc(i32 4080)
store i8* %15, i8** %3
br label %16
16: ; preds = %14
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 4096
store i32 %18, i32* %5
br label %11
19: ; preds = %11
br label %20
20: ; preds = %19
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %6
23: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @init_mo(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fortchartoc(char *);
int /*<<< orphan*/ gmvwrite_surface_fromfile(int /*<<< orphan*/, long);
void fgmvwrite_surface_fromfile_(char filnam[], long nsrf) {
  gmvwrite_surface_fromfile(fortchartoc(filnam), nsrf);
}


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

x86 assembly (clang, -O2):
<fgmvwrite_surface_fromfile_>:
push   %rbx
mov    %rsi,%rbx
call   1030 <fortchartoc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <gmvwrite_surface_fromfile@plt>

LLVM IR (-O0):
define void @fgmvwrite_surface_fromfile_(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 = call i32 @fortchartoc(i8* %5)
%7 = load i64, i64* %4
%8 = call i32 @gmvwrite_surface_fromfile(i32 %6, i64 %7)
ret void
}

LLVM IR (-O2):
define void @fgmvwrite_surface_fromfile_(i8* %0, i64 %1) {
%3 = tail call i32 @fortchartoc(i8* %0)
%4 = tail call i32 @gmvwrite_surface_fromfile(i32 %3, i64 %1)
ret void
}
void errexit(s) const char *s;
{
  write(2, "\n", 1);
  perror(s);
  getout(0);
}


x86 assembly (clang, -O0):
<errexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%edi
lea    0xeb8(%rip),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1040 <write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <perror@plt>
xor    %edi,%edi
mov    $0x0,%al
call   1030 <getout@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errexit>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
mov    $0x2,%edi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <write@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <perror@plt>
xor    %edi,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <getout@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @errexit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* %4)
%6 = call i32 (i32, ...) bitcast (i32 (...)* @getout to i32 (i32, ...)*)(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @errexit(i8* %0) {
%2 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* %0)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @getout to i32 (i32, ...)*)(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dotvv(double const *, double const *);
double sqrt(int /*<<< orphan*/);
double lengthv(const double *v) { return sqrt(dotvv(v, v)); }


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

x86 assembly (clang, -O2):
<lengthv>:
push   %rax
mov    %rdi,%rsi
call   1030 <dotvv@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

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

LLVM IR (-O2):
define double @lengthv(double* %0) {
%2 = tail call i32 @dotvv(double* %0, double* %0)
%3 = tail call double @sqrt(i32 %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ show_error(char *);
char *strdup(char const *);
char *xstrdup(const char *s) {
  char *tmp;
  if (!s)
    return NULL;
  if (!(tmp = strdup(s)))
    show_error("Out of memory");
  return tmp;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <xstrdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    116f <xstrdup+0x4f>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1167 <xstrdup+0x47>
lea    0xe9e(%rip),%rdi
call   1030 <show_error@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rax
test   %rdi,%rdi
je     113e <xstrdup+0x1e>
call   1040 <strdup@plt>
test   %rax,%rax
je     1132 <xstrdup+0x12>
pop    %rcx
ret
lea    0xec7(%rip),%rdi
call   1030 <show_error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
store i8* null, i8** %2
br label %16
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i8* @strdup(i8* %9)
store i8* %10, i8** %4
%11 = icmp ne i8* %10, null
br i1 %11, label %14, label %12
12: ; preds = %8
%13 = call i32 @show_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %8
%15 = load i8*, i8** %4
store i8* %15, i8** %2
br label %16
16: ; preds = %14, %7
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define noalias i8* @xstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @show_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %3, %6, %1
%9 = phi i8* [ null, %1 ], [ null, %6 ], [ %4, %3 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ get_lexval();
int /*<<< orphan*/ translation_unit();
int yyselect();
YYSTART() {
  switch (yyselect()) {
  case 103: {
    translation_unit();
    get_lexval();
  } break;
  }
}


x86 assembly (clang, -O0):
<YYSTART>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <yyselect@plt>
sub    $0x67,%eax
jne    115b <YYSTART+0x2b>
jmp    114d <YYSTART+0x1d>
mov    $0x0,%al
call   1050 <translation_unit@plt>
mov    $0x0,%al
call   1040 <get_lexval@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<YYSTART>:
push   %rax
xor    %eax,%eax
call   1030 <yyselect@plt>
cmp    $0x67,%eax
jne    114b <YYSTART+0x1b>
xor    %eax,%eax
call   1050 <translation_unit@plt>
xor    %eax,%eax
call   1040 <get_lexval@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @YYSTART() {
%1 = alloca i32
%2 = call i32 (...) @yyselect()
switch i32 %2, label %6 [
i32 103, label %3
]
3: ; preds = %0
%4 = call i32 (...) @translation_unit()
%5 = call i32 (...) @get_lexval()
br label %6
6: ; preds = %0, %3
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @YYSTART() {
%1 = tail call i32 (...) @yyselect()
%2 = icmp eq i32 %1, 103
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 (...) @translation_unit()
%5 = tail call i32 (...) @get_lexval()
br label %6
6: ; preds = %0, %3
ret i32 undef
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int copy_dobldobl_Laurent_container_to_target_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(781, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<copy_dobldobl_Laurent_container_to_target_system>:
mov    $0x30d,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @copy_dobldobl_Laurent_container_to_target_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 781, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("readpartition <options>\n"
         " -d /path/to/dev set device to read/write\n"
         " -h this screen\n"
         " -s set swap bytes on\n"
         " -w After reading drive, write the modified boot block back.\n"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [167 x i8] c"readpartition <options>\0A -d /path/to/dev set device to read/write\0A -h this screen\0A -s set swap bytes on\0A -w After reading drive, write the modified boot block back.\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [166 x i8] c"readpartition <options>\0A -d /path/to/dev set device to read/write\0A -h this screen\0A -s set swap bytes on\0A -w After reading drive, write the modified boot block back.\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([166 x i8], [166 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ system(char *);
int trap(int *, int);
int main() {
  int bar[] = {2, 0, 2};
  printf("%d\n", trap(bar, 3));
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeb8(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1050 <trap@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
lea    0xe9a(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xece(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xebb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x3,%esi
call   1050 <trap@plt>
lea    0xeac(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xea2(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.bar = [3 x i32] [i32 2, i32 0, i32 2]
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32 @trap(i32* %3, i32 3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void os_thread_sleep(int s) { sleep(s); }


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

x86 assembly (clang, -O2):
<os_thread_sleep>:
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define void @os_thread_sleep(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret void
}
void adis16204_unconfigure_ring(struct iio_dev *indio_dev) {}


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

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

LLVM IR (-O0):
%struct.iio_dev = type opaque
define void @adis16204_unconfigure_ring(%struct.iio_dev* %0) {
%2 = alloca %struct.iio_dev*
store %struct.iio_dev* %0, %struct.iio_dev** %2
ret void
}

LLVM IR (-O2):
%struct.iio_dev = type opaque
define void @adis16204_unconfigure_ring(%struct.iio_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main() {
  int c;
  c = getchar();
  c = -1;
  while (c != EOF) {
    putchar(c);
    c = getchar();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%eax
je     1169 <main+0x49>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
jmp    1140 <main+0x20>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmpl   $0xffffffff,(%rbx)
je     1152 <main+0x32>
mov    $0xffffffff,%eax
nopl   0x0(%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @getchar()
store i32 %3, i32* %2
store i32 -1, i32* %2
br label %4
4: ; preds = %8, %0
%5 = load i32, i32* %2
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i32, i32* %2
%10 = call i32 @putchar(i32 %9)
%11 = call i32 (...) @getchar()
store i32 %11, i32* %2
br label %4
12: ; preds = %4
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %2, -1
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ -1, %0 ]
%6 = tail call i32 @putchar(i32 %5)
%7 = tail call i32 (...) @getchar()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main(int argc, char **argv) {
  if (argc == 2) {
    assert(argv[1][0] != 'a');
  }
  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)
cmpl   $0x2,-0x8(%rbp)
jne    114b <main+0x3b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jne    112c <main+0x1c>
push   %rax
mov    0x8(%rsi),%rax
xor    %edi,%edi
cmpb   $0x61,(%rax)
setne  %dil
call   1030 <assert@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %18
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 97
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
br label %18
18: ; preds = %8, %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 97
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
br label %11
11: ; preds = %4, %2
ret i32 0
}
/* Variables and functions */
char *cat(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("Hello C89!\n");
  char *email = cat("chrinkus", "hotmail");
  printf("%s\n", email);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0xece(%rip),%rsi
call   1040 <cat@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Hello C89!\0A\00"
@.str.1 = [9 x i8] c"chrinkus\00"
@.str.2 = [8 x i8] c"hotmail\00"
@.str.3 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = call i8* @cat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"chrinkus\00"
@.str.2 = [8 x i8] c"hotmail\00"
@str = [11 x i8] c"Hello C89!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = tail call i8* @cat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) %2)
ret i32 0
}
/* Variables and functions */
long CommandWaitComplete(unsigned long);
signed long CommandInitialize(unsigned long dCoderId) {
  signed long sdRet;
  sdRet = CommandWaitComplete(dCoderId);
  return sdRet;
}


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

x86 assembly (clang, -O2):
<CommandInitialize>:
jmp    1030 <CommandWaitComplete@plt>

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

LLVM IR (-O2):
define i64 @CommandInitialize(i64 %0) {
%2 = tail call i64 @CommandWaitComplete(i64 %0)
ret i64 %2
}
void ice_dcbnl_flush_apps(struct ice_pf *pf, struct ice_dcbx_cfg *old_cfg,
                          struct ice_dcbx_cfg *new_cfg) {}


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

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

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

LLVM IR (-O2):
%struct.ice_pf = type opaque
%struct.ice_dcbx_cfg = type opaque
define void @ice_dcbnl_flush_apps(%struct.ice_pf* nocapture %0, %struct.ice_dcbx_cfg* nocapture %1, %struct.ice_dcbx_cfg* nocapture %2) {
ret void
}