xunge/DecIR huggingface dataset:
/* Type definitions */
struct task_struct {
  int dummy;
};

/* Variables and functions */
int ENOSYS;
int stack_trace_save_tsk_reliable(struct task_struct *tsk, unsigned long *store,
                                  unsigned int size) {
  return -ENOSYS;
}


x86 assembly (clang, -O0):
<stack_trace_save_tsk_reliable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
mov    0x2ed0(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_trace_save_tsk_reliable>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.task_struct = type { i32 }
@ENOSYS = global i32 0
define i32 @stack_trace_save_tsk_reliable(%struct.task_struct* %0, i64* %1, i32 %2) {
%4 = alloca %struct.task_struct*
%5 = alloca i64*
%6 = alloca i32
store %struct.task_struct* %0, %struct.task_struct** %4
store i64* %1, i64** %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
%struct.task_struct = type { i32 }
@ENOSYS = global i32 0
define i32 @stack_trace_save_tsk_reliable(%struct.task_struct* nocapture readnone %0, i64* nocapture readnone %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
%5 = sub nsw i32 0, %4
ret i32 %5
}
char *mycmp(char *dst, const char *src) {
  char *ret = dst;
  while (*src != '\0') {
    *dst = *src;
    src++;
    dst++;
  }
  *dst = '\0';
  return ret;
}


x86 assembly (clang, -O0):
<mycmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114d <mycmp+0x4d>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <mycmp+0x14>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mycmp>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <mycmp+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <mycmp+0x20>
movb   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define i8* @mycmp(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
store i8 %6, i8* %7
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_file(void *arg, void *userdata) { free(arg); }


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

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

LLVM IR (-O0):
define void @free_file(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 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @free_file(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
int s39ini_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @s39ini_init() {
ret i32 0
}
void adcCalibrate(int wait) {
  (*((volatile unsigned int *const)(0x48030000 + 0x080))) |= (1 << 31);
  while (wait) {
    unsigned int state =
        ((*((volatile unsigned int *const)(0x48034000 + 0x040))) >> 28) & 0x0F;
    switch (state) {
    case 1:
      break;
    case 2:
      break;
    case 3:
      break;
    default:
      wait = 0;
    }
  }
}


x86 assembly (clang, -O0):
<adcCalibrate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x48030080,%eax
mov    (%rax),%ecx
or     $0x80000000,%ecx
mov    $0x48030080,%eax
mov    %ecx,(%rax)
cmpl   $0x0,-0x4(%rbp)
je     1183 <adcCalibrate+0x83>
mov    0x48034040,%eax
shr    $0x1c,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1168 <adcCalibrate+0x68>
jmp    1146 <adcCalibrate+0x46>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     116d <adcCalibrate+0x6d>
jmp    1157 <adcCalibrate+0x57>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     1172 <adcCalibrate+0x72>
jmp    1177 <adcCalibrate+0x77>
jmp    117e <adcCalibrate+0x7e>
jmp    117e <adcCalibrate+0x7e>
jmp    117e <adcCalibrate+0x7e>
movl   $0x0,-0x4(%rbp)
jmp    111b <adcCalibrate+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adcCalibrate>:
orl    $0x80000000,0x48030080
test   %edi,%edi
je     1122 <adcCalibrate+0x22>
nop
mov    0x48034040,%eax
shr    $0x1c,%eax
add    $0xfffffffc,%eax
cmp    $0xfffffffc,%eax
ja     1110 <adcCalibrate+0x10>
ret

LLVM IR (-O0):
define void @adcCalibrate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load volatile i32, i32* inttoptr (i64 1208156288 to i32*)
%5 = or i32 %4, -2147483648
store volatile i32 %5, i32* inttoptr (i64 1208156288 to i32*)
br label %6
6: ; preds = %18, %1
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load volatile i32, i32* inttoptr (i64 1208172608 to i32*)
%11 = lshr i32 %10, 28
%12 = and i32 %11, 15
store i32 %12, i32* %3
%13 = load i32, i32* %3
switch i32 %13, label %17 [
i32 1, label %14
i32 2, label %15
i32 3, label %16
]
14: ; preds = %9
br label %18
15: ; preds = %9
br label %18
16: ; preds = %9
br label %18
17: ; preds = %9
store i32 0, i32* %2
br label %18
18: ; preds = %17, %16, %15, %14
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @adcCalibrate(i32 %0) {
%2 = load volatile i32, i32* inttoptr (i64 1208156288 to i32*)
%3 = or i32 %2, -2147483648
store volatile i32 %3, i32* inttoptr (i64 1208156288 to i32*)
%4 = icmp eq i32 %0, 0
br i1 %4, label %10, label %5
5: ; preds = %1, %5
%6 = load volatile i32, i32* inttoptr (i64 1208172608 to i32*)
%7 = lshr i32 %6, 28
%8 = add nsw i32 %7, -4
%9 = icmp ult i32 %8, -3
br i1 %9, label %10, label %5
10: ; preds = %5, %1
ret void
}
double DegreesToRadians(const double degrees) {
  return ((double)(3.14159265358979323846264338327950288419716939937510 *
                   degrees / 180.0));
}


x86 assembly (clang, -O0):
<DegreesToRadians>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @DegreesToRadians(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 0x400921FB54442D18, %3
%5 = fdiv double %4, 1.800000e+02
ret double %5
}

LLVM IR (-O2):
define double @DegreesToRadians(double %0) {
%2 = fmul double %0, 0x400921FB54442D18
%3 = fdiv double %2, 1.800000e+02
ret double %3
}
int test_imm_55uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x55 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_55uint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0x55,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_55uint64_highword_reg>:
movabs $0x5500000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_55uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 85
%6 = icmp ne i64 %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_55uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 365072220160
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t BME_UBFX_W(volatile uint32_t *addr,
                                             uint8_t bit, uint8_t width) {
  return *(volatile uint32_t *)((uint32_t)addr | (1 << 28) | (bit << 23) |
                                ((width - 1) << 19));
}


x86 assembly (clang, -O0):
<BME_UBFX_W>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
or     $0x10000000,%eax
mov    -0xc(%rbp),%ecx
shl    $0x17,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
shl    $0x13,%ecx
or     %ecx,%eax
cltq
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BME_UBFX_W>:
shl    $0x17,%esi
shl    $0x13,%edx
add    $0xfff80000,%edx
or     %edi,%esi
or     %edx,%esi
movslq %esi,%rax
or     $0x10000000,%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @BME_UBFX_W(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i32
%9 = or i32 %8, 268435456
%10 = load i32, i32* %5
%11 = shl i32 %10, 23
%12 = or i32 %9, %11
%13 = load i32, i32* %6
%14 = sub nsw i32 %13, 1
%15 = shl i32 %14, 19
%16 = or i32 %12, %15
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
%19 = load volatile i32, i32* %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @BME_UBFX_W(i32* %0, i32 %1, i32 %2) {
%4 = ptrtoint i32* %0 to i64
%5 = trunc i64 %4 to i32
%6 = shl i32 %1, 23
%7 = shl i32 %2, 19
%8 = add i32 %7, -524288
%9 = or i32 %6, %5
%10 = or i32 %9, %8
%11 = or i32 %10, 268435456
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
ret i32 %14
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int fileExists(const char *file) {
  struct stat b;
  return stat(file, &b) != -1;
}


x86 assembly (clang, -O0):
<fileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileExists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @fileExists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = icmp ne i32 %5, -1
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fileExists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp ne i32 %4, -1
%6 = zext i1 %5 to i32
ret i32 %6
}
double calc_pri(unsigned short pri_dn) {
  return (((double)pri_dn + 2.0) * 210.94e-09);
}


x86 assembly (clang, -O0):
<calc_pri>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xeed(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xed9(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_pri>:
cvtsi2sd %edi,%xmm0
addsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @calc_pri(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = uitofp i16 %3 to double
%5 = fadd double %4, 2.000000e+00
%6 = fmul double %5, 2.109400e-07
ret double %6
}

LLVM IR (-O2):
define double @calc_pri(i16 zeroext %0) {
%2 = uitofp i16 %0 to double
%3 = fadd double %2, 2.000000e+00
%4 = fmul double %3, 2.109400e-07
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void pulse_signal_handler(int sig_num) { exit(0); }


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

x86 assembly (clang, -O2):
<pulse_signal_handler>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @pulse_signal_handler(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void AONRTCModeCh2Set(uint32_t ui32Mode) {

  ;
  (*((volatile unsigned long
          *)(((unsigned long)(0x40092000 + 0x00000014) & 0xF0000000) |
             0x02000000 |
             (((unsigned long)(0x40092000 + 0x00000014) & 0x000FFFFF) << 5) |
             ((18) << 2)))) = ui32Mode;
}


x86 assembly (clang, -O0):
<AONRTCModeCh2Set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x432402c8,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AONRTCModeCh2Set>:
mov    %rdi,0x432402c8
43
ret

LLVM IR (-O0):
define void @AONRTCModeCh2Set(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1126433480 to i64*)
ret void
}

LLVM IR (-O2):
define void @AONRTCModeCh2Set(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1126433480 to i64*)
ret void
}
int f2fs_acl_chmod(struct inode *inode) { return 0; }


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

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

LLVM IR (-O0):
%struct.inode = type opaque
define i32 @f2fs_acl_chmod(%struct.inode* %0) {
%2 = alloca %struct.inode*
store %struct.inode* %0, %struct.inode** %2
ret i32 0
}

LLVM IR (-O2):
%struct.inode = type opaque
define i32 @f2fs_acl_chmod(%struct.inode* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct bptFile {
  int dummy;
};

/* Variables and functions */
struct bptFile *bptFileAttach(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ cloneString(char *);
int /*<<< orphan*/ udcDefaultDir();
int /*<<< orphan*/ udcFileOpen(char *, int /*<<< orphan*/);
struct bptFile *bptFileOpen(char *fileName) {
  return bptFileAttach(cloneString(fileName),
                       udcFileOpen(fileName, udcDefaultDir()));
}


x86 assembly (clang, -O0):
<bptFileOpen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <cloneString@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <udcDefaultDir@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1050 <udcFileOpen@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1040 <bptFileAttach@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bptFileOpen>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <cloneString@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <udcDefaultDir@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <udcFileOpen@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <bptFileAttach@plt>

LLVM IR (-O0):
%struct.bptFile = type { i32 }
define %struct.bptFile* @bptFileOpen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @cloneString(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 (...) @udcDefaultDir()
%7 = call i32 @udcFileOpen(i8* %5, i32 %6)
%8 = call %struct.bptFile* @bptFileAttach(i32 %4, i32 %7)
ret %struct.bptFile* %8
}

LLVM IR (-O2):
%struct.bptFile = type { i32 }
define %struct.bptFile* @bptFileOpen(i8* %0) {
%2 = tail call i32 @cloneString(i8* %0)
%3 = tail call i32 (...) @udcDefaultDir()
%4 = tail call i32 @udcFileOpen(i8* %0, i32 %3)
%5 = tail call %struct.bptFile* @bptFileAttach(i32 %2, i32 %4)
ret %struct.bptFile* %5
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
int writes(const char *p) { write(2, p, strlen(p)); }


x86 assembly (clang, -O0):
<writes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writes>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @writes(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @strlen(i8* %5)
%7 = call i32 @write(i32 2, i8* %4, i32 %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @writes(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
ret i32 undef
}
int trans_3_y(int x, int y) { return y; }


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

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

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

LLVM IR (-O2):
define i32 @trans_3_y(i32 %0, i32 returned %1) {
ret i32 %1
}
long minOf(long a, long b) { return (a > b) ? b : a; }


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

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

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

LLVM IR (-O2):
define i64 @minOf(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
void PrintingUnload(void) {}


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

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

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

LLVM IR (-O2):
define void @PrintingUnload() {
ret void
}
int _default_storage_select_folder(char *folder, char readonly) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_default_storage_select_folder(i8* nocapture readnone %0, i8 signext %1) {
ret i32 0
}
unsigned long _c2ul(const char *c) {
  unsigned long *rtn = (unsigned long *)c;
  return *rtn;
}


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

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

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

LLVM IR (-O2):
define i64 @_c2ul(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Type definitions */
struct suffix_mult {
  int dummy;
};

/* Variables and functions */
unsigned int xstrtoull_range_sfx(char const *, int, unsigned int, unsigned int,
                                 struct suffix_mult const *);
__attribute__((always_)) unsigned int
xstrtou_range_sfx(const char *str, int b, unsigned int l, unsigned int u,
                  const struct suffix_mult *sfx) {
  return xstrtoull_range_sfx(str, b, l, u, sfx);
}


x86 assembly (clang, -O0):
<xstrtou_range_sfx>:
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    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1030 <xstrtoull_range_sfx@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.suffix_mult = type { i32 }
define i32 @xstrtou_range_sfx(i8* %0, i32 %1, i32 %2, i32 %3, %struct.suffix_mult* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.suffix_mult*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store %struct.suffix_mult* %4, %struct.suffix_mult** %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load %struct.suffix_mult*, %struct.suffix_mult** %10
%16 = call i32 @xstrtoull_range_sfx(i8* %11, i32 %12, i32 %13, i32 %14, %struct.suffix_mult* %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.suffix_mult = type { i32 }
define i32 @xstrtou_range_sfx(i8* %0, i32 %1, i32 %2, i32 %3, %struct.suffix_mult* %4) {
%6 = tail call i32 @xstrtoull_range_sfx(i8* %0, i32 %1, i32 %2, i32 %3, %struct.suffix_mult* %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ error_exit(char *);
void *malloc(size_t);
void *safe_malloc(size_t size) {
  if (size == 0)
    error_exit("malloc size of 0");
  void *mem = malloc(size);
  if (mem == NULL)
    error_exit("malloc call failed");
  return mem;
}


x86 assembly (clang, -O0):
<safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1143 <safe_malloc+0x23>
lea    0xec2(%rip),%rdi
call   1030 <error_exit@plt>
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1167 <safe_malloc+0x47>
lea    0xeaf(%rip),%rdi
call   1030 <error_exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    1135 <safe_malloc+0x15>
lea    0xed0(%rip),%rdi
call   1030 <error_exit@plt>
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1151 <safe_malloc+0x31>
lea    0xec5(%rip),%rdi
call   1030 <error_exit@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"malloc size of 0\00"
@.str.1 = [19 x i8] c"malloc call failed\00"
define noalias i8* @safe_malloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @error_exit(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = tail call i8* @malloc(i64 %0)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @error_exit(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/, char *);
int /*<<< orphan*/ nondet_int();
int main() {
  int x = nondet_int();
  int *p = &x;
  while (x < 100) {
    (*p)++;
  }
  if (!(0))
    goto ERROR;
ERROR:
  assert(0, "ERROR");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <nondet_int@plt>
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    115b <main+0x3b>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    1141 <main+0x21>
jmp    1160 <main+0x40>
xor    %edi,%edi
lea    0xe97(%rip),%rsi
call   1040 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <nondet_int@plt>
lea    0xed1(%rip),%rsi
xor    %edi,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"ERROR\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32 (...) @nondet_int()
store i32 %4, i32* %2
store i32* %2, i32** %3
br label %5
5: ; preds = %8, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 100
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = add nsw i32 %10, 1
store i32 %11, i32* %9
br label %5
12: ; preds = %5
br label %13
13: ; preds = %12
%14 = call i32 @assert(i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [6 x i8] c"ERROR\00"
define i32 @main() {
%1 = tail call i32 (...) @nondet_int()
%2 = tail call i32 @assert(i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int main(int argc, char **argv) {
  foo();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @foo()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @foo()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ call7g(double, unsigned short, unsigned long, unsigned int,
                          char, int, short, long, float, unsigned char);
void call7f(unsigned char uc, double d, unsigned short us, unsigned long ul,
            unsigned int ui, char c, int i, short s, long l, float f) {
  call7g(d, us, ul, ui, c, i, s, l, f, uc);
}


x86 assembly (clang, -O0):
<call7f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %r8b,%al
mov    0x18(%rbp),%r8
mov    0x10(%rbp),%r8w
mov    %dil,-0x1(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %si,-0x12(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %al,-0x25(%rbp)
mov    %r9d,-0x2c(%rbp)
movss  %xmm1,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x12(%rbp),%di
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x25(%rbp),%cl
mov    -0x2c(%rbp),%r8d
mov    0x10(%rbp),%r9w
mov    0x18(%rbp),%rax
movss  -0x30(%rbp),%xmm1
movzwl %di,%edi
movsbl %cl,%ecx
movswl %r9w,%r9d
mov    %rax,(%rsp)
movzbl -0x1(%rbp),%eax
mov    %eax,0x8(%rsp)
call   1030 <call7g@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call7f>:
push   %rax
mov    %r9d,%r10d
mov    %edi,%eax
movswl 0x10(%rsp),%r9d
mov    %esi,%edi
mov    %rdx,%rsi
mov    %ecx,%edx
mov    %r8d,%ecx
mov    %r10d,%r8d
push   %rax
push   0x20(%rsp)
call   1030 <call7g@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
define void @call7f(i8 zeroext %0, double %1, i16 zeroext %2, i64 %3, i32 %4, i8 signext %5, i32 %6, i16 signext %7, i64 %8, float %9) {
%11 = alloca i8
%12 = alloca double
%13 = alloca i16
%14 = alloca i64
%15 = alloca i32
%16 = alloca i8
%17 = alloca i32
%18 = alloca i16
%19 = alloca i64
%20 = alloca float
store i8 %0, i8* %11
store double %1, double* %12
store i16 %2, i16* %13
store i64 %3, i64* %14
store i32 %4, i32* %15
store i8 %5, i8* %16
store i32 %6, i32* %17
store i16 %7, i16* %18
store i64 %8, i64* %19
store float %9, float* %20
%21 = load double, double* %12
%22 = load i16, i16* %13
%23 = load i64, i64* %14
%24 = load i32, i32* %15
%25 = load i8, i8* %16
%26 = load i32, i32* %17
%27 = load i16, i16* %18
%28 = load i64, i64* %19
%29 = load float, float* %20
%30 = load i8, i8* %11
%31 = call i32 @call7g(double %21, i16 zeroext %22, i64 %23, i32 %24, i8 signext %25, i32 %26, i16 signext %27, i64 %28, float %29, i8 zeroext %30)
ret void
}

LLVM IR (-O2):
define void @call7f(i8 zeroext %0, double %1, i16 zeroext %2, i64 %3, i32 %4, i8 signext %5, i32 %6, i16 signext %7, i64 %8, float %9) {
%11 = tail call i32 @call7g(double %1, i16 zeroext %2, i64 %3, i32 %4, i8 signext %5, i32 %6, i16 signext %7, i64 %8, float %9, i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int htable_equal_str(void *key1, void *key2) {
  return !(strcmp((char *)key1, (char *)key2));
}


x86 assembly (clang, -O0):
<htable_equal_str>:
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 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @htable_equal_str(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @htable_equal_str(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int partition(int *, int, int);
void quicksort(int a[], int p, int r) {
  int q = 0;
  if (p < r) {
    q = partition(a, p, r);
    quicksort(a, p, q - 1);
    quicksort(a, q + 1, r);
  }
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    117b <quicksort+0x5b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quicksort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quicksort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quicksort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quicksort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quicksort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quicksort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quicksort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum(int, int, int, int, int);
int main(void) {
  printf("sum(4, 2, 2, 2, 2)"
         " = [%d]\n",
         (sum(4, 2, 2, 2, 2)));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
mov    $0x2,%esi
mov    $0x2,%edx
mov    $0x2,%ecx
mov    $0x2,%r8d
call   1040 <sum@plt>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"sum(4, 2, 2, 2, 2) = [%d]\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sum(i32 4, i32 2, i32 2, i32 2, i32 2)
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"sum(4, 2, 2, 2, 2) = [%d]\0A\00"
define i32 @main() {
%1 = tail call i32 @sum(i32 4, i32 2, i32 2, i32 2, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void SysCtlUSBPLLEnable(void) {
  (*((volatile unsigned long *)(0x400FE070))) &= ~0x00004000;
}


x86 assembly (clang, -O0):
<SysCtlUSBPLLEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fe070,%eax
mov    (%rax),%rcx
and    $0xffffffffffffbfff,%rcx
mov    $0x400fe070,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlUSBPLLEnable>:
andq   $0xffffffffffffbfff,0x400fe070
40 ff bf ff ff
ret

LLVM IR (-O0):
define void @SysCtlUSBPLLEnable() {
%1 = load volatile i64, i64* inttoptr (i64 1074782320 to i64*)
%2 = and i64 %1, -16385
store volatile i64 %2, i64* inttoptr (i64 1074782320 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlUSBPLLEnable() {
%1 = load volatile i64, i64* inttoptr (i64 1074782320 to i64*)
%2 = and i64 %1, -16385
store volatile i64 %2, i64* inttoptr (i64 1074782320 to i64*)
ret void
}
void BUF_strndup(void) {}


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

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

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

LLVM IR (-O2):
define void @BUF_strndup() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/ *);
int /*<<< orphan*/ abort();
int /*<<< orphan*/ log_error(int, char *);
int pthread_mutex_unlock(int /*<<< orphan*/ *);
void mutexUnlock(pthread_mutex_t *mutex) {
  ASSERT(mutex);
  int r = pthread_mutex_unlock(mutex);
  if (r != 0) {
    log_error(r, "Error pthread_mutex_unlock()");
    abort();
  }
}


x86 assembly (clang, -O0):
<mutexUnlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <ASSERT@plt>
mov    -0x8(%rbp),%rdi
call   1050 <pthread_mutex_unlock@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1181 <mutexUnlock+0x41>
mov    -0xc(%rbp),%edi
lea    0xe8b(%rip),%rsi
call   1040 <log_error@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutexUnlock>:
push   %rbx
mov    %rdi,%rbx
call   1060 <ASSERT@plt>
mov    %rbx,%rdi
call   1050 <pthread_mutex_unlock@plt>
test   %eax,%eax
jne    1157 <mutexUnlock+0x17>
pop    %rbx
ret
lea    0xea2(%rip),%rsi
mov    %eax,%edi
call   1040 <log_error@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Error pthread_mutex_unlock()\00"
define void @mutexUnlock(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @ASSERT(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @pthread_mutex_unlock(i32* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i32, i32* %3
%12 = call i32 @log_error(i32 %11, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Error pthread_mutex_unlock()\00"
define void @mutexUnlock(i32* %0) {
%2 = tail call i32 @ASSERT(i32* %0)
%3 = tail call i32 @pthread_mutex_unlock(i32* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 @log_error(i32 %3, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printbin(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char const *argv[]) {
  int i = 0;
  while (i != 502) {
    printf("Give (int) or (502)> ");
    scanf("%d", &i);
    printbin(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)
cmpl   $0x1f6,-0x14(%rbp)
je     1183 <main+0x53>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
lea    0xea9(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%edi
call   1040 <printbin@plt>
jmp    114d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xeb8(%rip),%r14
lea    0xec7(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1040 <printbin@plt>
cmpl   $0x1f6,0xc(%rsp)
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Give (int) or (502)> \00"
@.str.1 = [3 x i8] c"%d\00"
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 = %10, %2
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 502
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%13 = load i32, i32* %6
%14 = call i32 @printbin(i32 %13)
br label %7
15: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Give (int) or (502)> \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %2, %5
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %3
%9 = call i32 @printbin(i32 %8)
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 502
br i1 %11, label %12, label %5
12: ; preds = %5
ret i32 0
}
/* Type definitions */
typedef scalar_t__ pthread_t;
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, char const *, unsigned long, unsigned long,
                          unsigned long);
scalar_t__ pthread_self();
void printids(const char *s) {
  pid_t pid;
  pthread_t tid;
  pid = getpid();
  tid = pthread_self();
  printf("%s pid %lu tid %lu (0x%1x)\n", s, (unsigned long)pid,
         (unsigned long)tid, (unsigned long)tid);
}


x86 assembly (clang, -O0):
<printids>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printids>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xeb1(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
mov    %rax,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"%s pid %lu tid %lu (0x%1x)\0A\00"
define void @printids(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
%5 = call i64 (...) @getpid()
store i64 %5, i64* %3
%6 = call i64 (...) @pthread_self()
store i64 %6, i64* %4
%7 = load i8*, i8** %2
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = load i64, i64* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %7, i64 %8, i64 %9, i64 %10)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"%s pid %lu tid %lu (0x%1x)\0A\00"
define void @printids(i8* %0) {
%2 = tail call i64 (...) @getpid()
%3 = tail call i64 (...) @pthread_self()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %2, i64 %3, i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ signal(int, int /*<<< orphan*/);
void die(int onsig) {
  signal(onsig, SIG_IGN);
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    $0x0,%al
call   1040 <endwin@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
xor    %eax,%eax
call   1040 <endwin@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@SIG_IGN = global i32 0
define void @die(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIG_IGN
%5 = call i32 @signal(i32 %3, i32 %4)
%6 = call i32 (...) @endwin()
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@SIG_IGN = global i32 0
define void @die(i32 %0) {
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %0, i32 %2)
%4 = tail call i32 (...) @endwin()
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ dmc_unrar_huff_tree_node_set_leaf(int /*<<< orphan*/ *, int);
void dmc_unrar_huff_tree_node_set_empty(uint32_t *node) {
  dmc_unrar_huff_tree_node_set_leaf(node, 0xFFFFFFFF);
}


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

x86 assembly (clang, -O2):
<dmc_unrar_huff_tree_node_set_empty>:
mov    $0xffffffff,%esi
jmp    1030 <dmc_unrar_huff_tree_node_set_leaf@plt>

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

LLVM IR (-O2):
define void @dmc_unrar_huff_tree_node_set_empty(i32* %0) {
%2 = tail call i32 @dmc_unrar_huff_tree_node_set_leaf(i32* %0, i32 -1)
ret void
}
void tick_setup_hrtimer_broadcast(void) {}


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

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

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

LLVM IR (-O2):
define void @tick_setup_hrtimer_broadcast() {
ret void
}
int str_length(char str[]) {
  int i;
  for (i = 0; str[i] != '\0'; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<str_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <str_length+0x37>
jmp    1129 <str_length+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <str_length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_length>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <str_length+0x10>
ret

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

LLVM IR (-O2):
define i32 @str_length(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
void op0xDD(void) {}


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

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

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

LLVM IR (-O2):
define void @op0xDD() {
ret void
}