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

/* Variables and functions */
int f(int);
void doubleRound(uint32_t *left, uint32_t *right, uint32_t rk0, uint32_t rk1) {
  *right = f(*left) ^ *right ^ rk0;
  *left = f(*right) ^ *left ^ rk1;
}


x86 assembly (clang, -O0):
<doubleRound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <f@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
xor    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <f@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
xor    -0x18(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubleRound>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r15
mov    (%rdi),%edi
call   1030 <f@plt>
xor    %eax,%ebp
xor    (%rbx),%ebp
mov    %ebp,(%rbx)
mov    %ebp,%edi
call   1030 <f@plt>
xor    %r14d,%eax
xor    %eax,(%r15)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @doubleRound(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = call i32 @f(i32 %10)
%12 = load i32*, i32** %6
%13 = load i32, i32* %12
%14 = xor i32 %11, %13
%15 = load i32, i32* %7
%16 = xor i32 %14, %15
%17 = load i32*, i32** %6
store i32 %16, i32* %17
%18 = load i32*, i32** %6
%19 = load i32, i32* %18
%20 = call i32 @f(i32 %19)
%21 = load i32*, i32** %5
%22 = load i32, i32* %21
%23 = xor i32 %20, %22
%24 = load i32, i32* %8
%25 = xor i32 %23, %24
%26 = load i32*, i32** %5
store i32 %25, i32* %26
ret void
}

LLVM IR (-O2):
define void @doubleRound(i32* nocapture %0, i32* nocapture %1, i32 %2, i32 %3) {
%5 = load i32, i32* %0
%6 = tail call i32 @f(i32 %5)
%7 = load i32, i32* %1
%8 = xor i32 %6, %2
%9 = xor i32 %8, %7
store i32 %9, i32* %1
%10 = tail call i32 @f(i32 %9)
%11 = load i32, i32* %0
%12 = xor i32 %10, %3
%13 = xor i32 %12, %11
store i32 %13, i32* %0
ret void
}
int absInt(int x) { return (x < 0) ? -x : x; }


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

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

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

LLVM IR (-O2):
define i32 @absInt(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
unsigned int bit_align_down(unsigned int, unsigned int);
unsigned int bit_align_up(unsigned int n, unsigned int b) {
  return bit_align_down((n + (b - 1)), b);
}


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

x86 assembly (clang, -O2):
<bit_align_up>:
add    %esi,%edi
add    $0xffffffff,%edi
jmp    1030 <bit_align_down@plt>

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

LLVM IR (-O2):
define i32 @bit_align_up(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = tail call i32 @bit_align_down(i32 %4, i32 %1)
ret i32 %5
}
/* Variables and functions */
double __ocml_mul_rte_f64(double, double);
double __dmul_rn(double x, double y) { return __ocml_mul_rte_f64(x, y); }


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

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

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

LLVM IR (-O2):
define double @__dmul_rn(double %0, double %1) {
%3 = tail call double @__ocml_mul_rte_f64(double %0, double %1)
ret double %3
}
double luminosity(mass_ratio)
double mass_ratio;
{
  double n;
  if (mass_ratio < 1.0)
    n = 1.75 * (mass_ratio - 0.1) + 3.325;
  else
    n = 0.5 * (2.0 - mass_ratio) + 4.4;
  return (pow(mass_ratio, n));
}


x86 assembly (clang, -O0):
<luminosity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1163 <luminosity+0x53>
movsd  -0x8(%rbp),%xmm0
movsd  0xef3(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xed7(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed3(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    118d <luminosity+0x7d>
movsd  0xead(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xe90(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe8c(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<luminosity>:
movsd  0xee8(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    113f <luminosity+0x2f>
movsd  0xefa(%rip),%xmm1
addsd  %xmm0,%xmm1
mulsd  0xef6(%rip),%xmm1
addsd  0xef6(%rip),%xmm1
jmp    1030 <pow@plt>
movsd  0xec1(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xebd(%rip),%xmm1
addsd  0xebd(%rip),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @luminosity(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fcmp olt double %4, 1.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %2
%8 = fsub double %7, 1.000000e-01
%9 = call double @llvm.fmuladd.f64(double 1.750000e+00, double %8, double 3.325000e+00)
store double %9, double* %3
br label %14
10: ; preds = %1
%11 = load double, double* %2
%12 = fsub double 2.000000e+00, %11
%13 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %12, double 4.400000e+00)
store double %13, double* %3
br label %14
14: ; preds = %10, %6
%15 = load double, double* %2
%16 = load double, double* %3
%17 = call double @pow(double %15, double %16)
ret double %17
}

LLVM IR (-O2):
define double @luminosity(double %0) {
%2 = fcmp olt double %0, 1.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fadd double %0, -1.000000e-01
%5 = tail call double @llvm.fmuladd.f64(double %4, double 1.750000e+00, double 3.325000e+00)
br label %9
6: ; preds = %1
%7 = fsub double 2.000000e+00, %0
%8 = tail call double @llvm.fmuladd.f64(double %7, double 5.000000e-01, double 4.400000e+00)
br label %9
9: ; preds = %6, %3
%10 = phi double [ %5, %3 ], [ %8, %6 ]
%11 = tail call double @pow(double %0, double %10)
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void flex_print_float(float value) { printf("%.1f", value); }


x86 assembly (clang, -O0):
<flex_print_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"%.1f\00"
define void @flex_print_float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %3)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.1f\00"
define void @flex_print_float(float %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %0)
ret void
}
signed short int signedshortint_ignoring_signedlonglong(signed short int x,
                                                        signed long long y) {
  return x;
}


x86 assembly (clang, -O0):
<signedshortint_ignoring_signedlonglong>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @signedshortint_ignoring_signedlonglong(i16 signext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @signedshortint_ignoring_signedlonglong(i16 returned signext %0, i64 %1) {
ret i16 %0
}
__attribute__((always_)) void sel4bench_private_lfence() {
  asm volatile("lfence");
}


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

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

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

LLVM IR (-O2):
define void @sel4bench_private_lfence() {
tail call void asm sideeffect "lfence", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
struct ib_mad_reg_req {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ib_register_mad_agent(struct ib_mad_reg_req *);
void *kmalloc(unsigned int);
int main(void) {
  struct ib_mad_reg_req *reg_req;
  void *tmp;
  void *__cil_tmp3;
  {
    {
      __cil_tmp3 = (void *)0;
      reg_req = (struct ib_mad_reg_req *)__cil_tmp3;
      tmp = kmalloc(4U);
      reg_req = (struct ib_mad_reg_req *)tmp;
      ib_register_mad_agent(reg_req);
    }
    return (0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x4,%edi
call   1040 <kmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ib_register_mad_agent@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1040 <kmalloc@plt>
mov    %rax,%rdi
call   1030 <ib_register_mad_agent@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ib_mad_reg_req = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.ib_mad_reg_req*
%3 = alloca i8*
%4 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to %struct.ib_mad_reg_req*
store %struct.ib_mad_reg_req* %6, %struct.ib_mad_reg_req** %2
%7 = call i8* @kmalloc(i32 4)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to %struct.ib_mad_reg_req*
store %struct.ib_mad_reg_req* %9, %struct.ib_mad_reg_req** %2
%10 = load %struct.ib_mad_reg_req*, %struct.ib_mad_reg_req** %2
%11 = call i32 @ib_register_mad_agent(%struct.ib_mad_reg_req* %10)
ret i32 0
}

LLVM IR (-O2):
%struct.ib_mad_reg_req = type { i32 }
define i32 @main() {
%1 = tail call i8* @kmalloc(i32 4)
%2 = bitcast i8* %1 to %struct.ib_mad_reg_req*
%3 = tail call i32 @ib_register_mad_agent(%struct.ib_mad_reg_req* %2)
ret i32 0
}
/* Variables and functions */
void *function() { return (NULL); }


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

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

LLVM IR (-O0):
define i8* @function() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @function() {
ret i8* null
}
void nonzeroMemseti32() {
  unsigned arr[9] = {
      0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0,
      0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0,
  };
}


x86 assembly (clang, -O0):
<nonzeroMemseti32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
mov    $0xf0,%esi
mov    $0x24,%edx
call   1030 <memset@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @nonzeroMemseti32() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
ret void
}

LLVM IR (-O2):
define void @nonzeroMemseti32() {
ret void
}
void xxx(int argc) {
  int map;
#pragma omp target data map(map)
  for (int i = 0; i < 10; ++i)
    ;
}


x86 assembly (clang, -O0):
<xxx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    112b <xxx+0x2b>
jmp    111d <xxx+0x1d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <xxx+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @xxx(i32 %0) {
ret void
}
/* Variables and functions */
void *sbrk(int /*<<< orphan*/);
int main(void) { return (sbrk(0) != (void *)0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <sbrk@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <sbrk@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i8* @sbrk(i32 0)
%3 = icmp ne i8* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* @sbrk(i32 0)
%2 = icmp ne i8* %1, null
%3 = zext i1 %2 to i32
ret i32 %3
}
int test_imm_04uint32_reg(unsigned int val) {
  return ((val) & (0x04 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_04uint32_reg(i32 %0) {
%2 = and i32 %0, 4
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int _digest_cmp(unsigned char *, unsigned char *, int);
extern int sha256cmp(unsigned char *digest1, unsigned char *digest2) {
  return (_digest_cmp(digest1, digest2, 32));
}


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

x86 assembly (clang, -O2):
<sha256cmp>:
mov    $0x20,%edx
jmp    1030 <_digest_cmp@plt>

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

LLVM IR (-O2):
define i32 @sha256cmp(i8* %0, i8* %1) {
%3 = tail call i32 @_digest_cmp(i8* %0, i8* %1, i32 32)
ret i32 %3
}
int BS2BCalculateflevel(unsigned int fcut, unsigned int gain) {
  return (int)(fcut | (gain << 16));
}


x86 assembly (clang, -O0):
<BS2BCalculateflevel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BS2BCalculateflevel>:
mov    %esi,%eax
shl    $0x10,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @BS2BCalculateflevel(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 = shl i32 %6, 16
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @BS2BCalculateflevel(i32 %0, i32 %1) {
%3 = shl i32 %1, 16
%4 = or i32 %3, %0
ret i32 %4
}
/* Variables and functions */
void closelog();
void log_close() { return closelog(); }


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

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

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

LLVM IR (-O2):
define void @log_close() {
tail call void (...) @closelog()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parseVimBallFile(unsigned char const *);
int /*<<< orphan*/ parseVimFile(unsigned char const *);
unsigned char *readVimLine();
scalar_t__ strncmp(char const *, char *, size_t);
void findVimTags(void) {
  const unsigned char *line;
  line = readVimLine();
  if (line == NULL) {
    return;
  }
  if (strncmp((const char *)line, "UseVimball", (size_t)10) == 0) {
    parseVimBallFile(line);
  } else {
    parseVimFile(line);
  }
}


x86 assembly (clang, -O0):
<findVimTags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <readVimLine@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1163 <findVimTags+0x23>
jmp    1199 <findVimTags+0x59>
mov    -0x8(%rbp),%rdi
lea    0xe92(%rip),%rsi
mov    $0xa,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1190 <findVimTags+0x50>
mov    -0x8(%rbp),%rdi
call   1060 <parseVimBallFile@plt>
jmp    1199 <findVimTags+0x59>
mov    -0x8(%rbp),%rdi
call   1030 <parseVimFile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findVimTags>:
push   %rbx
xor    %eax,%eax
call   1050 <readVimLine@plt>
test   %rax,%rax
je     1172 <findVimTags+0x32>
mov    %rax,%rbx
lea    0xea9(%rip),%rsi
mov    $0xa,%edx
mov    %rax,%rdi
call   1040 <strncmp@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     1174 <findVimTags+0x34>
pop    %rbx
jmp    1030 <parseVimFile@plt>
pop    %rbx
ret
pop    %rbx
jmp    1060 <parseVimBallFile@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"UseVimball\00"
define void @findVimTags() {
%1 = alloca i8*
%2 = call i8* (...) @readVimLine()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %0
br label %16
6: ; preds = %0
%7 = load i8*, i8** %1
%8 = call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 10)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i8*, i8** %1
%12 = call i32 @parseVimBallFile(i8* %11)
br label %16
13: ; preds = %6
%14 = load i8*, i8** %1
%15 = call i32 @parseVimFile(i8* %14)
br label %16
16: ; preds = %5, %13, %10
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"UseVimball\00"
define void @findVimTags() {
%1 = tail call i8* (...) @readVimLine()
%2 = icmp eq i8* %1, null
br i1 %2, label %10, label %3
3: ; preds = %0
%4 = tail call i64 @strncmp(i8* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 10)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @parseVimBallFile(i8* %1)
br label %10
8: ; preds = %3
%9 = tail call i32 @parseVimFile(i8* %1)
br label %10
10: ; preds = %6, %8, %0
ret void
}
long get_unmarked_ref(long w) { return w & ~0x1L; }


x86 assembly (clang, -O0):
<get_unmarked_ref>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xfffffffffffffffe,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_unmarked_ref>:
mov    %rdi,%rax
and    $0xfffffffffffffffe,%rax
ret

LLVM IR (-O0):
define i64 @get_unmarked_ref(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, -2
ret i64 %4
}

LLVM IR (-O2):
define i64 @get_unmarked_ref(i64 %0) {
%2 = and i64 %0, -2
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ clear_variables();
void clear_command(void) { clear_variables(); }


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

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

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

LLVM IR (-O2):
define void @clear_command() {
%1 = tail call i32 (...) @clear_variables()
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ event;
};
struct TYPE_4__ {
  TYPE_1__ xgravity;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xgravity_event(void *_p) {
  return (unsigned long)((XEvent *)_p)->xgravity.event;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xgravity_event>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xgravity_event(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_XEvent_xgravity_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ __free_cf(void *);
void CGPDFObjectRelease(void *item) { __free_cf(item); }


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

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

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

LLVM IR (-O2):
define void @CGPDFObjectRelease(i8* %0) {
%2 = tail call i32 @__free_cf(i8* %0)
ret void
}
void task_unlock(struct task_struct *p) {
  do {
  } while (0);
}


x86 assembly (clang, -O0):
<task_unlock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
jmp    110d <task_unlock+0xd>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define void @task_unlock(%struct.task_struct* %0) {
%2 = alloca %struct.task_struct*
store %struct.task_struct* %0, %struct.task_struct** %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @task_unlock(%struct.task_struct* nocapture %0) {
ret void
}
void alt_little_field_gather(_Complex double *w) { return; }


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

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

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

LLVM IR (-O2):
define void @alt_little_field_gather({ double, double }* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XEnterWindowEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XEnterWindowEvent(void *_p) {
  if (_p == NULL)
    abort();
  free((XEnterWindowEvent *)_p);
}


x86 assembly (clang, -O0):
<free_XEnterWindowEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XEnterWindowEvent+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XEnterWindowEvent>:
test   %rdi,%rdi
je     112a <free_XEnterWindowEvent+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XEnterWindowEvent(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XEnterWindowEvent(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void *task(void *p) {
  usleep(300000);
  return NULL;
}


x86 assembly (clang, -O0):
<task>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x493e0,%edi
call   1030 <usleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<task>:
push   %rax
mov    $0x493e0,%edi
call   1030 <usleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @task(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @usleep(i32 300000)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @task(i8* nocapture readnone %0) {
%2 = tail call i32 @usleep(i32 300000)
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int /*<<< orphan*/ sem_destroy(int /*<<< orphan*/ *);
void destroy_semaphore(const char *const name, sem_t *p) {
  sem_destroy(p);
  free(p);
}


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

x86 assembly (clang, -O2):
<destroy_semaphore>:
push   %rbx
mov    %rsi,%rbx
mov    %rsi,%rdi
call   1040 <sem_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @destroy_semaphore(i8* nocapture readnone %0, i32* %1) {
%3 = tail call i32 @sem_destroy(i32* %1)
%4 = tail call i32 @free(i32* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLfloat;

/* Variables and functions */
int /*<<< orphan*/ colorSetter(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ drawerSetBackColor(int /*<<< orphan*/ *);
void consoleCmdSetBackground(char *color) {
  GLfloat components[4];
  if (!colorSetter(components, color))
    return;
  drawerSetBackColor(components);
}


x86 assembly (clang, -O0):
<consoleCmdSetBackground>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <colorSetter@plt>
cmp    $0x0,%eax
jne    1147 <consoleCmdSetBackground+0x27>
jmp    1150 <consoleCmdSetBackground+0x30>
lea    -0x20(%rbp),%rdi
call   1040 <drawerSetBackColor@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<consoleCmdSetBackground>:
sub    $0x18,%rsp
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <colorSetter@plt>
test   %eax,%eax
je     113b <consoleCmdSetBackground+0x1b>
mov    %rsp,%rdi
call   1040 <drawerSetBackColor@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define void @consoleCmdSetBackground(i8* %0) {
%2 = alloca [4 x i32]
%3 = bitcast [4 x i32]* %2 to i8*
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%5 = call i32 @colorSetter(i32* %4, i8* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @drawerSetBackColor(i32* %4)
br label %9
9: ; preds = %1, %7
ret void
}
/* Type definitions */
struct vec3i {
  int dummy;
};
struct vec3 {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec3_assign_vec3i(float *, int /*<<< orphan*/ *);
__attribute__((always_)) struct vec3 *psvec3_assign_vec3i(struct vec3 *result,
                                                          struct vec3i *a) {
  vec3_assign_vec3i((float *)result, (int32_t *)a);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec3_assign_vec3i>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec3_assign_vec3i@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec3 = type { i32 }
%struct.vec3i = type { i32 }
define %struct.vec3* @psvec3_assign_vec3i(%struct.vec3* %0, %struct.vec3i* %1) {
%3 = alloca %struct.vec3*
%4 = alloca %struct.vec3i*
store %struct.vec3* %0, %struct.vec3** %3
store %struct.vec3i* %1, %struct.vec3i** %4
%5 = load %struct.vec3*, %struct.vec3** %3
%6 = bitcast %struct.vec3* %5 to float*
%7 = load %struct.vec3i*, %struct.vec3i** %4
%8 = bitcast %struct.vec3i* %7 to i32*
%9 = call i32 @vec3_assign_vec3i(float* %6, i32* %8)
%10 = load %struct.vec3*, %struct.vec3** %3
ret %struct.vec3* %10
}

LLVM IR (-O2):
%struct.vec3 = type { i32 }
%struct.vec3i = type { i32 }
define %struct.vec3* @psvec3_assign_vec3i(%struct.vec3* returned %0, %struct.vec3i* %1) {
%3 = bitcast %struct.vec3* %0 to float*
%4 = getelementptr %struct.vec3i, %struct.vec3i* %1, i64 0, i32 0
%5 = tail call i32 @vec3_assign_vec3i(float* %3, i32* %4)
ret %struct.vec3* %0
}
/* Type definitions */
struct triple {
  int dummy;
};
struct compile_state {
  int dummy;
};

/* Variables and functions */
struct triple *do_farg(struct compile_state *, struct triple *,
                       int /*<<< orphan*/);
struct triple *fresult(struct compile_state *state, struct triple *func) {
  return do_farg(state, func, 0);
}


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

x86 assembly (clang, -O2):
<fresult>:
xor    %edx,%edx
jmp    1030 <do_farg@plt>

LLVM IR (-O0):
%struct.compile_state = type { i32 }
%struct.triple = type { i32 }
define %struct.triple* @fresult(%struct.compile_state* %0, %struct.triple* %1) {
%3 = alloca %struct.compile_state*
%4 = alloca %struct.triple*
store %struct.compile_state* %0, %struct.compile_state** %3
store %struct.triple* %1, %struct.triple** %4
%5 = load %struct.compile_state*, %struct.compile_state** %3
%6 = load %struct.triple*, %struct.triple** %4
%7 = call %struct.triple* @do_farg(%struct.compile_state* %5, %struct.triple* %6, i32 0)
ret %struct.triple* %7
}

LLVM IR (-O2):
%struct.compile_state = type { i32 }
%struct.triple = type { i32 }
define %struct.triple* @fresult(%struct.compile_state* %0, %struct.triple* %1) {
%3 = tail call %struct.triple* @do_farg(%struct.compile_state* %0, %struct.triple* %1, i32 0)
ret %struct.triple* %3
}
/* Variables and functions */
int /*<<< orphan*/ lerp(float, int, float);
float sqrt(int /*<<< orphan*/);
float SmithG(float NdotV, float alpha) {
  float a = alpha * alpha;
  float b = NdotV * NdotV;
  return (2.f * NdotV) / (NdotV + sqrt(lerp(b, 1, a)));
}


x86 assembly (clang, -O0):
<SmithG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xea8(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mov    $0x1,%edi
call   1030 <lerp@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
movss  -0x18(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x14(%rbp),%xmm0
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SmithG>:
push   %rax
movaps %xmm0,%xmm2
movss  %xmm0,(%rsp)
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm2,%xmm2
movss  %xmm2,0x4(%rsp)
mov    $0x1,%edi
call   1030 <lerp@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
addss  (%rsp),%xmm0
movss  0x4(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @SmithG(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %3
store float %1, float* %4
%7 = load float, float* %4
%8 = load float, float* %4
%9 = fmul float %7, %8
store float %9, float* %5
%10 = load float, float* %3
%11 = load float, float* %3
%12 = fmul float %10, %11
store float %12, float* %6
%13 = load float, float* %3
%14 = fmul float 2.000000e+00, %13
%15 = load float, float* %3
%16 = load float, float* %6
%17 = load float, float* %5
%18 = call i32 @lerp(float %16, i32 1, float %17)
%19 = call float @sqrt(i32 %18)
%20 = fadd float %15, %19
%21 = fdiv float %14, %20
ret float %21
}

LLVM IR (-O2):
define float @SmithG(float %0, float %1) {
%3 = fmul float %1, %1
%4 = fmul float %0, %0
%5 = fmul float %0, 2.000000e+00
%6 = tail call i32 @lerp(float %4, i32 1, float %3)
%7 = tail call float @sqrt(i32 %6)
%8 = fadd float %7, %0
%9 = fdiv float %5, %8
ret float %9
}
void foo_2_1_1_2_1_2_1_1_2() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ send_error(char *);
void cmd_set_zip_out_level(struct ctrl_command *cmd) {
  send_error("can't set compression level - no libz support!");
}


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

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

LLVM IR (-O0):
%struct.ctrl_command = type { i32 }
@.str = [47 x i8] c"can't set compression level - no libz support!\00"
define void @cmd_set_zip_out_level(%struct.ctrl_command* %0) {
%2 = alloca %struct.ctrl_command*
store %struct.ctrl_command* %0, %struct.ctrl_command** %2
%3 = call i32 @send_error(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.ctrl_command = type { i32 }
@.str = [47 x i8] c"can't set compression level - no libz support!\00"
define void @cmd_set_zip_out_level(%struct.ctrl_command* nocapture readnone %0) {
%2 = tail call i32 @send_error(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}
struct file_desc *file_open(char *filename) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.file_desc = type opaque
define %struct.file_desc* @file_open(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret %struct.file_desc* null
}

LLVM IR (-O2):
%struct.file_desc = type opaque
define noalias %struct.file_desc* @file_open(i8* nocapture readnone %0) {
ret %struct.file_desc* null
}
/* Variables and functions */
void memset() {}


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

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

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

LLVM IR (-O2):
define void @memset() {
ret void
}
double clamp(double v, double min, double max) {
  if (v < min) {
    return min;
  }
  if (v > max) {
    return max;
  }
  return v;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <clamp+0x36>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <clamp+0x5f>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1155 <clamp+0x55>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <clamp+0x5f>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
minsd  %xmm0,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm2,%xmm3
andpd  %xmm1,%xmm0
orpd   %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @clamp(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fcmp olt double %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load double, double* %6
store double %12, double* %4
br label %21
13: ; preds = %3
%14 = load double, double* %5
%15 = load double, double* %7
%16 = fcmp ogt double %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load double, double* %7
store double %18, double* %4
br label %21
19: ; preds = %13
%20 = load double, double* %5
store double %20, double* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load double, double* %4
ret double %22
}

LLVM IR (-O2):
define double @clamp(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = fcmp ogt double %0, %2
%6 = select i1 %5, double %2, double %0
%7 = select i1 %4, double %1, double %6
ret double %7
}
void foo641() {}


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

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

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

LLVM IR (-O2):
define void @foo641() {
ret void
}
int test_imm_46uint32_reg(unsigned int val) {
  return ((val) & (0x46 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_46uint32_reg(i32 %0) {
%2 = and i32 %0, 70
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void timeR_name_bin(unsigned int bin_id, const char *name) {}


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

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

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

LLVM IR (-O2):
define void @timeR_name_bin(i32 %0, i8* nocapture %1) {
ret void
}
int numdigits(int n) {
  int c = 0;
  while (n != 0) {
    n /= 10;
    ++c;
  }
  return c;
}


x86 assembly (clang, -O0):
<numdigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <numdigits+0x34>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <numdigits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numdigits>:
xor    %eax,%eax
test   %edi,%edi
je     1132 <numdigits+0x32>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x1,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <numdigits+0x10>
ret

LLVM IR (-O0):
define i32 @numdigits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 10
store i32 %9, i32* %2
%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
ret i32 %13
}

LLVM IR (-O2):
define i32 @numdigits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = sdiv i32 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = add i32 %5, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ line_style;
};
typedef TYPE_1__ XGCValues;

/* Variables and functions */
int get_XGCValues_line_style(void *_p) {
  return (int)((XGCValues *)_p)->line_style;
}


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

x86 assembly (clang, -O2):
<get_XGCValues_line_style>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XGCValues_line_style(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XGCValues_line_style(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ main(int);
void _start(int mem) { main(mem); }


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

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

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

LLVM IR (-O2):
define void @_start(i32 %0) {
%2 = tail call i32 @main(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
int /*<<< orphan*/ foo(int);
int main() {
  foo(7);
  bar(7);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7,%edi
call   1040 <foo@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7,%edi
call   1040 <foo@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 7)
%3 = call i32 @bar(i32 7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 7)
%2 = tail call i32 @bar(i32 7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AddSound(unsigned char *, unsigned char **);
void AddSoundClass(unsigned char **class) {
  unsigned char **p;
  for (p = class; **p; p++)
    AddSound(*p, class);
}


x86 assembly (clang, -O0):
<AddSoundClass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmpb   $0x0,(%rax)
je     1155 <AddSoundClass+0x45>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <AddSound@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <AddSoundClass+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AddSoundClass>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
cmpb   $0x0,(%rdi)
je     1144 <AddSoundClass+0x34>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rsi
call   1030 <AddSound@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
cmpb   $0x0,(%rdi)
jne    1130 <AddSoundClass+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @AddSoundClass(i8** %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i8* [ %10, %5 ], [ %2, %1 ]
%7 = phi i8** [ %9, %5 ], [ %0, %1 ]
%8 = tail call i32 @AddSound(i8* %6, i8** %0)
%9 = getelementptr inbounds i8*, i8** %7, i64 1
%10 = load i8*, i8** %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %1
ret void
}