xunge/DecIR huggingface dataset:
int get_pawn_count(int cache_pawn_count[2][8], int file, int color) {
  if (file < 0 || file > 7) {
    return 0;
  }
  if (color == -1) {
    return cache_pawn_count[0][file];
  } else {
    return cache_pawn_count[1][file];
  }
}


x86 assembly (clang, -O0):
<get_pawn_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1122 <get_pawn_count+0x22>
cmpl   $0x7,-0x14(%rbp)
jle    112e <get_pawn_count+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    115a <get_pawn_count+0x5a>
cmpl   $0xffffffff,-0x18(%rbp)
jne    114b <get_pawn_count+0x4b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <get_pawn_count+0x5a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    0x20(%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pawn_count>:
xor    %eax,%eax
cmp    $0x7,%esi
ja     111b <get_pawn_count+0x1b>
xor    %eax,%eax
cmp    $0xffffffff,%edx
setne  %al
mov    %esi,%ecx
shl    $0x5,%rax
add    %rax,%rdi
mov    (%rdi,%rcx,4),%eax
ret

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

LLVM IR (-O2):
define i32 @get_pawn_count([8 x i32]* nocapture %0, i32 %1, i32 %2) {
%4 = icmp ugt i32 %1, 7
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = icmp ne i32 %2, -1
%7 = zext i32 %1 to i64
%8 = zext i1 %6 to i64
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 %8, i64 %7
%10 = load i32, i32* %9
br label %11
11: ; preds = %5, %3
%12 = phi i32 [ 0, %3 ], [ %10, %5 ]
ret i32 %12
}
void f_omp_target(void) {
#pragma omp target
  {
#pragma omp target
    ;
#pragma omp target data map(i)
    ;
#pragma omp target update to(i)
#pragma omp parallel
    {
#pragma omp target
      ;
#pragma omp target data map(i)
      ;
#pragma omp target update to(i)
    }
  }
}


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

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

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

LLVM IR (-O2):
define void @f_omp_target() {
ret void
}
int prime(int n) {
  int l = 0, j;
  for (j = 2; j < n; j++) {
    if (n % j == 0)
      l = 1;
  }
  return l;
}


x86 assembly (clang, -O0):
<prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    114b <prime+0x4b>
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1138 <prime+0x38>
movl   $0x1,-0x8(%rbp)
jmp    113d <prime+0x3d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <prime+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prime>:
xor    %ecx,%ecx
cmp    $0x3,%edi
jl     116f <prime+0x6f>
mov    %edi,%r10d
jne    1115 <prime+0x15>
xor    %ecx,%ecx
mov    $0x2,%esi
jmp    1159 <prime+0x59>
lea    -0x2(%r10),%r8d
and    $0xfffffffe,%r8d
xor    %ecx,%ecx
mov    $0x2,%esi
mov    $0x1,%r9d
nopw   0x0(%rax,%rax,1)
mov    %esi,%edi
mov    %r10d,%eax
cltd
idiv   %esi
mov    %edx,%r11d
lea    0x1(%rdi),%esi
mov    %r10d,%eax
cltd
idiv   %esi
test   %r11d,%r11d
cmove  %r9d,%ecx
test   %edx,%edx
cmove  %r9d,%ecx
lea    0x2(%rdi),%esi
cmp    %r8d,%edi
jne    1130 <prime+0x30>
test   $0x1,%r10b
je     116f <prime+0x6f>
mov    %r10d,%eax
cltd
idiv   %esi
test   %edx,%edx
mov    $0x1,%eax
cmove  %eax,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %3, label %32
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %0, 3
br i1 %5, label %23, label %6
6: ; preds = %3
%7 = add i32 %0, -2
%8 = and i32 %7, -2
br label %9
9: ; preds = %9, %6
%10 = phi i32 [ 2, %6 ], [ %20, %9 ]
%11 = phi i32 [ 0, %6 ], [ %19, %9 ]
%12 = phi i32 [ 0, %6 ], [ %21, %9 ]
%13 = srem i32 %0, %10
%14 = icmp eq i32 %13, 0
%15 = or i32 %10, 1
%16 = srem i32 %0, %15
%17 = icmp eq i32 %16, 0
%18 = select i1 %17, i1 true, i1 %14
%19 = select i1 %18, i32 1, i32 %11
%20 = add nuw nsw i32 %10, 2
%21 = add i32 %12, 2
%22 = icmp eq i32 %21, %8
br i1 %22, label %23, label %9
23: ; preds = %9, %3
%24 = phi i32 [ undef, %3 ], [ %19, %9 ]
%25 = phi i32 [ 2, %3 ], [ %20, %9 ]
%26 = phi i32 [ 0, %3 ], [ %19, %9 ]
%27 = icmp eq i32 %4, 0
br i1 %27, label %32, label %28
28: ; preds = %23
%29 = srem i32 %0, %25
%30 = icmp eq i32 %29, 0
%31 = select i1 %30, i32 1, i32 %26
br label %32
32: ; preds = %28, %23, %1
%33 = phi i32 [ 0, %1 ], [ %24, %23 ], [ %31, %28 ]
ret i32 %33
}
void GP_break20(void) {}


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

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

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

LLVM IR (-O2):
define void @GP_break20() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__8__IO__makeOutput();
void HplCC2420SpiP__SS__makeOutput(void) {
  HplAtm128GeneralIOPinP__8__IO__makeOutput();
}


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

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

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

LLVM IR (-O2):
define void @HplCC2420SpiP__SS__makeOutput() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__8__IO__makeOutput()
ret void
}
/* Variables and functions */
unsigned int const rand();
unsigned int hasard(const unsigned int min, const unsigned int max) {
  return (rand() % (max - min + 1)) + min;
}


x86 assembly (clang, -O0):
<hasard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasard>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
xor    %edx,%edx
div    %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @hasard(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub i32 %6, %7
%9 = add i32 %8, 1
%10 = urem i32 %5, %9
%11 = load i32, i32* %3
%12 = add i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @hasard(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = urem i32 %3, %5
%7 = add i32 %6, %0
ret i32 %7
}
void fossil_mbcs_free(void *zOld) {}


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

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

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

LLVM IR (-O2):
define void @fossil_mbcs_free(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int i;
  printf("ASCII Table:\nNumber  |\tSymbol\n");
  for (i = 0; i <= 255; i++) {
    printf("%d\t\t|%c\n", i, i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jg     1163 <main+0x53>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x24>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
lea    0xeca(%rip),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    $0x100,%ebp
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%d\09\09|%c\0A\00"
@str = [30 x i8] c"ASCII Table:\0ANumber |\09Symbol\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %3, i32 %3)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 256
br i1 %6, label %7, label %2
7: ; preds = %2
ret i32 0
}
/* Variables and functions */
void *stack_alloc_mask(int, int /*<<< orphan*/);
void *stack_alloc(int sz_w) { return stack_alloc_mask(sz_w, 0); }


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

x86 assembly (clang, -O2):
<stack_alloc>:
xor    %esi,%esi
jmp    1030 <stack_alloc_mask@plt>

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

LLVM IR (-O2):
define i8* @stack_alloc(i32 %0) {
%2 = tail call i8* @stack_alloc_mask(i32 %0, i32 0)
ret i8* %2
}
/* Variables and functions */
scalar_t__ acos(float);
int /*<<< orphan*/ v_nrm(float *, float const *);
void q_as_axisangle(const float q[4], float u[3], float *a) {
  *a = 2.0f * ((float)acos((float)q[0]));
  v_nrm(u, q + 1);
}


x86 assembly (clang, -O0):
<q_as_axisangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <acos@plt>
cvtsi2ss %rax,%xmm1
movss  0xeb2(%rip),%xmm0
mulss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x4,%rsi
call   1040 <v_nrm@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q_as_axisangle>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
movss  (%rdi),%xmm0
call   1030 <acos@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
addss  %xmm0,%xmm0
movss  %xmm0,(%r15)
add    $0x4,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <v_nrm@plt>

LLVM IR (-O0):
define void @q_as_axisangle(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 = load float*, float** %4
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = call i64 @acos(float %9)
%11 = sitofp i64 %10 to float
%12 = fmul float 2.000000e+00, %11
%13 = load float*, float** %6
store float %12, float* %13
%14 = load float*, float** %5
%15 = load float*, float** %4
%16 = getelementptr inbounds float, float* %15, i64 1
%17 = call i32 @v_nrm(float* %14, float* %16)
ret void
}

LLVM IR (-O2):
define void @q_as_axisangle(float* %0, float* %1, float* nocapture writeonly %2) {
%4 = load float, float* %0
%5 = tail call i64 @acos(float %4)
%6 = sitofp i64 %5 to float
%7 = fmul float %6, 2.000000e+00
store float %7, float* %2
%8 = getelementptr inbounds float, float* %0, i64 1
%9 = tail call i32 @v_nrm(float* %1, float* %8)
ret void
}
void handle_33(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_33(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vprintf(char *, char *, int, int, int *, int);
void sscan(char *buf, char *form, int a, int b, int c) {
  vprintf(buf, form, a, b, &c, 0x100000);
}


x86 assembly (clang, -O0):
<sscan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    -0x1c(%rbp),%r8
mov    $0x100000,%r9d
call   1030 <vprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sscan>:
push   %rax
mov    %r8d,0x4(%rsp)
lea    0x4(%rsp),%r8
mov    $0x100000,%r9d
call   1030 <vprintf@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @sscan(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = call i32 @vprintf(i8* %11, i8* %12, i32 %13, i32 %14, i32* %10, i32 1048576)
ret void
}

LLVM IR (-O2):
define void @sscan(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
store i32 %4, i32* %6
%7 = call i32 @vprintf(i8* %0, i8* %1, i32 %2, i32 %3, i32* %6, i32 1048576)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushinteger4array_(void *x, unsigned int *n) {
  pushNarray((char *)x, (*n * 4));
}


x86 assembly (clang, -O0):
<pushinteger4array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
shl    $0x2,%esi
call   1030 <pushNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pushinteger4array_>:
mov    (%rsi),%esi
shl    $0x2,%esi
jmp    1030 <pushNarray@plt>

LLVM IR (-O0):
define void @pushinteger4array_(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = mul i32 %7, 4
%9 = call i32 @pushNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @pushinteger4array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 2
%5 = tail call i32 @pushNarray(i8* %0, i32 %4)
ret void
}
/* Variables and functions */
int getchar();
int ostgetc(void) { return getchar(); }


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

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

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

LLVM IR (-O2):
define i32 @ostgetc() {
%1 = tail call i32 (...) @getchar()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ _SC_PAGESIZE;
int /*<<< orphan*/ sysconf(int /*<<< orphan*/);
size_t round_to_page(size_t block_size) {
  size_t page_size = (size_t)sysconf(_SC_PAGESIZE);
  return page_size * ((block_size + page_size - 1) / page_size);
}


x86 assembly (clang, -O0):
<round_to_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
sub    $0x1,%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
imul   %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_to_page>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %eax,%esi
movslq %eax,%rdi
lea    (%rbx,%rdi,1),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,%rax
or     %rdi,%rax
shr    $0x20,%rax
je     1145 <round_to_page+0x35>
mov    %rcx,%rax
xor    %edx,%edx
div    %rdi
jmp    114b <round_to_page+0x3b>
mov    %ecx,%eax
xor    %edx,%edx
div    %esi
sub    %rdx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@_SC_PAGESIZE = global i32 0
define i64 @round_to_page(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i32, i32* @_SC_PAGESIZE
%5 = call i32 @sysconf(i32 %4)
%6 = sext i32 %5 to i64
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = load i64, i64* %2
%9 = load i64, i64* %3
%10 = add i64 %8, %9
%11 = sub i64 %10, 1
%12 = load i64, i64* %3
%13 = udiv i64 %11, %12
%14 = mul i64 %7, %13
ret i64 %14
}

LLVM IR (-O2):
@_SC_PAGESIZE = global i32 0
define i64 @round_to_page(i64 %0) {
%2 = load i32, i32* @_SC_PAGESIZE
%3 = tail call i32 @sysconf(i32 %2)
%4 = sext i32 %3 to i64
%5 = add i64 %0, -1
%6 = add i64 %5, %4
%7 = urem i64 %6, %4
%8 = sub i64 %6, %7
ret i64 %8
}
/* Variables and functions */
scalar_t__ strdup(char *);
scalar_t__ vamore(void **, void *);
char **argsadd(char *argv[], char *s) {
  return s ? ((char **)vamore((void **)argv, (void *)strdup(s))) : argv;
}


x86 assembly (clang, -O0):
<argsadd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1161 <argsadd+0x41>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rsi
call   1030 <vamore@plt>
mov    %rax,-0x18(%rbp)
jmp    1169 <argsadd+0x49>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argsadd>:
push   %rbx
mov    %rdi,%rbx
test   %rsi,%rsi
je     113f <argsadd+0x1f>
mov    %rsi,%rdi
call   1040 <strdup@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <vamore@plt>
mov    %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8** @argsadd(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %4
%10 = call i64 @strdup(i8* %9)
%11 = inttoptr i64 %10 to i8*
%12 = call i64 @vamore(i8** %8, i8* %11)
%13 = inttoptr i64 %12 to i8**
br label %16
14: ; preds = %2
%15 = load i8**, i8*** %3
br label %16
16: ; preds = %14, %7
%17 = phi i8** [ %13, %7 ], [ %15, %14 ]
ret i8** %17
}

LLVM IR (-O2):
define i8** @argsadd(i8** %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i64 @strdup(i8* %1)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i64 @vamore(i8** %0, i8* %6)
%8 = inttoptr i64 %7 to i8**
br label %9
9: ; preds = %2, %4
%10 = phi i8** [ %8, %4 ], [ %0, %2 ]
ret i8** %10
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
int coin_flip(double chance) {
  double rng = (double)rand() / (double)RAND_MAX;
  if (rng < chance)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<coin_flip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb8(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    115e <coin_flip+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1165 <coin_flip+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coin_flip>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    0x2ebc(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
xor    %eax,%eax
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i32 @coin_flip(double %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = call i64 (...) @rand()
%6 = sitofp i64 %5 to double
%7 = load i64, i64* @RAND_MAX
%8 = sitofp i64 %7 to double
%9 = fdiv double %6, %8
store double %9, double* %4
%10 = load double, double* %4
%11 = load double, double* %3
%12 = fcmp olt double %10, %11
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 1, i32* %2
br label %15
14: ; preds = %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i32 @coin_flip(double %0) {
%2 = tail call i64 (...) @rand()
%3 = sitofp i64 %2 to double
%4 = load i64, i64* @RAND_MAX
%5 = sitofp i64 %4 to double
%6 = fdiv double %3, %5
%7 = fcmp olt double %6, %0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int is_exit(char *str) {
  if (strcmp(str, "exit\r\n") == 0 || strcmp(str, "exit\n") == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1150 <is_exit+0x40>
mov    -0x10(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    115c <is_exit+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <is_exit+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_exit>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1141 <is_exit+0x31>
lea    0xedb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"exit\0D\0A\00"
@.str.1 = [6 x i8] c"exit\0A\00"
define i32 @is_exit(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void version(void) {
  printf("cam 0.0.0"
         "\n");
  fflush(stdout);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"cam 0.0.0\0A\00"
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
@str = [10 x i8] c"cam 0.0.0\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void sp_aligned_free(void *newptr) {
  void *ptr;
  if (newptr == NULL)
    return;
  ptr = *((void **)newptr - 1);
  free(ptr);
}


x86 assembly (clang, -O0):
<sp_aligned_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <sp_aligned_free+0x1c>
jmp    1141 <sp_aligned_free+0x31>
mov    -0x8(%rbp),%rax
mov    -0x8(%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sp_aligned_free>:
test   %rdi,%rdi
je     111e <sp_aligned_free+0xe>
mov    -0x8(%rdi),%rdi
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @sp_aligned_free(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
br label %14
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i8**
%10 = getelementptr inbounds i8*, i8** %9, i64 -1
%11 = load i8*, i8** %10
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = call i32 @free(i8* %12)
br label %14
14: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
define void @sp_aligned_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 -8
%5 = bitcast i8* %4 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @free(i8* %6)
br label %8
8: ; preds = %1, %3
ret void
}
void gtk_file_chooser_error_quark() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_chooser_error_quark() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello\n");
  abort();
  printf("World\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
@str = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int set_default_entire_table_property(int /*<<< orphan*/, int);
int ft_set_default_tbl_prop(uint32_t property, int value) {
  return set_default_entire_table_property(property, value);
}


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

x86 assembly (clang, -O2):
<ft_set_default_tbl_prop>:
jmp    1030 <set_default_entire_table_property@plt>

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

LLVM IR (-O2):
define i32 @ft_set_default_tbl_prop(i32 %0, i32 %1) {
%3 = tail call i32 @set_default_entire_table_property(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
double atan(double);
double module_libc_atan(double x) { return atan(x); }


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

x86 assembly (clang, -O2):
<module_libc_atan>:
jmp    1030 <atan@plt>

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

LLVM IR (-O2):
define double @module_libc_atan(double %0) {
%2 = tail call double @atan(double %0)
ret double %2
}
test_store_ccp(int i) {
  int *p, a, b, c;
  if (i < 5)
    p = &a;
  else if (i > 8)
    p = &b;
  else
    p = &c;
  *p = 10;
  b = 3;
  return *p + 2;
}


x86 assembly (clang, -O0):
<test_store_ccp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    111e <test_store_ccp+0x1e>
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1142 <test_store_ccp+0x42>
cmpl   $0x8,-0x4(%rbp)
jle    1135 <test_store_ccp+0x35>
lea    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    113d <test_store_ccp+0x3d>
lea    -0x1c(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1142 <test_store_ccp+0x42>
mov    -0x10(%rbp),%rax
movl   $0xa,(%rax)
movl   $0x3,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_store_ccp>:
cmp    $0x9,%edi
lea    -0xc(%rsp),%rax
lea    -0x8(%rsp),%rcx
cmovge %rax,%rcx
cmp    $0x5,%edi
lea    -0x4(%rsp),%rax
cmovge %rcx,%rax
movl   $0xa,(%rax)
movl   $0x3,-0xc(%rsp)
mov    (%rax),%eax
add    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @test_store_ccp(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = icmp slt i32 %0, 5
%9 = icmp sgt i32 %0, 8
%10 = select i1 %9, i32* %3, i32* %4
%11 = select i1 %8, i32* %2, i32* %10
store i32 10, i32* %11
store i32 3, i32* %3
%12 = load i32, i32* %11
%13 = add nsw i32 %12, 2
ret i32 %13
}
__attribute__((no, noclone)) signed __int128 t140_2sub(unsigned __int128 y) {
  signed __int128 x =
      (((signed __int128)(((unsigned __int128)1 << (16 * 8 - 1)) - 1)));
  signed __int128 r;
  if (__builtin_sub_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t140_2sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movabs $0x7fffffffffffffff,%rax
ff ff 7f
mov    %rax,-0x38(%rbp)
movq   $0xffffffffffffffff,-0x40(%rbp)
ff
mov    -0x40(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    %rcx,%r9
sar    $0x3f,%r9
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rax
sub    %rsi,%rdx
sbb    %rax,%rcx
mov    %r9,%r8
sbb    $0x0,%r8
sbb    $0x0,%r9
mov    %r8d,%eax
and    $0x1,%eax
mov    %eax,%esi
mov    %rsi,%rax
neg    %rax
mov    %rax,%rdi
xor    %r9,%rdi
xor    %r8,%rax
or     %rdi,%rax
mov    %rcx,%rdi
shr    $0x3f,%rdi
xor    %rdi,%rsi
or     %rsi,%rax
setne  %al
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x48(%rbp)
test   $0x1,%al
jne    11ad <t140_2sub+0x9d>
jmp    11b4 <t140_2sub+0xa4>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t140_2sub>:
mov    %rdi,%rax
movabs $0x7fffffffffffffff,%rdx
ff ff 7f
sub    %rsi,%rdx
not    %rax
ret

LLVM IR (-O0):
define { i64, i64 } @t140_2sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %4
store i128 %11, i128* %5
store i128 170141183460469231731687303715884105727, i128* %6
%12 = load i128, i128* %6
%13 = load i128, i128* %5
%14 = sext i128 %12 to i129
%15 = zext i128 %13 to i129
%16 = call { i129, i1 } @llvm.ssub.with.overflow.i129(i129 %14, i129 %15)
%17 = extractvalue { i129, i1 } %16, 1
%18 = extractvalue { i129, i1 } %16, 0
%19 = trunc i129 %18 to i128
%20 = sext i128 %19 to i129
%21 = icmp ne i129 %18, %20
%22 = or i1 %17, %21
store i128 %19, i128* %7
br i1 %22, label %23, label %25
23: ; preds = %2
%24 = call i32 (...) @bar()
br label %25
25: ; preds = %23, %2
%26 = load i128, i128* %7
store i128 %26, i128* %3
%27 = bitcast i128* %3 to { i64, i64 }*
%28 = load { i64, i64 }, { i64, i64 }* %27
ret { i64, i64 } %28
}

LLVM IR (-O2):
define { i64, i64 } @t140_2sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = zext i128 %6 to i129
%8 = sub nsw i129 170141183460469231731687303715884105727, %7
%9 = trunc i129 %8 to i64
%10 = lshr i129 %8, 64
%11 = trunc i129 %10 to i64
%12 = insertvalue { i64, i64 } poison, i64 %9, 0
%13 = insertvalue { i64, i64 } %12, i64 %11, 1
ret { i64, i64 } %13
}
/* Variables and functions */
int /*<<< orphan*/ execlp(char *, char *, char *, char *, int /*<<< orphan*/ *);
int main(void) {
  execlp("ls", "ls", "-al", "/etc/passwd", NULL);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee4(%rip),%rdx
lea    0xee1(%rip),%rcx
mov    %rdi,%rsi
xor    %r8d,%r8d
call   1030 <execlp@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"ls\00"
@.str.1 = [4 x i8] c"-al\00"
@.str.2 = [12 x i8] c"/etc/passwd\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"ls\00"
@.str.1 = [4 x i8] c"-al\00"
@.str.2 = [12 x i8] c"/etc/passwd\00"
define i32 @main() {
%1 = tail call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret i32 0
}
unsigned long read_cr0() {
  unsigned long cr0;
  asm volatile("mov %%cr0, %0" : "=r"(cr0));
  return cr0;
}


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

x86 assembly (clang, -O2):
<read_cr0>:
mov    %cr0,%rax
ret

LLVM IR (-O0):
define i64 @read_cr0() {
%1 = alloca i64
%2 = call i64 asm sideeffect "mov %cr0, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @read_cr0() {
%1 = tail call i64 asm sideeffect "mov %cr0, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("abc\n");
  return 1;
}


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

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

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

LLVM IR (-O2):
@str = [4 x i8] c"abc\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 1
}
int f(int p, int q, int r, int s) {
  int sum;
  sum = p + q + r + s;
  return sum;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %1, %0
%6 = add nsw i32 %5, %2
%7 = add nsw i32 %6, %3
ret i32 %7
}
void tvm_sleep() {}


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

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

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

LLVM IR (-O2):
define void @tvm_sleep() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ save_the_time();
int /*<<< orphan*/ what_time_did_i_save();
void *thread_routine(void *arg) {
  int *my_id = (int *)arg;
  printf("thread_routine %d\n", *my_id);
  save_the_time();
  what_time_did_i_save();
  return (NULL);
}


x86 assembly (clang, -O0):
<thread_routine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <save_the_time@plt>
mov    $0x0,%al
call   1030 <what_time_did_i_save@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_routine>:
push   %rax
mov    (%rdi),%esi
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <save_the_time@plt>
xor    %eax,%eax
call   1030 <what_time_did_i_save@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"thread_routine %d\0A\00"
define noalias i8* @thread_routine(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @save_the_time()
%6 = tail call i32 (...) @what_time_did_i_save()
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int gethostname(char *, size_t);
int /*<<< orphan*/ perror(char *);
void std_gethostname(char *hostname, size_t len) {
  if (gethostname(hostname, len) == -1) {
    perror("gethostname");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<std_gethostname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <gethostname@plt>
cmp    $0xffffffff,%eax
jne    116c <std_gethostname+0x3c>
lea    0xea3(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_gethostname>:
push   %rax
call   1040 <gethostname@plt>
cmp    $0xffffffff,%eax
je     113d <std_gethostname+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"gethostname\00"
define void @std_gethostname(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @gethostname(i8* %5, i64 %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"gethostname\00"
define void @std_gethostname(i8* %0, i64 %1) {
%3 = tail call i32 @gethostname(i8* %0, i64 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
__attribute__((no)) double broken(double (*indirect)(int x, ...), int v) {
  return indirect(v);
}


x86 assembly (clang, -O0):
<broken>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   *%rcx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<broken>:
mov    %rdi,%rcx
mov    %esi,%edi
xor    %eax,%eax
jmp    *%rcx

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

LLVM IR (-O2):
define double @broken(double (i32, ...)* nocapture %0, i32 %1) {
%3 = tail call double (i32, ...) %0(i32 %1)
ret double %3
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main() {
  int c;
  while ((c = getchar()) != EOF) {
    if (c == '\t' || c == ' ' || c == '\n') {
      putchar('\n');
    } else
      putchar(c);
  }
  return 0;
}


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)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     1182 <main+0x62>
cmpl   $0x9,-0x8(%rbp)
je     1166 <main+0x46>
cmpl   $0x20,-0x8(%rbp)
je     1166 <main+0x46>
cmpl   $0xa,-0x8(%rbp)
jne    1175 <main+0x55>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    117d <main+0x5d>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%rbx
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
movabs $0x100000600,%r14
jmp    1162 <main+0x42>
nopl   0x0(%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
je     1136 <main+0x16>
cmp    $0x20,%eax
ja     1150 <main+0x30>
mov    $0xa,%edi
mov    %eax,%ecx
bt     %rcx,%r14
jb     1152 <main+0x32>
jmp    1150 <main+0x30>

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %13, label %4
4: ; preds = %0, %7
%5 = phi i32 [ %10, %7 ], [ %1, %0 ]
switch i32 %5, label %6 [
i32 32, label %7
i32 10, label %7
i32 9, label %7
]
6: ; preds = %4
br label %7
7: ; preds = %4, %4, %4, %6
%8 = phi i32 [ %5, %6 ], [ 10, %4 ], [ 10, %4 ], [ 10, %4 ]
%9 = tail call i32 @putchar(i32 %8)
%10 = tail call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %7, %0
ret i32 0
}