xunge/DecIR huggingface dataset:
unsigned sub_ul(unsigned long minuend, unsigned long subtrahend) {
  if (subtrahend > minuend)
    return 0;
  return (minuend - subtrahend);
}


x86 assembly (clang, -O0):
<sub_ul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1126 <sub_ul+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1131 <sub_ul+0x31>
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_ul>:
xor    %eax,%eax
sub    %rsi,%rdi
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @sub_ul(i64 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = load i64, i64* %4
%8 = icmp ugt i64 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %15
10: ; preds = %2
%11 = load i64, i64* %4
%12 = load i64, i64* %5
%13 = sub i64 %11, %12
%14 = trunc i64 %13 to i32
store i32 %14, i32* %3
br label %15
15: ; preds = %10, %9
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @sub_ul(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = sub i64 %0, %1
%5 = trunc i64 %4 to i32
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
unsigned short inw_p(unsigned short port) {
  unsigned short ret;
  asm volatile("inw (%%dx),%%ax"
               ";outb %%al,$0x80"
               : "=a"(ret)
               : "d"(port));
  return ret;
}


x86 assembly (clang, -O0):
<inw_p>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%ax
out    %al,$0x80
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw_p>:
mov    %edi,%edx
in     (%dx),%ax
out    %al,$0x80
ret

LLVM IR (-O0):
define zeroext i16 @inw_p(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i16 asm sideeffect "inw (%dx),%ax;outb %al,$$0x80", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @inw_p(i16 zeroext %0) {
%2 = tail call i16 asm sideeffect "inw (%dx),%ax;outb %al,$$0x80", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i16 %2
}
/* Variables and functions */
int GCD(int, int);
int LCMDenoCalculator(int n, int m) {
  int gcd = GCD(n, m);
  return m / gcd;
}


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

x86 assembly (clang, -O2):
<LCMDenoCalculator>:
push   %rbx
mov    %esi,%ebx
call   1030 <GCD@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i32 @LCMDenoCalculator(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @GCD(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = sdiv i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @LCMDenoCalculator(i32 %0, i32 %1) {
%3 = tail call i32 @GCD(i32 %0, i32 %1)
%4 = sdiv i32 %1, %3
ret i32 %4
}
/* Type definitions */
struct timeval {
  double tv_usec;
  double tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double get_time() {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return 1.e-6 * tv.tv_usec + tv.tv_sec;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xecb(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x8(%rsp),%xmm0
mulsd  0xed2(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = call double @llvm.fmuladd.f64(double 0x3EB0C6F7A0B5ED8D, double %4, double %6)
ret double %7
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = call double @llvm.fmuladd.f64(double %5, double 0x3EB0C6F7A0B5ED8D, double %7)
ret double %8
}
void m10mo_startCapture(void) { return; }


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

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

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

LLVM IR (-O2):
define void @m10mo_startCapture() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void applyIntFunction(int n, void (*f)(int, double)) {
  printf("applyIntFunction is doing its thing now...\n");
  f(n, 13.0);
}


x86 assembly (clang, -O0):
<applyIntFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%edi
movsd  0xec6(%rip),%xmm0
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<applyIntFunction>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
movsd  0xed3(%rip),%xmm0
mov    %ebx,%edi
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    *%rax

LLVM IR (-O0):
@.str = [44 x i8] c"applyIntFunction is doing its thing now...\0A\00"
define void @applyIntFunction(i32 %0, void (i32, double)* %1) {
%3 = alloca i32
%4 = alloca void (i32, double)*
store i32 %0, i32* %3
store void (i32, double)* %1, void (i32, double)** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%6 = load void (i32, double)*, void (i32, double)** %4
%7 = load i32, i32* %3
ret void
}

LLVM IR (-O2):
@str = [43 x i8] c"applyIntFunction is doing its thing now...\00"
define void @applyIntFunction(i32 %0, void (i32, double)* nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
tail call void %1(i32 %0, double 1.300000e+01)
ret void
}
int test_imm_CEint16_reg(short val) {
  return ((val) & (-0xCE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CEint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff32,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CEint16_reg>:
test   $0xff32,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CEint16_reg(i16 signext %0) {
%2 = and i16 %0, -206
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
float nsvg__maxf(float a, float b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<nsvg__maxf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <nsvg__maxf+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <nsvg__maxf+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsvg__maxf>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @nsvg__maxf(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 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @nsvg__maxf(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int findLucky(int *, int);
int main() {
  int case0[4] = {2, 2, 3, 4};
  assert(2 == findLucky(case0, 4));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1030 <findLucky@plt>
mov    %eax,%ecx
mov    $0x2,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
call   1030 <findLucky@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.case0 = [4 x i32] [i32 2, i32 2, i32 3, i32 4]
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @findLucky(i32* %3, i32 4)
%5 = icmp eq i32 2, %4
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.case0 = [4 x i32] [i32 2, i32 2, i32 3, i32 4]
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @findLucky(i32* %3, i32 4)
%5 = icmp eq i32 %4, 2
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret i32 0
}
/* Variables and functions */
scalar_t__ __builtin_ynl(int, long double);
int /*<<< orphan*/ link_failure_builtin_ynl();
void test_builtin_ynl(int x, long double ld) {
  if (__builtin_ynl(x, ld) != __builtin_ynl(x, ld))
    link_failure_builtin_ynl();
}


x86 assembly (clang, -O0):
<test_builtin_ynl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
mov    %edi,-0x4(%rbp)
fstpt  -0x20(%rbp)
mov    -0x4(%rbp),%edi
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__builtin_ynl@plt>
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%edi
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__builtin_ynl@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
je     116c <test_builtin_ynl+0x4c>
mov    $0x0,%al
call   1040 <link_failure_builtin_ynl@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_ynl>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %edi,%ebx
fldt   0x40(%rsp)
fld    %st(0)
fstpt  0x1c(%rsp)
fstpt  (%rsp)
call   1030 <__builtin_ynl@plt>
mov    %rax,%r14
fldt   0x1c(%rsp)
fstpt  (%rsp)
mov    %ebx,%edi
call   1030 <__builtin_ynl@plt>
cmp    %rax,%r14
jne    1159 <test_builtin_ynl+0x39>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
jmp    1040 <link_failure_builtin_ynl@plt>

LLVM IR (-O0):
define void @test_builtin_ynl(i32 %0, x86_fp80 %1) {
%3 = alloca i32
%4 = alloca x86_fp80
store i32 %0, i32* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load i32, i32* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = call i64 @__builtin_ynl(i32 %5, x86_fp80 %6)
%8 = load i32, i32* %3
%9 = load x86_fp80, x86_fp80* %4
%10 = call i64 @__builtin_ynl(i32 %8, x86_fp80 %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_builtin_ynl()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_builtin_ynl(i32 %0, x86_fp80 %1) {
%3 = tail call i64 @__builtin_ynl(i32 %0, x86_fp80 %1)
%4 = tail call i64 @__builtin_ynl(i32 %0, x86_fp80 %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_builtin_ynl()
br label %8
8: ; preds = %6, %2
ret void
}
unsigned int umax(unsigned int a, unsigned int b) { return (a > b ? a : b); }


x86 assembly (clang, -O0):
<umax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    1121 <umax+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <umax+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<umax>:
mov    %esi,%eax
cmp    %esi,%edi
cmova  %edi,%eax
ret

LLVM IR (-O0):
define i32 @umax(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 = icmp ugt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @umax(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
long long fac_loop(int, int, int);
long long fac(int n) { return fac_loop(n, 2, 1); }


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

x86 assembly (clang, -O2):
<fac>:
mov    $0x2,%esi
mov    $0x1,%edx
jmp    1030 <fac_loop@plt>

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

LLVM IR (-O2):
define i64 @fac(i32 %0) {
%2 = tail call i64 @fac_loop(i32 %0, i32 2, i32 1)
ret i64 %2
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint64_t rtc_make64(uint32_t high, uint32_t low) {
  return (((uint64_t)high) << 32) | low;
}


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

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

LLVM IR (-O0):
define i32 @rtc_make64(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 = shl i32 %5, 32
%7 = load i32, i32* %4
%8 = or i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @rtc_make64(i32 %0, i32 %1) {
ret i32 poison
}
/* Type definitions */
struct block_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bdev_get_queue(struct block_device *);
int queue_dma_alignment(int /*<<< orphan*/);
__attribute__((always_)) int bdev_dma_aligment(struct block_device *bdev) {
  return queue_dma_alignment(bdev_get_queue(bdev));
}


x86 assembly (clang, -O0):
<bdev_dma_aligment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <bdev_get_queue@plt>
mov    %eax,%edi
call   1030 <queue_dma_alignment@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bdev_dma_aligment>:
push   %rax
call   1040 <bdev_get_queue@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <queue_dma_alignment@plt>

LLVM IR (-O0):
%struct.block_device = type { i32 }
define i32 @bdev_dma_aligment(%struct.block_device* %0) {
%2 = alloca %struct.block_device*
store %struct.block_device* %0, %struct.block_device** %2
%3 = load %struct.block_device*, %struct.block_device** %2
%4 = call i32 @bdev_get_queue(%struct.block_device* %3)
%5 = call i32 @queue_dma_alignment(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.block_device = type { i32 }
define i32 @bdev_dma_aligment(%struct.block_device* %0) {
%2 = tail call i32 @bdev_get_queue(%struct.block_device* %0)
%3 = tail call i32 @queue_dma_alignment(i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t to_mask(uint8_t x) {
  x |= x >> 1;
  x |= x >> 2;
  x |= x >> 4;
  return x & ~(x >> 1);
  if (0) {
    while (x & (x - 1))
      x &= x - 1;
    return 255 - x;
  }
}


x86 assembly (clang, -O0):
<to_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_mask>:
mov    %edi,%eax
sar    %eax
or     %edi,%eax
mov    %eax,%ecx
sar    $0x2,%ecx
or     %eax,%ecx
mov    %ecx,%edx
sar    $0x4,%edx
or     %ecx,%edx
mov    %edx,%eax
sar    %eax
not    %eax
and    %edx,%eax
ret

LLVM IR (-O0):
define i32 @to_mask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 1
%5 = load i32, i32* %2
%6 = or i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = ashr i32 %7, 2
%9 = load i32, i32* %2
%10 = or i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = ashr i32 %11, 4
%13 = load i32, i32* %2
%14 = or i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = load i32, i32* %2
%17 = ashr i32 %16, 1
%18 = xor i32 %17, -1
%19 = and i32 %15, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @to_mask(i32 %0) {
%2 = ashr i32 %0, 1
%3 = or i32 %2, %0
%4 = ashr i32 %3, 2
%5 = or i32 %4, %3
%6 = ashr i32 %5, 4
%7 = or i32 %6, %5
%8 = ashr i32 %7, 1
%9 = xor i32 %8, -1
%10 = and i32 %7, %9
ret i32 %10
}
unsigned xrop3_73_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  unsigned stk4;
  stk4 = T & D;
  stk3 = S | stk4;
  stk2 = D ^ stk3;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_73_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
or     -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_73_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
xor    %ecx,%eax
not    %esi
and    %esi,%eax
xor    $0xffffff00,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_73_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = xor i32 %5, -1
%8 = xor i32 %4, %6
%9 = and i32 %8, %7
%10 = xor i32 %9, -256
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_mkdirat;
int syscall(int /*<<< orphan*/, int, char const *, int /*<<< orphan*/);
__attribute__((always_)) int _syscall_mkdirat(int dirfd, const char *pathname,
                                              mode_t mode) {
  return syscall(__NR_mkdirat, dirfd, pathname, mode);
}


x86 assembly (clang, -O0):
<_syscall_mkdirat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_syscall_mkdirat>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2eca(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_mkdirat = global i32 0
define i32 @_syscall_mkdirat(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @__NR_mkdirat
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @syscall(i32 %7, i32 %8, i8* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@__NR_mkdirat = global i32 0
define i32 @_syscall_mkdirat(i32 %0, i8* %1, i32 %2) {
%4 = load i32, i32* @__NR_mkdirat
%5 = tail call i32 @syscall(i32 %4, i32 %0, i8* %1, i32 %2)
ret i32 %5
}
int davinci_cfg_reg_list(const short pins[]) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @davinci_cfg_reg_list(i16* nocapture readnone %0) {
ret i32 0
}
double bitflip(double a) {
  int xbitWidth = 32;
  unsigned int mask = (unsigned int)-1 >> (32 - xbitWidth);
  unsigned int tmp = a < 0 ? (int)a : (unsigned)a;
  return (double)(~tmp & mask);
}


x86 assembly (clang, -O0):
<bitflip>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movl   $0x20,-0xc(%rbp)
mov    $0x20,%ecx
sub    -0xc(%rbp),%ecx
mov    $0xffffffff,%eax
shr    %cl,%eax
mov    %eax,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <bitflip+0x3d>
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1146 <bitflip+0x46>
cvttsd2si -0x8(%rbp),%rax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
not    %eax
mov    -0x10(%rbp),%ecx
and    %ecx,%eax
cvtsi2sd %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitflip>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
cvttsd2si %xmm0,%eax
cvttsd2si %xmm0,%rcx
cmova  %eax,%ecx
not    %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %rcx,%xmm0
ret

LLVM IR (-O0):
define double @bitflip(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store double %0, double* %2
store i32 32, i32* %3
%6 = load i32, i32* %3
%7 = sub nsw i32 32, %6
%8 = lshr i32 -1, %7
store i32 %8, i32* %4
%9 = load double, double* %2
%10 = fcmp olt double %9, 0.000000e+00
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load double, double* %2
%13 = fptosi double %12 to i32
br label %17
14: ; preds = %1
%15 = load double, double* %2
%16 = fptoui double %15 to i32
br label %17
17: ; preds = %14, %11
%18 = phi i32 [ %13, %11 ], [ %16, %14 ]
store i32 %18, i32* %5
%19 = load i32, i32* %5
%20 = xor i32 %19, -1
%21 = load i32, i32* %4
%22 = and i32 %20, %21
%23 = uitofp i32 %22 to double
ret double %23
}

LLVM IR (-O2):
define double @bitflip(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fptosi double %0 to i32
%4 = fptoui double %0 to i32
%5 = select i1 %2, i32 %3, i32 %4
%6 = xor i32 %5, -1
%7 = uitofp i32 %6 to double
ret double %7
}
/* Variables and functions */
char *bp_sw_string_from_charred_equality(char *, char);
char *bp_sw_string_from_quoted_equality(char *string) {
  return bp_sw_string_from_charred_equality(string, '"');
}


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

x86 assembly (clang, -O2):
<bp_sw_string_from_quoted_equality>:
mov    $0x22,%esi
jmp    1030 <bp_sw_string_from_charred_equality@plt>

LLVM IR (-O0):
define i8* @bp_sw_string_from_quoted_equality(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @bp_sw_string_from_charred_equality(i8* %3, i8 signext 34)
ret i8* %4
}

LLVM IR (-O2):
define i8* @bp_sw_string_from_quoted_equality(i8* %0) {
%2 = tail call i8* @bp_sw_string_from_charred_equality(i8* %0, i8 signext 34)
ret i8* %2
}
unsigned int f1(unsigned int x, unsigned int y) {
  return (x << y) | (x >> (8 * 4 - y));
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @f1(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 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 32, %9
%11 = lshr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 32, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
int main(void) {
  char *my_dynamic_buffer = malloc(27);
  strcpy(my_dynamic_buffer, "abcdefghijklmnopqrstuvwxyz");
  printf("Hello, world!\n");
  printf("%s\n", my_dynamic_buffer);
  free(my_dynamic_buffer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1b,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1040 <strcpy@plt>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1b,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
lea    0xeb7(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
@str = [14 x i8] c"Hello, world!\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(27) i8* @malloc(i32 27)
%2 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) %1)
%5 = tail call i32 @free(i8* %1)
ret i32 0
}
int isSpace(char ent) {
  if (ent == 9 || ent == 32)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isSpace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
je     1124 <isSpace+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jne    1130 <isSpace+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <isSpace+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isSpace(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ for_each(char *);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("For_each, pointer arithmetic; macros next\n");
  char collection[] = {'g', 'e', 'o'};
  char *ptr;
  ptr = collection;
  for_each(ptr);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    0xef0(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xee8(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x3(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <for_each@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
movb   $0x6f,0x6(%rsp)
movw   $0x6567,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <for_each@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"For_each, pointer arithmetic; macros next\0A\00"
@__const.main.collection = [3 x i8] c"geo"
define i32 @main() {
%1 = alloca [3 x i8]
%2 = alloca i8*
%3 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%4 = bitcast [3 x i8]* %1 to i8*
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @for_each(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.collection = [3 x i8] c"geo"
@str = [42 x i8] c"For_each, pointer arithmetic; macros next\00"
define i32 @main() {
%1 = alloca [3 x i8]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%4 = call i32 @for_each(i8* %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ arg;

/* Variables and functions */
int /*<<< orphan*/ banClient(char *);
int /*<<< orphan*/ trap_Argv(int, char *, int);
void Svcmd_AddIP_f(void) {
  char arg[256];
  trap_Argv(1, arg, sizeof(arg));
  banClient(arg);
}


x86 assembly (clang, -O0):
<Svcmd_AddIP_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rsi
mov    $0x1,%edi
mov    $0x100,%edx
call   1040 <trap_Argv@plt>
lea    -0x100(%rbp),%rdi
call   1030 <banClient@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Svcmd_AddIP_f>:
push   %rbx
sub    $0x100,%rsp
mov    %rsp,%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x100,%edx
call   1040 <trap_Argv@plt>
mov    %rbx,%rdi
call   1030 <banClient@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @Svcmd_AddIP_f() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @trap_Argv(i32 1, i8* %2, i32 256)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @banClient(i8* %4)
ret void
}

LLVM IR (-O2):
define void @Svcmd_AddIP_f() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @trap_Argv(i32 1, i8* %2, i32 256)
%4 = call i32 @banClient(i8* %2)
ret void
}
unsigned rightrot(int x, int n) {
  int size = sizeof(x) * 8;
  unsigned y = (unsigned)x;
  return y >> n | y << (size - n);
}


x86 assembly (clang, -O0):
<rightrot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x20,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightrot>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @rightrot(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 32, i32* %5
%7 = load i32, i32* %3
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = lshr i32 %8, %9
%11 = load i32, i32* %6
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = sub nsw i32 %12, %13
%15 = shl i32 %11, %14
%16 = or i32 %10, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @rightrot(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
void selinux_secmark_refcount_inc(void) { return; }


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

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

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

LLVM IR (-O2):
define void @selinux_secmark_refcount_inc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_stats_updatebyname_d_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_stats@%p::updatebyname_d (rtpp_stats_updatebyname_d) is "
          "invoked after destruction\x0a",
          pub);
  abort();
}


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

x86 assembly (clang, -O2):
<rtpp_stats_updatebyname_d_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [95 x i8] c"Method rtpp_stats@%p::updatebyname_d (rtpp_stats_updatebyname_d) is invoked after destruction\0A\00"
define void @rtpp_stats_updatebyname_d_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [95 x i8] c"Method rtpp_stats@%p::updatebyname_d (rtpp_stats_updatebyname_d) is invoked after destruction\0A\00"
define void @rtpp_stats_updatebyname_d_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int addq(int, char *, scalar_t__, int);
scalar_t__ strlen(char *);
int writesock_DELAY(int socket, char *data, int delay) {
  return addq(socket, data, strlen(data) + 1, delay);
}


x86 assembly (clang, -O0):
<writesock_DELAY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
mov    -0x14(%rbp),%ecx
call   1040 <addq@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writesock_DELAY>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <addq@plt>

LLVM IR (-O0):
define i32 @writesock_DELAY(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %5
%10 = call i64 @strlen(i8* %9)
%11 = add nsw i64 %10, 1
%12 = load i32, i32* %6
%13 = call i32 @addq(i32 %7, i8* %8, i64 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @writesock_DELAY(i32 %0, i8* %1, i32 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add nsw i64 %4, 1
%6 = tail call i32 @addq(i32 %0, i8* %1, i64 %5, i32 %2)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          unsigned int);
unsigned int bytestream_get_buffer(const uint8_t **b, uint8_t *dst,
                                   unsigned int size) {
  memcpy(dst, *b, size);
  (*b) += size;
  return size;
}


x86 assembly (clang, -O0):
<bytestream_get_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    %edx,%edx
shl    $0x2,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytestream_get_buffer>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%rax
mov    %rdi,%r14
mov    (%rdi),%rsi
mov    %rax,%rdi
call   1030 <memcpy@plt>
mov    %ebx,%eax
shl    $0x2,%rax
add    %rax,(%r14)
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @bytestream_get_buffer(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** %5
%8 = load i32**, i32*** %4
%9 = load i32*, i32** %8
%10 = load i32, i32* %6
%11 = call i32 @memcpy(i32* %7, i32* %9, i32 %10)
%12 = load i32, i32* %6
%13 = load i32**, i32*** %4
%14 = load i32*, i32** %13
%15 = zext i32 %12 to i64
%16 = getelementptr inbounds i32, i32* %14, i64 %15
store i32* %16, i32** %13
%17 = load i32, i32* %6
ret i32 %17
}

LLVM IR (-O2):
define i32 @bytestream_get_buffer(i32** nocapture %0, i32* %1, i32 returned %2) {
%4 = load i32*, i32** %0
%5 = tail call i32 @memcpy(i32* %1, i32* %4, i32 %2)
%6 = load i32*, i32** %0
%7 = zext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %6, i64 %7
store i32* %8, i32** %0
ret i32 %2
}
int fun218() { return 218; }


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

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

LLVM IR (-O0):
define i32 @fun218() {
ret i32 218
}

LLVM IR (-O2):
define i32 @fun218() {
ret i32 218
}
/* Variables and functions */
int /*<<< orphan*/ reallocarray(int /*<<< orphan*/ *, int, int);
int main(void) { return !reallocarray(NULL, 2, 2); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x2,%esi
mov    $0x2,%edx
call   1030 <reallocarray@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @reallocarray(i32* null, i32 2, i32 2)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct wmprefs_t {
  int dummy;
};
struct rc_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ init_rc_options(struct wmprefs_t *, struct rc_t *);
int /*<<< orphan*/ rc_free(struct rc_t *);
struct rc_t *rc_init();
int /*<<< orphan*/ rc_read_file(struct rc_t *, char *);
void wmprefs_read_config_files(struct wmprefs_t *p) {
  struct rc_t *R = rc_init();
  init_rc_options(p, R);
  rc_read_file(R, "wmrc");
  rc_free(R);
}


x86 assembly (clang, -O0):
<wmprefs_read_config_files>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <rc_init@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <init_rc_options@plt>
mov    -0x10(%rbp),%rdi
lea    0xe91(%rip),%rsi
call   1060 <rc_read_file@plt>
mov    -0x10(%rbp),%rdi
call   1050 <rc_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wmprefs_read_config_files>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <rc_init@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <init_rc_options@plt>
lea    0xe9d(%rip),%rsi
mov    %rbx,%rdi
call   1060 <rc_read_file@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <rc_free@plt>

LLVM IR (-O0):
%struct.wmprefs_t = type { i32 }
%struct.rc_t = type { i32 }
@.str = [5 x i8] c"wmrc\00"
define void @wmprefs_read_config_files(%struct.wmprefs_t* %0) {
%2 = alloca %struct.wmprefs_t*
%3 = alloca %struct.rc_t*
store %struct.wmprefs_t* %0, %struct.wmprefs_t** %2
%4 = call %struct.rc_t* (...) @rc_init()
store %struct.rc_t* %4, %struct.rc_t** %3
%5 = load %struct.wmprefs_t*, %struct.wmprefs_t** %2
%6 = load %struct.rc_t*, %struct.rc_t** %3
%7 = call i32 @init_rc_options(%struct.wmprefs_t* %5, %struct.rc_t* %6)
%8 = load %struct.rc_t*, %struct.rc_t** %3
%9 = call i32 @rc_read_file(%struct.rc_t* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = load %struct.rc_t*, %struct.rc_t** %3
%11 = call i32 @rc_free(%struct.rc_t* %10)
ret void
}

LLVM IR (-O2):
%struct.wmprefs_t = type { i32 }
%struct.rc_t = type { i32 }
@.str = [5 x i8] c"wmrc\00"
define void @wmprefs_read_config_files(%struct.wmprefs_t* %0) {
%2 = tail call %struct.rc_t* (...) @rc_init()
%3 = tail call i32 @init_rc_options(%struct.wmprefs_t* %0, %struct.rc_t* %2)
%4 = tail call i32 @rc_read_file(%struct.rc_t* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @rc_free(%struct.rc_t* %2)
ret void
}
void foo578() {}


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

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

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

LLVM IR (-O2):
define void @foo578() {
ret void
}
/* Variables and functions */
int WIFSIGNALED(int);
int goose_WIFSIGNALED(int status) { return WIFSIGNALED(status); }


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

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

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

LLVM IR (-O2):
define i32 @goose_WIFSIGNALED(i32 %0) {
%2 = tail call i32 @WIFSIGNALED(i32 %0)
ret i32 %2
}
char __ge_func(long double d1, long double d2) { return d1 >= d2 ? 1 : 0; }


x86 assembly (clang, -O0):
<__ge_func>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ge_func>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
ret

LLVM IR (-O0):
define signext i8 @__ge_func(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fcmp oge x86_fp80 %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @__ge_func(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp oge x86_fp80 %0, %1
%4 = zext i1 %3 to i8
ret i8 %4
}
float vec2_dist(const float a[2], const float b[2]) {
  return sqrt(vec2_dist2(a, b));
}


x86 assembly (clang, -O0):
<vec2_dist>:
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    $0x0,%al
call   1040 <vec2_dist2@plt>
cvtsi2sd %eax,%xmm0
call   1030 <sqrt@plt>
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2_dist>:
push   %rax
xor    %eax,%eax
call   1040 <vec2_dist2@plt>
cvtsi2sd %eax,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     113c <vec2_dist+0x1c>
sqrtsd %xmm0,%xmm0
jmp    1141 <vec2_dist+0x21>
call   1030 <sqrt@plt>
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @vec2_dist(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 = call i32 (float*, float*, ...) bitcast (i32 (...)* @vec2_dist2 to i32 (float*, float*, ...)*)(float* %5, float* %6)
%8 = sitofp i32 %7 to double
%9 = call double @sqrt(double %8)
%10 = fptrunc double %9 to float
ret float %10
}

LLVM IR (-O2):
define float @vec2_dist(float* %0, float* %1) {
%3 = tail call i32 (float*, float*, ...) bitcast (i32 (...)* @vec2_dist2 to i32 (float*, float*, ...)*)(float* %0, float* %1)
%4 = sitofp i32 %3 to double
%5 = tail call double @sqrt(double %4)
%6 = fptrunc double %5 to float
ret float %6
}
double toRadians(double d) { return d * (3.14159265358979323846 / 180.0); }


x86 assembly (clang, -O0):
<toRadians>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<toRadians>:
mulsd  0xef8(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @toRadians(double %0) {
%2 = fmul double %0, 0x3F91DF46A2529D39
ret double %2
}