xunge/DecIR huggingface dataset:
int int_compare(const void *a, const void *b) {
  if (*((const int *)a) > *((const int *)b))
    return 1;
  if (*((const int *)a) < *((const int *)b))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<int_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    112a <int_compare+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    114f <int_compare+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    1148 <int_compare+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <int_compare+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @int_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
void readerr(file) const char *const file;
{
  nlog("Couldn't read");
  logqnl(file);
}


x86 assembly (clang, -O0):
<readerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1040 <nlog@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <logqnl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readerr>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <nlog@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <logqnl@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Couldn't read\00"
define void @readerr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @nlog to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @logqnl to i32 (i8*, ...)*)(i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Couldn't read\00"
define void @readerr(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @nlog to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @logqnl to i32 (i8*, ...)*)(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ print_word(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
void print_count(int *count) {
  char buf[24];
  (void)snprintf(buf, sizeof(buf), "%d.\\&", ++*count);
  print_word(buf);
}


x86 assembly (clang, -O0):
<print_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    $0x18,%esi
lea    0xeb9(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <print_word@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_count>:
push   %rbx
sub    $0x20,%rsp
mov    (%rdi),%ecx
add    $0x1,%ecx
mov    %ecx,(%rdi)
lea    0xecd(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x18,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <print_word@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d.\\&\00"
define void @print_count(i32* %0) {
%2 = alloca i32*
%3 = alloca [24 x i8]
store i32* %0, i32** %2
%4 = getelementptr inbounds [24 x i8], [24 x i8]* %3, i64 0, i64 0
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 1
store i32 %7, i32* %5
%8 = call i32 @snprintf(i8* %4, i32 24, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [24 x i8], [24 x i8]* %3, i64 0, i64 0
%10 = call i32 @print_word(i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d.\\&\00"
define void @print_count(i32* nocapture %0) {
%2 = alloca [24 x i8]
%3 = getelementptr inbounds [24 x i8], [24 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* %0
%5 = add nsw i32 %4, 1
store i32 %5, i32* %0
%6 = call i32 @snprintf(i8* %3, i32 24, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @print_word(i8* %3)
ret void
}
int fun1261() { return 1261; }


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

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

LLVM IR (-O0):
define i32 @fun1261() {
ret i32 1261
}

LLVM IR (-O2):
define i32 @fun1261() {
ret i32 1261
}
/* Variables and functions */
int /*<<< orphan*/ T_FMT_AMPM;
char *nl_langinfo(int /*<<< orphan*/);
char *langinfo_t_fmt_ampm() { return nl_langinfo(T_FMT_AMPM); }


x86 assembly (clang, -O0):
<langinfo_t_fmt_ampm>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <nl_langinfo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<langinfo_t_fmt_ampm>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <nl_langinfo@plt>

LLVM IR (-O0):
@T_FMT_AMPM = global i32 0
define i8* @langinfo_t_fmt_ampm() {
%1 = load i32, i32* @T_FMT_AMPM
%2 = call i8* @nl_langinfo(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@T_FMT_AMPM = global i32 0
define i8* @langinfo_t_fmt_ampm() {
%1 = load i32, i32* @T_FMT_AMPM
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int print_version(void) {
  printf("plambda 1.0\n\n"
         "Written by Enric Meinhardt-Llopis\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"plambda 1.0\0A\0AWritten by Enric Meinhardt-Llopis\0A\00"
define i32 @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [47 x i8] c"plambda 1.0\0A\0AWritten by Enric Meinhardt-Llopis\00"
define i32 @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
ret i32 0
}
float ret_float(float f) { return f; }


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

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

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

LLVM IR (-O2):
define float @ret_float(float returned %0) {
ret float %0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t Maj(uint32_t x, uint32_t y, uint32_t z) {
  return (x & y) ^ (x & z) ^ (y & z);
}


x86 assembly (clang, -O0):
<Maj>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Maj>:
mov    %edx,%eax
xor    %esi,%eax
and    %edi,%eax
and    %esi,%edx
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @Maj(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 = load i32, i32* %5
%9 = and i32 %7, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %6
%12 = and i32 %10, %11
%13 = xor i32 %9, %12
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = and i32 %14, %15
%17 = xor i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @Maj(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %2, %1
%5 = and i32 %4, %0
%6 = and i32 %2, %1
%7 = xor i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_wfd_peristent_group_invoke_usage(void) {
  printf("\nUsage : wfd_cfg_persistent_group_invoke [index] | <cancel>\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [61 x i8] c"\0AUsage : wfd_cfg_persistent_group_invoke [index] | <cancel>\0A\00"
define void @print_wfd_peristent_group_invoke_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [60 x i8] c"\0AUsage : wfd_cfg_persistent_group_invoke [index] | <cancel>\00"
define void @print_wfd_peristent_group_invoke_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double trio_pinf();
__attribute__((visibility("default"))) double trio_ninf(void) {
  static double ninf_value = 0.0;
  if (ninf_value == 0.0) {
    ninf_value = -trio_pinf();
  }
  return ninf_value;
}


x86 assembly (clang, -O0):
<trio_ninf>:
push   %rbp
mov    %rsp,%rbp
movsd  0x2f14(%rip),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1155 <trio_ninf+0x45>
jp     1155 <trio_ninf+0x45>
mov    $0x0,%al
call   1030 <trio_pinf@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,0x2edb(%rip)
movsd  0x2ed3(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<trio_ninf>:
push   %rax
movsd  0x2f17(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    113c <trio_ninf+0x2c>
jp     113c <trio_ninf+0x2c>
xor    %eax,%eax
call   1030 <trio_pinf@plt>
xorpd  0xecc(%rip),%xmm0
movlpd %xmm0,0x2ef4(%rip)
pop    %rax
ret

LLVM IR (-O0):
@trio_ninf.ninf_value = internal global double 0.000000e+00
define double @trio_ninf() {
%1 = load double, double* @trio_ninf.ninf_value
%2 = fcmp oeq double %1, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call double (...) @trio_pinf()
%5 = fneg double %4
store double %5, double* @trio_ninf.ninf_value
br label %6
6: ; preds = %3, %0
%7 = load double, double* @trio_ninf.ninf_value
ret double %7
}

LLVM IR (-O2):
@trio_ninf.ninf_value = internal unnamed_addr global double 0.000000e+00
define double @trio_ninf() {
%1 = load double, double* @trio_ninf.ninf_value
%2 = fcmp oeq double %1, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call double (...) @trio_pinf()
%5 = fneg double %4
store double %5, double* @trio_ninf.ninf_value
br label %6
6: ; preds = %3, %0
%7 = phi double [ %5, %3 ], [ %1, %0 ]
ret double %7
}
/* Variables and functions */
int errno_linux_to_bsd(int);
int psynch_errno(int rv) {
  int top;
  if (rv >= 0)
    return rv;
  rv = -rv;
  top = rv & 0xffffff00;
  rv = errno_linux_to_bsd(rv & 0xff);
  rv |= top;
  return -rv;
}


x86 assembly (clang, -O0):
<psynch_errno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1130 <psynch_errno+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1165 <psynch_errno+0x55>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffffff00,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
and    $0xff,%edi
call   1030 <errno_linux_to_bsd@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psynch_errno>:
mov    %edi,%eax
test   %edi,%edi
js     1117 <psynch_errno+0x7>
ret
push   %rbx
neg    %eax
mov    %eax,%ebx
and    $0xffffff00,%ebx
movzbl %al,%edi
call   1030 <errno_linux_to_bsd@plt>
or     %ebx,%eax
neg    %eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @psynch_errno(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = sub nsw i32 0, %0
%5 = and i32 %4, -256
%6 = and i32 %4, 255
%7 = tail call i32 @errno_linux_to_bsd(i32 %6)
%8 = or i32 %7, %5
%9 = sub nsw i32 0, %8
br label %10
10: ; preds = %1, %3
%11 = phi i32 [ %9, %3 ], [ %0, %1 ]
ret i32 %11
}
/* Variables and functions */
double pow(double, int);
int sinh(double);
double partitionFunc(double beta) {
  double Z;
  double betaMuB = beta * 1.0 * 1.0;
  double base = ((4 * 3.141592653589793239) / (betaMuB)) * sinh(betaMuB);
  Z = pow(base, 1);
  return Z;
}


x86 assembly (clang, -O0):
<partitionFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xed3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xead(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sinh@plt>
movsd  -0x28(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    $0x1,%edi
call   1040 <pow@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<partitionFunc>:
push   %rax
movsd  0xed7(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
call   1030 <sinh@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  (%rsp),%xmm0
mov    $0x1,%edi
pop    %rax
jmp    1040 <pow@plt>

LLVM IR (-O0):
define double @partitionFunc(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
%6 = load double, double* %2
%7 = fmul double %6, 1.000000e+00
%8 = fmul double %7, 1.000000e+00
store double %8, double* %4
%9 = load double, double* %4
%10 = fdiv double 0x402921FB54442D18, %9
%11 = load double, double* %4
%12 = call i32 @sinh(double %11)
%13 = sitofp i32 %12 to double
%14 = fmul double %10, %13
store double %14, double* %5
%15 = load double, double* %5
%16 = call double @pow(double %15, i32 1)
store double %16, double* %3
%17 = load double, double* %3
ret double %17
}

LLVM IR (-O2):
define double @partitionFunc(double %0) {
%2 = fdiv double 0x402921FB54442D18, %0
%3 = tail call i32 @sinh(double %0)
%4 = sitofp i32 %3 to double
%5 = fmul double %2, %4
%6 = tail call double @pow(double %5, i32 1)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int nama;
  printf("Siapa namanya? \n");
  scanf("%d", &nama);
  printf("Halo &d,\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Siapa namanya? \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"Halo &d,\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [16 x i8] c"Siapa namanya? \00"
@str.3 = [9 x i8] c"Halo &d,\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, unsigned int);
void f4(int size) {
  char src[10];
  if (size > 0)
    memset(src, 0, (unsigned)size);
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1133 <f4+0x23>
lea    -0xe(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
test   %edi,%edi
jle    112a <f4+0x1a>
sub    $0x18,%rsp
mov    %edi,%edx
lea    0xe(%rsp),%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @f4(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%8 = load i32, i32* %2
%9 = call i32 @memset(i8* %7, i32 0, i32 %8)
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @f4(i32 %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @memset(i8* %3, i32 0, i32 %0)
br label %7
7: ; preds = %5, %1
ret void
}
void GB_ISNE_f_FP64(double *z, const double *x, const double *y) {
  (*z) = ((*x) != (*y));
}


x86 assembly (clang, -O0):
<GB_ISNE_f_FP64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GB_ISNE_f_FP64>:
movsd  (%rdx),%xmm0
cmpneqsd (%rsi),%xmm0
movsd  0xeef(%rip),%xmm1
andpd  %xmm0,%xmm1
movlpd %xmm1,(%rdi)
ret

LLVM IR (-O0):
define void @GB_ISNE_f_FP64(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = load double, double* %7
%9 = load double*, double** %6
%10 = load double, double* %9
%11 = fcmp une double %8, %10
%12 = zext i1 %11 to i32
%13 = sitofp i32 %12 to double
%14 = load double*, double** %4
store double %13, double* %14
ret void
}

LLVM IR (-O2):
define void @GB_ISNE_f_FP64(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
%5 = load double, double* %2
%6 = fcmp une double %4, %5
%7 = uitofp i1 %6 to double
store double %7, double* %0
ret void
}
_Bool audio_init(void *handle) { return 0; }


x86 assembly (clang, -O0):
<audio_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i1 @audio_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i1 false
}

LLVM IR (-O2):
define zeroext i1 @audio_init(i8* nocapture readnone %0) {
ret i1 false
}
/* Type definitions */
typedef int /*<<< orphan*/ XErrorEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int _xerrordummy(Display *dpy, XErrorEvent *ee) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_xerrordummy(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  printf("\n %d\n", a * a);
  printf("%d\n", a * a * a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
imul   %esi,%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%eax
mov    %eax,%esi
imul   %eax,%esi
imul   %eax,%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"\0A %d\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, %7
%9 = mul nsw i32 %8, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO2(int, int /*<<< orphan*/);
long int BNCLCDEchoOff() {
  long int stat = 99;
  BNCIO2(33, 0);
  return (stat);
}


x86 assembly (clang, -O0):
<BNCLCDEchoOff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x63,-0x8(%rbp)
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <BNCIO2@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCLCDEchoOff>:
push   %rax
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <BNCIO2@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @BNCLCDEchoOff() {
%1 = alloca i64
store i64 99, i64* %1
%2 = call i32 @BNCIO2(i32 33, i32 0)
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @BNCLCDEchoOff() {
%1 = tail call i32 @BNCIO2(i32 33, i32 0)
ret i64 99
}
int virtual_machine_resource_pool_plain_uninit(void *pool_ptr) {
  (void)pool_ptr;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @virtual_machine_resource_pool_plain_uninit(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pthread_self();
int ikmem_current_cpu(void) {
  size_t self = (size_t)pthread_self();
  return (int)(self % 67);
}


x86 assembly (clang, -O0):
<ikmem_current_cpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <pthread_self@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x43,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ikmem_current_cpu>:
push   %rax
xor    %eax,%eax
call   1030 <pthread_self@plt>
movslq %eax,%rcx
movabs $0xf4898d5f85bb3951,%rdx
8d 89 f4
mov    %rcx,%rax
mul    %rdx
shr    $0x6,%rdx
imul   $0x43,%edx,%eax
sub    %eax,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ikmem_current_cpu() {
%1 = alloca i64
%2 = call i32 (...) @pthread_self()
%3 = sext i32 %2 to i64
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = urem i64 %4, 67
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @ikmem_current_cpu() {
%1 = tail call i32 (...) @pthread_self()
%2 = sext i32 %1 to i64
%3 = urem i64 %2, 67
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ ConfigureOscillator();
int /*<<< orphan*/ InitApp();
int /*<<< orphan*/ RunApp();
int16_t main(void) {
  ConfigureOscillator();
  InitApp();
  while (1) {
    RunApp();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <ConfigureOscillator@plt>
mov    $0x0,%al
call   1030 <InitApp@plt>
mov    $0x0,%al
call   1050 <RunApp@plt>
jmp    114d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <ConfigureOscillator@plt>
xor    %eax,%eax
call   1030 <InitApp@plt>
nop
xor    %eax,%eax
call   1050 <RunApp@plt>
jmp    1140 <main+0x10>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ConfigureOscillator()
%2 = tail call i32 (...) @InitApp()
br label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @RunApp()
br label %3
}
execl(path, args) char *path, *args;
{ return execvp(path, &args); }


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

x86 assembly (clang, -O2):
<execl>:
push   %rax
mov    %rsi,(%rsp)
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <execvp@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @execl(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 (i8*, i8**, ...) bitcast (i32 (...)* @execvp to i32 (i8*, i8**, ...)*)(i8* %5, i8** %4)
ret i32 %6
}

LLVM IR (-O2):
define i32 @execl(i8* %0, i8* %1) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = call i32 (i8*, i8**, ...) bitcast (i32 (...)* @execvp to i32 (i8*, i8**, ...)*)(i8* %0, i8** %3)
ret i32 %4
}
int k_atomcmp(int volatile *value, int exch, int comperand) {
  return (int)__sync_val_compare_and_swap(value, comperand, exch);
}


x86 assembly (clang, -O0):
<k_atomcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%edx
lock cmpxchg %edx,(%rcx)
sete   %cl
pop    %rbp
ret

x86 assembly (clang, -O2):
<k_atomcmp>:
mov    %edx,%eax
lock cmpxchg %esi,(%rdi)
ret

LLVM IR (-O0):
define i32 @k_atomcmp(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 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = cmpxchg i32* %7, i32 %8, i32 %9 seq_cst seq_cst
%11 = extractvalue { i32, i1 } %10, 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @k_atomcmp(i32* nocapture %0, i32 %1, i32 %2) {
%4 = cmpxchg i32* %0, i32 %2, i32 %1 seq_cst seq_cst
%5 = extractvalue { i32, i1 } %4, 0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void v8regerror(char *s) {
  char Message[512];
  sprintf(Message, "REGEXP Error: %s", s);
  printf("%s\n", s);
}


x86 assembly (clang, -O0):
<v8regerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v8regerror>:
push   %rbx
sub    $0x200,%rsp
mov    %rdi,%rbx
lea    0xece(%rip),%rsi
mov    %rsp,%rdi
mov    %rbx,%rdx
call   1040 <sprintf@plt>
lea    0xecd(%rip),%rdi
mov    %rbx,%rsi
add    $0x200,%rsp
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"REGEXP Error: %s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @v8regerror(i8* %0) {
%2 = alloca i8*
%3 = alloca [512 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"REGEXP Error: %s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @v8regerror(i8* %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
int main(void) {
  if (3.0 * 3.0 == 9.0 && 16.0 / 2.0 == 8.0) {
    return 42;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x2a,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 42
}

LLVM IR (-O2):
define i32 @main() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int DOlshell(void) { system("$SHELL"); }


x86 assembly (clang, -O0):
<DOlshell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"$SHELL\00"
define i32 @DOlshell() {
%1 = alloca i32
%2 = call i32 @system(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [7 x i8] c"$SHELL\00"
define i32 @DOlshell() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
double RAND_MAX;
double rand();
unsigned int get_randnum(unsigned int max) {
  return (unsigned int)((float)max * (rand() / (RAND_MAX + 1.0)));
}


x86 assembly (clang, -O0):
<get_randnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xor    %eax,%eax
call   1030 <rand@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mov    0x2ea6(%rip),%rax
movsd  (%rax),%xmm2
movsd  0xeb2(%rip),%xmm3
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_randnum>:
push   %rax
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2eb9(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xec5(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  (%rsp),%xmm0
cvttsd2si %xmm0,%rax
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @get_randnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = uitofp i32 %3 to float
%5 = fpext float %4 to double
%6 = call double (...) @rand()
%7 = load double, double* @RAND_MAX
%8 = fadd double %7, 1.000000e+00
%9 = fdiv double %6, %8
%10 = fmul double %5, %9
%11 = fptoui double %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @get_randnum(i32 %0) {
%2 = uitofp i32 %0 to float
%3 = fpext float %2 to double
%4 = tail call double (...) @rand()
%5 = load double, double* @RAND_MAX
%6 = fadd double %5, 1.000000e+00
%7 = fdiv double %4, %6
%8 = fmul double %7, %3
%9 = fptoui double %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void v29nfy_free(void *ptr) { free((char *)ptr); }


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

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

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

LLVM IR (-O2):
define void @v29nfy_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
extern const char *drmp3_version_string(void) {
  return "0"
         "."
         "6"
         "."
         "27";
}


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"0.6.27\00"
define i8* @drmp3_version_string() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ adc8(int /*<<< orphan*/);
int /*<<< orphan*/ indirect();
int /*<<< orphan*/ readmem65816(int /*<<< orphan*/);
void adcIndirect8(void) { adc8(readmem65816(indirect())); }


x86 assembly (clang, -O0):
<adcIndirect8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <indirect@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
call   1030 <adc8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adcIndirect8>:
push   %rax
xor    %eax,%eax
call   1040 <indirect@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <adc8@plt>

LLVM IR (-O0):
define void @adcIndirect8() {
%1 = call i32 (...) @indirect()
%2 = call i32 @readmem65816(i32 %1)
%3 = call i32 @adc8(i32 %2)
ret void
}

LLVM IR (-O2):
define void @adcIndirect8() {
%1 = tail call i32 (...) @indirect()
%2 = tail call i32 @readmem65816(i32 %1)
%3 = tail call i32 @adc8(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int client_msg(int /*<<< orphan*/ *, int /*<<< orphan*/, char *,
               int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
               int /*<<< orphan*/, int /*<<< orphan*/);
int close_window(Display *disp, Window win) {
  return client_msg(disp, win, "_NET_CLOSE_WINDOW", 0, 0, 0, 0, 0);
}


x86 assembly (clang, -O0):
<close_window>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <client_msg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_window>:
push   %rax
lea    0xee8(%rip),%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
call   1030 <client_msg@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"_NET_CLOSE_WINDOW\00"
define i32 @close_window(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @client_msg(i32* %5, i32 %6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 %7
}

LLVM IR (-O2):
@.str = [18 x i8] c"_NET_CLOSE_WINDOW\00"
define i32 @close_window(i32* %0, i32 %1) {
%3 = tail call i32 @client_msg(i32* %0, i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 %3
}
/* Variables and functions */
float s3d_now();
float s3d_since(float when) { return s3d_now() - when; }


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

x86 assembly (clang, -O2):
<s3d_since>:
push   %rax
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <s3d_now@plt>
subss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @s3d_since(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call float (...) @s3d_now()
%4 = load float, float* %2
%5 = fsub float %3, %4
ret float %5
}

LLVM IR (-O2):
define float @s3d_since(float %0) {
%2 = tail call float (...) @s3d_now()
%3 = fsub float %2, %0
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *xmalloc(size_t n) {
  void *p = malloc(n);
  if (p == NULL) {
    perror("");
    exit(EXIT_FAILURE);
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116e <xmalloc+0x3e>
lea    0xea5(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@EXIT_FAILURE = global i32 0
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@EXIT_FAILURE = global i32 0
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret i8* %2
}
unsigned long long f2(unsigned long long ui1, unsigned long long ui2) {
  return ui1 % ui2;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1118 <f2+0x18>
xor    %edx,%edx
div    %rsi
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i64 @f2(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 = urem i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @f2(i64 %0, i64 %1) {
%3 = urem i64 %0, %1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ clearGraph(int **);
int /*<<< orphan*/ inputGraph(int **);
int /*<<< orphan*/ printGraphMatrix(int **);
int /*<<< orphan*/ traverseBFT(int **);
int /*<<< orphan*/ traverseDFT(int **);
int main() {
  int Graph[5][5];
  clearGraph(Graph);
  inputGraph(Graph);
  printGraphMatrix(Graph);
  traverseBFT(Graph);
  traverseDFT(Graph);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
call   1070 <clearGraph@plt>
lea    -0x70(%rbp),%rdi
call   1050 <inputGraph@plt>
lea    -0x70(%rbp),%rdi
call   1040 <printGraphMatrix@plt>
lea    -0x70(%rbp),%rdi
call   1030 <traverseBFT@plt>
lea    -0x70(%rbp),%rdi
call   1060 <traverseDFT@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1070 <clearGraph@plt>
mov    %rbx,%rdi
call   1050 <inputGraph@plt>
mov    %rbx,%rdi
call   1040 <printGraphMatrix@plt>
mov    %rbx,%rdi
call   1030 <traverseBFT@plt>
mov    %rbx,%rdi
call   1060 <traverseDFT@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x [5 x i32]]
store i32 0, i32* %1
%3 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %2, i64 0, i64 0
%4 = bitcast [5 x i32]* %3 to i32**
%5 = call i32 @clearGraph(i32** %4)
%6 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %2, i64 0, i64 0
%7 = bitcast [5 x i32]* %6 to i32**
%8 = call i32 @inputGraph(i32** %7)
%9 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %2, i64 0, i64 0
%10 = bitcast [5 x i32]* %9 to i32**
%11 = call i32 @printGraphMatrix(i32** %10)
%12 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %2, i64 0, i64 0
%13 = bitcast [5 x i32]* %12 to i32**
%14 = call i32 @traverseBFT(i32** %13)
%15 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %2, i64 0, i64 0
%16 = bitcast [5 x i32]* %15 to i32**
%17 = call i32 @traverseDFT(i32** %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [5 x [5 x i32]]
%2 = bitcast [5 x [5 x i32]]* %1 to i8*
%3 = bitcast [5 x [5 x i32]]* %1 to i32**
%4 = call i32 @clearGraph(i32** %3)
%5 = call i32 @inputGraph(i32** %3)
%6 = call i32 @printGraphMatrix(i32** %3)
%7 = call i32 @traverseBFT(i32** %3)
%8 = call i32 @traverseDFT(i32** %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ UT_LINESIZE;
int strncmp(void const *, void const *, int /*<<< orphan*/);
int compare(const void *a, const void *b) { return strncmp(a, b, UT_LINESIZE); }


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

x86 assembly (clang, -O2):
<compare>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
@UT_LINESIZE = global i32 0
define i32 @compare(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 i32, i32* @UT_LINESIZE
%8 = call i32 @strncmp(i8* %5, i8* %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@UT_LINESIZE = global i32 0
define i32 @compare(i8* %0, i8* %1) {
%3 = load i32, i32* @UT_LINESIZE
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Type definitions */
struct c2tool_state {
  int dummy;
};

/* Variables and functions */
int c2_flash_erase_device(struct c2tool_state *);
int handle_erase(struct c2tool_state *state, int argc, char **argv) {
  return c2_flash_erase_device(state);
}


x86 assembly (clang, -O0):
<handle_erase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <c2_flash_erase_device@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_erase>:
jmp    1030 <c2_flash_erase_device@plt>

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

LLVM IR (-O2):
%struct.c2tool_state = type { i32 }
define i32 @handle_erase(%struct.c2tool_state* %0, i32 %1, i8** nocapture readnone %2) {
%4 = tail call i32 @c2_flash_erase_device(%struct.c2tool_state* %0)
ret i32 %4
}