xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_snanmin(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 0.0 / 0.0, 0.0 / 0.0};
  int64_t N = 5;
  int64_t stride = 2;
  float v = stdlib_strided_snanmin(N, x, stride);
  printf("min: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
movl   $0x5,-0x34(%rbp)
movl   $0x2,-0x38(%rbp)
mov    -0x34(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%edx
call   1050 <stdlib_strided_snanmin@plt>
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm0
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x5,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_snanmin@plt>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [10 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00, float 0x7FF8000000000000, float 0x7FF8000000000000]
@.str = [9 x i8] c"min: %f\0A\00"
define i32 @main() {
%1 = alloca [10 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [10 x float]* %1 to i8*
store i32 5, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_snanmin(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [10 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00, float 0x7FF8000000000000, float 0x7FF8000000000000]
@.str = [9 x i8] c"min: %f\0A\00"
define i32 @main() {
%1 = alloca [10 x float]
%2 = bitcast [10 x float]* %1 to i8*
%3 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_snanmin(i32 5, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
int dd_geq_dd_d(const double *a, double b) {
  return (a[0] > b || (a[0] == b && a[1] >= 0.0)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<dd_geq_dd_d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    $0x1,%al
ucomisd -0x10(%rbp),%xmm0
mov    %al,-0x11(%rbp)
ja     115f <dd_geq_dd_d+0x5f>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
xor    %eax,%eax
ucomisd -0x10(%rbp),%xmm0
mov    %al,-0x12(%rbp)
jne    1159 <dd_geq_dd_d+0x59>
jp     1159 <dd_geq_dd_d+0x59>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setae  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dd_geq_dd_d>:
movsd  (%rdi),%xmm1
mov    $0x1,%eax
ucomisd %xmm0,%xmm1
ja     1129 <dd_geq_dd_d+0x29>
ucomisd %xmm0,%xmm1
jne    112a <dd_geq_dd_d+0x2a>
jp     112a <dd_geq_dd_d+0x2a>
movsd  0x8(%rdi),%xmm0
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setae  %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @dd_geq_dd_d(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double, double* %4
%9 = fcmp ogt double %7, %8
br i1 %9, label %23, label %10
10: ; preds = %2
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 0
%13 = load double, double* %12
%14 = load double, double* %4
%15 = fcmp oeq double %13, %14
br i1 %15, label %16, label %21
16: ; preds = %10
%17 = load double*, double** %3
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = fcmp oge double %19, 0.000000e+00
br label %21
21: ; preds = %16, %10
%22 = phi i1 [ false, %10 ], [ %20, %16 ]
br label %23
23: ; preds = %21, %2
%24 = phi i1 [ true, %2 ], [ %22, %21 ]
%25 = zext i1 %24 to i64
%26 = select i1 %24, i32 1, i32 0
ret i32 %26
}

LLVM IR (-O2):
define i32 @dd_geq_dd_d(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fcmp ogt double %3, %1
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = fcmp oeq double %3, %1
br i1 %6, label %7, label %12
7: ; preds = %5
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = load double, double* %8
%10 = fcmp oge double %9, 0.000000e+00
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %5, %7, %2
%13 = phi i32 [ 1, %2 ], [ 0, %5 ], [ %11, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ ItoaHelper(int, char *, size_t);
int /*<<< orphan*/ Reverse(char *);
int Itoa(int n, char *buffer, size_t bufferLen) {
  if (!buffer) {
    return 1;
  }
  ItoaHelper(n, buffer, bufferLen);
  Reverse(buffer);
  return 0;
}


x86 assembly (clang, -O0):
<Itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114a <Itoa+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    116a <Itoa+0x4a>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <ItoaHelper@plt>
mov    -0x10(%rbp),%rdi
call   1040 <Reverse@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Itoa>:
test   %rsi,%rsi
je     113a <Itoa+0x1a>
push   %rbx
mov    %rsi,%rbx
call   1030 <ItoaHelper@plt>
mov    %rbx,%rdi
call   1040 <Reverse@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @Itoa(i32 %0, i8* %1, i64 %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = tail call i32 @ItoaHelper(i32 %0, i8* %1, i64 %2)
%7 = tail call i32 @Reverse(i8* %1)
br label %8
8: ; preds = %3, %5
%9 = phi i32 [ 0, %5 ], [ 1, %3 ]
ret i32 %9
}
int INHERENT_alloca() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @INHERENT_alloca() {
ret i32 0
}
int ls_cost_nm6_n_out(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @ls_cost_nm6_n_out() {
ret i32 2
}

LLVM IR (-O2):
define i32 @ls_cost_nm6_n_out() {
ret i32 2
}
int isSpace(char ch) { return (ch == ' ' || ch == '\t' ? 1 : 0); }


x86 assembly (clang, -O0):
<isSpace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1129 <isSpace+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSpace>:
cmp    $0x20,%dil
sete   %al
cmp    $0x9,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isSpace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
ret i32 %13
}

LLVM IR (-O2):
define i32 @isSpace(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void server_free_result(char *buffer) { free(buffer); }


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

x86 assembly (clang, -O2):
<server_free_result>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @server_free_result(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
size_t write_file_segment(void *, size_t, char *);
size_t write_segment(void *buf, size_t size, char *filename) {
  return write_file_segment(buf, size, filename);
}


x86 assembly (clang, -O0):
<write_segment>:
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 <write_file_segment@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_segment>:
jmp    1030 <write_file_segment@plt>

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

LLVM IR (-O2):
define i64 @write_segment(i8* %0, i64 %1, i8* %2) {
%4 = tail call i64 @write_file_segment(i8* %0, i64 %1, i8* %2)
ret i64 %4
}
int weak(void) { return 30; }


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

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

LLVM IR (-O0):
define i32 @weak() {
ret i32 30
}

LLVM IR (-O2):
define i32 @weak() {
ret i32 30
}
/* Variables and functions */
int /*<<< orphan*/ test61_AvrPin_toggle__E();
void test61_Led_toggle__E() { test61_AvrPin_toggle__E(); }


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

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

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

LLVM IR (-O2):
define void @test61_Led_toggle__E() {
%1 = tail call i32 (...) @test61_AvrPin_toggle__E()
ret void
}
void q_decrement(void *cntp) {
  int *cnt = (int *)cntp;
  ;
  (*cnt)--;
  ;
}


x86 assembly (clang, -O0):
<q_decrement>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<q_decrement>:
addl   $0xffffffff,(%rdi)
ret

LLVM IR (-O0):
define void @q_decrement(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 = add nsw i32 %7, -1
store i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @q_decrement(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
ret void
}
unsigned long ld(unsigned long x) {
  unsigned long k = 0;
  while (x >>= 1) {
    ++k;
  }
  return k;
}


x86 assembly (clang, -O0):
<ld>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1137 <ld+0x37>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <ld+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld>:
xor    %eax,%eax
cmp    $0x2,%rdi
jb     1120 <ld+0x20>
mov    %rdi,%rcx
nopl   0x0(%rax,%rax,1)
shr    %rcx
add    $0x1,%rax
cmp    $0x3,%rdi
mov    %rcx,%rdi
ja     1110 <ld+0x10>
ret

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

LLVM IR (-O2):
define i64 @ld(i64 %0) {
%2 = icmp ult i64 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %7, %3 ], [ 0, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i64 %5, 1
%7 = add nuw nsw i64 %4, 1
%8 = icmp ult i64 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i64 [ 0, %1 ], [ %7, %3 ]
ret i64 %10
}
/* Variables and functions */
double __ocml_fdim_f64(double, double);
double fdim(double x, double y) { return __ocml_fdim_f64(x, y); }


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

x86 assembly (clang, -O2):
<fdim>:
jmp    1030 <__ocml_fdim_f64@plt>

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

LLVM IR (-O2):
define double @fdim(double %0, double %1) {
%3 = tail call double @__ocml_fdim_f64(double %0, double %1)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ _random_32_func(int /*<<< orphan*/, int /*<<< orphan*/);
int32_t AMCRandom32(int32_t min, int32_t max) {
  return _random_32_func(min, max);
}


x86 assembly (clang, -O0):
<AMCRandom32>:
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 <_random_32_func@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AMCRandom32>:
jmp    1030 <_random_32_func@plt>

LLVM IR (-O0):
define i32 @AMCRandom32(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 @_random_32_func(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @AMCRandom32(i32 %0, i32 %1) {
%3 = tail call i32 @_random_32_func(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void strncpy_overflow(char *y) {
  char x[4];
  if (strlen(y) == 4)
    strncpy(x, y, 5);
}


x86 assembly (clang, -O0):
<strncpy_overflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x4,%eax
jne    1150 <strncpy_overflow+0x30>
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x5,%edx
call   1030 <strncpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy_overflow>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1040 <strlen@plt>
cmp    $0x4,%eax
jne    1144 <strncpy_overflow+0x24>
lea    0xc(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x5,%edx
call   1030 <strncpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @strncpy_overflow(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = icmp eq i32 %5, 4
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%9 = load i8*, i8** %2
%10 = call i32 @strncpy(i8* %8, i8* %9, i32 5)
br label %11
11: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @strncpy_overflow(i8* %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp eq i32 %4, 4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @strncpy(i8* %3, i8* %0, i32 5)
br label %8
8: ; preds = %6, %1
ret void
}
/* Variables and functions */
int sort_array(int *array, size_t length) { return 0; }


x86 assembly (clang, -O0):
<sort_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sort_array(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @sort_array(i32* nocapture readnone %0, i64 %1) {
ret i32 0
}
extern __attribute__((gnu_)) double carmen_fmax(double val1, double val2) {
  if (val2 > val1)
    return val2;
  return val1;
}


x86 assembly (clang, -O0):
<carmen_fmax>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <carmen_fmax+0x2d>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <carmen_fmax+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<carmen_fmax>:
maxsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @carmen_fmax(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fcmp ogt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %5
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %4
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @carmen_fmax(double %0, double %1) {
%3 = fcmp ogt double %1, %0
%4 = select i1 %3, double %1, double %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ _delay_us(int);
int /*<<< orphan*/ clear_SDA();
int /*<<< orphan*/ set_SCL();
int /*<<< orphan*/ set_SDA();
int /*<<< orphan*/ set_SDA_output();
void send_stop_sequence() {
  set_SDA();
  set_SDA_output();
  _delay_us(1);
  clear_SDA();
  _delay_us(1);
  set_SCL();
  _delay_us(1);
  set_SDA();
  _delay_us(1);
}


x86 assembly (clang, -O0):
<send_stop_sequence>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <set_SDA@plt>
mov    $0x0,%al
call   1050 <set_SDA_output@plt>
mov    $0x1,%edi
call   1040 <_delay_us@plt>
mov    $0x0,%al
call   1060 <clear_SDA@plt>
mov    $0x1,%edi
call   1040 <_delay_us@plt>
mov    $0x0,%al
call   1070 <set_SCL@plt>
mov    $0x1,%edi
call   1040 <_delay_us@plt>
mov    $0x0,%al
call   1030 <set_SDA@plt>
mov    $0x1,%edi
call   1040 <_delay_us@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_stop_sequence>:
push   %rax
xor    %eax,%eax
call   1030 <set_SDA@plt>
xor    %eax,%eax
call   1050 <set_SDA_output@plt>
mov    $0x1,%edi
call   1040 <_delay_us@plt>
xor    %eax,%eax
call   1060 <clear_SDA@plt>
mov    $0x1,%edi
call   1040 <_delay_us@plt>
xor    %eax,%eax
call   1070 <set_SCL@plt>
mov    $0x1,%edi
call   1040 <_delay_us@plt>
xor    %eax,%eax
call   1030 <set_SDA@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <_delay_us@plt>

LLVM IR (-O0):
define void @send_stop_sequence() {
%1 = call i32 (...) @set_SDA()
%2 = call i32 (...) @set_SDA_output()
%3 = call i32 @_delay_us(i32 1)
%4 = call i32 (...) @clear_SDA()
%5 = call i32 @_delay_us(i32 1)
%6 = call i32 (...) @set_SCL()
%7 = call i32 @_delay_us(i32 1)
%8 = call i32 (...) @set_SDA()
%9 = call i32 @_delay_us(i32 1)
ret void
}

LLVM IR (-O2):
define void @send_stop_sequence() {
%1 = tail call i32 (...) @set_SDA()
%2 = tail call i32 (...) @set_SDA_output()
%3 = tail call i32 @_delay_us(i32 1)
%4 = tail call i32 (...) @clear_SDA()
%5 = tail call i32 @_delay_us(i32 1)
%6 = tail call i32 (...) @set_SCL()
%7 = tail call i32 @_delay_us(i32 1)
%8 = tail call i32 (...) @set_SDA()
%9 = tail call i32 @_delay_us(i32 1)
ret void
}
/* Variables and functions */
scalar_t__ fopen(char const *, char const *);
void *File_GetHandle(const char *file_path, const char *mode) {
  return (void *)fopen(file_path, mode);
}


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

x86 assembly (clang, -O2):
<File_GetHandle>:
jmp    1030 <fopen@plt>

LLVM IR (-O0):
define i8* @File_GetHandle(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @fopen(i8* %5, i8* %6)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @File_GetHandle(i8* %0, i8* %1) {
%3 = tail call i64 @fopen(i8* %0, i8* %1)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int read_quaddobl_target_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(241, a, b, c);
  return fail;
}


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

x86 assembly (clang, -O2):
<read_quaddobl_target_system>:
mov    $0xf1,%edi
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @read_quaddobl_target_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 241, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printw(char *);
void ion_cmd_copy(char *cmd) { printw("\n\rcopy command\n\r\n\r"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"\0A\0Dcopy command\0A\0D\0A\0D\00"
define void @ion_cmd_copy(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printw(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0A\0Dcopy command\0A\0D\0A\0D\00"
define void @ion_cmd_copy(i8* nocapture readnone %0) {
%2 = tail call i32 @printw(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bSearch(int);
int main() {
  for (int i = 0; i < 10; i++) {
    bSearch(i);
  }
  bSearch(11);
  bSearch(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1146 <main+0x36>
mov    -0x8(%rbp),%edi
call   1030 <bSearch@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    $0xb,%edi
call   1030 <bSearch@plt>
xor    %edi,%edi
call   1030 <bSearch@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <bSearch@plt>
mov    $0x1,%edi
call   1030 <bSearch@plt>
mov    $0x2,%edi
call   1030 <bSearch@plt>
mov    $0x3,%edi
call   1030 <bSearch@plt>
mov    $0x4,%edi
call   1030 <bSearch@plt>
mov    $0x5,%edi
call   1030 <bSearch@plt>
mov    $0x6,%edi
call   1030 <bSearch@plt>
mov    $0x7,%edi
call   1030 <bSearch@plt>
mov    $0x8,%edi
call   1030 <bSearch@plt>
mov    $0x9,%edi
call   1030 <bSearch@plt>
mov    $0xb,%edi
call   1030 <bSearch@plt>
xor    %edi,%edi
call   1030 <bSearch@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @bSearch(i32 0)
%2 = tail call i32 @bSearch(i32 1)
%3 = tail call i32 @bSearch(i32 2)
%4 = tail call i32 @bSearch(i32 3)
%5 = tail call i32 @bSearch(i32 4)
%6 = tail call i32 @bSearch(i32 5)
%7 = tail call i32 @bSearch(i32 6)
%8 = tail call i32 @bSearch(i32 7)
%9 = tail call i32 @bSearch(i32 8)
%10 = tail call i32 @bSearch(i32 9)
%11 = tail call i32 @bSearch(i32 11)
%12 = tail call i32 @bSearch(i32 0)
ret i32 0
}
void empty_kernel(__attribute__((unused)) void **alloc,
                  __attribute__((unused)) void **in,
                  __attribute__((unused)) void **inout,
                  __attribute__((unused)) void **out) {}


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

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

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

LLVM IR (-O2):
define void @empty_kernel(i8** nocapture %0, i8** nocapture %1, i8** nocapture %2, i8** nocapture %3) {
ret void
}
short int shortswap_(le_short)
short int le_short;
{
  union {
    short bs;
    char bc[2];
  } bsbuf;
  char chold;
  bsbuf.bs = le_short;
  chold = bsbuf.bc[0];
  bsbuf.bc[0] = bsbuf.bc[1];
  bsbuf.bc[1] = chold;
  return (bsbuf.bs);
}


x86 assembly (clang, -O0):
<shortswap_>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
mov    %ax,-0x8(%rbp)
mov    -0x8(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x7(%rbp),%al
mov    %al,-0x8(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0x7(%rbp)
movswl -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shortswap_>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
%union.anon = type { i16 }
define signext i16 @shortswap_(i32 %0) {
%2 = alloca i16
%3 = alloca %union.anon
%4 = alloca i8
%5 = trunc i32 %0 to i16
store i16 %5, i16* %2
%6 = load i16, i16* %2
%7 = bitcast %union.anon* %3 to i16*
store i16 %6, i16* %7
%8 = bitcast %union.anon* %3 to [2 x i8]*
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 0
%10 = load i8, i8* %9
store i8 %10, i8* %4
%11 = bitcast %union.anon* %3 to [2 x i8]*
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %11, i64 0, i64 1
%13 = load i8, i8* %12
%14 = bitcast %union.anon* %3 to [2 x i8]*
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %14, i64 0, i64 0
store i8 %13, i8* %15
%16 = load i8, i8* %4
%17 = bitcast %union.anon* %3 to [2 x i8]*
%18 = getelementptr inbounds [2 x i8], [2 x i8]* %17, i64 0, i64 1
store i8 %16, i8* %18
%19 = bitcast %union.anon* %3 to i16*
%20 = load i16, i16* %19
ret i16 %20
}

LLVM IR (-O2):
define signext i16 @shortswap_(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
ret i16 %3
}
long int sas_fetch_and_or_long(unsigned long *pointer, long int delta) {
  return __atomic_fetch_or(pointer, delta, 4);
}


x86 assembly (clang, -O0):
<sas_fetch_and_or_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rcx
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x30(%rbp)
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%rsi
mov    %rax,%rdx
or     %rsi,%rdx
lock cmpxchg %rdx,(%rcx)
sete   %cl
mov    %rax,-0x40(%rbp)
test   $0x1,%cl
mov    %rax,-0x28(%rbp)
jne    115b <sas_fetch_and_or_long+0x5b>
jmp    112b <sas_fetch_and_or_long+0x2b>
mov    -0x40(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sas_fetch_and_or_long>:
mov    (%rdi),%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rax,%rcx
or     %rsi,%rcx
lock cmpxchg %rcx,(%rdi)
jne    1110 <sas_fetch_and_or_long+0x10>
ret

LLVM IR (-O0):
define i64 @sas_fetch_and_or_long(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%7 = load i64*, i64** %3
%8 = load i64, i64* %4
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = atomicrmw or i64* %7, i64 %9 acq_rel
store i64 %10, i64* %6
%11 = load i64, i64* %6
ret i64 %11
}

LLVM IR (-O2):
define i64 @sas_fetch_and_or_long(i64* nocapture %0, i64 %1) {
%3 = atomicrmw or i64* %0, i64 %1 acq_rel
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Available operations:\n"
         "\tcreate <rows> <cols>\n"
         "\tdestroy <id>\n"
         "\tlist\n"
         "\tprint <id>\n"
         "\tget <id> <row> <col>\n"
         "\tset <id> <row> <col> <value>\n"
         "\thelp\n"
         "\tquit"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [141 x i8] c"Available operations:\0A\09create <rows> <cols>\0A\09destroy <id>\0A\09list\0A\09print <id>\0A\09get <id> <row> <col>\0A\09set <id> <row> <col> <value>\0A\09help\0A\09quit\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [140 x i8] c"Available operations:\0A\09create <rows> <cols>\0A\09destroy <id>\0A\09list\0A\09print <id>\0A\09get <id> <row> <col>\0A\09set <id> <row> <col> <value>\0A\09help\0A\09quit\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([140 x i8], [140 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isascii(unsigned char const);
int is_binary(const unsigned char *buffer, size_t len) {
  int i;
  for (i = 0; i < len; i++) {
    if (!isascii(buffer[i]))
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_binary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    116e <is_binary+0x5e>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <isascii@plt>
cmp    $0x0,%eax
jne    115b <is_binary+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1175 <is_binary+0x65>
jmp    1160 <is_binary+0x50>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1127 <is_binary+0x17>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_binary>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1147 <is_binary+0x37>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%r14,%rbx,1),%edi
call   1030 <isascii@plt>
test   %eax,%eax
je     114b <is_binary+0x3b>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <is_binary+0x20>
xor    %eax,%eax
jmp    1150 <is_binary+0x40>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @is_binary(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %13, label %6
4: ; preds = %6
%5 = icmp eq i64 %12, %1
br i1 %5, label %13, label %6
6: ; preds = %2, %4
%7 = phi i64 [ %12, %4 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @isascii(i8 zeroext %9)
%11 = icmp eq i32 %10, 0
%12 = add nuw i64 %7, 1
br i1 %11, label %13, label %4
13: ; preds = %6, %4, %2
%14 = phi i32 [ 0, %2 ], [ 0, %4 ], [ 1, %6 ]
ret i32 %14
}
/* Variables and functions */
unsigned long micros();
void moduleLoop() { unsigned long now = micros(); }


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

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

LLVM IR (-O0):
define void @moduleLoop() {
%1 = alloca i64
%2 = call i64 (...) @micros()
store i64 %2, i64* %1
ret void
}

LLVM IR (-O2):
define void @moduleLoop() {
%1 = tail call i64 (...) @micros()
ret void
}
/* Variables and functions */
double oddhs_lhs(int const, int const *, double const *);
double oddhs_rhs(int const);
double oddhs_viol(const int size, const int idx[], const double x[]) {
  return oddhs_lhs(size, idx, x) - oddhs_rhs(size);
}


x86 assembly (clang, -O0):
<oddhs_viol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <oddhs_lhs@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <oddhs_rhs@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
subsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oddhs_viol>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
call   1040 <oddhs_lhs@plt>
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
call   1030 <oddhs_rhs@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @oddhs_viol(i32 %0, i32* %1, double* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca double*
store i32 %0, i32* %4
store i32* %1, i32** %5
store double* %2, double** %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = load double*, double** %6
%10 = call double @oddhs_lhs(i32 %7, i32* %8, double* %9)
%11 = load i32, i32* %4
%12 = call double @oddhs_rhs(i32 %11)
%13 = fsub double %10, %12
ret double %13
}

LLVM IR (-O2):
define double @oddhs_viol(i32 %0, i32* %1, double* %2) {
%4 = tail call double @oddhs_lhs(i32 %0, i32* %1, double* %2)
%5 = tail call double @oddhs_rhs(i32 %0)
%6 = fsub double %4, %5
ret double %6
}
/* Variables and functions */
unsigned char RD(int, int);
unsigned char GR(int i, int j) { return RD(i, j); }


x86 assembly (clang, -O0):
<GR>:
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 <RD@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GR>:
jmp    1030 <RD@plt>

LLVM IR (-O0):
define zeroext i8 @GR(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 zeroext i8 @RD(i32 %5, i32 %6)
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @GR(i32 %0, i32 %1) {
%3 = tail call zeroext i8 @RD(i32 %0, i32 %1)
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ pcibios_write_config_dword(int /*<<< orphan*/, scalar_t__,
                                              int, int);
void set_nbxcfg(void) {
  pcibios_write_config_dword(0, ((0x00 << 3) + 0), 0x50, 0xff00000c);
}


x86 assembly (clang, -O0):
<set_nbxcfg>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x50,%edx
mov    $0xff00000c,%ecx
call   1030 <pcibios_write_config_dword@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_nbxcfg>:
xor    %edi,%edi
xor    %esi,%esi
mov    $0x50,%edx
mov    $0xff00000c,%ecx
jmp    1030 <pcibios_write_config_dword@plt>

LLVM IR (-O0):
define void @set_nbxcfg() {
%1 = call i32 @pcibios_write_config_dword(i32 0, i64 0, i32 80, i32 -16777204)
ret void
}

LLVM IR (-O2):
define void @set_nbxcfg() {
%1 = tail call i32 @pcibios_write_config_dword(i32 0, i64 0, i32 80, i32 -16777204)
ret void
}
int count_digits(int n) {
  if (n <= 0)
    return 0;
  return 1 + count_digits(n / 10);
}


x86 assembly (clang, -O0):
<count_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1131 <count_digits+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1149 <count_digits+0x39>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <count_digits@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_digits>:
xor    %eax,%eax
test   %edi,%edi
jle    1124 <count_digits+0x24>
mov    $0xcccccccd,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    $0x1,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <count_digits+0x10>
ret

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

LLVM IR (-O2):
define i32 @count_digits(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = udiv i32 %4, 10
%7 = add nuw nsw i32 %5, 1
%8 = icmp ult i32 %4, 10
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
void rop3_67_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D & S;
  stk3 = ~stk3;
  stk2 = T & stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  *D = stk1;
}


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

x86 assembly (clang, -O2):
<rop3_67_0_0>:
mov    (%rdi),%al
and    %sil,%al
not    %al
and    %dl,%al
xor    %sil,%al
not    %al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_67_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
%6 = xor i8 %5, -1
%7 = and i8 %6, %2
%8 = xor i8 %7, %1
%9 = xor i8 %8, -1
store i8 %9, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int /*<<< orphan*/,
                           char *);
int /*<<< orphan*/ stdout;
void __kv_5_print(void *c, void *k, void *v) {
  fprintf(stdout, "(%ld,%s)\n", *(int64_t *)k, (char *)v);
}


x86 assembly (clang, -O0):
<__kv_5_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rcx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__kv_5_print>:
mov    %rdx,%rcx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%edx
lea    0xedb(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [10 x i8] c"(%ld,%s)\0A\00"
define void @__kv_5_print(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* @stdout
%8 = load i8*, i8** %5
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = load i8*, i8** %6
%12 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %11)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [10 x i8] c"(%ld,%s)\0A\00"
define void @__kv_5_print(i8* nocapture readnone %0, i8* nocapture %1, i8* %2) {
%4 = load i32, i32* @stdout
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %2)
ret void
}
/* Variables and functions */
char *getenv(char *);
scalar_t__ strcmp(char *, char *);
bool have_xcode_colors(void) {
  char *xcc_env = getenv("XcodeColors");
  if (xcc_env && (strcmp(xcc_env, "YES") == 0)) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<have_xcode_colors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1169 <have_xcode_colors+0x49>
mov    -0x10(%rbp),%rdi
lea    0xebe(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1169 <have_xcode_colors+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1170 <have_xcode_colors+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<have_xcode_colors>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1146 <have_xcode_colors+0x26>
lea    0xed3(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     114a <have_xcode_colors+0x2a>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"XcodeColors\00"
@.str.1 = [4 x i8] c"YES\00"
define i32 @have_xcode_colors() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %3, %0
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %8
}
/* Variables and functions */
int lace_builtin_elastic_pthread_main(int, char **, int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  return lace_builtin_elastic_pthread_main(argc, argv, NULL, NULL);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <lace_builtin_elastic_pthread_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <lace_builtin_elastic_pthread_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @lace_builtin_elastic_pthread_main(i32 %0, i8** %1, i32* null, i32* null)
ret i32 %3
}
void compilerParseFile(struct compiler *cmp) { (void)cmp; }


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

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

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

LLVM IR (-O2):
%struct.compiler = type opaque
define void @compilerParseFile(%struct.compiler* nocapture %0) {
ret void
}