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

/* Variables and functions */
struct cpufreq_affected_cpus *sysfs_get_cpu_list(unsigned int, char *);
struct cpufreq_affected_cpus *cpufreq_get_affected_cpus(unsigned int cpu) {
  return sysfs_get_cpu_list(cpu, "affected_cpus");
}


x86 assembly (clang, -O0):
<cpufreq_get_affected_cpus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
call   1030 <sysfs_get_cpu_list@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpufreq_get_affected_cpus>:
lea    0xee9(%rip),%rsi
jmp    1030 <sysfs_get_cpu_list@plt>

LLVM IR (-O0):
%struct.cpufreq_affected_cpus = type { i32 }
@.str = [14 x i8] c"affected_cpus\00"
define %struct.cpufreq_affected_cpus* @cpufreq_get_affected_cpus(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call %struct.cpufreq_affected_cpus* @sysfs_get_cpu_list(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret %struct.cpufreq_affected_cpus* %4
}

LLVM IR (-O2):
%struct.cpufreq_affected_cpus = type { i32 }
@.str = [14 x i8] c"affected_cpus\00"
define %struct.cpufreq_affected_cpus* @cpufreq_get_affected_cpus(i32 %0) {
%2 = tail call %struct.cpufreq_affected_cpus* @sysfs_get_cpu_list(i32 %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret %struct.cpufreq_affected_cpus* %2
}
int OS_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @OS_init() {
ret i32 0
}
void Debug(char *dbg) {}


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

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

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

LLVM IR (-O2):
define void @Debug(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ strncasecmp(char *, char *, int /*<<< orphan*/);
bool prefix(char *pre, char *full) {
  return !strncasecmp(pre, full, strlen(pre));
}


x86 assembly (clang, -O0):
<prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <strncasecmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <strncasecmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @prefix(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 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @strncasecmp(i8* %5, i8* %6, i32 %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @prefix(i8* %0, i8* nocapture %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strncasecmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void GPMCPrefetchTrnsCntValSet(unsigned int baseAddr, unsigned int trnsCntVal) {
  (*((volatile unsigned int *)(baseAddr + (0x1E0 + ((2 - 1) * (0x4)))))) &=
      ~(0x00003FFFu);
  (*((volatile unsigned int *)(baseAddr + (0x1E0 + ((2 - 1) * (0x4)))))) |=
      ((trnsCntVal << (0x00000000u)) & (0x00003FFFu));
}


x86 assembly (clang, -O0):
<GPMCPrefetchTrnsCntValSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1e4,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xffffc000,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
shl    $0x0,%edx
and    $0x3fff,%edx
mov    -0x4(%rbp),%eax
add    $0x1e4,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCPrefetchTrnsCntValSet>:
add    $0x1e4,%edi
andl   $0xffffc000,(%rdi)
and    $0x3fff,%esi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @GPMCPrefetchTrnsCntValSet(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 = add i32 %5, 484
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -16384
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = shl i32 %11, 0
%13 = and i32 %12, 16383
%14 = load i32, i32* %3
%15 = add i32 %14, 484
%16 = zext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
%18 = load volatile i32, i32* %17
%19 = or i32 %18, %13
store volatile i32 %19, i32* %17
ret void
}

LLVM IR (-O2):
define void @GPMCPrefetchTrnsCntValSet(i32 %0, i32 %1) {
%3 = add i32 %0, 484
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -16384
store volatile i32 %7, i32* %5
%8 = and i32 %1, 16383
%9 = load volatile i32, i32* %5
%10 = or i32 %9, %8
store volatile i32 %10, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double r;
  scanf("%lf", &r);
  printf("VOLUME = %.3lf\n", ((4.0 / 3.0) * 3.14159 * r * r * r));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  0xeb9(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm1
movsd  0xec3(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [16 x i8] c"VOLUME = %.3lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fmul double %4, 0x4010C1514ABD0449
%6 = fmul double %4, %5
%7 = fmul double %4, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %7)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  long tm_hour;
  long tm_min;
  long tm_sec;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
long get_secs(void) {
  time_t sys_time = time(NULL);
  struct tm *sys_date = localtime(&sys_time);
  return ((sys_date->tm_hour * 60L) + sys_date->tm_min) * 60L +
         sys_date->tm_sec;
}


x86 assembly (clang, -O0):
<get_secs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
imul   $0x3c,(%rax),%rax
mov    -0x10(%rbp),%rcx
add    0x8(%rcx),%rax
imul   $0x3c,%rax,%rax
mov    -0x10(%rbp),%rcx
add    0x10(%rcx),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_secs>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
imul   $0x3c,(%rax),%rcx
add    0x8(%rax),%rcx
imul   $0x3c,%rcx,%rcx
add    0x10(%rax),%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i64, i64, i64 }
define i64 @get_secs() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
%6 = getelementptr inbounds %struct.tm, %struct.tm* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = mul nsw i64 %7, 60
%9 = load %struct.tm*, %struct.tm** %2
%10 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 1
%11 = load i64, i64* %10
%12 = add nsw i64 %8, %11
%13 = mul nsw i64 %12, 60
%14 = load %struct.tm*, %struct.tm** %2
%15 = getelementptr inbounds %struct.tm, %struct.tm* %14, i32 0, i32 2
%16 = load i64, i64* %15
%17 = add nsw i64 %13, %16
ret i64 %17
}

LLVM IR (-O2):
%struct.tm = type { i64, i64, i64 }
define i64 @get_secs() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%6 = load i64, i64* %5
%7 = mul nsw i64 %6, 60
%8 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 1
%9 = load i64, i64* %8
%10 = add nsw i64 %7, %9
%11 = mul nsw i64 %10, 60
%12 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 2
%13 = load i64, i64* %12
%14 = add nsw i64 %11, %13
ret i64 %14
}
/* Variables and functions */
double randomReal(int /*<<< orphan*/, int);
int randomChance(double p) { return (randomReal(0, 1) < p); }


x86 assembly (clang, -O0):
<randomChance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <randomReal@plt>
movaps %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomChance>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <randomReal@plt>
xor    %eax,%eax
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @randomChance(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double @randomReal(i32 0, i32 1)
%4 = load double, double* %2
%5 = fcmp olt double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @randomChance(double %0) {
%2 = tail call double @randomReal(i32 0, i32 1)
%3 = fcmp olt double %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
void ___fa_error(const char *msg) { (void)msg; }


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

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

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

LLVM IR (-O2):
define void @___fa_error(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ zk_clo_init();
int zk_init() {
  zk_clo_init();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @zk_init() {
%1 = call i32 (...) @zk_clo_init()
ret i32 0
}

LLVM IR (-O2):
define i32 @zk_init() {
%1 = tail call i32 (...) @zk_clo_init()
ret i32 0
}
/* Variables and functions */
unsigned int tick();
unsigned int gettick(void) { return tick(); }


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

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

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

LLVM IR (-O2):
define i32 @gettick() {
%1 = tail call i32 (...) @tick()
ret i32 %1
}
/* Variables and functions */
scalar_t__ __infer_nondet_int();
int /*<<< orphan*/ infinite_loop_bad();
void FN_loop_once_unreachable_bad() {
  while (__infer_nondet_int()) {
    infinite_loop_bad();
  }
}


x86 assembly (clang, -O0):
<FN_loop_once_unreachable_bad>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <FN_loop_once_unreachable_bad+0x9>
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
cmp    $0x0,%rax
je     1146 <FN_loop_once_unreachable_bad+0x26>
mov    $0x0,%al
call   1040 <infinite_loop_bad@plt>
jmp    1129 <FN_loop_once_unreachable_bad+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FN_loop_once_unreachable_bad>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
test   %rax,%rax
je     1145 <FN_loop_once_unreachable_bad+0x25>
xor    %eax,%eax
call   1040 <infinite_loop_bad@plt>
jmp    1130 <FN_loop_once_unreachable_bad+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @FN_loop_once_unreachable_bad() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @__infer_nondet_int()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = call i32 (...) @infinite_loop_bad()
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @FN_loop_once_unreachable_bad() {
%1 = tail call i64 (...) @__infer_nondet_int()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @infinite_loop_bad()
%5 = tail call i64 (...) @__infer_nondet_int()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3, %0
ret void
}
void soft_left(void) {}


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

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

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

LLVM IR (-O2):
define void @soft_left() {
ret void
}
void be_uint32_write(void *ptr, unsigned v) {
  unsigned char *ptr8 = (unsigned char *)ptr;
  ptr8[3] = (unsigned char)(v & 0xFF);
  ptr8[2] = (unsigned char)((v >> 8) & 0xFF);
  ptr8[1] = (unsigned char)((v >> 16) & 0xFF);
  ptr8[0] = (unsigned char)((v >> 24) & 0xFF);
}


x86 assembly (clang, -O0):
<be_uint32_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<be_uint32_write>:
bswap  %esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @be_uint32_write(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i64 3
store i8 %9, i8* %11
%12 = load i32, i32* %4
%13 = lshr i32 %12, 8
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 2
store i8 %15, i8* %17
%18 = load i32, i32* %4
%19 = lshr i32 %18, 16
%20 = and i32 %19, 255
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i64 1
store i8 %21, i8* %23
%24 = load i32, i32* %4
%25 = lshr i32 %24, 24
%26 = and i32 %25, 255
%27 = trunc i32 %26 to i8
%28 = load i8*, i8** %5
%29 = getelementptr inbounds i8, i8* %28, i64 0
store i8 %27, i8* %29
ret void
}

LLVM IR (-O2):
define void @be_uint32_write(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %3, i8* %4
%5 = lshr i32 %1, 8
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %6, i8* %7
%8 = lshr i32 %1, 16
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %9, i8* %10
%11 = lshr i32 %1, 24
%12 = trunc i32 %11 to i8
store i8 %12, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ draw_board();
int /*<<< orphan*/ draw_ghosts();
int /*<<< orphan*/ draw_player();
int /*<<< orphan*/ init_board();
int /*<<< orphan*/ reset_score();
void init() {
  reset_score();
  init_board();
  draw_board();
  draw_player();
  draw_ghosts();
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <reset_score@plt>
mov    $0x0,%al
call   1050 <init_board@plt>
mov    $0x0,%al
call   1030 <draw_board@plt>
mov    $0x0,%al
call   1070 <draw_player@plt>
mov    $0x0,%al
call   1040 <draw_ghosts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xor    %eax,%eax
call   1060 <reset_score@plt>
xor    %eax,%eax
call   1050 <init_board@plt>
xor    %eax,%eax
call   1030 <draw_board@plt>
xor    %eax,%eax
call   1070 <draw_player@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <draw_ghosts@plt>

LLVM IR (-O0):
define void @init() {
%1 = call i32 (...) @reset_score()
%2 = call i32 (...) @init_board()
%3 = call i32 (...) @draw_board()
%4 = call i32 (...) @draw_player()
%5 = call i32 (...) @draw_ghosts()
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 (...) @reset_score()
%2 = tail call i32 (...) @init_board()
%3 = tail call i32 (...) @draw_board()
%4 = tail call i32 (...) @draw_player()
%5 = tail call i32 (...) @draw_ghosts()
ret void
}
int f_bgt_rc2(float a1) { return !(__builtin_isgreater(a1, 100)); }


x86 assembly (clang, -O0):
<f_bgt_rc2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
ucomiss %xmm1,%xmm0
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_bgt_rc2>:
xor    %eax,%eax
ucomiss 0xef7(%rip),%xmm0
setbe  %al
ret

LLVM IR (-O0):
define i32 @f_bgt_rc2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ogt float %3, 1.000000e+02
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f_bgt_rc2(float %0) {
%2 = fcmp ule float %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ _start();
void __start() { _start(); }


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

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

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

LLVM IR (-O2):
define void @__start() {
%1 = tail call i32 (...) @_start()
ret void
}
/* Variables and functions */
int getpagesize();
int libbf_getpagesize() { return getpagesize(); }


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

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

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

LLVM IR (-O2):
define i32 @libbf_getpagesize() {
%1 = tail call i32 (...) @getpagesize()
ret i32 %1
}
__attribute__((visibility("default"))) void compiler_inscount(void) {}


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

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

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

LLVM IR (-O2):
define void @compiler_inscount() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_0();
int /*<<< orphan*/ output_1();
void energenie_on() {
  output_1();
  output_0();
}


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

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

LLVM IR (-O0):
define void @energenie_on() {
%1 = call i32 (...) @output_1()
%2 = call i32 (...) @output_0()
ret void
}

LLVM IR (-O2):
define void @energenie_on() {
%1 = tail call i32 (...) @output_1()
%2 = tail call i32 (...) @output_0()
ret void
}
int test_imm_61uint16_mem(unsigned short *val) {
  return ((*val) & (0x61 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_61uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x61,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_61uint16_mem>:
testb  $0x61,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_61uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 97
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void lowercase_string(unsigned char *string) {
  for (; *string; string++)
    if (*string >= 'A' && *string <= 'Z')
      *string = *string - 'A' + 'a';
}


x86 assembly (clang, -O0):
<lowercase_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1160 <lowercase_string+0x60>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x41,%eax
jl     114a <lowercase_string+0x4a>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x5a,%eax
jg     114a <lowercase_string+0x4a>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    114f <lowercase_string+0x4f>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <lowercase_string+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lowercase_string>:
mov    (%rdi),%al
test   %al,%al
je     112a <lowercase_string+0x2a>
add    $0x1,%rdi
jmp    111b <lowercase_string+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112a <lowercase_string+0x2a>
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <lowercase_string+0x10>
add    $0x20,%al
mov    %al,-0x1(%rdi)
jmp    1110 <lowercase_string+0x10>
ret

LLVM IR (-O0):
define void @lowercase_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %26, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %29
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = icmp sge i32 %10, 65
br i1 %11, label %12, label %25
12: ; preds = %7
%13 = load i8*, i8** %2
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = icmp sle i32 %15, 90
br i1 %16, label %17, label %25
17: ; preds = %12
%18 = load i8*, i8** %2
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = sub nsw i32 %20, 65
%22 = add nsw i32 %21, 97
%23 = trunc i32 %22 to i8
%24 = load i8*, i8** %2
store i8 %23, i8* %24
br label %25
25: ; preds = %17, %12, %7
br label %26
26: ; preds = %25
%27 = load i8*, i8** %2
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %2
br label %3
29: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @lowercase_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %4, %9
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret void
}
/* Variables and functions */
char tolower(char);
char *str_lower(char *str) {
  char *c;
  for (c = str; *c != '\0'; c++) {
    *c = tolower(*c);
  }
  return str;
}


x86 assembly (clang, -O0):
<str_lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1159 <str_lower+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <str_lower+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_lower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <str_lower+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <str_lower+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @str_lower(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
int IsHexCh(char ch) {
  return ('0' <= ch && ch <= '9') || ('a' <= ch && ch <= 'f');
}


x86 assembly (clang, -O0):
<IsHexCh>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
jg     112d <IsHexCh+0x2d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    1156 <IsHexCh+0x56>
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x61,%ecx
cmp    %edx,%ecx
mov    %al,-0x3(%rbp)
jg     1150 <IsHexCh+0x50>
movsbl -0x1(%rbp),%eax
cmp    $0x66,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsHexCh>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
add    $0x9f,%dil
cmp    $0x6,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @IsHexCh(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 48, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %20, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sle i32 97, %12
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 102
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %6
%21 = phi i1 [ true, %6 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @IsHexCh(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = add i8 %0, -97
%5 = icmp ult i8 %4, 6
%6 = or i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
struct PdSocket {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_RCVBUF;
int pd_socket_int_option(struct PdSocket *, int /*<<< orphan*/,
                         int /*<<< orphan*/, int);
int pd_socket_recv_buffer(struct PdSocket *sock, int size) {
  return pd_socket_int_option(sock, SOL_SOCKET, SO_RCVBUF, size);
}


x86 assembly (clang, -O0):
<pd_socket_recv_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
mov    -0xc(%rbp),%ecx
call   1030 <pd_socket_int_option@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pd_socket_recv_buffer>:
mov    %esi,%ecx
mov    0x2ecf(%rip),%rax
mov    (%rax),%esi
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
jmp    1030 <pd_socket_int_option@plt>

LLVM IR (-O0):
%struct.PdSocket = type { i32 }
@SOL_SOCKET = global i32 0
@SO_RCVBUF = global i32 0
define i32 @pd_socket_recv_buffer(%struct.PdSocket* %0, i32 %1) {
%3 = alloca %struct.PdSocket*
%4 = alloca i32
store %struct.PdSocket* %0, %struct.PdSocket** %3
store i32 %1, i32* %4
%5 = load %struct.PdSocket*, %struct.PdSocket** %3
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_RCVBUF
%8 = load i32, i32* %4
%9 = call i32 @pd_socket_int_option(%struct.PdSocket* %5, i32 %6, i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.PdSocket = type { i32 }
@SOL_SOCKET = global i32 0
@SO_RCVBUF = global i32 0
define i32 @pd_socket_recv_buffer(%struct.PdSocket* %0, i32 %1) {
%3 = load i32, i32* @SOL_SOCKET
%4 = load i32, i32* @SO_RCVBUF
%5 = tail call i32 @pd_socket_int_option(%struct.PdSocket* %0, i32 %3, i32 %4, i32 %1)
ret i32 %5
}
double MaximumOfDouble(double D1, double D2) { return (D1 >= D2 ? D1 : D2); }


x86 assembly (clang, -O0):
<MaximumOfDouble>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     112d <MaximumOfDouble+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <MaximumOfDouble+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MaximumOfDouble>:
movapd %xmm1,%xmm2
cmplesd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @MaximumOfDouble(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int os_sock_init();
int http_lib_init(void) { return (os_sock_init()); }


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

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

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

LLVM IR (-O2):
define i32 @http_lib_init() {
%1 = tail call i32 (...) @os_sock_init()
ret i32 %1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void adts_set_home(uint8_t *p_adts) { p_adts[3] |= 0x10; }


x86 assembly (clang, -O0):
<adts_set_home>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
or     $0x10,%ecx
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<adts_set_home>:
orb    $0x10,0xc(%rdi)
ret

LLVM IR (-O0):
define void @adts_set_home(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
%6 = or i32 %5, 16
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @adts_set_home(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = or i32 %3, 16
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
int /*<<< orphan*/ printf(char *, char const *, int, char const *);
void *aMalloc_(size_t size, const char *file, int line, const char *func) {
  void *ret;
  ret = malloc(size);
  if (ret == NULL) {
    printf("%s:%d: in func %s: malloc error out of memory!\n", file, line,
           func);
    exit(1);
  }
  return ret;
}


x86 assembly (clang, -O0):
<aMalloc_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1180 <aMalloc_+0x50>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aMalloc_>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %edx,%ebp
mov    %rsi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     114b <aMalloc_+0x1b>
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %r14,%rcx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"%s:%d: in func %s: malloc error out of memory!\0A\00"
define i8* @aMalloc_(i64 %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
store i64 %0, i64* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%10 = load i64, i64* %5
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %9
%12 = load i8*, i8** %9
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %20
14: ; preds = %4
%15 = load i8*, i8** %6
%16 = load i32, i32* %7
%17 = load i8*, i8** %8
%18 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %15, i32 %16, i8* %17)
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %4
%21 = load i8*, i8** %9
ret i8* %21
}

LLVM IR (-O2):
@.str = [48 x i8] c"%s:%d: in func %s: malloc error out of memory!\0A\00"
define noalias i8* @aMalloc_(i64 %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i8* @malloc(i64 %0)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %3)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %4
ret i8* %5
}
/* Variables and functions */
unsigned int _rearr(unsigned int, unsigned int);
void _quick(unsigned lb, unsigned ub) {
  unsigned j;
  if (lb < ub) {
    if ((j = _rearr(lb, ub)))
      _quick(lb, j - 1);
    _quick(j + 1, ub);
  }
}


x86 assembly (clang, -O0):
<_quick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    116d <_quick+0x4d>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <_rearr@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     115f <_quick+0x3f>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <_quick@plt>
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
call   1030 <_quick@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_quick>:
push   %rbp
push   %r14
push   %rbx
cmp    %esi,%edi
jae    1156 <_quick+0x36>
mov    %esi,%r14d
mov    %edi,%ebp
jmp    113a <_quick+0x1a>
nop
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jae    1156 <_quick+0x36>
mov    %ebp,%edi
mov    %r14d,%esi
call   1040 <_rearr@plt>
mov    %eax,%ebx
test   %eax,%eax
je     1130 <_quick+0x10>
lea    -0x1(%rbx),%esi
mov    %ebp,%edi
call   1030 <_quick@plt>
jmp    1130 <_quick+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @_quick(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
br i1 %3, label %4, label %13
4: ; preds = %2, %10
%5 = phi i32 [ %11, %10 ], [ %0, %2 ]
%6 = tail call i32 @_rearr(i32 %5, i32 %1)
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = add i32 %6, -1
tail call void @_quick(i32 %5, i32 %9)
br label %10
10: ; preds = %8, %4
%11 = add i32 %6, 1
%12 = icmp ult i32 %11, %1
br i1 %12, label %4, label %13
13: ; preds = %10, %2
ret void
}
int quotes_in_line(the_line)
register char *the_line;
{
  while (*the_line) {
    if (*the_line == '"' || *the_line == '\\')
      return 1;
    ++the_line;
  }
  return 0;
}


x86 assembly (clang, -O0):
<quotes_in_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1152 <quotes_in_line+0x52>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
je     1135 <quotes_in_line+0x35>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    1141 <quotes_in_line+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1159 <quotes_in_line+0x59>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <quotes_in_line+0x8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quotes_in_line>:
movzbl (%rdi),%eax
test   %al,%al
je     111b <quotes_in_line+0x1b>
cmp    $0x22,%al
je     1115 <quotes_in_line+0x15>
cmp    $0x5c,%al
je     1115 <quotes_in_line+0x15>
add    $0x1,%rdi
jmp    1100 <quotes_in_line>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @quotes_in_line(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %8
i8 34, label %7
i8 92, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
br label %8
8: ; preds = %2, %7
%9 = phi i32 [ 1, %7 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ bar(double);
void foo(void) { bar(0.0); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
call   1030 <bar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xorps  %xmm0,%xmm0
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @foo() {
%1 = call i32 @bar(double 0.000000e+00)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @bar(double 0.000000e+00)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long, long long);
void printResult(long long int orig, long long int num) {
  printf("\nThe final result of the input %lli is: %lli\n\n", orig, num);
  return;
}


x86 assembly (clang, -O0):
<printResult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printResult>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"\0AThe final result of the input %lli is: %lli\0A\0A\00"
define void @printResult(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 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i64 %5, i64 %6)
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"\0AThe final result of the input %lli is: %lli\0A\0A\00"
define void @printResult(i64 %0, i64 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ _get_page(int, scalar_t__);
uint32_t cmd_get_page(int fd, uint32_t addr) {
  uint32_t page[2];
  do {
    page[0] = _get_page(fd, addr);
    page[1] = _get_page(fd, addr);
  } while (page[0] != page[1]);
  return page[0];
}


x86 assembly (clang, -O0):
<cmd_get_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <_get_page@plt>
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <_get_page@plt>
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    111f <cmd_get_page+0xf>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_get_page>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %r14,%rsi
call   1030 <_get_page@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    %r14,%rsi
call   1030 <_get_page@plt>
cmp    %rax,%rbx
jne    1120 <cmd_get_page+0x10>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @cmd_get_page(i32 %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i64 @_get_page(i32 %0, i64 %1)
%5 = tail call i64 @_get_page(i32 %0, i64 %1)
%6 = icmp eq i64 %4, %5
br i1 %6, label %7, label %3
7: ; preds = %3
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ NETSCAPE_SPKI;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ NETSCAPE_SPKI_it;
void NETSCAPE_SPKI_free(NETSCAPE_SPKI *a) {
  ASN1_item_free((ASN1_VALUE *)a, &NETSCAPE_SPKI_it);
}


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

x86 assembly (clang, -O2):
<NETSCAPE_SPKI_free>:
mov    0x2ec9(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

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

LLVM IR (-O2):
@NETSCAPE_SPKI_it = global i32 0
define void @NETSCAPE_SPKI_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @NETSCAPE_SPKI_it)
ret void
}
/* Variables and functions */
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
int /*<<< orphan*/ standend();
void cmd_standend(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  report_count(1);
  report_return(standend());
}


x86 assembly (clang, -O0):
<cmd_standend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1050 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_standend+0x27>
jmp    117f <cmd_standend+0x3f>
mov    $0x1,%edi
call   1060 <report_count@plt>
mov    $0x0,%al
call   1030 <standend@plt>
mov    %eax,%edi
call   1040 <report_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_standend>:
push   %rax
xor    %esi,%esi
call   1050 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_standend+0xf>
pop    %rax
ret
mov    $0x1,%edi
call   1060 <report_count@plt>
xor    %eax,%eax
call   1030 <standend@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <report_return@plt>

LLVM IR (-O0):
define void @cmd_standend(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 (...) @standend()
%12 = call i32 @report_return(i32 %11)
br label %13
13: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_standend(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 (...) @standend()
%8 = tail call i32 @report_return(i32 %7)
br label %9
9: ; preds = %2, %5
ret void
}
void sendpacket(long other, char *bufptr, long messleng) {}


x86 assembly (clang, -O0):
<sendpacket>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sendpacket(i64 %0, i8* %1, i64 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i64 %0, i64* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret void
}

LLVM IR (-O2):
define void @sendpacket(i64 %0, i8* nocapture %1, i64 %2) {
ret void
}