xunge/DecIR huggingface dataset:
void init_board(int board[20][40]) {
  int i, j;
  for (i = 0; i < 20; i++)
    for (j = 0; j < 40; j++)
      board[i][j] = 0;
}


x86 assembly (clang, -O0):
<init_board>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    1168 <init_board+0x68>
movl   $0x0,-0x10(%rbp)
cmpl   $0x28,-0x10(%rbp)
jge    1155 <init_board+0x55>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0xa0,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <init_board+0x20>
jmp    115a <init_board+0x5a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <init_board+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_board>:
push   %rax
mov    $0xc80,%edx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @init_board([40 x i32]* nocapture writeonly %0) {
%2 = bitcast [40 x i32]* %0 to i8*
ret void
}
void foo459() {}


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

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

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

LLVM IR (-O2):
define void @foo459() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ test_align();
int /*<<< orphan*/ test_pointer();
int /*<<< orphan*/ test_signed();
int /*<<< orphan*/ test_storage_class();
int /*<<< orphan*/ test_type();
int /*<<< orphan*/ test_typedef();
int /*<<< orphan*/ test_unsigned();
int /*<<< orphan*/ test_unusual_order();
void testmain() {
  print("type system");
  test_type();
  test_signed();
  test_unsigned();
  test_storage_class();
  test_pointer();
  test_unusual_order();
  test_typedef();
  test_align();
}


x86 assembly (clang, -O0):
<testmain>:
push   %rbp
mov    %rsp,%rbp
lea    0xe65(%rip),%rdi
call   1060 <print@plt>
mov    $0x0,%al
call   1090 <test_type@plt>
mov    $0x0,%al
call   1070 <test_signed@plt>
mov    $0x0,%al
call   1030 <test_unsigned@plt>
mov    $0x0,%al
call   1040 <test_storage_class@plt>
mov    $0x0,%al
call   10a0 <test_pointer@plt>
mov    $0x0,%al
call   1050 <test_unusual_order@plt>
mov    $0x0,%al
call   1080 <test_typedef@plt>
mov    $0x0,%al
call   10b0 <test_align@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testmain>:
push   %rax
lea    0xe68(%rip),%rdi
call   1060 <print@plt>
xor    %eax,%eax
call   1090 <test_type@plt>
xor    %eax,%eax
call   1070 <test_signed@plt>
xor    %eax,%eax
call   1030 <test_unsigned@plt>
xor    %eax,%eax
call   1040 <test_storage_class@plt>
xor    %eax,%eax
call   10a0 <test_pointer@plt>
xor    %eax,%eax
call   1050 <test_unusual_order@plt>
xor    %eax,%eax
call   1080 <test_typedef@plt>
xor    %eax,%eax
pop    %rcx
jmp    10b0 <test_align@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"type system\00"
define void @testmain() {
%1 = call i32 @print(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @test_type()
%3 = call i32 (...) @test_signed()
%4 = call i32 (...) @test_unsigned()
%5 = call i32 (...) @test_storage_class()
%6 = call i32 (...) @test_pointer()
%7 = call i32 (...) @test_unusual_order()
%8 = call i32 (...) @test_typedef()
%9 = call i32 (...) @test_align()
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"type system\00"
define void @testmain() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @test_type()
%3 = tail call i32 (...) @test_signed()
%4 = tail call i32 (...) @test_unsigned()
%5 = tail call i32 (...) @test_storage_class()
%6 = tail call i32 (...) @test_pointer()
%7 = tail call i32 (...) @test_unusual_order()
%8 = tail call i32 (...) @test_typedef()
%9 = tail call i32 (...) @test_align()
ret void
}
/* Variables and functions */
float expf(float);
float sigmoid(float x) { return 1.f / (1.f + expf(-0.007f * x)); }


x86 assembly (clang, -O0):
<sigmoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedf(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
call   1030 <expf@plt>
movss  0xec9(%rip),%xmm1
addss  %xmm0,%xmm1
movss  0xebd(%rip),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigmoid>:
push   %rax
mulss  0xee7(%rip),%xmm0
call   1030 <expf@plt>
movss  0xede(%rip),%xmm1
addss  %xmm1,%xmm0
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sigmoid(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float 0xBF7CAC0840000000, %3
%5 = call float @expf(float %4)
%6 = fadd float 1.000000e+00, %5
%7 = fdiv float 1.000000e+00, %6
ret float %7
}

LLVM IR (-O2):
define float @sigmoid(float %0) {
%2 = fmul float %0, 0xBF7CAC0840000000
%3 = tail call float @expf(float %2)
%4 = fadd float %3, 1.000000e+00
%5 = fdiv float 1.000000e+00, %4
ret float %5
}
unsigned xrop3_1_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T | S;
  stk1 = D | stk2;
  stk1 = ~stk1;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_1_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_1_0_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
mov    %esi,%edx
shl    $0x8,%edx
lea    (%rdx,%rsi,1),%eax
or     %ecx,%edx
xor    $0xffffff00,%edx
not    %eax
and    %edx,%eax
not    %edi
and    %esi,%edi
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_1_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = or i32 %6, %5
%8 = or i32 %6, %4
%9 = xor i32 %8, -256
%10 = xor i32 %7, -1
%11 = and i32 %9, %10
%12 = xor i32 %3, -1
%13 = and i32 %12, %5
%14 = or i32 %11, %13
ret i32 %14
}
/* Variables and functions */
size_t RAND_MAX;
size_t rand();
size_t rand_lim(size_t limit) {
  size_t divisor = RAND_MAX / (limit);
  size_t random;
  do {
    random = rand() / divisor;
  } while (random > limit);
  return random;
}


x86 assembly (clang, -O0):
<rand_lim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
ja     1132 <rand_lim+0x22>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_lim>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    0x2eca(%rip),%rax
mov    (%rax),%rax
mov    %rax,%rcx
or     %rdi,%rcx
shr    $0x20,%rcx
je     1137 <rand_lim+0x27>
xor    %edx,%edx
div    %r14
mov    %rax,%rbx
jmp    114a <rand_lim+0x3a>
xor    %edx,%edx
div    %r14d
mov    %eax,%ebx
jmp    114a <rand_lim+0x3a>
xor    %edx,%edx
div    %rbx
cmp    %r14,%rax
jbe    1166 <rand_lim+0x56>
xor    %eax,%eax
call   1030 <rand@plt>
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
jne    1140 <rand_lim+0x30>
xor    %edx,%edx
div    %ebx
cmp    %r14,%rax
ja     114a <rand_lim+0x3a>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i64 @rand_lim(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* @RAND_MAX
%6 = load i64, i64* %2
%7 = udiv i64 %5, %6
store i64 %7, i64* %3
br label %8
8: ; preds = %12, %1
%9 = call i64 (...) @rand()
%10 = load i64, i64* %3
%11 = udiv i64 %9, %10
store i64 %11, i64* %4
br label %12
12: ; preds = %8
%13 = load i64, i64* %4
%14 = load i64, i64* %2
%15 = icmp ugt i64 %13, %14
br i1 %15, label %8, label %16
16: ; preds = %12
%17 = load i64, i64* %4
ret i64 %17
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i64 @rand_lim(i64 %0) {
%2 = load i64, i64* @RAND_MAX
%3 = udiv i64 %2, %0
br label %4
4: ; preds = %4, %1
%5 = tail call i64 (...) @rand()
%6 = udiv i64 %5, %3
%7 = icmp ugt i64 %6, %0
br i1 %7, label %4, label %8
8: ; preds = %4
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p256_sub(uintptr_t, uintptr_t, uintptr_t);
void fiat_p256_sub(uint64_t out1[4], const uint64_t arg1[4],
                   const uint64_t arg2[4]) {
  internal_fiat_p256_sub((uintptr_t)out1, (uintptr_t)arg1, (uintptr_t)arg2);
}


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

x86 assembly (clang, -O2):
<fiat_p256_sub>:
jmp    1030 <internal_fiat_p256_sub@plt>

LLVM IR (-O0):
define void @fiat_p256_sub(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = call i32 @internal_fiat_p256_sub(i64 %8, i64 %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @fiat_p256_sub(i32* %0, i32* %1, i32* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = tail call i32 @internal_fiat_p256_sub(i64 %4, i64 %5, i64 %6)
ret void
}
void store_double(double *dp, double x) { *dp = x; }


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

x86 assembly (clang, -O2):
<store_double>:
movsd  %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @store_double(double* nocapture writeonly %0, double %1) {
store double %1, double* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BootInit();
int /*<<< orphan*/ BootTask();
int /*<<< orphan*/ Init();
int main(void) {
  Init();
  BootInit();
  while (1) {
    BootTask();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <Init@plt>
mov    $0x0,%al
call   1030 <BootInit@plt>
mov    $0x0,%al
call   1050 <BootTask@plt>
jmp    114d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <Init@plt>
xor    %eax,%eax
call   1030 <BootInit@plt>
nop
xor    %eax,%eax
call   1050 <BootTask@plt>
jmp    1140 <main+0x10>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @Init()
%2 = tail call i32 (...) @BootInit()
br label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @BootTask()
br label %3
}
void RTUtf16Cmp(void) {}


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

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

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

LLVM IR (-O2):
define void @RTUtf16Cmp() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ display_X11_open_screen(int);
void display_open_screen(int num) { display_X11_open_screen(num); }


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

x86 assembly (clang, -O2):
<display_open_screen>:
jmp    1030 <display_X11_open_screen@plt>

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

LLVM IR (-O2):
define void @display_open_screen(i32 %0) {
%2 = tail call i32 @display_X11_open_screen(i32 %0)
ret void
}
int test_imm_2Dint16_mem(short *val) {
  return ((*val) & (-0x2D << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_2Dint16_mem>:
movzwl (%rdi),%eax
test   $0xffd3,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_2Dint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -45
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
_Complex double test1() { return __extension__ 1.0if; }


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x10(%rbp)
movabs $0x3ff0000000000000,%rax
mov    %rax,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
movsd  0xef8(%rip),%xmm1
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define { double, double } @test1() {
%1 = alloca { double, double }
%2 = getelementptr inbounds { double, double }, { double, double }* %1, i32 0, i32 0
%3 = getelementptr inbounds { double, double }, { double, double }* %1, i32 0, i32 1
store double 0.000000e+00, double* %2
store double 1.000000e+00, double* %3
%4 = load { double, double }, { double, double }* %1
ret { double, double } %4
}

LLVM IR (-O2):
define { double, double } @test1() {
ret { double, double } { double 0.000000e+00, double 1.000000e+00 }
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
uint64_t ulabs(int64_t n) { return (n < 0) ? -n : n; }


x86 assembly (clang, -O0):
<ulabs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <ulabs+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <ulabs+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ulabs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int square(int);
int main(int argc, char *argv[]) {
  printf("hello, world\n");
  printf("Square 2 = %d\n", square(2));
  exit(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)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x2,%edi
call   1030 <square@plt>
mov    %eax,%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1040 <square@plt>
lea    0xea2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"hello, world\0A\00"
@.str.1 = [15 x i8] c"Square 2 = %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 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @square(i32 2)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.1 = [15 x i8] c"Square 2 = %d\0A\00"
@str = [13 x i8] c"hello, world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @square(i32 2)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = tail call i32 @exit(i32 0)
unreachable
}
void delay_loop(unsigned int c) {
  while (c) {
    c--;
  }
}


x86 assembly (clang, -O0):
<delay_loop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111f <delay_loop+0x1f>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <delay_loop+0x7>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay_loop(i32 %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uid_t;

/* Variables and functions */
int setuid(scalar_t__);
int test(void) {
  uid_t uid;
  int result;
  uid = 0;
  result = setuid(uid);
  return result;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <setuid@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
xor    %edi,%edi
jmp    1030 <setuid@plt>

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

LLVM IR (-O2):
define i32 @test() {
%1 = tail call i32 @setuid(i64 0)
ret i32 %1
}
int IntSize(void) { return sizeof(int); }


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

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

LLVM IR (-O0):
define i32 @IntSize() {
ret i32 4
}

LLVM IR (-O2):
define i32 @IntSize() {
ret i32 4
}
int sumIter(int n) {
  int sum = 0, i;
  for (i = 1; i <= n; i++) {
    sum += i;
  }
  return sum;
}


x86 assembly (clang, -O0):
<sumIter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1138 <sumIter+0x38>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <sumIter+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumIter>:
test   %edi,%edi
jle    1118 <sumIter+0x18>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rdi,2),%eax
add    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sumIter(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = shl nuw i32 %0, 1
%5 = add nsw i32 %0, -1
%6 = zext i32 %5 to i33
%7 = add nsw i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %4, %11
%13 = add i32 %12, -1
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
int call_sys(int num) {
  int fail;
  asm volatile("movl %1, %%eax\n\t"
               "int $0x80"
               : "=a"(fail)
               : "g"(num));
  return fail;
}


x86 assembly (clang, -O0):
<call_sys>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
int    $0x80
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_sys>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
int    $0x80
ret

LLVM IR (-O0):
define i32 @call_sys(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm sideeffect "movl $1, %eax\0A\09int $$0x80", "={ax},imr,~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @call_sys(i32 %0) {
%2 = tail call i32 asm sideeffect "movl $1, %eax\0A\09int $$0x80", "={ax},imr,~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
double compute_gpa(double weighted_credits, int total_cedits) {
  double total_gpa = 0;
  total_gpa = weighted_credits / total_cedits;
  return total_gpa;
}


x86 assembly (clang, -O0):
<compute_gpa>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_gpa>:
cvtsi2sd %edi,%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @compute_gpa(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double
store double %0, double* %3
store i32 %1, i32* %4
store double 0.000000e+00, double* %5
%6 = load double, double* %3
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = fdiv double %6, %8
store double %9, double* %5
%10 = load double, double* %5
ret double %10
}

LLVM IR (-O2):
define double @compute_gpa(double %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = fdiv double %0, %3
ret double %4
}
/* Variables and functions */
void *malloc(size_t);
void *ftg_malloc(size_t size, size_t num) {
  void *heap = NULL;
  ((void)0);
  if (size > 0 && num > 0 && (18446744073709551615UL) / size >= num) {
    size_t alloc_size = size * num;
    heap = malloc(alloc_size);
    if (!heap) {
      ((void)0);
    }
  } else {
    ((void)0);
  }
  return heap;
}


x86 assembly (clang, -O0):
<ftg_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jbe    1186 <ftg_malloc+0x76>
cmpq   $0x0,-0x10(%rbp)
jbe    1186 <ftg_malloc+0x76>
mov    $0xffffffffffffffff,%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x8(%rbp)
cmp    -0x10(%rbp),%rax
jb     1186 <ftg_malloc+0x76>
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1181 <ftg_malloc+0x71>
jmp    1181 <ftg_malloc+0x71>
jmp    118b <ftg_malloc+0x7b>
jmp    118b <ftg_malloc+0x7b>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftg_malloc>:
test   %rdi,%rdi
je     1122 <ftg_malloc+0x12>
test   %rsi,%rsi
je     1122 <ftg_malloc+0x12>
mov    %rdi,%rax
mul    %rsi
jno    1125 <ftg_malloc+0x15>
xor    %eax,%eax
ret
imul   %rdi,%rsi
mov    %rsi,%rdi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @ftg_malloc(i64 %0, i64 %1) {
%3 = icmp ne i64 %0, 0
%4 = icmp ne i64 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %12
6: ; preds = %2
%7 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %0, i64 %1)
%8 = extractvalue { i64, i1 } %7, 1
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = mul i64 %1, %0
%11 = tail call i8* @malloc(i64 %10)
br label %12
12: ; preds = %2, %6, %9
%13 = phi i8* [ %11, %9 ], [ null, %6 ], [ null, %2 ]
ret i8* %13
}
/* Variables and functions */
char *sqlite3_malloc(scalar_t__);
char *strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *sqlite3StrDup(const char *z) {
  char *res = sqlite3_malloc(strlen(z) + 1);
  return strcpy(res, z);
}


x86 assembly (clang, -O0):
<sqlite3StrDup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <sqlite3_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlite3StrDup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <sqlite3_malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @sqlite3StrDup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @sqlite3_malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i8* @strcpy(i8* %8, i8* %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @sqlite3StrDup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @sqlite3_malloc(i64 %3)
%5 = tail call i8* @strcpy(i8* dereferenceable(1) %4, i8* dereferenceable(1) %0)
ret i8* %4
}
/* Variables and functions */
scalar_t__ pow(int, int);
float sqrt(scalar_t__);
float distancia(int ghost[3], int pac[3]) {
  float a;
  a = sqrt((pow((ghost[0] - pac[0]), 2)) + (pow((ghost[1] - pac[1]), 2)));
  return a;
}


x86 assembly (clang, -O0):
<distancia>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
sub    (%rax),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
mov    -0x10(%rbp),%rax
sub    0x4(%rax),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
call   1040 <sqrt@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distancia>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    (%rdi),%edi
sub    (%rsi),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %rax,%rbx
mov    0x4(%r15),%edi
sub    0x4(%r14),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
add    %rax,%rbx
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define float @distancia(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca float
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = sub nsw i32 %8, %11
%13 = call i64 @pow(i32 %12, i32 2)
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = load i32*, i32** %4
%18 = getelementptr inbounds i32, i32* %17, i64 1
%19 = load i32, i32* %18
%20 = sub nsw i32 %16, %19
%21 = call i64 @pow(i32 %20, i32 2)
%22 = add nsw i64 %13, %21
%23 = call float @sqrt(i64 %22)
store float %23, float* %5
%24 = load float, float* %5
ret float %24
}

LLVM IR (-O2):
define float @distancia(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sub nsw i32 %3, %4
%6 = tail call i64 @pow(i32 %5, i32 2)
%7 = getelementptr inbounds i32, i32* %0, i64 1
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %1, i64 1
%10 = load i32, i32* %9
%11 = sub nsw i32 %8, %10
%12 = tail call i64 @pow(i32 %11, i32 2)
%13 = add nsw i64 %12, %6
%14 = tail call float @sqrt(i64 %13)
ret float %14
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void show_usage() { fprintf(stderr, "Usage: loadconfig [ -f filename ]\n"); }


x86 assembly (clang, -O0):
<show_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Usage: loadconfig [ -f filename ]\0A\00"
define void @show_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Usage: loadconfig [ -f filename ]\0A\00"
define void @show_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *command) {
  do {
    fprintf(stderr,
            "[PAF] Usage: %s COMMAND [OPTION...] PATTERN... [OPTION...]\n"
            "[PAF] PATTERN:\n"
            "[PAF] \t{}:\t\t\tPATTERN will be replaced with /tmp/default\n"
            "[PAF] \t{/path/to/file}:\tPATTERN will be replaced with "
            "/path/to/file\n"
            "[PAF] \t{!/path/to/file}:\tForce mode\n"
            "[PAF] \n"
            "[PAF] Note: If there are more than one PATTERNs in a single "
            "command line, the \n"
            "[PAF]       PATTERNs should be the same.\n",
            command);
    if (1)
      exit(1);
  } while (0);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [362 x i8] c"[PAF] Usage: %s COMMAND [OPTION...] PATTERN... [OPTION...]\0A[PAF] PATTERN:\0A[PAF] \09{}:\09\09\09PATTERN will be replaced with /tmp/default\0A[PAF] \09{/path/to/file}:\09PATTERN will be replaced with /path/to/file\0A[PAF] \09{!/path/to/file}:\09Force mode\0A[PAF] \0A[PAF] Note: If there are more than one PATTERNs in a single command line, the \0A[PAF] PATTERNs should be the same.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = load i8*, i8** %2
%6 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([362 x i8], [362 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 @exit(i32 1)
unreachable
8: ; No predecessors!
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [362 x i8] c"[PAF] Usage: %s COMMAND [OPTION...] PATTERN... [OPTION...]\0A[PAF] PATTERN:\0A[PAF] \09{}:\09\09\09PATTERN will be replaced with /tmp/default\0A[PAF] \09{/path/to/file}:\09PATTERN will be replaced with /path/to/file\0A[PAF] \09{!/path/to/file}:\09Force mode\0A[PAF] \0A[PAF] Note: If there are more than one PATTERNs in a single command line, the \0A[PAF] PATTERNs should be the same.\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([362 x i8], [362 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int subtraction(int a, int b) { return a - b; }


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

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

LLVM IR (-O0):
define i32 @subtraction(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 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @subtraction(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ print_unicode(int const *, int);
int /*<<< orphan*/ printf(char *, int, char const *);
int /*<<< orphan*/ putchar(char);
void print_idx_field_unicode(uint8_t idx, const char *name, const uint8_t *ptr,
                             int len) {
  printf(" %02x | %22s: ", idx, name);
  print_unicode(ptr, len);
  putchar('\n');
}


x86 assembly (clang, -O0):
<print_idx_field_unicode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1050 <print_unicode@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_idx_field_unicode>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%rbx
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <print_unicode@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [15 x i8] c" %02x | %22s: \00"
define void @print_idx_field_unicode(i32 %0, i8* %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10)
%12 = load i32*, i32** %7
%13 = load i32, i32* %8
%14 = call i32 @print_unicode(i32* %12, i32 %13)
%15 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c" %02x | %22s: \00"
define void @print_idx_field_unicode(i32 %0, i8* %1, i32* %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%6 = tail call i32 @print_unicode(i32* %2, i32 %3)
%7 = tail call i32 @putchar(i8 signext 10)
ret void
}
int test_imm_40uint32_reg(unsigned int val) {
  return ((val) & (0x40 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_40uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x40,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_40uint32_reg(i32 %0) {
%2 = and i32 %0, 64
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int warp_frame(struct ccd_frame *in, struct ccd_frame *out, struct ctrans *ct) {
  return -1;
}


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

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

LLVM IR (-O0):
%struct.ccd_frame = type opaque
%struct.ctrans = type opaque
define i32 @warp_frame(%struct.ccd_frame* %0, %struct.ccd_frame* %1, %struct.ctrans* %2) {
%4 = alloca %struct.ccd_frame*
%5 = alloca %struct.ccd_frame*
%6 = alloca %struct.ctrans*
store %struct.ccd_frame* %0, %struct.ccd_frame** %4
store %struct.ccd_frame* %1, %struct.ccd_frame** %5
store %struct.ctrans* %2, %struct.ctrans** %6
ret i32 -1
}

LLVM IR (-O2):
%struct.ccd_frame = type opaque
%struct.ctrans = type opaque
define i32 @warp_frame(%struct.ccd_frame* nocapture readnone %0, %struct.ccd_frame* nocapture readnone %1, %struct.ctrans* nocapture readnone %2) {
ret i32 -1
}
/* Type definitions */
struct predicate {
  int dummy;
};

/* Variables and functions */
bool pred_true(const char *path, int flags, struct predicate *pred) {
  return true;
}


x86 assembly (clang, -O0):
<pred_true>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.predicate = type { i32 }
define i32 @pred_true(i8* %0, i32 %1, %struct.predicate* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca %struct.predicate*
store i8* %0, i8** %4
store i32 %1, i32* %5
store %struct.predicate* %2, %struct.predicate** %6
ret i32 1
}

LLVM IR (-O2):
%struct.predicate = type { i32 }
define i32 @pred_true(i8* nocapture readnone %0, i32 %1, %struct.predicate* nocapture readnone %2) {
ret i32 1
}
int eraVersionMajor(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @eraVersionMajor() {
ret i32 1
}

LLVM IR (-O2):
define i32 @eraVersionMajor() {
ret i32 1
}
int left(int k) { return 2 * k + 1; }


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

x86 assembly (clang, -O2):
<left>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @left(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 2, %3
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @left(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ COM_CreatePath(char *);
int LoadFile(char *, void **);
int /*<<< orphan*/ SaveFile(char *, void *, int);
int /*<<< orphan*/ free(void *);
void COM_CopyFile(char *from, char *to) {
  void *buffer;
  int length;
  length = LoadFile(from, &buffer);
  COM_CreatePath(to);
  SaveFile(to, buffer, length);
  free(buffer);
}


x86 assembly (clang, -O0):
<COM_CopyFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <LoadFile@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <COM_CreatePath@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1050 <SaveFile@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<COM_CopyFile>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rsp,%rsi
call   1060 <LoadFile@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <COM_CreatePath@plt>
mov    (%rsp),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1050 <SaveFile@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @COM_CopyFile(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @LoadFile(i8* %7, i8** %5)
store i32 %8, i32* %6
%9 = load i8*, i8** %4
%10 = call i32 @COM_CreatePath(i8* %9)
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = call i32 @SaveFile(i8* %11, i8* %12, i32 %13)
%15 = load i8*, i8** %5
%16 = call i32 @free(i8* %15)
ret void
}

LLVM IR (-O2):
define void @COM_CopyFile(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @LoadFile(i8* %0, i8** %3)
%6 = call i32 @COM_CreatePath(i8* %1)
%7 = load i8*, i8** %3
%8 = call i32 @SaveFile(i8* %1, i8* %7, i32 %5)
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
ret void
}
void avcodec_parameters_alloc() {}


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

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

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

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

/* Variables and functions */
int EINVAL;
int devpts_pty_new(struct tty_struct *tty) { return -EINVAL; }


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

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

LLVM IR (-O0):
%struct.tty_struct = type { i32 }
@EINVAL = global i32 0
define i32 @devpts_pty_new(%struct.tty_struct* %0) {
%2 = alloca %struct.tty_struct*
store %struct.tty_struct* %0, %struct.tty_struct** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
%struct.tty_struct = type { i32 }
@EINVAL = global i32 0
define i32 @devpts_pty_new(%struct.tty_struct* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
int RAND_bytes(unsigned char *, int);
int /*<<< orphan*/ log_ssl_err(char *);
int get_random_bytes(unsigned char *buf, int num) {
  int rval;
  if (!(rval = RAND_bytes(buf, num))) {
    log_ssl_err("Error getting random bytes");
  }
  return rval;
}


x86 assembly (clang, -O0):
<get_random_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <RAND_bytes@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
jne    1153 <get_random_bytes+0x33>
lea    0xeb2(%rip),%rdi
call   1040 <log_ssl_err@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random_bytes>:
push   %rbx
call   1030 <RAND_bytes@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1138 <get_random_bytes+0x18>
lea    0xecd(%rip),%rdi
call   1040 <log_ssl_err@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Error getting random bytes\00"
define i32 @get_random_bytes(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @RAND_bytes(i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = icmp ne i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = call i32 @log_ssl_err(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
@.str = [27 x i8] c"Error getting random bytes\00"
define i32 @get_random_bytes(i8* %0, i32 %1) {
%3 = tail call i32 @RAND_bytes(i8* %0, i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @log_ssl_err(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32 %3
}