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

/* Variables and functions */
long C_flonum(long **, double);
long C_int_to_num(long **ptr, long n) {
  if ((((n)&0x8000000000000000L) == (((n)&0x4000000000000000L) << 1)))
    return (((long)(n) << 1) | 0x00000001);
  else
    return C_flonum(ptr, (double)n);
}


x86 assembly (clang, -O0):
<C_int_to_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movabs $0x8000000000000000,%rax
and    -0x18(%rbp),%rax
movabs $0x4000000000000000,%rcx
and    -0x18(%rbp),%rcx
shl    $0x1,%rcx
cmp    %rcx,%rax
jne    115e <C_int_to_num+0x4e>
mov    -0x18(%rbp),%rax
shl    $0x1,%rax
or     $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1171 <C_int_to_num+0x61>
mov    -0x10(%rbp),%rdi
cvtsi2sdq -0x18(%rbp),%xmm0
call   1030 <C_flonum@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_int_to_num>:
lea    (%rsi,%rsi,1),%rax
mov    %rax,%rcx
xor    %rsi,%rcx
js     1121 <C_int_to_num+0x11>
or     $0x1,%rax
ret
cvtsi2sd %rsi,%xmm0
jmp    1030 <C_flonum@plt>

LLVM IR (-O0):
define i64 @C_int_to_num(i64** %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64**
%5 = alloca i64
store i64** %0, i64*** %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = and i64 %6, -9223372036854775808
%8 = load i64, i64* %5
%9 = and i64 %8, 4611686018427387904
%10 = shl i64 %9, 1
%11 = icmp eq i64 %7, %10
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i64, i64* %5
%14 = shl i64 %13, 1
%15 = or i64 %14, 1
store i64 %15, i64* %3
br label %21
16: ; preds = %2
%17 = load i64**, i64*** %4
%18 = load i64, i64* %5
%19 = sitofp i64 %18 to double
%20 = call i64 @C_flonum(i64** %17, double %19)
store i64 %20, i64* %3
br label %21
21: ; preds = %16, %12
%22 = load i64, i64* %3
ret i64 %22
}

LLVM IR (-O2):
define i64 @C_int_to_num(i64** %0, i64 %1) {
%3 = shl i64 %1, 1
%4 = xor i64 %3, %1
%5 = icmp sgt i64 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = or i64 %3, 1
br label %11
8: ; preds = %2
%9 = sitofp i64 %1 to double
%10 = tail call i64 @C_flonum(i64** %0, double %9)
br label %11
11: ; preds = %8, %6
%12 = phi i64 [ %7, %6 ], [ %10, %8 ]
ret i64 %12
}
unsigned hash_combine(unsigned seed, unsigned hash) {
  seed ^= hash + 0x9e3779b9 + (seed << 6) + (seed >> 2);
  return seed;
}


x86 assembly (clang, -O0):
<hash_combine>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x9e3779b9,%eax
mov    -0x4(%rbp),%ecx
shl    $0x6,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
add    %ecx,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_combine>:
mov    %edi,%eax
shl    $0x6,%eax
add    %esi,%eax
mov    %edi,%ecx
shr    $0x2,%ecx
add    %ecx,%eax
add    $0x9e3779b9,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @hash_combine(i32 %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 = add i32 %5, -1640531527
%7 = load i32, i32* %3
%8 = shl i32 %7, 6
%9 = add i32 %6, %8
%10 = load i32, i32* %3
%11 = lshr i32 %10, 2
%12 = add i32 %9, %11
%13 = load i32, i32* %3
%14 = xor i32 %13, %12
store i32 %14, i32* %3
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @hash_combine(i32 %0, i32 %1) {
%3 = add i32 %1, -1640531527
%4 = shl i32 %0, 6
%5 = add i32 %3, %4
%6 = lshr i32 %0, 2
%7 = add i32 %5, %6
%8 = xor i32 %7, %0
ret i32 %8
}
int fun1044() { return 1044; }


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

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

LLVM IR (-O0):
define i32 @fun1044() {
ret i32 1044
}

LLVM IR (-O2):
define i32 @fun1044() {
ret i32 1044
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ get_reg(int);
int get_regb(int);
int /*<<< orphan*/ sx(int, int);
uint16_t get_opb(uint32_t insn) {
  if (insn & 0x00400000) {
    return sx(insn & 0xfff, 12);
  } else {
    int reg;
    reg = get_regb(insn);
    return get_reg(reg);
  }
}


x86 assembly (clang, -O0):
<get_opb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x400000,%eax
cmp    $0x0,%eax
je     1167 <get_opb+0x37>
mov    -0x8(%rbp),%edi
and    $0xfff,%edi
mov    $0xc,%esi
call   1040 <sx@plt>
mov    %eax,-0x4(%rbp)
jmp    117d <get_opb+0x4d>
mov    -0x8(%rbp),%edi
call   1050 <get_regb@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <get_reg@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_opb>:
test   $0x400000,%edi
jne    1146 <get_opb+0x16>
push   %rax
call   1050 <get_regb@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <get_reg@plt>
and    $0xfff,%edi
mov    $0xc,%esi
jmp    1040 <sx@plt>

LLVM IR (-O0):
define i32 @get_opb(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = and i32 %5, 4194304
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %3
%10 = and i32 %9, 4095
%11 = call i32 @sx(i32 %10, i32 12)
store i32 %11, i32* %2
br label %17
12: ; preds = %1
%13 = load i32, i32* %3
%14 = call i32 @get_regb(i32 %13)
store i32 %14, i32* %4
%15 = load i32, i32* %4
%16 = call i32 @get_reg(i32 %15)
store i32 %16, i32* %2
br label %17
17: ; preds = %12, %8
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @get_opb(i32 %0) {
%2 = and i32 %0, 4194304
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = and i32 %0, 4095
%6 = tail call i32 @sx(i32 %5, i32 12)
br label %10
7: ; preds = %1
%8 = tail call i32 @get_regb(i32 %0)
%9 = tail call i32 @get_reg(i32 %8)
br label %10
10: ; preds = %7, %4
%11 = phi i32 [ %6, %4 ], [ %9, %7 ]
ret i32 %11
}
/* Variables and functions */
double pow(double, double);
double alphaB_PPB(double TM) {
  double t4;
  t4 = TM / 8.617343e-5 / 1e4;
  return 4.309e-13 * pow(t4, -0.6166) / (1. + 0.6703 * pow(t4, 0.5300));
}


x86 assembly (clang, -O0):
<alphaB_PPB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xf06(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xef2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed4(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xebc(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe9e(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  0xe79(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe75(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alphaB_PPB>:
sub    $0x18,%rsp
divsd  0xee4(%rip),%xmm0
divsd  0xee4(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xede(%rip),%xmm1
call   1030 <pow@plt>
mulsd  0xed9(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xed3(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
call   1030 <pow@plt>
mulsd  0xec8(%rip),%xmm0
addsd  0xec8(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @alphaB_PPB(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fdiv double %4, 0x3F16970041294F34
%6 = fdiv double %5, 1.000000e+04
store double %6, double* %3
%7 = load double, double* %3
%8 = call double @pow(double %7, double -6.166000e-01)
%9 = fmul double 4.309000e-13, %8
%10 = load double, double* %3
%11 = call double @pow(double %10, double 5.300000e-01)
%12 = call double @llvm.fmuladd.f64(double 6.703000e-01, double %11, double 1.000000e+00)
%13 = fdiv double %9, %12
ret double %13
}

LLVM IR (-O2):
define double @alphaB_PPB(double %0) {
%2 = fdiv double %0, 0x3F16970041294F34
%3 = fdiv double %2, 1.000000e+04
%4 = tail call double @pow(double %3, double -6.166000e-01)
%5 = fmul double %4, 4.309000e-13
%6 = tail call double @pow(double %3, double 5.300000e-01)
%7 = tail call double @llvm.fmuladd.f64(double %6, double 6.703000e-01, double 1.000000e+00)
%8 = fdiv double %5, %7
ret double %8
}
double _pow(double x, unsigned int y) {
  double t = 1;
  for (; y != 0; y--)
    t *= x;
  return t;
}


x86 assembly (clang, -O0):
<_pow>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1140 <_pow+0x40>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <_pow+0x19>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pow>:
test   %edi,%edi
je     116a <_pow+0x6a>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
je     1173 <_pow+0x73>
xor    %edx,%edx
movsd  0xee8(%rip),%xmm1
nopl   0x0(%rax,%rax,1)
mulsd  %xmm0,%xmm1
add    $0x1,%edx
cmp    %edx,%ecx
jne    1120 <_pow+0x20>
sub    %edx,%edi
cmp    $0x7,%eax
jb     1165 <_pow+0x65>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
add    $0xfffffff8,%edi
jne    1140 <_pow+0x40>
movapd %xmm1,%xmm0
ret
movsd  0xe8e(%rip),%xmm0
ret
movsd  0xe85(%rip),%xmm1
cmp    $0x7,%eax
jae    1140 <_pow+0x40>
jmp    1165 <_pow+0x65>

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

LLVM IR (-O2):
define double @_pow(double %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %34, label %4
4: ; preds = %2
%5 = add i32 %1, -1
%6 = and i32 %1, 7
%7 = icmp eq i32 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %4, %8
%9 = phi double [ %12, %8 ], [ 1.000000e+00, %4 ]
%10 = phi i32 [ %13, %8 ], [ %1, %4 ]
%11 = phi i32 [ %14, %8 ], [ 0, %4 ]
%12 = fmul double %9, %0
%13 = add i32 %10, -1
%14 = add i32 %11, 1
%15 = icmp eq i32 %14, %6
br i1 %15, label %16, label %8
16: ; preds = %8, %4
%17 = phi double [ undef, %4 ], [ %12, %8 ]
%18 = phi double [ 1.000000e+00, %4 ], [ %12, %8 ]
%19 = phi i32 [ %1, %4 ], [ %13, %8 ]
%20 = icmp ult i32 %5, 7
br i1 %20, label %34, label %21
21: ; preds = %16, %21
%22 = phi double [ %31, %21 ], [ %18, %16 ]
%23 = phi i32 [ %32, %21 ], [ %19, %16 ]
%24 = fmul double %22, %0
%25 = fmul double %24, %0
%26 = fmul double %25, %0
%27 = fmul double %26, %0
%28 = fmul double %27, %0
%29 = fmul double %28, %0
%30 = fmul double %29, %0
%31 = fmul double %30, %0
%32 = add i32 %23, -8
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %21
34: ; preds = %16, %21, %2
%35 = phi double [ 1.000000e+00, %2 ], [ %17, %16 ], [ %31, %21 ]
ret double %35
}
/* Variables and functions */
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test1_2();
int /*<<< orphan*/ test2();
int /*<<< orphan*/ test3();
int /*<<< orphan*/ test4();
int /*<<< orphan*/ test5();
int /*<<< orphan*/ test6();
int main(void) {
  test1();
  test1_2();
  test2();
  test3();
  test4();
  test5();
  test6();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <test1@plt>
mov    $0x0,%al
call   1090 <test1_2@plt>
mov    $0x0,%al
call   1080 <test2@plt>
mov    $0x0,%al
call   1040 <test3@plt>
mov    $0x0,%al
call   1070 <test4@plt>
mov    $0x0,%al
call   1030 <test5@plt>
mov    $0x0,%al
call   1060 <test6@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test1@plt>
xor    %eax,%eax
call   1090 <test1_2@plt>
xor    %eax,%eax
call   1080 <test2@plt>
xor    %eax,%eax
call   1040 <test3@plt>
xor    %eax,%eax
call   1070 <test4@plt>
xor    %eax,%eax
call   1030 <test5@plt>
xor    %eax,%eax
call   1060 <test6@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test1()
%3 = call i32 (...) @test1_2()
%4 = call i32 (...) @test2()
%5 = call i32 (...) @test3()
%6 = call i32 (...) @test4()
%7 = call i32 (...) @test5()
%8 = call i32 (...) @test6()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test1()
%2 = tail call i32 (...) @test1_2()
%3 = tail call i32 (...) @test2()
%4 = tail call i32 (...) @test3()
%5 = tail call i32 (...) @test4()
%6 = tail call i32 (...) @test5()
%7 = tail call i32 (...) @test6()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DEC16(int /*<<< orphan*/, int);
int /*<<< orphan*/ SA1Absolute(int);
void OpCEM0(void) { DEC16(SA1Absolute(3), 0xFFFFFF); }


x86 assembly (clang, -O0):
<OpCEM0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <SA1Absolute@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
call   1040 <DEC16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpCEM0>:
push   %rax
mov    $0x3,%edi
call   1030 <SA1Absolute@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
pop    %rax
jmp    1040 <DEC16@plt>

LLVM IR (-O0):
define void @OpCEM0() {
%1 = call i32 @SA1Absolute(i32 3)
%2 = call i32 @DEC16(i32 %1, i32 16777215)
ret void
}

LLVM IR (-O2):
define void @OpCEM0() {
%1 = tail call i32 @SA1Absolute(i32 3)
%2 = tail call i32 @DEC16(i32 %1, i32 16777215)
ret void
}
/* Type definitions */
struct eembed_allocator {
  int dummy;
};

/* Variables and functions */
void *realloc(void *, size_t);
void *eembed_system_realloc(struct eembed_allocator *ea, void *ptr,
                            size_t size) {
  (void)ea;
  return realloc(ptr, size);
}


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

x86 assembly (clang, -O2):
<eembed_system_realloc>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <realloc@plt>

LLVM IR (-O0):
%struct.eembed_allocator = type { i32 }
define i8* @eembed_system_realloc(%struct.eembed_allocator* %0, i8* %1, i64 %2) {
%4 = alloca %struct.eembed_allocator*
%5 = alloca i8*
%6 = alloca i64
store %struct.eembed_allocator* %0, %struct.eembed_allocator** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load %struct.eembed_allocator*, %struct.eembed_allocator** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i8* @realloc(i8* %8, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
%struct.eembed_allocator = type { i32 }
define noalias i8* @eembed_system_realloc(%struct.eembed_allocator* nocapture readnone %0, i8* nocapture %1, i64 %2) {
%4 = tail call i8* @realloc(i8* %1, i64 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  printf("Hello world (%s)!\n", argv[0]);
  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    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [19 x i8] c"Hello world (%s)!\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
int has_empty_goal_on(char ch) { return ch == '.'; }


x86 assembly (clang, -O0):
<has_empty_goal_on>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x2e,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_empty_goal_on>:
xor    %eax,%eax
cmp    $0x2e,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @has_empty_goal_on(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, 46
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @has_empty_goal_on(i8 signext %0) {
%2 = icmp eq i8 %0, 46
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int f178(int *);
int f179(int *p) { return f178(p); }


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

x86 assembly (clang, -O2):
<f179>:
jmp    1030 <f178@plt>

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

LLVM IR (-O2):
define i32 @f179(i32* %0) {
%2 = tail call i32 @f178(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void chpl_free(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<chpl_free>:
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):
<chpl_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @chpl_free(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 @chpl_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int rand();
void random_vector_int(int *a, const unsigned int n) {
  for (unsigned int i = 0; i < n; i++) {
    a[i] = rand();
  }
}


x86 assembly (clang, -O0):
<random_vector_int>:
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
jae    1153 <random_vector_int+0x43>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <random_vector_int+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_vector_int>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1144 <random_vector_int+0x34>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <random_vector_int+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @random_vector_int(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 = %16, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = call i32 (...) @rand()
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
store i32 %11, i32* %15
br label %16
16: ; preds = %10
%17 = load i32, i32* %5
%18 = add i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @random_vector_int(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %11, %7 ]
%9 = tail call i32 (...) @rand()
%10 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 %9, i32* %10
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ PTRACE_TRACEME;
int execv(char *, char **);
int /*<<< orphan*/ ptrace(int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/, int /*<<< orphan*/);
int tracee(char *path, char *argv[]) {
  ptrace(PTRACE_TRACEME, 0, 0, 0);
  return execv(path, argv);
}


x86 assembly (clang, -O0):
<tracee>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <ptrace@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <execv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tracee>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <ptrace@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <execv@plt>

LLVM IR (-O0):
@PTRACE_TRACEME = global i32 0
define i32 @tracee(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i32, i32* @PTRACE_TRACEME
%6 = call i32 @ptrace(i32 %5, i32 0, i32 0, i32 0)
%7 = load i8*, i8** %3
%8 = load i8**, i8*** %4
%9 = call i32 @execv(i8* %7, i8** %8)
ret i32 %9
}

LLVM IR (-O2):
@PTRACE_TRACEME = global i32 0
define i32 @tracee(i8* %0, i8** %1) {
%3 = load i32, i32* @PTRACE_TRACEME
%4 = tail call i32 @ptrace(i32 %3, i32 0, i32 0, i32 0)
%5 = tail call i32 @execv(i8* %0, i8** %1)
ret i32 %5
}
int _succeeded_test_case(int option, int reset) {
  static int count = 0;
  if (reset)
    count = option;
  else
    count += option;
  return count;
}


x86 assembly (clang, -O0):
<_succeeded_test_case>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1122 <_succeeded_test_case+0x22>
mov    -0x4(%rbp),%eax
mov    %eax,0x2f07(%rip)
jmp    1131 <_succeeded_test_case+0x31>
mov    -0x4(%rbp),%eax
add    0x2ef9(%rip),%eax
mov    %eax,0x2ef3(%rip)
mov    0x2eed(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_succeeded_test_case>:
xor    %eax,%eax
test   %esi,%esi
jne    110c <_succeeded_test_case+0xc>
mov    0x2f18(%rip),%eax
add    %edi,%eax
mov    %eax,0x2f10(%rip)
ret

LLVM IR (-O0):
@_succeeded_test_case.count = internal global i32 0
define i32 @_succeeded_test_case(i32 %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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i32, i32* %3
store i32 %8, i32* @_succeeded_test_case.count
br label %13
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* @_succeeded_test_case.count
%12 = add nsw i32 %11, %10
store i32 %12, i32* @_succeeded_test_case.count
br label %13
13: ; preds = %9, %7
%14 = load i32, i32* @_succeeded_test_case.count
ret i32 %14
}

LLVM IR (-O2):
@_succeeded_test_case.count = internal unnamed_addr global i32 0
define i32 @_succeeded_test_case(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = load i32, i32* @_succeeded_test_case.count
%5 = select i1 %3, i32 %4, i32 0
%6 = add nsw i32 %5, %0
store i32 %6, i32* @_succeeded_test_case.count
ret i32 %6
}
int test_imm_A1int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xA1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A1int64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0xa1,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A1int64_midword_mem>:
testb  $0xa1,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A1int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 10551296
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__19__IO__set();
void LedsP__Led1__set(void) { HplAtm128GeneralIOPinP__19__IO__set(); }


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

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

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

LLVM IR (-O2):
define void @LedsP__Led1__set() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__19__IO__set()
ret void
}
void SCOTCH_version(int *const versptr, int *const relaptr,
                    int *const patcptr) {
  *versptr = 6;
  *relaptr = 1;
  *patcptr = 0;
}


x86 assembly (clang, -O0):
<SCOTCH_version>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x6,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SCOTCH_version>:
movl   $0x6,(%rdi)
movl   $0x1,(%rsi)
movl   $0x0,(%rdx)
ret

LLVM IR (-O0):
define void @SCOTCH_version(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
store i32 6, i32* %7
%8 = load i32*, i32** %5
store i32 1, i32* %8
%9 = load i32*, i32** %6
store i32 0, i32* %9
ret void
}

LLVM IR (-O2):
define void @SCOTCH_version(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
store i32 6, i32* %0
store i32 1, i32* %1
store i32 0, i32* %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgethex(int /*<<< orphan*/ *);
int fgethex2(FILE *fp) {
  int hi, lo;
  hi = fgethex(fp);
  lo = fgethex(fp);
  return (hi << 4) | lo;
}


x86 assembly (clang, -O0):
<fgethex2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgethex@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgethex@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x4,%eax
or     -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgethex2>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fgethex@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <fgethex@plt>
shl    $0x4,%ebp
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fgethex2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @fgethex(i32* %5)
store i32 %6, i32* %3
%7 = load i32*, i32** %2
%8 = call i32 @fgethex(i32* %7)
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = shl i32 %9, 4
%11 = load i32, i32* %4
%12 = or i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @fgethex2(i32* %0) {
%2 = tail call i32 @fgethex(i32* %0)
%3 = tail call i32 @fgethex(i32* %0)
%4 = shl i32 %2, 4
%5 = or i32 %4, %3
ret i32 %5
}
/* Variables and functions */
float __nv_sqrtf(float);
float sqrtf(float __a) { return __nv_sqrtf(__a); }


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

x86 assembly (clang, -O2):
<sqrtf>:
jmp    1030 <__nv_sqrtf@plt>

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

LLVM IR (-O2):
define float @sqrtf(float %0) {
%2 = tail call float @__nv_sqrtf(float %0)
ret float %2
}
/* Variables and functions */
char *base64decode(const void *b64_decode_this, int decode_this_many_bytes,
                   int *decoded_bytes) {
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @base64decode(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @base64decode(i8* nocapture readnone %0, i32 %1, i32* nocapture readnone %2) {
ret i8* null
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool is_stcx(uint32_t insn) {
  uint32_t insn_base = insn & 0xfc0007ff;
  if ((insn_base == 0x7c00056d) || (insn_base == 0x7c0005ad) ||
      (insn_base == 0x7c00012d) || (insn_base == 0x7c0001ad) ||
      (insn_base == 0x7c00016d))
    return true;
  return false;
}


x86 assembly (clang, -O0):
<is_stcx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xfc0007ff,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x7c00056d,-0xc(%rbp)
je     1153 <is_stcx+0x53>
cmpl   $0x7c0005ad,-0xc(%rbp)
je     1153 <is_stcx+0x53>
cmpl   $0x7c00012d,-0xc(%rbp)
je     1153 <is_stcx+0x53>
cmpl   $0x7c0001ad,-0xc(%rbp)
je     1153 <is_stcx+0x53>
cmpl   $0x7c00016d,-0xc(%rbp)
jne    115f <is_stcx+0x5f>
movl   $0x1,-0x4(%rbp)
jmp    1166 <is_stcx+0x66>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_stcx>:
movd   %edi,%xmm0
pshufd $0x0,%xmm0,%xmm0
pand   0xeef(%rip),%xmm0
pcmpeqd 0xef7(%rip),%xmm0
movmskps %xmm0,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
ret

LLVM IR (-O0):
define i32 @is_stcx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = and i32 %5, -67106817
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 2080376173
br i1 %8, label %21, label %9
9: ; preds = %1
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 2080376237
br i1 %11, label %21, label %12
12: ; preds = %9
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 2080375085
br i1 %14, label %21, label %15
15: ; preds = %12
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 2080375213
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 2080375149
br i1 %20, label %21, label %22
21: ; preds = %18, %15, %12, %9, %1
store i32 1, i32* %2
br label %23
22: ; preds = %18
store i32 0, i32* %2
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @is_stcx(i32 %0) {
%2 = insertelement <2 x i32> poison, i32 %0, i64 0
%3 = shufflevector <2 x i32> %2, <2 x i32> poison, <2 x i32> zeroinitializer
%4 = and <2 x i32> %3, <i32 -67106817, i32 -67106945>
%5 = shufflevector <2 x i32> %4, <2 x i32> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 0>
%6 = icmp eq <4 x i32> %5, <i32 2080375149, i32 2080375085, i32 2080376173, i32 2080376237>
%7 = bitcast <4 x i1> %6 to i4
%8 = icmp ne i4 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int ser0inchk();
int ser1inchk();
int serialChk(int serno) {
  if (serno == 0) {
    return ser0inchk();
  } else {
    return ser1inchk();
  }
}


x86 assembly (clang, -O0):
<serialChk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1144 <serialChk+0x24>
mov    $0x0,%al
call   1030 <ser0inchk@plt>
mov    %eax,-0x4(%rbp)
jmp    114e <serialChk+0x2e>
mov    $0x0,%al
call   1040 <ser1inchk@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialChk>:
xor    %eax,%eax
test   %edi,%edi
je     112b <serialChk+0xb>
jmp    1040 <ser1inchk@plt>
jmp    1030 <ser0inchk@plt>

LLVM IR (-O0):
define i32 @serialChk(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @ser0inchk()
store i32 %7, i32* %2
br label %10
8: ; preds = %1
%9 = call i32 (...) @ser1inchk()
store i32 %9, i32* %2
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @serialChk(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @ser0inchk()
br label %7
5: ; preds = %1
%6 = tail call i32 (...) @ser1inchk()
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ %4, %3 ], [ %6, %5 ]
ret i32 %8
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
short RandomNumberInRange(short min, short max) {
  return (min + (short)(((double)(1 + max - min)) * ((double)rand()) /
                        (1.0 + ((double)RAND_MAX))));
}


x86 assembly (clang, -O0):
<RandomNumberInRange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%ecx
mov    %ecx,-0x8(%rbp)
movswl -0x4(%rbp),%eax
sub    %ecx,%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
xor    %eax,%eax
call   1030 <rand@plt>
movsd  -0x10(%rbp),%xmm0
mov    %rax,%rcx
mov    -0x8(%rbp),%eax
cvtsi2sd %rcx,%xmm1
mulsd  %xmm1,%xmm0
mov    0x2e87(%rip),%rcx
cvtsi2sdq (%rcx),%xmm1
movsd  0xe92(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
movswl %cx,%ecx
add    %ecx,%eax
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomNumberInRange>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
sub    %edi,%esi
add    $0x1,%esi
cvtsi2sd %esi,%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mulsd  0x8(%rsp),%xmm0
mov    0x2ea6(%rip),%rax
cvtsi2sdq (%rax),%xmm1
addsd  0xeb1(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define signext i16 @RandomNumberInRange(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = add nsw i32 1, %8
%10 = load i16, i16* %3
%11 = sext i16 %10 to i32
%12 = sub nsw i32 %9, %11
%13 = sitofp i32 %12 to double
%14 = call i64 (...) @rand()
%15 = sitofp i64 %14 to double
%16 = fmul double %13, %15
%17 = load i64, i64* @RAND_MAX
%18 = sitofp i64 %17 to double
%19 = fadd double 1.000000e+00, %18
%20 = fdiv double %16, %19
%21 = fptosi double %20 to i16
%22 = sext i16 %21 to i32
%23 = add nsw i32 %6, %22
%24 = trunc i32 %23 to i16
ret i16 %24
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define signext i16 @RandomNumberInRange(i16 signext %0, i16 signext %1) {
%3 = sext i16 %0 to i32
%4 = sext i16 %1 to i32
%5 = sub nsw i32 1, %3
%6 = add nsw i32 %5, %4
%7 = sitofp i32 %6 to double
%8 = tail call i64 (...) @rand()
%9 = sitofp i64 %8 to double
%10 = fmul double %7, %9
%11 = load i64, i64* @RAND_MAX
%12 = sitofp i64 %11 to double
%13 = fadd double %12, 1.000000e+00
%14 = fdiv double %10, %13
%15 = fptosi double %14 to i16
%16 = add i16 %15, %0
ret i16 %16
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void dp_mem_free(void *_p) { free(_p); }


x86 assembly (clang, -O0):
<dp_mem_free>:
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):
<dp_mem_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @dp_mem_free(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 @dp_mem_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void get_face_grad_2d(int iX, int iY, int nX, int nY, int X_nbr, int Y_nbr,
                      int tid, double *sc_face_grad, double *sc_old) {
  int nbrid;
  nbrid = (iY + (Y_nbr)) * nX + iX + (X_nbr);
  *sc_face_grad = *(sc_old + nbrid) - *(sc_old + tid);
}


x86 assembly (clang, -O0):
<get_face_grad_2d>:
push   %rbp
mov    %rsp,%rbp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    -0x18(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    0x20(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x20(%rbp),%rax
movslq 0x10(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    0x18(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_face_grad_2d>:
mov    0x10(%rsp),%r10
movslq 0x8(%rsp),%rcx
mov    0x18(%rsp),%rax
add    %r9d,%esi
imul   %edx,%esi
add    %r8d,%edi
add    %esi,%edi
movslq %edi,%rdx
movsd  (%rax,%rdx,8),%xmm0
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%r10)
ret

LLVM IR (-O0):
define void @get_face_grad_2d(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, double* %7, double* %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca double*
%18 = alloca double*
%19 = alloca i32
store i32 %0, i32* %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store double* %7, double** %17
store double* %8, double** %18
%20 = load i32, i32* %11
%21 = load i32, i32* %15
%22 = add nsw i32 %20, %21
%23 = load i32, i32* %12
%24 = mul nsw i32 %22, %23
%25 = load i32, i32* %10
%26 = add nsw i32 %24, %25
%27 = load i32, i32* %14
%28 = add nsw i32 %26, %27
store i32 %28, i32* %19
%29 = load double*, double** %18
%30 = load i32, i32* %19
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds double, double* %29, i64 %31
%33 = load double, double* %32
%34 = load double*, double** %18
%35 = load i32, i32* %16
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds double, double* %34, i64 %36
%38 = load double, double* %37
%39 = fsub double %33, %38
%40 = load double*, double** %17
store double %39, double* %40
ret void
}

LLVM IR (-O2):
define void @get_face_grad_2d(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, double* nocapture writeonly %7, double* nocapture %8) {
%10 = add nsw i32 %5, %1
%11 = mul nsw i32 %10, %2
%12 = add i32 %4, %0
%13 = add i32 %12, %11
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %8, i64 %14
%16 = load double, double* %15
%17 = sext i32 %6 to i64
%18 = getelementptr inbounds double, double* %8, i64 %17
%19 = load double, double* %18
%20 = fsub double %16, %19
store double %20, double* %7
ret void
}
/* Variables and functions */
bool fspath_write_file(const char path[], char *content, char method) {
  return false;
}


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

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

LLVM IR (-O0):
define i32 @fspath_write_file(i8* %0, i8* %1, i8 signext %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
ret i32 0
}

LLVM IR (-O2):
define i32 @fspath_write_file(i8* nocapture readnone %0, i8* nocapture readnone %1, i8 signext %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert_div_32(size_t, int, int);
void test_unsigned_div() { assert_div_32((size_t)-1, 8, 0x1FFFFFFF); }


x86 assembly (clang, -O0):
<test_unsigned_div>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffffffffffff,%rdi
mov    $0x8,%esi
mov    $0x1fffffff,%edx
call   1030 <assert_div_32@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_unsigned_div>:
mov    $0xffffffffffffffff,%rdi
mov    $0x8,%esi
mov    $0x1fffffff,%edx
jmp    1030 <assert_div_32@plt>

LLVM IR (-O0):
define void @test_unsigned_div() {
%1 = call i32 @assert_div_32(i64 -1, i32 8, i32 536870911)
ret void
}

LLVM IR (-O2):
define void @test_unsigned_div() {
%1 = tail call i32 @assert_div_32(i64 -1, i32 8, i32 536870911)
ret void
}
float bit_crusher_drive(const float val, const float drive) {
  return bit_crusher_limiter(
      val * ((drive) > -90.0f ? powf(10.0f, (drive)*0.05f) : 0.0f));
}


x86 assembly (clang, -O0):
<bit_crusher_drive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xeb7(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1176 <bit_crusher_drive+0x56>
movss  0xeae(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
movss  0xe9d(%rip),%xmm0
call   1030 <powf@plt>
movss  %xmm0,-0x10(%rbp)
jmp    1183 <bit_crusher_drive+0x63>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1183 <bit_crusher_drive+0x63>
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1040 <bit_crusher_limiter@plt>
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_crusher_drive>:
push   %rax
movaps %xmm0,%xmm2
xorps  %xmm0,%xmm0
ucomiss 0xed2(%rip),%xmm1
jbe    1151 <bit_crusher_drive+0x31>
mulss  0xecc(%rip),%xmm1
movss  0xec8(%rip),%xmm0
movss  %xmm2,0x4(%rsp)
call   1030 <powf@plt>
movss  0x4(%rsp),%xmm2
mulss  %xmm2,%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1040 <bit_crusher_limiter@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @bit_crusher_drive(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %6, -9.000000e+01
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load float, float* %4
%10 = fmul float %9, 0x3FA99999A0000000
%11 = call float @powf(float 1.000000e+01, float %10)
br label %13
12: ; preds = %2
br label %13
13: ; preds = %12, %8
%14 = phi float [ %11, %8 ], [ 0.000000e+00, %12 ]
%15 = fmul float %5, %14
%16 = fpext float %15 to double
%17 = call i32 (double, ...) bitcast (i32 (...)* @bit_crusher_limiter to i32 (double, ...)*)(double %16)
%18 = sitofp i32 %17 to float
ret float %18
}

LLVM IR (-O2):
define float @bit_crusher_drive(float %0, float %1) {
%3 = fcmp ogt float %1, -9.000000e+01
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = fmul float %1, 0x3FA99999A0000000
%6 = tail call float @powf(float 1.000000e+01, float %5)
br label %7
7: ; preds = %2, %4
%8 = phi float [ %6, %4 ], [ 0.000000e+00, %2 ]
%9 = fmul float %8, %0
%10 = fpext float %9 to double
%11 = tail call i32 (double, ...) bitcast (i32 (...)* @bit_crusher_limiter to i32 (double, ...)*)(double %10)
%12 = sitofp i32 %11 to float
ret float %12
}
/* Variables and functions */
char *valloc(int);
int vallocTest() {
  char *mem = valloc(12);
  return 0;
}


x86 assembly (clang, -O0):
<vallocTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc,%edi
call   1030 <valloc@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @vallocTest() {
%1 = alloca i8*
%2 = call i8* @valloc(i32 12)
store i8* %2, i8** %1
ret i32 0
}

LLVM IR (-O2):
define i32 @vallocTest() {
ret i32 0
}
main() {
  int x;
  x = 10;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 10, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int max3(int a, int b, int c) {
  if (a > b) {
    if (a > c) {
      return a;
    } else {
      return c;
    }
  } else {
    if (b > c) {
      return b;
    } else {
      return c;
    }
  }
}


x86 assembly (clang, -O0):
<max3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113b <max3+0x3b>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1130 <max3+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <max3+0x58>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <max3+0x58>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1152 <max3+0x52>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <max3+0x58>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max3>:
mov    %edx,%eax
cmp    %edx,%edi
cmovg  %edi,%eax
cmp    %esi,%eax
cmovle %esi,%eax
ret

LLVM IR (-O0):
define i32 @max3(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %19
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %7
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load i32, i32* %5
store i32 %16, i32* %4
br label %27
17: ; preds = %11
%18 = load i32, i32* %7
store i32 %18, i32* %4
br label %27
19: ; preds = %3
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = icmp sgt i32 %20, %21
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = load i32, i32* %6
store i32 %24, i32* %4
br label %27
25: ; preds = %19
%26 = load i32, i32* %7
store i32 %26, i32* %4
br label %27
27: ; preds = %25, %23, %17, %15
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @max3(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %2
%5 = select i1 %4, i32 %0, i32 %2
%6 = icmp sgt i32 %5, %1
%7 = select i1 %6, i32 %5, i32 %1
ret i32 %7
}
unsigned mix(unsigned i, unsigned j) { return (i + j * 103995407) % 103072243; }


x86 assembly (clang, -O0):
<mix>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   $0x632d80f,-0x8(%rbp),%ecx
add    %ecx,%eax
mov    $0x624c1f3,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mix>:
imul   $0x632d80f,%esi,%eax
add    %edi,%eax
imul   $0x5356c6c1,%rax,%rcx
shr    $0x39,%rcx
imul   $0x624c1f3,%ecx,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mix(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 = mul i32 %6, 103995407
%8 = add i32 %5, %7
%9 = urem i32 %8, 103072243
ret i32 %9
}

LLVM IR (-O2):
define i32 @mix(i32 %0, i32 %1) {
%3 = mul i32 %1, 103995407
%4 = add i32 %3, %0
%5 = urem i32 %4, 103072243
ret i32 %5
}
const char *strerror$UNIX2003(int errnum) { return strerror(errnum); }


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

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

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

LLVM IR (-O2):
define i8* @"strerror$UNIX2003"(i32 %0) {
%2 = tail call i8* @strerror(i32 %0)
ret i8* %2
}