xunge/DecIR huggingface dataset:
/* Variables and functions */
double sqrt(double);
double futhark_sqrt64(double x) { return sqrt(x); }


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

x86 assembly (clang, -O2):
<futhark_sqrt64>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     111f <futhark_sqrt64+0xf>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @futhark_sqrt64(double %0) {
%2 = tail call double @sqrt(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ f1();
float f2() { f1(); }


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

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

LLVM IR (-O0):
define float @f2() {
%1 = alloca float
%2 = call i32 (...) @f1()
%3 = load float, float* %1
ret float %3
}

LLVM IR (-O2):
define float @f2() {
%1 = tail call i32 (...) @f1()
ret float undef
}
int is_inbetween(int start, int val, int end, int mod) {
  start %= mod;
  end %= mod;
  val %= mod;
  return ((end > start) ^ (val >= start) ^ (val <= end));
}


x86 assembly (clang, -O0):
<is_inbetween>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x8(%rbp),%ecx
cmp    -0x4(%rbp),%ecx
setge  %cl
and    $0x1,%cl
movzbl %cl,%ecx
xor    %ecx,%eax
mov    -0x8(%rbp),%ecx
cmp    -0xc(%rbp),%ecx
setle  %cl
and    $0x1,%cl
movzbl %cl,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_inbetween>:
mov    %edx,%r8d
mov    %esi,%r9d
mov    %edi,%eax
cltd
idiv   %ecx
mov    %edx,%edi
mov    %r8d,%eax
cltd
idiv   %ecx
mov    %edx,%esi
mov    %r9d,%eax
cltd
idiv   %ecx
cmp    %edi,%esi
setg   %al
cmp    %edi,%edx
setge  %cl
xor    %al,%cl
cmp    %esi,%edx
setle  %al
xor    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @is_inbetween(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* %8
%10 = load i32, i32* %5
%11 = srem i32 %10, %9
store i32 %11, i32* %5
%12 = load i32, i32* %8
%13 = load i32, i32* %7
%14 = srem i32 %13, %12
store i32 %14, i32* %7
%15 = load i32, i32* %8
%16 = load i32, i32* %6
%17 = srem i32 %16, %15
store i32 %17, i32* %6
%18 = load i32, i32* %7
%19 = load i32, i32* %5
%20 = icmp sgt i32 %18, %19
%21 = zext i1 %20 to i32
%22 = load i32, i32* %6
%23 = load i32, i32* %5
%24 = icmp sge i32 %22, %23
%25 = zext i1 %24 to i32
%26 = xor i32 %21, %25
%27 = load i32, i32* %6
%28 = load i32, i32* %7
%29 = icmp sle i32 %27, %28
%30 = zext i1 %29 to i32
%31 = xor i32 %26, %30
ret i32 %31
}

LLVM IR (-O2):
define i32 @is_inbetween(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = srem i32 %0, %3
%6 = srem i32 %2, %3
%7 = srem i32 %1, %3
%8 = icmp sgt i32 %6, %5
%9 = icmp sge i32 %7, %5
%10 = xor i1 %8, %9
%11 = icmp sle i32 %7, %6
%12 = xor i1 %11, %10
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
int /*<<< orphan*/ IntDisable(int);
int /*<<< orphan*/ IntUnregister(int);
void PECIIntUnregister(unsigned long ulBase) {
  DEBUG_ASSERT(ulBase == 0x400B0000);
  IntDisable(123);
  IntUnregister(123);
}


x86 assembly (clang, -O0):
<PECIIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x400b0000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    $0x7b,%edi
call   1030 <IntDisable@plt>
mov    $0x7b,%edi
call   1050 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PECIIntUnregister>:
push   %rax
xor    %eax,%eax
cmp    $0x400b0000,%rdi
sete   %al
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    $0x7b,%edi
call   1030 <IntDisable@plt>
mov    $0x7b,%edi
pop    %rax
jmp    1050 <IntUnregister@plt>

LLVM IR (-O0):
define void @PECIIntUnregister(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1074462720
%5 = zext i1 %4 to i32
%6 = call i32 @DEBUG_ASSERT(i32 %5)
%7 = call i32 @IntDisable(i32 123)
%8 = call i32 @IntUnregister(i32 123)
ret void
}

LLVM IR (-O2):
define void @PECIIntUnregister(i64 %0) {
%2 = icmp eq i64 %0, 1074462720
%3 = zext i1 %2 to i32
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = tail call i32 @IntDisable(i32 123)
%6 = tail call i32 @IntUnregister(i32 123)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
const char *unpack_u16(uint16_t *data, const char *buffer) {
  *data = ntohs(*(uint16_t *)buffer);
  return buffer + sizeof(*data);
}


x86 assembly (clang, -O0):
<unpack_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <ntohs@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack_u16>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rsi),%edi
call   1030 <ntohs@plt>
mov    %eax,(%r14)
add    $0x4,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @unpack_u16(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = call i32 @ntohs(i32 %7)
%9 = load i32*, i32** %3
store i32 %8, i32* %9
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 4
ret i8* %11
}

LLVM IR (-O2):
define i8* @unpack_u16(i32* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @ntohs(i32 %4)
store i32 %5, i32* %0
%6 = getelementptr inbounds i8, i8* %1, i64 4
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ box_double(double);
int /*<<< orphan*/ dpop();
double untag_float_fast(int /*<<< orphan*/);
void primitive_float_divfloat_impl(void) {
  double y = untag_float_fast(dpop());
  double x = untag_float_fast(dpop());
  ;
  box_double(x / y);
}


x86 assembly (clang, -O0):
<primitive_float_divfloat_impl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <dpop@plt>
mov    %eax,%edi
call   1040 <untag_float_fast@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <dpop@plt>
mov    %eax,%edi
call   1040 <untag_float_fast@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
call   1050 <box_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_float_divfloat_impl>:
push   %rax
xor    %eax,%eax
call   1030 <dpop@plt>
mov    %eax,%edi
call   1040 <untag_float_fast@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <dpop@plt>
mov    %eax,%edi
call   1040 <untag_float_fast@plt>
divsd  (%rsp),%xmm0
pop    %rax
jmp    1050 <box_double@plt>

LLVM IR (-O0):
define void @primitive_float_divfloat_impl() {
%1 = alloca double
%2 = alloca double
%3 = call i32 (...) @dpop()
%4 = call double @untag_float_fast(i32 %3)
store double %4, double* %1
%5 = call i32 (...) @dpop()
%6 = call double @untag_float_fast(i32 %5)
store double %6, double* %2
%7 = load double, double* %2
%8 = load double, double* %1
%9 = fdiv double %7, %8
%10 = call i32 @box_double(double %9)
ret void
}

LLVM IR (-O2):
define void @primitive_float_divfloat_impl() {
%1 = tail call i32 (...) @dpop()
%2 = tail call double @untag_float_fast(i32 %1)
%3 = tail call i32 (...) @dpop()
%4 = tail call double @untag_float_fast(i32 %3)
%5 = fdiv double %4, %2
%6 = tail call i32 @box_double(double %5)
ret void
}
int should_return_one() { return 1; }


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

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

LLVM IR (-O0):
define i32 @should_return_one() {
ret i32 1
}

LLVM IR (-O2):
define i32 @should_return_one() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ bang_tilde_setup();
int /*<<< orphan*/ print_setup();
void d_misc_setup(void) {
  print_setup();
  bang_tilde_setup();
}


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

x86 assembly (clang, -O2):
<d_misc_setup>:
push   %rax
xor    %eax,%eax
call   1030 <print_setup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <bang_tilde_setup@plt>

LLVM IR (-O0):
define void @d_misc_setup() {
%1 = call i32 (...) @print_setup()
%2 = call i32 (...) @bang_tilde_setup()
ret void
}

LLVM IR (-O2):
define void @d_misc_setup() {
%1 = tail call i32 (...) @print_setup()
%2 = tail call i32 (...) @bang_tilde_setup()
ret void
}
void set_knight(char *p) { *p |= (1 << 1); }


x86 assembly (clang, -O0):
<set_knight>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
or     $0x2,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_knight>:
orb    $0x2,(%rdi)
ret

LLVM IR (-O0):
define void @set_knight(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = or i32 %5, 2
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
ret void
}

LLVM IR (-O2):
define void @set_knight(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = or i8 %2, 2
store i8 %3, i8* %0
ret void
}
unsigned long rdtsc() {
  unsigned long long hi, lo;
  asm volatile("rdtsc" : "=a"(lo), "=d"(hi));
  return hi << 32 | lo;
}


x86 assembly (clang, -O0):
<rdtsc>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %rax,-0x10(%rbp)
mov    %rdx,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x20,%rax
or     -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdtsc>:
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @rdtsc() {
%1 = alloca i64
%2 = alloca i64
%3 = call { i64, i64 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i64, i64 } %3, 0
%5 = extractvalue { i64, i64 } %3, 1
store i64 %4, i64* %2
store i64 %5, i64* %1
%6 = load i64, i64* %1
%7 = shl i64 %6, 32
%8 = load i64, i64* %2
%9 = or i64 %7, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @rdtsc() {
%1 = tail call { i64, i64 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i64, i64 } %1, 0
%3 = extractvalue { i64, i64 } %1, 1
%4 = shl i64 %3, 32
%5 = or i64 %4, %2
ret i64 %5
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  int /*<<< orphan*/ tv_sec;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ bot_timestamp_seconds(int /*<<< orphan*/);
int bot_timestamp_useconds(int /*<<< orphan*/);
void bot_timestamp_to_timespec(int64_t v, struct timespec *ts) {
  ts->tv_sec = bot_timestamp_seconds(v);
  ts->tv_nsec = bot_timestamp_useconds(v) * 1000;
}


x86 assembly (clang, -O0):
<bot_timestamp_to_timespec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <bot_timestamp_seconds@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x4(%rbp),%edi
call   1030 <bot_timestamp_useconds@plt>
imul   $0x3e8,%eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bot_timestamp_to_timespec>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <bot_timestamp_seconds@plt>
mov    %eax,0x4(%rbx)
mov    %ebp,%edi
call   1030 <bot_timestamp_useconds@plt>
imul   $0x3e8,%eax,%eax
mov    %eax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @bot_timestamp_to_timespec(i32 %0, %struct.timespec* nocapture writeonly %1) {
%3 = tail call i32 @bot_timestamp_seconds(i32 %0)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
store i32 %3, i32* %4
%5 = tail call i32 @bot_timestamp_useconds(i32 %0)
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
store i32 %6, i32* %7
ret void
}
unsigned long gf2_matrix_times(mat, vec)
unsigned long *mat;
unsigned long vec;
{
  unsigned long sum;
  sum = 0;
  while (vec) {
    if (vec & 1) {
      sum ^= *mat;
    }
    vec >>= 1;
    mat++;
  }
  return sum;
}


x86 assembly (clang, -O0):
<gf2_matrix_times>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115d <gf2_matrix_times+0x5d>
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1140 <gf2_matrix_times+0x40>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
xor    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <gf2_matrix_times+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf2_matrix_times>:
xor    %eax,%eax
test   %rsi,%rsi
jne    1123 <gf2_matrix_times+0x23>
ret
nopl   0x0(%rax,%rax,1)
mov    %rsi,%rcx
shr    %rcx
add    $0x8,%rdi
cmp    $0x1,%rsi
mov    %rcx,%rsi
jbe    1107 <gf2_matrix_times+0x7>
test   $0x1,%sil
je     1110 <gf2_matrix_times+0x10>
xor    (%rdi),%rax
jmp    1110 <gf2_matrix_times+0x10>

LLVM IR (-O0):
define i64 @gf2_matrix_times(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %18, %2
%7 = load i64, i64* %4
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i64, i64* %4
%11 = and i64 %10, 1
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = load i64*, i64** %3
%15 = load i64, i64* %14
%16 = load i64, i64* %5
%17 = xor i64 %16, %15
store i64 %17, i64* %5
br label %18
18: ; preds = %13, %9
%19 = load i64, i64* %4
%20 = lshr i64 %19, 1
store i64 %20, i64* %4
%21 = load i64*, i64** %3
%22 = getelementptr inbounds i64, i64* %21, i32 1
store i64* %22, i64** %3
br label %6
23: ; preds = %6
%24 = load i64, i64* %5
ret i64 %24
}

LLVM IR (-O2):
define i64 @gf2_matrix_times(i64* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %18, label %4
4: ; preds = %2, %13
%5 = phi i64 [ %14, %13 ], [ 0, %2 ]
%6 = phi i64 [ %15, %13 ], [ %1, %2 ]
%7 = phi i64* [ %16, %13 ], [ %0, %2 ]
%8 = and i64 %6, 1
%9 = icmp eq i64 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = load i64, i64* %7
%12 = xor i64 %11, %5
br label %13
13: ; preds = %10, %4
%14 = phi i64 [ %12, %10 ], [ %5, %4 ]
%15 = lshr i64 %6, 1
%16 = getelementptr inbounds i64, i64* %7, i64 1
%17 = icmp ult i64 %6, 2
br i1 %17, label %18, label %4
18: ; preds = %13, %2
%19 = phi i64 [ 0, %2 ], [ %14, %13 ]
ret i64 %19
}
__attribute__((always_)) void lidt(struct pseudodesc *pd) {
  asm volatile("lidt (%0)" ::"r"(pd) : "memory");
}


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

x86 assembly (clang, -O2):
<lidt>:
lidt   (%rdi)
ret

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

LLVM IR (-O2):
%struct.pseudodesc = type opaque
define void @lidt(%struct.pseudodesc* %0) {
tail call void asm sideeffect "lidt ($0)", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(%struct.pseudodesc* %0)
ret void
}
void Hal_hook_rd_sgncenum(void) {}


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

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

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

LLVM IR (-O2):
define void @Hal_hook_rd_sgncenum() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
void test05_head() {
  do {
    printf("test05");
    puts("");
  } while (0);
}


x86 assembly (clang, -O0):
<test05_head>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <test05_head+0x9>
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test05_head>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"test05\00"
@.str.1 = [1 x i8] zeroinitializer
define void @test05_head() {
br label %1
1: ; preds = %0
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %4
4: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"test05\00"
define void @test05_head() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret void
}
unsigned xrop3_52_0_1(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;
  stk3 = D & S;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_52_0_1>:
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    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_52_0_1(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
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = and i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = and i32 %32, %33
%35 = load i32, i32* %8
%36 = load i32, i32* %7
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = or i32 %34, %38
%40 = load i32, i32* %7
%41 = load i32, i32* %6
%42 = xor i32 %41, -1
%43 = and i32 %40, %42
%44 = load i32, i32* %5
%45 = and i32 %43, %44
%46 = or i32 %39, %45
ret i32 %46
}

LLVM IR (-O2):
define i32 @xrop3_52_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %3, -1
%8 = xor i32 %6, %4
%9 = and i32 %8, %7
%10 = xor i32 %6, -1
%11 = or i32 %4, %10
%12 = and i32 %9, %11
%13 = and i32 %7, %5
%14 = or i32 %12, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
scalar_t__ xmalloc(int);
char *cstr(char *s) {
  char *tmp = (char *)xmalloc(sizeof(char) * strlen(s) + 1);
  strcpy(tmp, s);
  return tmp;
}


x86 assembly (clang, -O0):
<cstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
cltq
shl    $0x0,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1050 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cstr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @cstr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sext i32 %5 to i64
%7 = mul i64 1, %6
%8 = add i64 %7, 1
%9 = trunc i64 %8 to i32
%10 = call i64 @xmalloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @strcpy(i8* %12, i8* %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @cstr(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add i32 %2, 1
%4 = tail call i64 @xmalloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ get_next_state();
int /*<<< orphan*/ set_curr_state(int /*<<< orphan*/);
int /*<<< orphan*/ set_next_state(int);
void advance_state() {
  set_curr_state(get_next_state());
  set_next_state(4);
}


x86 assembly (clang, -O0):
<advance_state>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_next_state@plt>
mov    %eax,%edi
call   1040 <set_curr_state@plt>
mov    $0x4,%edi
call   1050 <set_next_state@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<advance_state>:
push   %rax
xor    %eax,%eax
call   1030 <get_next_state@plt>
mov    %eax,%edi
call   1040 <set_curr_state@plt>
mov    $0x4,%edi
pop    %rax
jmp    1050 <set_next_state@plt>

LLVM IR (-O0):
define void @advance_state() {
%1 = call i32 (...) @get_next_state()
%2 = call i32 @set_curr_state(i32 %1)
%3 = call i32 @set_next_state(i32 4)
ret void
}

LLVM IR (-O2):
define void @advance_state() {
%1 = tail call i32 (...) @get_next_state()
%2 = tail call i32 @set_curr_state(i32 %1)
%3 = tail call i32 @set_next_state(i32 4)
ret void
}
unsigned insert_zb(insn, value, errmsg)
unsigned insn;
int value __attribute__((unused));
const char **errmsg __attribute__((unused));
{ return insn | (31 << 16); }


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

x86 assembly (clang, -O2):
<insert_zb>:
mov    %edi,%eax
or     $0x1f0000,%eax
ret

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

LLVM IR (-O2):
define i32 @insert_zb(i32 %0, i32 %1, i8** nocapture readnone %2) {
%4 = or i32 %0, 2031616
ret i32 %4
}
int is_decimal(int ch) { return ((ch >= '0') && (ch <= '9')); }


x86 assembly (clang, -O0):
<is_decimal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <is_decimal+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_decimal>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_decimal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_decimal(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void start_timer(struct timeval *start) { gettimeofday(start, NULL); }


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

x86 assembly (clang, -O2):
<start_timer>:
xor    %esi,%esi
jmp    1030 <gettimeofday@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @start_timer(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @start_timer(%struct.timeval* nocapture %0) {
%2 = tail call i32 @gettimeofday(%struct.timeval* %0, i32* null)
ret void
}
__attribute__((__no__)) void
do_nothing_packed_assigned_dynamic_partial(struct test_packed *ptr) {
  if ((unsigned long)ptr > 0x2)
    return;
  else
    return;
}


x86 assembly (clang, -O0):
<do_nothing_packed_assigned_dynamic_partial>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x2,%rax
jbe    111b <do_nothing_packed_assigned_dynamic_partial+0x1b>
jmp    1120 <do_nothing_packed_assigned_dynamic_partial+0x20>
jmp    1120 <do_nothing_packed_assigned_dynamic_partial+0x20>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test_packed = type opaque
define void @do_nothing_packed_assigned_dynamic_partial(%struct.test_packed* %0) {
%2 = alloca %struct.test_packed*
store %struct.test_packed* %0, %struct.test_packed** %2
%3 = load %struct.test_packed*, %struct.test_packed** %2
%4 = ptrtoint %struct.test_packed* %3 to i64
%5 = icmp ugt i64 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.test_packed = type opaque
define void @do_nothing_packed_assigned_dynamic_partial(%struct.test_packed* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ controlNew();
int /*<<< orphan*/ oosmos_DelayMS(int);
int /*<<< orphan*/ oosmos_RunStateMachines();
extern int main(void) {
  (void)controlNew();
  for (;;) {
    oosmos_RunStateMachines();
    oosmos_DelayMS(1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <controlNew@plt>
mov    $0x0,%al
call   1050 <oosmos_RunStateMachines@plt>
mov    $0x1,%edi
call   1040 <oosmos_DelayMS@plt>
jmp    1146 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <controlNew@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <oosmos_RunStateMachines@plt>
mov    $0x1,%edi
call   1040 <oosmos_DelayMS@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @controlNew()
br label %3
3: ; preds = %3, %0
%4 = call i32 (...) @oosmos_RunStateMachines()
%5 = call i32 @oosmos_DelayMS(i32 1)
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @controlNew()
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @oosmos_RunStateMachines()
%4 = tail call i32 @oosmos_DelayMS(i32 1)
br label %2
}
/* Variables and functions */
int yaffs_format_common(int /*<<< orphan*/, char const *, int, int, int);
int yaffs_format(const char *path, int unmount_flag, int force_unmount_flag,
                 int remount_flag) {
  return yaffs_format_common((0), path, unmount_flag, force_unmount_flag,
                             remount_flag);
}


x86 assembly (clang, -O0):
<yaffs_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
xor    %edi,%edi
call   1030 <yaffs_format_common@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yaffs_format>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <yaffs_format_common@plt>

LLVM IR (-O0):
define i32 @yaffs_format(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @yaffs_format_common(i32 0, i8* %9, i32 %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @yaffs_format(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @yaffs_format_common(i32 0, i8* %0, i32 %1, i32 %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
size_t bnode_leaf(void) { return (0); }


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

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

LLVM IR (-O0):
define i64 @bnode_leaf() {
ret i64 0
}

LLVM IR (-O2):
define i64 @bnode_leaf() {
ret i64 0
}
int compare(const void *key1, const void *key2) {
  int k1 = *((unsigned int *)key1);
  int k2 = *((unsigned int *)key2);
  if (k1 > k2)
    return 1;
  else if (k1 == k2)
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    1136 <compare+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1155 <compare+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    114e <compare+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1155 <compare+0x55>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setne  %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
void foo299(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo299(i32 %0) {
ret void
}
/* Type definitions */
struct fi_provider {
  int dummy;
};

/* Variables and functions */
int fi_param_get(struct fi_provider *, char const *, int *);
int fi_param_get_bool(struct fi_provider *provider, const char *param_name,
                      int *value) {
  return fi_param_get(provider, param_name, value);
}


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

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

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

LLVM IR (-O2):
%struct.fi_provider = type { i32 }
define i32 @fi_param_get_bool(%struct.fi_provider* %0, i8* %1, i32* %2) {
%4 = tail call i32 @fi_param_get(%struct.fi_provider* %0, i8* %1, i32* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_blanks(int num) {
  while (num--) {
    printf(" ");
  }
}


x86 assembly (clang, -O0):
<print_blanks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1140 <print_blanks+0x30>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
jmp    111b <print_blanks+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_blanks>:
push   %rbx
test   %edi,%edi
je     112f <print_blanks+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <print_blanks+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @print_blanks(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ne i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @print_blanks(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @putchar(i32 32)
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
void f(long i) {
  if ((signed char)i < 0 || (signed char)i == 0)
    _exit(-1);
  else
    _exit(0);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl %al,%eax
cmp    $0x0,%eax
jl     113c <f+0x2c>
mov    -0x8(%rbp),%rax
movsbl %al,%eax
cmp    $0x0,%eax
jne    1146 <f+0x36>
mov    $0xffffffff,%edi
call   1030 <_exit@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<f>:
push   %rax
shl    $0x18,%edi
test   %edi,%edi
jg     1122 <f+0x12>
mov    $0xffffffff,%edi
call   1030 <_exit@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @f(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i8
%5 = sext i8 %4 to i32
%6 = icmp slt i32 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = load i64, i64* %2
%9 = trunc i64 %8 to i8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %7, %1
%13 = call i32 @_exit(i32 -1)
unreachable
14: ; preds = %7
%15 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @f(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = shl i32 %2, 24
%4 = icmp slt i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @_exit(i32 -1)
unreachable
7: ; preds = %1
%8 = tail call i32 @_exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ restart(int);
void RST_20() { restart(0x20); }


x86 assembly (clang, -O0):
<RST_20>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
call   1030 <restart@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RST_20>:
mov    $0x20,%edi
jmp    1030 <restart@plt>

LLVM IR (-O0):
define void @RST_20() {
%1 = call i32 @restart(i32 32)
ret void
}

LLVM IR (-O2):
define void @RST_20() {
%1 = tail call i32 @restart(i32 32)
ret void
}
void g_value_set_boxed() {}


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

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

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

LLVM IR (-O2):
define void @g_value_set_boxed() {
ret void
}
/* Variables and functions */
double floor(double);
double mod2pi_positive(double vin) {
  return vin - 6.2831853071795862319959 * floor(vin / 6.2831853071795862319959);
}


x86 assembly (clang, -O0):
<mod2pi_positive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed4(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <floor@plt>
movsd  -0x10(%rbp),%xmm1
movsd  0xeb6(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod2pi_positive>:
push   %rax
movsd  %xmm0,(%rsp)
divsd  0xee2(%rip),%xmm0
call   1030 <floor@plt>
mulsd  0xedd(%rip),%xmm0
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mod2pi_positive(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fdiv double %4, 0x401921FB54442D18
%6 = call double @llvm.floor.f64(double %5)
%7 = call double @llvm.fmuladd.f64(double 0xC01921FB54442D18, double %6, double %3)
ret double %7
}

LLVM IR (-O2):
define double @mod2pi_positive(double %0) {
%2 = fdiv double %0, 0x401921FB54442D18
%3 = tail call double @llvm.floor.f64(double %2)
%4 = tail call double @llvm.fmuladd.f64(double %3, double 0xC01921FB54442D18, double %0)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ niceprint(char *);
void lava(void) {
  niceprint(
      "As the party traverses a long and winding corridor, a tremor opens up "
      "a lava-filled fissure behind them. Each character must make a DC 10 "
      "Dexterity saving throw to avoid the lava swell, taking 6d6 fire damage "
      "on a failed save. Decrease the drow pursuit level by 1.\n\n");
}


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

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

LLVM IR (-O0):
@.str = [267 x i8] c"As the party traverses a long and winding corridor, a tremor opens up a lava-filled fissure behind them. Each character must make a DC 10 Dexterity saving throw to avoid the lava swell, taking 6d6 fire damage on a failed save. Decrease the drow pursuit level by 1.\0A\0A\00"
define void @lava() {
%1 = call i32 @niceprint(i8* getelementptr inbounds ([267 x i8], [267 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [267 x i8] c"As the party traverses a long and winding corridor, a tremor opens up a lava-filled fissure behind them. Each character must make a DC 10 Dexterity saving throw to avoid the lava swell, taking 6d6 fire damage on a failed save. Decrease the drow pursuit level by 1.\0A\0A\00"
define void @lava() {
%1 = tail call i32 @niceprint(i8* getelementptr inbounds ([267 x i8], [267 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void logChangesToFile(char message[]) {
  FILE *logfp = fopen("sysDiffLog", "a");
  fprintf(logfp, "%s\n", message);
  fclose(logfp);
}


x86 assembly (clang, -O0):
<logChangesToFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
lea    0xec1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xeab(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logChangesToFile>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xeb9(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"sysDiffLog\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @logChangesToFile(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = load i8*, i8** %2
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%8 = load i32*, i32** %3
%9 = call i32 @fclose(i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"sysDiffLog\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @logChangesToFile(i8* %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%4 = tail call i32 @fclose(i32* %2)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int inb(int);
uint32_t fw_cfg_readl_le(void) {
  uint32_t val;
  val = inb(0x511);
  val = (inb(0x511) << 8) | val;
  val = (inb(0x511) << 16) | val;
  val = (inb(0x511) << 24) | val;
  return val;
}


x86 assembly (clang, -O0):
<fw_cfg_readl_le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x511,%edi
call   1030 <inb@plt>
mov    %eax,-0x4(%rbp)
mov    $0x511,%edi
call   1030 <inb@plt>
shl    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x511,%edi
call   1030 <inb@plt>
shl    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x511,%edi
call   1030 <inb@plt>
shl    $0x18,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fw_cfg_readl_le>:
push   %rbp
push   %rbx
push   %rax
mov    $0x511,%edi
call   1030 <inb@plt>
mov    %eax,%ebx
mov    $0x511,%edi
call   1030 <inb@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
or     %ebx,%ebp
mov    $0x511,%edi
call   1030 <inb@plt>
mov    %eax,%ebx
shl    $0x10,%ebx
mov    $0x511,%edi
call   1030 <inb@plt>
shl    $0x18,%eax
or     %ebx,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fw_cfg_readl_le() {
%1 = alloca i32
%2 = call i32 @inb(i32 1297)
store i32 %2, i32* %1
%3 = call i32 @inb(i32 1297)
%4 = shl i32 %3, 8
%5 = load i32, i32* %1
%6 = or i32 %4, %5
store i32 %6, i32* %1
%7 = call i32 @inb(i32 1297)
%8 = shl i32 %7, 16
%9 = load i32, i32* %1
%10 = or i32 %8, %9
store i32 %10, i32* %1
%11 = call i32 @inb(i32 1297)
%12 = shl i32 %11, 24
%13 = load i32, i32* %1
%14 = or i32 %12, %13
store i32 %14, i32* %1
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @fw_cfg_readl_le() {
%1 = tail call i32 @inb(i32 1297)
%2 = tail call i32 @inb(i32 1297)
%3 = shl i32 %2, 8
%4 = or i32 %3, %1
%5 = tail call i32 @inb(i32 1297)
%6 = shl i32 %5, 16
%7 = or i32 %4, %6
%8 = tail call i32 @inb(i32 1297)
%9 = shl i32 %8, 24
%10 = or i32 %7, %9
ret i32 %10
}
/* Type definitions */
typedef scalar_t__ gid_t;

/* Variables and functions */
int errno;
scalar_t__ getegid();
gid_t __sulong_posix_getegid(void) {
  {
    int native_errno = errno;
    gid_t result = getegid();
    if (result == (gid_t)-1) {
      result = (gid_t)(long)-errno;
    }
    errno = native_errno;
    return result;
  };
}


x86 assembly (clang, -O0):
<__sulong_posix_getegid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getegid@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x10(%rbp)
jne    114b <__sulong_posix_getegid+0x3b>
xor    %eax,%eax
mov    0x2e9d(%rip),%rcx
sub    (%rcx),%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2e8b(%rip),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sulong_posix_getegid>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
xor    %eax,%eax
call   1030 <getegid@plt>
movslq (%rbx),%rcx
neg    %rcx
cmp    $0xffffffffffffffff,%rax
cmove  %rcx,%rax
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
define i64 @__sulong_posix_getegid() {
%1 = alloca i32
%2 = alloca i64
%3 = load i32, i32* @errno
store i32 %3, i32* %1
%4 = call i64 (...) @getegid()
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = icmp eq i64 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i32, i32* @errno
%9 = sub nsw i32 0, %8
%10 = sext i32 %9 to i64
store i64 %10, i64* %2
br label %11
11: ; preds = %7, %0
%12 = load i32, i32* %1
store i32 %12, i32* @errno
%13 = load i64, i64* %2
ret i64 %13
}

LLVM IR (-O2):
@errno = global i32 0
define i64 @__sulong_posix_getegid() {
%1 = load i32, i32* @errno
%2 = tail call i64 (...) @getegid()
%3 = icmp eq i64 %2, -1
%4 = load i32, i32* @errno
%5 = sub nsw i32 0, %4
%6 = sext i32 %5 to i64
%7 = select i1 %3, i64 %6, i64 %2
store i32 %1, i32* @errno
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void sigalarm_handler(int sig) { exit(1); }


x86 assembly (clang, -O0):
<sigalarm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sigalarm_handler>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @sigalarm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @sigalarm_handler(i32 %0) {
%2 = tail call i32 @exit(i32 1)
unreachable
}