xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
unsigned int reverse_bits(unsigned int);
int main() {
  unsigned int x = 0x12345678;
  unsigned y = reverse_bits(x);
  printf("%#x\n%#x\n", x, y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x12345678,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <reverse_bits@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x12345678,%edi
call   1030 <reverse_bits@plt>
lea    0xece(%rip),%rdi
mov    $0x12345678,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%#x\0A%#x\0A\00"
define i32 @main() {
%1 = tail call i32 @reverse_bits(i32 305419896)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 305419896, i32 %1)
ret i32 0
}
void trsm(void *args) {}


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

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

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

LLVM IR (-O2):
define void @trsm(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_hex8(unsigned char);
void print_err_hex8(unsigned char value) { __console_tx_hex8(value); }


x86 assembly (clang, -O0):
<print_err_hex8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <__console_tx_hex8@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @print_err_hex8(i8 zeroext %0) {
%2 = tail call i32 @__console_tx_hex8(i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hal_early_print_printf(char *);
int /*<<< orphan*/ private_hal_mmu_paging_init();
int /*<<< orphan*/ private_hal_mmu_phymem_init();
void hal_mmu_init() {
  hal_early_print_printf("\nInitializing mmu module...\n");
  private_hal_mmu_phymem_init();
  private_hal_mmu_paging_init();
  return;
}


x86 assembly (clang, -O0):
<hal_mmu_init>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <hal_early_print_printf@plt>
mov    $0x0,%al
call   1040 <private_hal_mmu_phymem_init@plt>
mov    $0x0,%al
call   1030 <private_hal_mmu_paging_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hal_mmu_init>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <hal_early_print_printf@plt>
xor    %eax,%eax
call   1040 <private_hal_mmu_phymem_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <private_hal_mmu_paging_init@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"\0AInitializing mmu module...\0A\00"
define void @hal_mmu_init() {
%1 = call i32 @hal_early_print_printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @private_hal_mmu_phymem_init()
%3 = call i32 (...) @private_hal_mmu_paging_init()
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"\0AInitializing mmu module...\0A\00"
define void @hal_mmu_init() {
%1 = tail call i32 @hal_early_print_printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @private_hal_mmu_phymem_init()
%3 = tail call i32 (...) @private_hal_mmu_paging_init()
ret void
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void AONIOCDriveStrengthSet(uint32_t ui32DriveLevel,
                            uint32_t ui32DriveStrength) {

  ;

  ;
  (*((volatile unsigned long *)(0x40094000 + ui32DriveLevel))) =
      ui32DriveStrength;
}


x86 assembly (clang, -O0):
<AONIOCDriveStrengthSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    $0x40094000,%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AONIOCDriveStrengthSet>:
mov    %rsi,0x40094000(%rdi)
ret

LLVM IR (-O0):
define void @AONIOCDriveStrengthSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 1074348032, %6
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @AONIOCDriveStrengthSet(i64 %0, i64 %1) {
%3 = add i64 %0, 1074348032
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
int test_imm_A8uint16_reg(unsigned short val) {
  return ((val) & (-0xA8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A8uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -168
%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_A8uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -168
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void g(unsigned __int128 x) {
  unsigned __int128 y;
  unsigned __int128 z;
  unsigned __int128 m = -1;
  m = m / 2;
  if (x < m - 2)
    return;
  if (x > m - 1)
    return;
  y = x;
  z = y * y;
  if (z == 7)
    impossible();
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,-0x20(%rbp)
movq   $0xffffffffffffffff,-0x48(%rbp)
ff
movq   $0xffffffffffffffff,-0x50(%rbp)
ff
mov    -0x50(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    %rcx,%rax
shld   $0x3f,%rdx,%rax
shr    %rcx
mov    %rcx,-0x48(%rbp)
mov    %rax,-0x50(%rbp)
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rax
mov    -0x50(%rbp),%rsi
mov    -0x48(%rbp),%rcx
add    $0xfffffffffffffffe,%rsi
adc    $0xffffffffffffffff,%rcx
sub    %rsi,%rdx
sbb    %rcx,%rax
jae    1189 <g+0x79>
jmp    1184 <g+0x74>
jmp    1222 <g+0x112>
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x50(%rbp),%rdx
mov    -0x48(%rbp),%rax
add    $0xffffffffffffffff,%rdx
adc    $0xffffffffffffffff,%rax
sub    %rsi,%rdx
sbb    %rcx,%rax
jae    11b7 <g+0xa7>
jmp    11b2 <g+0xa2>
jmp    1222 <g+0x112>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rcx
mov    -0x28(%rbp),%rdx
mov    %rcx,%rax
imul   %rdx,%rax
mov    %rax,-0x58(%rbp)
mov    %rcx,%rax
mul    %rcx
mov    %rax,%rcx
mov    %rdx,%rax
mov    -0x58(%rbp),%rdx
add    %rdx,%rax
add    %rdx,%rax
mov    %rcx,-0x40(%rbp)
mov    %rax,-0x38(%rbp)
movaps -0x40(%rbp),%xmm0
movaps 0xdfd(%rip),%xmm1
pcmpeqb %xmm1,%xmm0
pmovmskb %xmm0,%eax
sub    $0xffff,%eax
jne    1222 <g+0x112>
jmp    121b <g+0x10b>
mov    $0x0,%al
call   1030 <impossible@plt>
add    $0x60,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @g(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %3 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %3
store i128 %11, i128* %4
store i128 -1, i128* %7
%12 = load i128, i128* %7
%13 = udiv i128 %12, 2
store i128 %13, i128* %7
%14 = load i128, i128* %4
%15 = load i128, i128* %7
%16 = sub i128 %15, 2
%17 = icmp ult i128 %14, %16
br i1 %17, label %18, label %19
18: ; preds = %2
br label %34
19: ; preds = %2
%20 = load i128, i128* %4
%21 = load i128, i128* %7
%22 = sub i128 %21, 1
%23 = icmp ugt i128 %20, %22
br i1 %23, label %24, label %25
24: ; preds = %19
br label %34
25: ; preds = %19
%26 = load i128, i128* %4
store i128 %26, i128* %5
%27 = load i128, i128* %5
%28 = load i128, i128* %5
%29 = mul i128 %27, %28
store i128 %29, i128* %6
%30 = load i128, i128* %6
%31 = icmp eq i128 %30, 7
br i1 %31, label %32, label %34
32: ; preds = %25
%33 = call i32 (...) @impossible()
br label %34
34: ; preds = %18, %24, %32, %25
ret void
}

LLVM IR (-O2):
define void @g(i64 %0, i64 %1) {
ret void
}
/* Variables and functions */
int SHRT_MAX;
double scalb(double, int);
double ldexp(double value, int exp) {
  if (exp > SHRT_MAX)
    exp = SHRT_MAX;
  else if (exp < -SHRT_MAX)
    exp = -SHRT_MAX;
  return scalb(value, exp);
}


x86 assembly (clang, -O0):
<ldexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2eb6(%rip),%rcx
cmp    (%rcx),%eax
jle    1143 <ldexp+0x33>
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    116c <ldexp+0x5c>
mov    -0xc(%rbp),%eax
xor    %ecx,%ecx
mov    0x2e91(%rip),%rdx
sub    (%rdx),%ecx
cmp    %ecx,%eax
jge    1167 <ldexp+0x57>
xor    %eax,%eax
mov    0x2e7e(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0xc(%rbp)
jmp    116c <ldexp+0x5c>
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
call   1030 <scalb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldexp>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
mov    %ecx,%eax
neg    %eax
cmp    %edi,%eax
cmovle %edi,%eax
cmp    %edi,%ecx
cmovl  %ecx,%eax
mov    %eax,%edi
jmp    1030 <scalb@plt>

LLVM IR (-O0):
@SHRT_MAX = global i32 0
define double @ldexp(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* @SHRT_MAX
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* @SHRT_MAX
store i32 %9, i32* %4
br label %19
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* @SHRT_MAX
%13 = sub nsw i32 0, %12
%14 = icmp slt i32 %11, %13
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = load i32, i32* @SHRT_MAX
%17 = sub nsw i32 0, %16
store i32 %17, i32* %4
br label %18
18: ; preds = %15, %10
br label %19
19: ; preds = %18, %8
%20 = load double, double* %3
%21 = load i32, i32* %4
%22 = call double @scalb(double %20, i32 %21)
ret double %22
}

LLVM IR (-O2):
@SHRT_MAX = global i32 0
define double @ldexp(double %0, i32 %1) {
%3 = load i32, i32* @SHRT_MAX
%4 = icmp slt i32 %3, %1
%5 = sub nsw i32 0, %3
%6 = icmp sgt i32 %5, %1
%7 = select i1 %6, i32 %5, i32 %1
%8 = select i1 %4, i32 %3, i32 %7
%9 = tail call double @scalb(double %0, i32 %8)
ret double %9
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int8_t minipack_unpack_int8(void *ptr, size_t *sz) {
  *sz = 2;
  return *((int8_t *)(ptr + 1));
}


x86 assembly (clang, -O0):
<minipack_unpack_int8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x2,(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_unpack_int8>:
movq   $0x2,(%rsi)
mov    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @minipack_unpack_int8(i8* nocapture %0, i64* nocapture writeonly %1) {
store i64 2, i64* %1
%3 = getelementptr i8, i8* %0, i64 1
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
ret i32 %5
}
int bit(int a, int b) { return (a & (1 << b)) >> b; }


x86 assembly (clang, -O0):
<bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %edi,%eax
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @bit(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 1, %6
%8 = and i32 %5, %7
%9 = load i32, i32* %4
%10 = ashr i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @bit(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = and i32 %3, %0
%5 = ashr i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int dr_get_worker_id_by_pthread_key();
int dr_nanox_get_worker() { return dr_get_worker_id_by_pthread_key(); }


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

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

LLVM IR (-O0):
define i32 @dr_nanox_get_worker() {
%1 = call i32 (...) @dr_get_worker_id_by_pthread_key()
ret i32 %1
}

LLVM IR (-O2):
define i32 @dr_nanox_get_worker() {
%1 = tail call i32 (...) @dr_get_worker_id_by_pthread_key()
ret i32 %1
}
/* Type definitions */
struct mono_time {
  int dummy;
};

/* Variables and functions */
scalar_t__ mono_time_cmp(struct mono_time const *, struct mono_time const *);
int mono_time_before(const struct mono_time *t1, const struct mono_time *t2) {
  return mono_time_cmp(t1, t2) < 0;
}


x86 assembly (clang, -O0):
<mono_time_before>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <mono_time_cmp@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mono_time_before>:
push   %rax
call   1030 <mono_time_cmp@plt>
shr    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.mono_time = type { i32 }
define i32 @mono_time_before(%struct.mono_time* %0, %struct.mono_time* %1) {
%3 = alloca %struct.mono_time*
%4 = alloca %struct.mono_time*
store %struct.mono_time* %0, %struct.mono_time** %3
store %struct.mono_time* %1, %struct.mono_time** %4
%5 = load %struct.mono_time*, %struct.mono_time** %3
%6 = load %struct.mono_time*, %struct.mono_time** %4
%7 = call i64 @mono_time_cmp(%struct.mono_time* %5, %struct.mono_time* %6)
%8 = icmp slt i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.mono_time = type { i32 }
define i32 @mono_time_before(%struct.mono_time* %0, %struct.mono_time* %1) {
%3 = tail call i64 @mono_time_cmp(%struct.mono_time* %0, %struct.mono_time* %1)
%4 = lshr i64 %3, 63
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t lfs_max(uint32_t a, uint32_t b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<lfs_max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <lfs_max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <lfs_max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lfs_max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @lfs_max(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cursoron() { printf("\x1b[?25h"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[?25h\00"
define void @cursoron() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?25h\00"
define void @cursoron() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
char *findname(s1, s2)
register char *s1, *s2;
{
  while (*s1 == *s2++)
    s1++;
  if (*s1 == '\0' && *(s2 - 1) == '=')
    return s2;
  return 0;
}


x86 assembly (clang, -O0):
<findname>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    113e <findname+0x3e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <findname+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    116c <findname+0x6c>
mov    -0x18(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x3d,%eax
jne    116c <findname+0x6c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <findname+0x74>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findname>:
movzbl (%rdi),%ecx
movzbl (%rsi),%edx
add    $0x1,%rsi
add    $0x1,%rdi
cmp    %dl,%cl
je     1100 <findname>
xor    $0x3d,%dl
xor    %eax,%eax
or     %dl,%cl
cmove  %rsi,%rax
ret

LLVM IR (-O0):
define i8* @findname(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %15, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %5
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %9, %13
br i1 %14, label %15, label %18
15: ; preds = %6
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %4
br label %6
18: ; preds = %6
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %31
23: ; preds = %18
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i64 -1
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 61
br i1 %28, label %29, label %31
29: ; preds = %23
%30 = load i8*, i8** %5
store i8* %30, i8** %3
br label %32
31: ; preds = %23, %18
store i8* null, i8** %3
br label %32
32: ; preds = %31, %29
%33 = load i8*, i8** %3
ret i8* %33
}

LLVM IR (-O2):
define i8* @findname(i8* nocapture %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %10, %3 ]
%5 = phi i8* [ %1, %2 ], [ %7, %3 ]
%6 = load i8, i8* %4
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = load i8, i8* %5
%9 = icmp eq i8 %6, %8
%10 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %9, label %3, label %11
11: ; preds = %3
%12 = icmp eq i8 %6, 0
%13 = icmp eq i8 %8, 61
%14 = select i1 %12, i1 %13, i1 false
%15 = select i1 %14, i8* %7, i8* null
ret i8* %15
}
void signed_char_xor_signed_char_signed_int(signed char *LHS, signed int RHS) {
  (*LHS) ^= RHS;
}


x86 assembly (clang, -O0):
<signed_char_xor_signed_char_signed_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_char_xor_signed_char_signed_int>:
xor    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @signed_char_xor_signed_char_signed_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = xor i32 %8, %5
%10 = trunc i32 %9 to i8
store i8 %10, i8* %6
ret void
}

LLVM IR (-O2):
define void @signed_char_xor_signed_char_signed_int(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = trunc i32 %1 to i8
%5 = xor i8 %3, %4
store i8 %5, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  printf("'main' leak @ %p\n", main);
  char buf[256];
  printf("buf:");
  scanf("%512s", buf);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    0xece(%rip),%rdi
mov    0x2eaf(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x100(%rbp),%rsi
lea    0xebb(%rip),%rdi
call   1040 <scanf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x108,%rsp
lea    0xed2(%rip),%rdi
mov    0x2eb3(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
add    $0x108,%rsp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"'main' leak @ %p\0A\00"
@.str.1 = [5 x i8] c"buf:\00"
@.str.2 = [6 x i8] c"%512s\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 (...)* bitcast (i32 ()* @main to i32 (...)*))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"'main' leak @ %p\0A\00"
@.str.1 = [5 x i8] c"buf:\00"
@.str.2 = [6 x i8] c"%512s\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 (...)* bitcast (i32 ()* @main to i32 (...)*))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Type definitions */
struct uwsgi_plugin {
  int dummy;
};

/* Variables and functions */
struct uwsgi_plugin *uwsgi_plugin_get(char const *);
int plugin_already_loaded(const char *plugin) {
  struct uwsgi_plugin *up = uwsgi_plugin_get(plugin);
  if (up)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<plugin_already_loaded>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <uwsgi_plugin_get@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1140 <plugin_already_loaded+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1147 <plugin_already_loaded+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.uwsgi_plugin = type { i32 }
define i32 @plugin_already_loaded(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.uwsgi_plugin*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call %struct.uwsgi_plugin* @uwsgi_plugin_get(i8* %5)
store %struct.uwsgi_plugin* %6, %struct.uwsgi_plugin** %4
%7 = load %struct.uwsgi_plugin*, %struct.uwsgi_plugin** %4
%8 = icmp ne %struct.uwsgi_plugin* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.uwsgi_plugin = type { i32 }
define i32 @plugin_already_loaded(i8* %0) {
%2 = tail call %struct.uwsgi_plugin* @uwsgi_plugin_get(i8* %0)
%3 = icmp ne %struct.uwsgi_plugin* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
double prior_apply_delta(const void *data, double u) { return *(double *)data; }


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

x86 assembly (clang, -O2):
<prior_apply_delta>:
movsd  (%rdi),%xmm0
ret

LLVM IR (-O0):
define double @prior_apply_delta(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to double*
%7 = load double, double* %6
ret double %7
}

LLVM IR (-O2):
define double @prior_apply_delta(i8* nocapture %0, double %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
ret double %4
}
/* Type definitions */
struct dune_tf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ syscall_allow(struct dune_tf *);
int syscall_check_params(struct dune_tf *);
int /*<<< orphan*/ syscall_do(struct dune_tf *);
void syscall_handler(struct dune_tf *tf) {
  if (syscall_check_params(tf) == -1)
    return;
  if (!syscall_allow(tf))
    return;
  syscall_do(tf);
}


x86 assembly (clang, -O0):
<syscall_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <syscall_check_params@plt>
cmp    $0xffffffff,%eax
jne    1153 <syscall_handler+0x23>
jmp    1173 <syscall_handler+0x43>
mov    -0x8(%rbp),%rdi
call   1050 <syscall_allow@plt>
cmp    $0x0,%eax
jne    116a <syscall_handler+0x3a>
jmp    1173 <syscall_handler+0x43>
mov    -0x8(%rbp),%rdi
call   1030 <syscall_do@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall_handler>:
push   %rbx
mov    %rdi,%rbx
call   1040 <syscall_check_params@plt>
cmp    $0xffffffff,%eax
je     1153 <syscall_handler+0x23>
mov    %rbx,%rdi
call   1050 <syscall_allow@plt>
test   %eax,%eax
je     1153 <syscall_handler+0x23>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <syscall_do@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.dune_tf = type { i32 }
define void @syscall_handler(%struct.dune_tf* %0) {
%2 = alloca %struct.dune_tf*
store %struct.dune_tf* %0, %struct.dune_tf** %2
%3 = load %struct.dune_tf*, %struct.dune_tf** %2
%4 = call i32 @syscall_check_params(%struct.dune_tf* %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %1
br label %15
7: ; preds = %1
%8 = load %struct.dune_tf*, %struct.dune_tf** %2
%9 = call i32 @syscall_allow(%struct.dune_tf* %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %7
br label %15
12: ; preds = %7
%13 = load %struct.dune_tf*, %struct.dune_tf** %2
%14 = call i32 @syscall_do(%struct.dune_tf* %13)
br label %15
15: ; preds = %12, %11, %6
ret void
}

LLVM IR (-O2):
%struct.dune_tf = type { i32 }
define void @syscall_handler(%struct.dune_tf* %0) {
%2 = tail call i32 @syscall_check_params(%struct.dune_tf* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 @syscall_allow(%struct.dune_tf* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @syscall_do(%struct.dune_tf* %0)
br label %9
9: ; preds = %4, %1, %7
ret void
}
char *RGMdevname(void) { return ("Macintosh Windows"); }


x86 assembly (clang, -O0):
<RGMdevname>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RGMdevname>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Macintosh Windows\00"
define i8* @RGMdevname() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [18 x i8] c"Macintosh Windows\00"
define i8* @RGMdevname() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}
void VectorScale(float *a, float b) {
  a[0] = b * a[0];
  a[1] = b * a[1];
  a[2] = b * a[2];
}


x86 assembly (clang, -O0):
<VectorScale>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<VectorScale>:
movss  (%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
movss  0x4(%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rdi)
mulss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @VectorScale(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float*, float** %3
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = fmul float %5, %8
%10 = load float*, float** %3
%11 = getelementptr inbounds float, float* %10, i64 0
store float %9, float* %11
%12 = load float, float* %4
%13 = load float*, float** %3
%14 = getelementptr inbounds float, float* %13, i64 1
%15 = load float, float* %14
%16 = fmul float %12, %15
%17 = load float*, float** %3
%18 = getelementptr inbounds float, float* %17, i64 1
store float %16, float* %18
%19 = load float, float* %4
%20 = load float*, float** %3
%21 = getelementptr inbounds float, float* %20, i64 2
%22 = load float, float* %21
%23 = fmul float %19, %22
%24 = load float*, float** %3
%25 = getelementptr inbounds float, float* %24, i64 2
store float %23, float* %25
ret void
}

LLVM IR (-O2):
define void @VectorScale(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fmul float %3, %1
store float %4, float* %0
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = fmul float %6, %1
store float %7, float* %5
%8 = getelementptr inbounds float, float* %0, i64 2
%9 = load float, float* %8
%10 = fmul float %9, %1
store float %10, float* %8
ret void
}
void RTLockValidatorRecSharedCheckOrderAndBlocking(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLockValidatorRecSharedCheckOrderAndBlocking() {
ret void
}
int cpu_validate_cpuinfo(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cpu_validate_cpuinfo() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_file;

/* Variables and functions */
int SQLITE_OK;
int wrap_Lock(sqlite3_file *pFile, int eLock) { return SQLITE_OK; }


x86 assembly (clang, -O0):
<wrap_Lock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap_Lock>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@SQLITE_OK = global i32 0
define i32 @wrap_Lock(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* @SQLITE_OK
ret i32 %5
}

LLVM IR (-O2):
@SQLITE_OK = global i32 0
define i32 @wrap_Lock(i32* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @SQLITE_OK
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int file_exists(char *name) {
  FILE *file = fopen(name, "r");
  if (file == NULL) {
    return 0;
  }
  fclose(file);
  return 1;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1157 <file_exists+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1167 <file_exists+0x47>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <file_exists+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @file_exists(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
unsigned int ToggleN(unsigned int val, unsigned int n) {
  return val ^ (1 << n);
}


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

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

LLVM IR (-O0):
define i32 @ToggleN(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 1, %6
%8 = xor i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @ToggleN(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, %0
ret i32 %4
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t prv_lt_real_fn(double a, double b) { return a < b ? -1 : 0; }


x86 assembly (clang, -O0):
<prv_lt_real_fn>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
xor    %eax,%eax
mov    $0xffffffff,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prv_lt_real_fn>:
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
neg    %eax
ret

LLVM IR (-O0):
define i32 @prv_lt_real_fn(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -1, i32 0
ret i32 %9
}

LLVM IR (-O2):
define i32 @prv_lt_real_fn(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int little_p0();
int little_p() {
  static int done = 0;
  static int little = 0;
  if (done)
    return little;
  little = little_p0();
  done = 1;
  return little;
}


x86 assembly (clang, -O0):
<little_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f0d(%rip)
je     1133 <little_p+0x23>
mov    0x2f05(%rip),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <little_p+0x43>
mov    $0x0,%al
call   1030 <little_p0@plt>
mov    %eax,0x2ef0(%rip)
movl   $0x1,0x2ee2(%rip)
mov    0x2ee0(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<little_p>:
push   %rax
cmpb   $0x1,0x2f14(%rip)
jne    1122 <little_p+0x12>
mov    0x2f10(%rip),%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <little_p0@plt>
mov    %eax,0x2f01(%rip)
movb   $0x1,0x2ef6(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@little_p.done = internal global i32 0
@little_p.little = internal global i32 0
define i32 @little_p() {
%1 = alloca i32
%2 = load i32, i32* @little_p.done
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = load i32, i32* @little_p.little
store i32 %5, i32* %1
br label %9
6: ; preds = %0
%7 = call i32 (...) @little_p0()
store i32 %7, i32* @little_p.little
store i32 1, i32* @little_p.done
%8 = load i32, i32* @little_p.little
store i32 %8, i32* %1
br label %9
9: ; preds = %6, %4
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@little_p.done = internal unnamed_addr global i1 false
@little_p.little = internal unnamed_addr global i32 0
define i32 @little_p() {
%1 = load i1, i1* @little_p.done
br i1 %1, label %2, label %4
2: ; preds = %0
%3 = load i32, i32* @little_p.little
br label %6
4: ; preds = %0
%5 = tail call i32 (...) @little_p0()
store i32 %5, i32* @little_p.little
store i1 true, i1* @little_p.done
br label %6
6: ; preds = %4, %2
%7 = phi i32 [ %3, %2 ], [ %5, %4 ]
ret i32 %7
}
int cmp(const void *x, const void *y) { return (*(int *)x) > (*(int *)y); }


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setg   %al
ret

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp sgt i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @cmp(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 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  int i;
  for (i = 0; i < argc; i++)
    puts(argv[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1158 <main+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <puts@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @puts(i8* dereferenceable(1) %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  printf("Hells yes, this is running remotely!\n");
  for (int q; q <= 0x7F; q++) {
    if (((q % 12) == 4) || ((q % 20) == 3))
      printf("Fuck this number!\n");
    else
      printf("Here is a number: %d\n", q);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x7f,-0x8(%rbp)
jg     1196 <main+0x86>
mov    -0x8(%rbp),%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
cmp    $0x4,%edx
je     115f <main+0x4f>
mov    -0x8(%rbp),%eax
mov    $0x14,%ecx
cltd
idiv   %ecx
cmp    $0x3,%edx
jne    1172 <main+0x62>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1183 <main+0x73>
mov    -0x8(%rbp),%esi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1188 <main+0x78>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [38 x i8] c"Hells yes, this is running remotely!\0A\00"
@.str.1 = [19 x i8] c"Fuck this number!\0A\00"
@.str.2 = [22 x i8] c"Here is a number: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %21, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 127
br i1 %6, label %7, label %24
7: ; preds = %4
%8 = load i32, i32* %2
%9 = srem i32 %8, 12
%10 = icmp eq i32 %9, 4
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = srem i32 %12, 20
%14 = icmp eq i32 %13, 3
br i1 %14, label %15, label %17
15: ; preds = %11, %7
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %20
17: ; preds = %11
%18 = load i32, i32* %2
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %17, %15
br label %21
21: ; preds = %20
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %4
24: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@str = [37 x i8] c"Hells yes, this is running remotely!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret i32 0
}
long f(w)
char *w;
{
  long k, i, c = 0, x;
  char *p = (char *)&x;
  for (i = 0; i < 1; i++) {
    for (k = 0; k < sizeof(long); k++)
      p[k] = w[k];
    c += x;
  }
  return c;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x20(%rbp)
lea    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x1,-0x18(%rbp)
jge    1182 <f+0x82>
movq   $0x0,-0x10(%rbp)
cmpq   $0x8,-0x10(%rbp)
jae    1165 <f+0x65>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1133 <f+0x33>
mov    -0x28(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1120 <f+0x20>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @f(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %2
store i64 0, i64* %5
%8 = bitcast i64* %6 to i8*
store i8* %8, i8** %7
store i64 0, i64* %4
br label %9
9: ; preds = %31, %1
%10 = load i64, i64* %4
%11 = icmp slt i64 %10, 1
br i1 %11, label %12, label %34
12: ; preds = %9
store i64 0, i64* %3
br label %13
13: ; preds = %24, %12
%14 = load i64, i64* %3
%15 = icmp ult i64 %14, 8
br i1 %15, label %16, label %27
16: ; preds = %13
%17 = load i8*, i8** %2
%18 = load i64, i64* %3
%19 = getelementptr inbounds i8, i8* %17, i64 %18
%20 = load i8, i8* %19
%21 = load i8*, i8** %7
%22 = load i64, i64* %3
%23 = getelementptr inbounds i8, i8* %21, i64 %22
store i8 %20, i8* %23
br label %24
24: ; preds = %16
%25 = load i64, i64* %3
%26 = add nsw i64 %25, 1
store i64 %26, i64* %3
br label %13
27: ; preds = %13
%28 = load i64, i64* %6
%29 = load i64, i64* %5
%30 = add nsw i64 %29, %28
store i64 %30, i64* %5
br label %31
31: ; preds = %27
%32 = load i64, i64* %4
%33 = add nsw i64 %32, 1
store i64 %33, i64* %4
br label %9
34: ; preds = %9
%35 = load i64, i64* %5
ret i64 %35
}

LLVM IR (-O2):
define i64 @f(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Type definitions */
typedef scalar_t__ val;
typedef scalar_t__ uint8_t;

/* Variables and functions */
uint8_t *ui08_to_bytes(uint8_t *buf, uint8_t val) {
  buf[0] = (val)&0xff;
  return buf + 1;
}


x86 assembly (clang, -O0):
<ui08_to_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
and    $0xff,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ui08_to_bytes>:
movzbl %sil,%eax
mov    %rax,(%rdi)
lea    0x8(%rdi),%rax
ret

LLVM IR (-O0):
define i64* @ui08_to_bytes(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = and i64 %5, 255
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
store i64 %6, i64* %8
%9 = load i64*, i64** %3
%10 = getelementptr inbounds i64, i64* %9, i64 1
ret i64* %10
}

LLVM IR (-O2):
define i64* @ui08_to_bytes(i64* writeonly %0, i64 %1) {
%3 = and i64 %1, 255
store i64 %3, i64* %0
%4 = getelementptr inbounds i64, i64* %0, i64 1
ret i64* %4
}