xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ int_pow(int, int);
int dep(int total, int width) {
  int i;
  int x = 0;
  for (i = 1; x < total - 1; i++) {
    x += int_pow(width, i);
  }
  return i - 1;
}


x86 assembly (clang, -O0):
<dep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1163 <dep+0x53>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <int_pow@plt>
mov    %rax,%rcx
movslq -0x10(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <dep+0x1c>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dep>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
cmp    $0x2,%edi
jl     1144 <dep+0x34>
mov    %esi,%r14d
mov    %edi,%r15d
add    $0xffffffff,%r15d
xor    %ebx,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax)
add    $0x1,%ebx
mov    %r14d,%edi
mov    %ebx,%esi
call   1030 <int_pow@plt>
add    %eax,%ebp
cmp    %r15d,%ebp
jl     1130 <dep+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @dep(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %6
store i32 1, i32* %5
br label %7
7: ; preds = %20, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 1
%11 = icmp slt i32 %8, %10
br i1 %11, label %12, label %23
12: ; preds = %7
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = call i64 @int_pow(i32 %13, i32 %14)
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = add nsw i64 %17, %15
%19 = trunc i64 %18 to i32
store i32 %19, i32* %6
br label %20
20: ; preds = %12
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %7
23: ; preds = %7
%24 = load i32, i32* %5
%25 = sub nsw i32 %24, 1
ret i32 %25
}

LLVM IR (-O2):
define i32 @dep(i32 %0, i32 %1) {
%3 = add nsw i32 %0, -1
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %13
5: ; preds = %2, %5
%6 = phi i32 [ %10, %5 ], [ 0, %2 ]
%7 = phi i32 [ %11, %5 ], [ 1, %2 ]
%8 = tail call i64 @int_pow(i32 %1, i32 %7)
%9 = trunc i64 %8 to i32
%10 = add i32 %6, %9
%11 = add nuw nsw i32 %7, 1
%12 = icmp slt i32 %10, %3
br i1 %12, label %5, label %13
13: ; preds = %5, %2
%14 = phi i32 [ 0, %2 ], [ %7, %5 ]
ret i32 %14
}
/* Variables and functions */
double rand_norm();
double rand_unif(double h) { return h * (2.0 * rand_norm() - 1.0); }


x86 assembly (clang, -O0):
<rand_unif>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand_norm@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
addsd  %xmm1,%xmm1
movsd  0xebe(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_unif>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand_norm@plt>
addsd  %xmm0,%xmm0
addsd  0xed7(%rip),%xmm0
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rand_unif(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double (...) @rand_norm()
%5 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %4, double -1.000000e+00)
%6 = fmul double %3, %5
ret double %6
}

LLVM IR (-O2):
define double @rand_unif(double %0) {
%2 = tail call double (...) @rand_norm()
%3 = tail call double @llvm.fmuladd.f64(double %2, double 2.000000e+00, double -1.000000e+00)
%4 = fmul double %3, %0
ret double %4
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
unsigned long long elapsed_utime(struct timeval start_time,
                                 struct timeval end_time) {
  unsigned long long ret = (end_time.tv_sec - start_time.tv_sec) * 1000000 +
                           (end_time.tv_usec - start_time.tv_usec);
  return ret;
}


x86 assembly (clang, -O0):
<elapsed_utime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0x8(%rbp),%eax
imul   $0xf4240,%eax,%eax
mov    -0xc(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    %ecx,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<elapsed_utime>:
mov    %rsi,%rax
sub    %edi,%esi
shr    $0x20,%rdi
shr    $0x20,%rax
imul   $0xf4240,%esi,%ecx
sub    %edi,%eax
add    %ecx,%eax
cltq
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @elapsed_utime(i64 %0, i64 %1) {
%3 = alloca %struct.timeval
%4 = alloca %struct.timeval
%5 = alloca i64
%6 = bitcast %struct.timeval* %3 to i64*
store i64 %0, i64* %6
%7 = bitcast %struct.timeval* %4 to i64*
store i64 %1, i64* %7
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%11 = load i32, i32* %10
%12 = sub nsw i32 %9, %11
%13 = mul nsw i32 %12, 1000000
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
%15 = load i32, i32* %14
%16 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%17 = load i32, i32* %16
%18 = sub nsw i32 %15, %17
%19 = add nsw i32 %13, %18
%20 = sext i32 %19 to i64
store i64 %20, i64* %5
%21 = load i64, i64* %5
ret i64 %21
}

LLVM IR (-O2):
define i64 @elapsed_utime(i64 %0, i64 %1) {
%3 = lshr i64 %0, 32
%4 = lshr i64 %1, 32
%5 = sub i64 %1, %0
%6 = mul i64 %5, 1000000
%7 = sub nsw i64 %4, %3
%8 = add i64 %7, %6
%9 = shl i64 %8, 32
%10 = ashr exact i64 %9, 32
ret i64 %10
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ printf(char *, int);
void main(void) {
  int c;
  int i = 0;
  while (c != '\n') {
    c = getchar();
    ++i;
  }
  printf("El numero de caracteres es: %i\n", i - 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x4(%rbp)
je     1151 <main+0x31>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <main+0xf>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%ebx
cmp    $0xa,%eax
jne    1130 <main+0x10>
lea    0xeba(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"El numero de caracteres es: %i\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = call i32 (...) @getchar()
store i32 %7, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %3
10: ; preds = %3
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 1
%13 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"El numero de caracteres es: %i\0A\00"
define void @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ %4, %1 ], [ 0, %0 ]
%3 = tail call i32 (...) @getchar()
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %3, 10
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ append(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ display_name(char const *, char const *);
void on_int32(void *ctx, const char *code, const char *name, int32_t value) {
  append("%s: %d", display_name(code, name), value);
}


x86 assembly (clang, -O0):
<on_int32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <display_name@plt>
mov    %eax,%esi
mov    -0x1c(%rbp),%edx
lea    0xeb0(%rip),%rdi
call   1030 <append@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_int32>:
push   %rbx
mov    %ecx,%ebx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1040 <display_name@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
pop    %rbx
jmp    1030 <append@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s: %d\00"
define void @on_int32(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = call i32 @display_name(i8* %9, i8* %10)
%12 = load i32, i32* %8
%13 = call i32 @append(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s: %d\00"
define void @on_int32(i8* nocapture readnone %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @display_name(i8* %1, i8* %2)
%6 = tail call i32 @append(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %3)
ret void
}
void test_37_0(char *mem) { __atomic_nand_fetch(mem, 1, 4); }


x86 assembly (clang, -O0):
<test_37_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movb   $0x1,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,-0xc(%rbp)
mov    (%rax),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%sil
mov    %al,%dl
and    %sil,%dl
mov    %dl,-0x1a(%rbp)
not    %dl
lock cmpxchg %dl,(%rcx)
sete   %cl
mov    %al,-0x19(%rbp)
test   $0x1,%cl
mov    %al,-0xb(%rbp)
jne    114f <test_37_0+0x4f>
jmp    111f <test_37_0+0x1f>
mov    -0xc(%rbp),%cl
mov    -0x19(%rbp),%al
and    %cl,%al
xor    $0xff,%al
mov    %al,-0xa(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_37_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8 1, i8* %3
%6 = load i8, i8* %3
%7 = atomicrmw nand i8* %5, i8 %6 acq_rel
%8 = and i8 %7, %6
%9 = xor i8 %8, -1
store i8 %9, i8* %4
%10 = load i8, i8* %4
ret void
}

LLVM IR (-O2):
define void @test_37_0(i8* nocapture %0) {
%2 = atomicrmw nand i8* %0, i8 1 acq_rel
ret void
}
void clear_piece(char piece[7][7]) {
  for (int y = 0; y < 7; y++) {
    for (int x = 0; x < 7; x++) {
      piece[x][y] = 0;
    }
  }
}


x86 assembly (clang, -O0):
<clear_piece>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
jge    1162 <clear_piece+0x62>
movl   $0x0,-0x10(%rbp)
cmpl   $0x7,-0x10(%rbp)
jge    114f <clear_piece+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
imul   $0x7,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <clear_piece+0x20>
jmp    1154 <clear_piece+0x54>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <clear_piece+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_piece>:
xorps  %xmm0,%xmm0
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
movb   $0x0,0x30(%rdi)
ret

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

LLVM IR (-O2):
define void @clear_piece([7 x i8]* nocapture writeonly %0) {
%2 = getelementptr [7 x i8], [7 x i8]* %0, i64 0, i64 0
ret void
}
double gsw_sr_from_sp(double sp) {
  double res;
  res = 1.004715428571429e0 * sp;
  if (res >= 1.e10)
    res = 9.e15;
  return (res);
}


x86 assembly (clang, -O0):
<gsw_sr_from_sp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed8(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     113f <gsw_sr_from_sp+0x3f>
movsd  0xed6(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsw_sr_from_sp>:
mulsd  0xef8(%rip),%xmm0
movsd  0xef8(%rip),%xmm1
cmpnlesd %xmm0,%xmm1
andpd  %xmm1,%xmm0
movsd  0xeef(%rip),%xmm2
andnpd %xmm2,%xmm1
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @gsw_sr_from_sp(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double 0x3FF013507C3803BC, %4
store double %5, double* %3
%6 = load double, double* %3
%7 = fcmp oge double %6, 1.000000e+10
br i1 %7, label %8, label %9
8: ; preds = %1
store double 9.000000e+15, double* %3
br label %9
9: ; preds = %8, %1
%10 = load double, double* %3
ret double %10
}

LLVM IR (-O2):
define double @gsw_sr_from_sp(double %0) {
%2 = fmul double %0, 0x3FF013507C3803BC
%3 = fcmp ult double %2, 1.000000e+10
%4 = select i1 %3, double %2, double 9.000000e+15
ret double %4
}
int input1_simple_loop() {
  int n = 10;
  int i, sum = 0;
  for (i = 1; i <= 10; i++) {
    sum += i;
  }
  return sum;
}


x86 assembly (clang, -O0):
<input1_simple_loop>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     113a <input1_simple_loop+0x3a>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <input1_simple_loop+0x19>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @input1_simple_loop() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 10, i32* %1
store i32 0, i32* %3
store i32 1, i32* %2
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 10
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %9, %8
store i32 %10, i32* %3
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
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @input1_simple_loop() {
ret i32 55
}
void NoSoundDrv_MIDI_Shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @NoSoundDrv_MIDI_Shutdown() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void json_free(void *ptr) {
  if (ptr != NULL) {
    free(ptr);
  }
}


x86 assembly (clang, -O0):
<json_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <json_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_free>:
test   %rdi,%rdi
je     111a <json_free+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @json_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void updateMovieCommunityRating(unsigned int movieID,
                                unsigned short communityRating) {
  return;
}


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

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

LLVM IR (-O0):
define void @updateMovieCommunityRating(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
ret void
}

LLVM IR (-O2):
define void @updateMovieCommunityRating(i32 %0, i16 zeroext %1) {
ret void
}
/* Variables and functions */
bool isPrime(int n) {
  if (n < 0) {
    n = -n;
  }
  return n == 2 || n == 3 || n == 5 || n == 7;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1119 <isPrime+0x19>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x2,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1150 <isPrime+0x50>
mov    $0x1,%al
cmpl   $0x3,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1150 <isPrime+0x50>
mov    $0x1,%al
cmpl   $0x5,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1150 <isPrime+0x50>
cmpl   $0x7,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
mov    %eax,%ecx
and    $0x7ffffffe,%ecx
cmp    $0x2,%ecx
sete   %cl
and    $0x7ffffffd,%eax
cmp    $0x5,%eax
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @isPrime(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
store i32 %7, i32* %2
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 2
br i1 %10, label %20, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 3
br i1 %13, label %20, label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 5
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 7
br label %20
20: ; preds = %17, %14, %11, %8
%21 = phi i1 [ true, %14 ], [ true, %11 ], [ true, %8 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = and i32 %2, 2147483646
%4 = icmp eq i32 %3, 2
%5 = and i32 %2, 2147483645
%6 = icmp eq i32 %5, 5
%7 = or i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int sr_skip_char_span(char const **, char *);
int sr_skip_uint(const char **input) {
  return sr_skip_char_span(input, "0123456789");
}


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

x86 assembly (clang, -O2):
<sr_skip_uint>:
lea    0xee9(%rip),%rsi
jmp    1030 <sr_skip_char_span@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"0123456789\00"
define i32 @sr_skip_uint(i8** %0) {
%2 = tail call i32 @sr_skip_char_span(i8** %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *, int, char const *);
void __assert_func(const char *file, int line, const char *msg) {
  printf("Assert failed: %s:%d: %s\n", file, line, msg);
  exit(1);
}


x86 assembly (clang, -O0):
<__assert_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<__assert_func>:
push   %rax
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Assert failed: %s:%d: %s\0A\00"
define void @__assert_func(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i8* %9)
%11 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [26 x i8] c"Assert failed: %s:%d: %s\0A\00"
define void @__assert_func(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
%5 = tail call i32 @exit(i32 1)
unreachable
}
int g(const int *restrict a, int *b) {
  *b;
  *a;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @g(i32* noalias nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 0
}
void ConvertFromI420() {}


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

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

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

LLVM IR (-O2):
define void @ConvertFromI420() {
ret void
}
void f_show(void) {
  printf("%s(%d)\n", __func__, 45);
  ;
}


x86 assembly (clang, -O0):
<f_show>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee6(%rip),%rsi
mov    $0x2d,%edx
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_show>:
lea    0xee9(%rip),%rdi
lea    0xeea(%rip),%rsi
mov    $0x2d,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s(%d)\0A\00"
@__func__.f_show = [7 x i8] c"f_show\00"
define void @f_show() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.f_show, i64 0, i64 0), i32 45)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s(%d)\0A\00"
@__func__.f_show = [7 x i8] c"f_show\00"
define void @f_show() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.f_show, i64 0, i64 0), i32 45)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x15() {
  Assert_real((isdigit(21) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              110, ("isdigit should be 0 for 0x15"));
}


x86 assembly (clang, -O0):
<t_isdigit_0x15>:
push   %rbp
mov    %rsp,%rbp
mov    $0x15,%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x6e,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0x15>:
push   %rax
mov    $0x15,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x6e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x15\00"
define void @t_isdigit_0x15() {
%1 = call i64 @isdigit(i32 21)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 110, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x15\00"
define void @t_isdigit_0x15() {
%1 = tail call i64 @isdigit(i32 21)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 110, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int nanosleep(struct timespec *, struct timespec *);
int msleep(int ms) {
  struct timespec t, r;
  t.tv_sec = ms / 1000;
  t.tv_nsec = (ms % 1000) * 1000 * 1000;
  return nanosleep(&t, &r);
}


x86 assembly (clang, -O0):
<msleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0x3e8,%edx,%eax
imul   $0x3e8,%eax,%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msleep>:
sub    $0x18,%rsp
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
mov    %ecx,0x8(%rsp)
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
imul   $0xf4240,%eax,%eax
mov    %eax,0xc(%rsp)
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i32 @msleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
%4 = alloca %struct.timespec
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %6, i32* %7
%8 = load i32, i32* %2
%9 = srem i32 %8, 1000
%10 = mul nsw i32 %9, 1000
%11 = mul nsw i32 %10, 1000
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 %11, i32* %12
%13 = call i32 @nanosleep(%struct.timespec* %3, %struct.timespec* %4)
ret i32 %13
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define i32 @msleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %2 to i8*
%5 = bitcast %struct.timespec* %3 to i8*
%6 = sdiv i32 %0, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %6, i32* %7
%8 = srem i32 %0, 1000
%9 = mul nsw i32 %8, 1000000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 %9, i32* %10
%11 = call i32 @nanosleep(%struct.timespec* %2, %struct.timespec* %3)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ EVLOOP_NONBLOCK;
int /*<<< orphan*/ event_loop(int /*<<< orphan*/);
void av_check() { event_loop(EVLOOP_NONBLOCK); }


x86 assembly (clang, -O0):
<av_check>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <event_loop@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_check>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <event_loop@plt>

LLVM IR (-O0):
@EVLOOP_NONBLOCK = global i32 0
define void @av_check() {
%1 = load i32, i32* @EVLOOP_NONBLOCK
%2 = call i32 @event_loop(i32 %1)
ret void
}

LLVM IR (-O2):
@EVLOOP_NONBLOCK = global i32 0
define void @av_check() {
%1 = load i32, i32* @EVLOOP_NONBLOCK
%2 = tail call i32 @event_loop(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char fgetc(int /*<<< orphan*/ *);
int skeep_string(FILE *file) {
  int i = 0;
  while (fgetc(file) != '\0')
    i++;
  return ++i;
}


x86 assembly (clang, -O0):
<skeep_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
movsbl %al,%eax
cmp    $0x0,%eax
je     1146 <skeep_string+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <skeep_string+0x13>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skeep_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <fgetc@plt>
add    $0x1,%ebx
test   %al,%al
jne    1120 <skeep_string+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @skeep_string(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %6, %2 ]
%4 = tail call signext i8 @fgetc(i32* %0)
%5 = icmp eq i8 %4, 0
%6 = add i32 %3, 1
br i1 %5, label %7, label %2
7: ; preds = %2
ret i32 %3
}
/* Variables and functions */
bool nrf51_errata_38(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_38() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ done();
void main(void) { done(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @done()
ret void
}
double tanh_derivative(const double value_before_activation,
                       const double value_after_activation) {
  (void)value_before_activation;
  return (1.0 - value_after_activation * value_after_activation);
}


x86 assembly (clang, -O0):
<tanh_derivative>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xec5(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tanh_derivative>:
mulsd  %xmm1,%xmm1
movsd  0xef4(%rip),%xmm0
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @tanh_derivative(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 = load double, double* %4
%8 = fneg double %6
%9 = call double @llvm.fmuladd.f64(double %8, double %7, double 1.000000e+00)
ret double %9
}

LLVM IR (-O2):
define double @tanh_derivative(double %0, double %1) {
%3 = fneg double %1
%4 = tail call double @llvm.fmuladd.f64(double %3, double %1, double 1.000000e+00)
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ myOrder(int /*<<< orphan*/ *);
int /*<<< orphan*/ *openUserFile(char *, char *);
int main(int argc, const char *argv[]) {
  FILE *infile;
  infile = openUserFile("Order file: ", "r");
  myOrder(infile);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    0xec9(%rip),%rsi
call   1040 <openUserFile@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <myOrder@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xede(%rip),%rsi
call   1040 <openUserFile@plt>
mov    %rax,%rdi
call   1030 <myOrder@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Order file: \00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32* @openUserFile(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %7, i32** %6
%8 = load i32*, i32** %6
%9 = call i32 @myOrder(i32* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Order file: \00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @openUserFile(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @myOrder(i32* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error(char *msg) {
  fprintf(stderr, "ERROR running script - %s\n", msg);
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"ERROR running script - %s\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"ERROR running script - %s\0A\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
extern bool __isleap(int year) {
  if (year % 100 == 0) {
    return year % 400 == 0;
  }
  return year % 4 == 0;
}


x86 assembly (clang, -O0):
<__isleap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1139 <__isleap+0x39>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <__isleap+0x52>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__isleap>:
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
ror    $0x2,%eax
cmp    $0x28f5c28,%eax
jbe    111a <__isleap+0x1a>
and    $0x3,%edi
jmp    1139 <__isleap+0x39>
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x27,%rax
add    %ecx,%eax
imul   $0x190,%eax,%eax
sub    %eax,%edi
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @__isleap(i32 %0) {
%2 = srem i32 %0, 100
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = srem i32 %0, 400
br label %8
6: ; preds = %1
%7 = and i32 %0, 3
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ stdout;
int vfprintf(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int vprintf_stdout(const char *fmt, va_list args) {
  return vfprintf(stdout, fmt, args);
}


x86 assembly (clang, -O0):
<vprintf_stdout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <vfprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vprintf_stdout>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <vfprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
define i32 @vprintf_stdout(i8* %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @vfprintf(i32 %3, i8* %0, i32 %1)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int puts(char *);
int vsprintf(char *, char const *, int /*<<< orphan*/);
signed int vprintf(const char *pFormat, va_list ap) {
  char pStr[100];
  char pError[] = "stdio.c: increase MAX_STRING_SIZE\r\n";
  if (vsprintf(pStr, pFormat, ap) >= 100) {
    puts(pError);
    while (1)
      ;
  }
  return puts(pStr);
}


x86 assembly (clang, -O0):
<vprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0xa0(%rbp),%rdi
lea    0xeb0(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1050 <vsprintf@plt>
cmp    $0x64,%eax
jl     1184 <vprintf+0x54>
lea    -0xa0(%rbp),%rdi
call   1030 <puts@plt>
jmp    117f <vprintf+0x4f>
lea    -0x70(%rbp),%rdi
call   1030 <puts@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vprintf>:
sub    $0x98,%rsp
mov    %esi,%edx
mov    %rdi,%rsi
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0xa0d45,0x20(%rsp)
lea    0x30(%rsp),%rdi
call   1040 <vsprintf@plt>
cmp    $0x64,%eax
jl     1172 <vprintf+0x52>
mov    %rsp,%rdi
call   1030 <puts@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
jmp    1170 <vprintf+0x50>
lea    0x30(%rsp),%rdi
call   1030 <puts@plt>
add    $0x98,%rsp
ret

LLVM IR (-O0):
@__const.vprintf.pError = [36 x i8] c"stdio.c: increase MAX_STRING_SIZE\0D\0A\00"
define i32 @vprintf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [100 x i8]
%6 = alloca [36 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = bitcast [36 x i8]* %6 to i8*
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = call i32 @vsprintf(i8* %8, i8* %9, i32 %10)
%12 = icmp sge i32 %11, 100
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = getelementptr inbounds [36 x i8], [36 x i8]* %6, i64 0, i64 0
%15 = call i32 @puts(i8* %14)
br label %16
16: ; preds = %13, %16
br label %16
17: ; preds = %2
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%19 = call i32 @puts(i8* %18)
ret i32 %19
}

LLVM IR (-O2):
@__const.vprintf.pError = [36 x i8] c"stdio.c: increase MAX_STRING_SIZE\0D\0A\00"
define i32 @vprintf(i8* nocapture %0, i32 %1) {
%3 = alloca [100 x i8]
%4 = alloca [36 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [36 x i8], [36 x i8]* %4, i64 0, i64 0
%7 = call i32 @vsprintf(i8* %5, i8* %0, i32 %1)
%8 = icmp sgt i32 %7, 99
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 @puts(i8* %6)
br label %11
11: ; preds = %11, %9
br label %11
12: ; preds = %2
%13 = call i32 @puts(i8* %5)
ret i32 %13
}
void mlx5_fpga_ipsec_cleanup(struct mlx5_core_dev *mdev) {}


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

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

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

LLVM IR (-O2):
%struct.mlx5_core_dev = type opaque
define void @mlx5_fpga_ipsec_cleanup(%struct.mlx5_core_dev* nocapture %0) {
ret void
}
void free2i(int **p, int row) {
  int i;
  for (i = 0; i < row; i++)
    free(p[i]);
  free(p);
}


x86 assembly (clang, -O0):
<free2i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free2i+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free2i+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free2i>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free2i+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free2i+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free2i(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i32** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putch(char);
int main(int argc, char **argv) {
  for (;;)
    putch('a');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x61,%edi
call   1030 <putch@plt>
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x61,%edi
call   1030 <putch@plt>
jmp    1120 <main+0x10>

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
br label %6
6: ; preds = %6, %2
%7 = call i32 @putch(i8 signext 97)
br label %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @putch(i8 signext 97)
br label %3
}
int is_char_bad(int c) {
  if (c == '_' || c == '.' || c == ',' || c == '/' || c == '\\' || c == '|' ||
      c == ' ' || c == '=' || c == '-') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_char_bad>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x5f,-0x8(%rbp)
je     1161 <is_char_bad+0x61>
cmpl   $0x2e,-0x8(%rbp)
je     1161 <is_char_bad+0x61>
cmpl   $0x2c,-0x8(%rbp)
je     1161 <is_char_bad+0x61>
cmpl   $0x2f,-0x8(%rbp)
je     1161 <is_char_bad+0x61>
cmpl   $0x5c,-0x8(%rbp)
je     1161 <is_char_bad+0x61>
cmpl   $0x7c,-0x8(%rbp)
je     1161 <is_char_bad+0x61>
cmpl   $0x20,-0x8(%rbp)
je     1161 <is_char_bad+0x61>
cmpl   $0x3d,-0x8(%rbp)
je     1161 <is_char_bad+0x61>
cmpl   $0x2d,-0x8(%rbp)
jne    116d <is_char_bad+0x6d>
movl   $0x1,-0x4(%rbp)
jmp    1174 <is_char_bad+0x74>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_char_bad>:
mov    $0x1,%eax
lea    -0x20(%rdi),%ecx
cmp    $0x3f,%ecx
ja     111e <is_char_bad+0x1e>
movabs $0x900000002000f001,%rdx
bt     %rcx,%rdx
jae    111e <is_char_bad+0x1e>
ret
cmp    $0x7c,%edi
je     111d <is_char_bad+0x1d>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_char_bad(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 95
br i1 %5, label %30, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 46
br i1 %8, label %30, label %9
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 44
br i1 %11, label %30, label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 47
br i1 %14, label %30, label %15
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 92
br i1 %17, label %30, label %18
18: ; preds = %15
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, 124
br i1 %20, label %30, label %21
21: ; preds = %18
%22 = load i32, i32* %3
%23 = icmp eq i32 %22, 32
br i1 %23, label %30, label %24
24: ; preds = %21
%25 = load i32, i32* %3
%26 = icmp eq i32 %25, 61
br i1 %26, label %30, label %27
27: ; preds = %24
%28 = load i32, i32* %3
%29 = icmp eq i32 %28, 45
br i1 %29, label %30, label %31
30: ; preds = %27, %24, %21, %18, %15, %12, %9, %6, %1
store i32 1, i32* %2
br label %32
31: ; preds = %27
store i32 0, i32* %2
br label %32
32: ; preds = %31, %30
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @is_char_bad(i32 %0) {
switch i32 %0, label %2 [
i32 124, label %3
i32 95, label %3
i32 92, label %3
i32 61, label %3
i32 47, label %3
i32 46, label %3
i32 45, label %3
i32 44, label %3
i32 32, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}