xunge/DecIR huggingface dataset:
float shmSet(float *addr, long i, float v) { return addr[i] = v; }


x86 assembly (clang, -O0):
<shmSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmSet>:
movss  %xmm0,(%rdi,%rsi,4)
ret

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

LLVM IR (-O2):
define float @shmSet(float* nocapture writeonly %0, i64 %1, float returned %2) {
%4 = getelementptr inbounds float, float* %0, i64 %1
store float %2, float* %4
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *translateDate(char *);
int /*<<< orphan*/ write(char *, char *, char *);
void function_real_date_end(char *end) {
  char *new = translateDate(end);
  write("msproject.xml", "\t<ManualFinish>%s</ManualFinish>\n", new);
  free(new);
}


x86 assembly (clang, -O0):
<function_real_date_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <translateDate@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
lea    0xeac(%rip),%rdi
lea    0xeb3(%rip),%rsi
call   1040 <write@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_real_date_end>:
push   %rbx
call   1050 <translateDate@plt>
mov    %rax,%rbx
lea    0xec0(%rip),%rdi
lea    0xec7(%rip),%rsi
mov    %rax,%rdx
call   1040 <write@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [34 x i8] c"\09<ManualFinish>%s</ManualFinish>\0A\00"
define void @function_real_date_end(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @translateDate(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [34 x i8] c"\09<ManualFinish>%s</ManualFinish>\0A\00"
define void @function_real_date_end(i8* %0) {
%2 = tail call i8* @translateDate(i8* %0)
%3 = tail call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = tail call i32 @free(i8* %2)
ret void
}
void become_root(void) { return; }


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

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

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

LLVM IR (-O2):
define void @become_root() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main(void) {
  double miles, kms;
  printf("Enter the distance in miles: ");
  scanf("%lf", &miles);
  kms = 1.609 * miles;
  printf("That is %f kilometers. \n", kms);
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"Enter the distance in miles: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [25 x i8] c"That is %f kilometers. \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = fmul double 1.609000e+00, %6
store double %7, double* %3
%8 = load double, double* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"Enter the distance in miles: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [25 x i8] c"That is %f kilometers. \0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = fmul double %5, 1.609000e+00
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}
/* Variables and functions */
int pow(int, double);
float henyey_greenstein_phase_func(float mu) {
  return (1. - (.2) * (.2)) /
         ((4. + 3.14159265359) * pow(1. + (.2) * (.2) - 2. * (.2) * mu, 1.5));
}


x86 assembly (clang, -O0):
<henyey_greenstein_phase_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeea(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  0xec6(%rip),%xmm0
call   1030 <pow@plt>
cvtsi2sd %eax,%xmm0
movsd  0xead(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe99(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<henyey_greenstein_phase_func>:
push   %rax
cvtss2sd %xmm0,%xmm0
mulsd  0xee3(%rip),%xmm0
addsd  0xee3(%rip),%xmm0
cvttsd2si %xmm0,%edi
movsd  0xedf(%rip),%xmm0
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xed3(%rip),%xmm0
movsd  0xed3(%rip),%xmm1
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @henyey_greenstein_phase_func(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call double @llvm.fmuladd.f64(double -4.000000e-01, double %4, double 1.040000e+00)
%6 = fptosi double %5 to i32
%7 = call i32 @pow(i32 %6, double 1.500000e+00)
%8 = sitofp i32 %7 to double
%9 = fmul double 0x401C90FDAA221775, %8
%10 = fdiv double 0x3FEEB851EB851EB8, %9
%11 = fptrunc double %10 to float
ret float %11
}

LLVM IR (-O2):
define float @henyey_greenstein_phase_func(float %0) {
%2 = fpext float %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double -4.000000e-01, double 1.040000e+00)
%4 = fptosi double %3 to i32
%5 = tail call i32 @pow(i32 %4, double 1.500000e+00)
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 0x401C90FDAA221775
%8 = fdiv double 0x3FEEB851EB851EB8, %7
%9 = fptrunc double %8 to float
ret float %9
}
/* Type definitions */
struct emdas_op {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct emdas_op *);
void emdas_iset_destroy(struct emdas_op *op_tab) { free(op_tab); }


x86 assembly (clang, -O0):
<emdas_iset_destroy>:
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):
<emdas_iset_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.emdas_op = type { i32 }
define void @emdas_iset_destroy(%struct.emdas_op* nocapture %0) {
%2 = tail call i32 @free(%struct.emdas_op* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int var = -1, wordlen = 0;
  while (var) {
    wordlen++;
    var <<= 1;
  }
  printf(" The Word length of this Host Machine is %d Bits", wordlen);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114e <main+0x3e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [49 x i8] c" The Word length of this Host Machine is %d Bits\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = shl i32 %10, 1
store i32 %11, i32* %2
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [49 x i8] c" The Word length of this Host Machine is %d Bits\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 32)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ joe_fatal(char *);
void *malloc(size_t);
void *realloc(void *, size_t);
void *xrealloc(void *object, size_t size) {
  void *new;
  if (object)
    new = realloc(object, size);
  else
    new = malloc(size);
  if (!new)
    joe_fatal("Memory exhausted");
  return new;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1161 <xrealloc+0x31>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <realloc@plt>
mov    %rax,-0x18(%rbp)
jmp    116e <xrealloc+0x3e>
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1185 <xrealloc+0x55>
lea    0xe80(%rip),%rdi
call   1030 <joe_fatal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
test   %rdi,%rdi
je     113d <xrealloc+0xd>
call   1050 <realloc@plt>
jmp    1145 <xrealloc+0x15>
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1159 <xrealloc+0x29>
lea    0xeac(%rip),%rdi
call   1030 <joe_fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"Memory exhausted\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i8* @realloc(i8* %0, i64 %1)
br label %8
6: ; preds = %2
%7 = tail call i8* @malloc(i64 %1)
br label %8
8: ; preds = %6, %4
%9 = phi i8* [ %5, %4 ], [ %7, %6 ]
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 @joe_fatal(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %8
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ jack_sysex_wait_write();
void avr_api_wait_write(void) { jack_sysex_wait_write(); }


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

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

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

LLVM IR (-O2):
define void @avr_api_wait_write() {
%1 = tail call i32 (...) @jack_sysex_wait_write()
ret void
}
/* Variables and functions */
int libxmp_round(double);
double log(double);
int libxmp_period_to_note(int p) {
  if (p <= 0) {
    return 0;
  }
  return libxmp_round(12.0 * log(13696.0 / p) / 0.69314718055994530942) + 1;
}


x86 assembly (clang, -O0):
<libxmp_period_to_note>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1141 <libxmp_period_to_note+0x21>
movl   $0x0,-0x4(%rbp)
jmp    117d <libxmp_period_to_note+0x5d>
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xec2(%rip),%xmm0
divsd  %xmm1,%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  0xea6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe92(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <libxmp_round@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libxmp_period_to_note>:
test   %edi,%edi
jle    1157 <libxmp_period_to_note+0x37>
push   %rax
cvtsi2sd %edi,%xmm1
movsd  0xecf(%rip),%xmm0
divsd  %xmm1,%xmm0
call   1040 <log@plt>
mulsd  0xec6(%rip),%xmm0
divsd  0xec6(%rip),%xmm0
call   1030 <libxmp_round@plt>
add    $0x1,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @libxmp_period_to_note(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %16
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sitofp i32 %8 to double
%10 = fdiv double 1.369600e+04, %9
%11 = call double @log(double %10)
%12 = fmul double 1.200000e+01, %11
%13 = fdiv double %12, 0x3FE62E42FEFA39EF
%14 = call i32 @libxmp_round(double %13)
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %16
16: ; preds = %7, %6
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @libxmp_period_to_note(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = sitofp i32 %0 to double
%5 = fdiv double 1.369600e+04, %4
%6 = tail call double @log(double %5)
%7 = fmul double %6, 1.200000e+01
%8 = fdiv double %7, 0x3FE62E42FEFA39EF
%9 = tail call i32 @libxmp_round(double %8)
%10 = add nsw i32 %9, 1
br label %11
11: ; preds = %1, %3
%12 = phi i32 [ %10, %3 ], [ 0, %1 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ gen_pop();
int /*<<< orphan*/ output_line(char *);
void gen_umod(void) {
  gen_pop();
  output_line("__umod");
}


x86 assembly (clang, -O0):
<gen_umod>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xece(%rip),%rdi
call   1040 <output_line@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_umod>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <output_line@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"__umod\00"
define void @gen_umod() {
%1 = call i32 (...) @gen_pop()
%2 = call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"__umod\00"
define void @gen_umod() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ compare_dfp();
int /*<<< orphan*/ inits();
int main() {
  inits();
  compare_dfp();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @inits()
%3 = call i32 (...) @compare_dfp()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @inits()
%2 = tail call i32 (...) @compare_dfp()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ function();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  static int static_var = 1337;
  for (i = 0; i < 5; i++) {
    printf("[in main] static_var = %d\n", static_var);
    function();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1167 <main+0x47>
mov    0x2eea(%rip),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <function@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x539,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <function@plt>
mov    %rbx,%rdi
mov    $0x539,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <function@plt>
mov    %rbx,%rdi
mov    $0x539,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <function@plt>
mov    %rbx,%rdi
mov    $0x539,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <function@plt>
mov    %rbx,%rdi
mov    $0x539,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <function@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@main.static_var = internal global i32 1337
@.str = [27 x i8] c"[in main] static_var = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 5
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* @main.static_var
%8 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 (...) @function()
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [27 x i8] c"[in main] static_var = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 1337)
%2 = tail call i32 (...) @function()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 1337)
%4 = tail call i32 (...) @function()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 1337)
%6 = tail call i32 (...) @function()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 1337)
%8 = tail call i32 (...) @function()
%9 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 1337)
%10 = tail call i32 (...) @function()
ret i32 0
}
/* Variables and functions */
float second();
float second_() { return (second()); }


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

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

LLVM IR (-O0):
define float @second_() {
%1 = call float (...) @second()
ret float %1
}

LLVM IR (-O2):
define float @second_() {
%1 = tail call float (...) @second()
ret float %1
}
int __get_cpuid(unsigned int level, unsigned int *eax, unsigned int *ebx,
                unsigned int *ecx, unsigned int *edx) {
  __asm("cpuid" : "=a"(*eax), "=b"(*ebx), "=c"(*ecx), "=d"(*edx) : "0"(level));
  return 1;
}


x86 assembly (clang, -O0):
<__get_cpuid>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0xc(%rbp),%eax
cpuid
mov    %eax,%r9d
mov    -0x40(%rbp),%rax
mov    %ecx,%esi
mov    -0x38(%rbp),%rcx
mov    %r9d,(%r8)
mov    %ebx,(%rdi)
mov    %esi,(%rcx)
mov    %edx,(%rax)
mov    $0x1,%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__get_cpuid>:
push   %rbx
mov    %rcx,%r9
mov    %rdx,%r10
mov    %edi,%eax
cpuid
mov    %eax,(%rsi)
mov    %ebx,(%r10)
mov    %ecx,(%r9)
mov    %edx,(%r8)
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @__get_cpuid(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = load i32*, i32** %9
%14 = load i32*, i32** %10
%15 = load i32, i32* %6
%16 = call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %15)
%17 = extractvalue { i32, i32, i32, i32 } %16, 0
%18 = extractvalue { i32, i32, i32, i32 } %16, 1
%19 = extractvalue { i32, i32, i32, i32 } %16, 2
%20 = extractvalue { i32, i32, i32, i32 } %16, 3
store i32 %17, i32* %11
store i32 %18, i32* %12
store i32 %19, i32* %13
store i32 %20, i32* %14
ret i32 1
}

LLVM IR (-O2):
define i32 @__get_cpuid(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = tail call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %0)
%7 = extractvalue { i32, i32, i32, i32 } %6, 0
%8 = extractvalue { i32, i32, i32, i32 } %6, 1
%9 = extractvalue { i32, i32, i32, i32 } %6, 2
%10 = extractvalue { i32, i32, i32, i32 } %6, 3
store i32 %7, i32* %1
store i32 %8, i32* %2
store i32 %9, i32* %3
store i32 %10, i32* %4
ret i32 1
}
/* Variables and functions */
char *addColor(char *, char *);
char *bgWhite(char *str) { return addColor("47", str); }


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

x86 assembly (clang, -O2):
<bgWhite>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <addColor@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"47\00"
define i8* @bgWhite(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @addColor(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"47\00"
define i8* @bgWhite(i8* %0) {
%2 = tail call i8* @addColor(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
int HelpItem72(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem72() {
ret i32 0
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
void timevalSet10ms(struct timeval *ap, int b) {
  ap->tv_sec = b / 100;
  ap->tv_usec = (b % 100) * 10 * 1000;
}


x86 assembly (clang, -O0):
<timevalSet10ms>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
imul   $0xa,%edx,%eax
imul   $0x3e8,%eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<timevalSet10ms>:
movslq %esi,%rax
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
mov    %ecx,(%rdi)
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
imul   $0x2710,%eax,%eax
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @timevalSet10ms(%struct.timeval* %0, i32 %1) {
%3 = alloca %struct.timeval*
%4 = alloca i32
store %struct.timeval* %0, %struct.timeval** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sdiv i32 %5, 100
%7 = load %struct.timeval*, %struct.timeval** %3
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = srem i32 %9, 100
%11 = mul nsw i32 %10, 10
%12 = mul nsw i32 %11, 1000
%13 = load %struct.timeval*, %struct.timeval** %3
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %13, i32 0, i32 1
store i32 %12, i32* %14
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @timevalSet10ms(%struct.timeval* nocapture writeonly %0, i32 %1) {
%3 = sdiv i32 %1, 100
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
store i32 %3, i32* %4
%5 = srem i32 %1, 100
%6 = mul nsw i32 %5, 10000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
store i32 %6, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x = 10, y = 5;
  printf("x/y"
         " = %d \n",
         x / y);
  ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"x/y = %d \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
int ftol(float f) {
  int a = *(int *)(&f);
  int sign = (a >> 31);
  int mantissa = (a & ((1 << 23) - 1)) | (1 << 23);
  int exponent = ((a & 0x7fffffff) >> 23) - 127;
  int r = ((unsigned int)(mantissa) << 8) >> (31 - exponent);
  return ((r ^ (sign)) - sign) & ~(exponent >> 31);
}


x86 assembly (clang, -O0):
<ftol>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x7fffff,%eax
or     $0x800000,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    $0x7fffffff,%eax
sar    $0x17,%eax
sub    $0x7f,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x8,%eax
mov    $0x1f,%ecx
sub    -0x14(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    -0xc(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
sar    $0x1f,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftol>:
movd   %xmm0,%edx
mov    %edx,%eax
mov    %edx,%ecx
shr    $0x17,%ecx
movzbl %cl,%esi
shl    $0x8,%edx
or     $0x80000000,%edx
mov    $0x9e,%cl
sub    %sil,%cl
shr    %cl,%edx
sar    $0x1f,%eax
xor    %eax,%edx
sub    %eax,%edx
xor    %eax,%eax
cmp    $0x7f,%esi
cmovae %edx,%eax
ret

LLVM IR (-O0):
define i32 @ftol(float %0) {
%2 = alloca float
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store float %0, float* %2
%8 = bitcast float* %2 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = ashr i32 %10, 31
store i32 %11, i32* %4
%12 = load i32, i32* %3
%13 = and i32 %12, 8388607
%14 = or i32 %13, 8388608
store i32 %14, i32* %5
%15 = load i32, i32* %3
%16 = and i32 %15, 2147483647
%17 = ashr i32 %16, 23
%18 = sub nsw i32 %17, 127
store i32 %18, i32* %6
%19 = load i32, i32* %5
%20 = shl i32 %19, 8
%21 = load i32, i32* %6
%22 = sub nsw i32 31, %21
%23 = lshr i32 %20, %22
store i32 %23, i32* %7
%24 = load i32, i32* %7
%25 = load i32, i32* %4
%26 = xor i32 %24, %25
%27 = load i32, i32* %4
%28 = sub nsw i32 %26, %27
%29 = load i32, i32* %6
%30 = ashr i32 %29, 31
%31 = xor i32 %30, -1
%32 = and i32 %28, %31
ret i32 %32
}

LLVM IR (-O2):
define i32 @ftol(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 31
%4 = lshr i32 %2, 23
%5 = and i32 %4, 255
%6 = shl i32 %2, 8
%7 = or i32 %6, -2147483648
%8 = sub nsw i32 158, %5
%9 = lshr i32 %7, %8
%10 = xor i32 %9, %3
%11 = sub nsw i32 %10, %3
%12 = icmp ult i32 %5, 127
%13 = select i1 %12, i32 0, i32 %11
ret i32 %13
}
/* Variables and functions */
char peek_2_char();
char peek_char();
bool block_comment_close_detected(void) {
  bool result = false;
  if ((peek_char() == '*') && (peek_2_char() == '/')) {
    result = true;
  }
  return result;
}


x86 assembly (clang, -O0):
<block_comment_close_detected>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <peek_char@plt>
movsbl %al,%eax
cmp    $0x2a,%eax
jne    115c <block_comment_close_detected+0x3c>
mov    $0x0,%al
call   1030 <peek_2_char@plt>
movsbl %al,%eax
cmp    $0x2f,%eax
jne    115c <block_comment_close_detected+0x3c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<block_comment_close_detected>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <peek_char@plt>
cmp    $0x2a,%al
jne    113c <block_comment_close_detected+0x1c>
xor    %eax,%eax
call   1030 <peek_2_char@plt>
xor    %ebx,%ebx
cmp    $0x2f,%al
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @block_comment_close_detected() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call signext i8 (...) @peek_char()
%3 = sext i8 %2 to i32
%4 = icmp eq i32 %3, 42
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = call signext i8 (...) @peek_2_char()
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 47
br i1 %8, label %9, label %10
9: ; preds = %5
store i32 1, i32* %1
br label %10
10: ; preds = %9, %5, %0
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @block_comment_close_detected() {
%1 = tail call signext i8 (...) @peek_char()
%2 = icmp eq i8 %1, 42
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call signext i8 (...) @peek_2_char()
%5 = icmp eq i8 %4, 47
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}
long power(int num, int pow) {
  if (pow) {
    return (num * power(num, pow - 1));
  }
  return 1;
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1152 <power+0x42>
movslq -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
sub    $0x1,%esi
call   1030 <power@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
imul   %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    115a <power+0x4a>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
test   %esi,%esi
je     111b <power+0x1b>
movslq %edi,%rcx
lea    -0x1(%rsi),%eax
mov    %esi,%edx
and    $0x7,%edx
cmp    $0x7,%eax
jae    1121 <power+0x21>
mov    $0x1,%eax
jmp    1155 <power+0x55>
mov    $0x1,%eax
ret
and    $0xfffffff8,%esi
mov    $0x1,%eax
nopl   0x0(%rax)
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
add    $0xfffffff8,%esi
jne    1130 <power+0x30>
test   %edx,%edx
je     1169 <power+0x69>
nopl   0x0(%rax)
imul   %rcx,%rax
add    $0xffffffff,%edx
jne    1160 <power+0x60>
ret

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

LLVM IR (-O2):
define i64 @power(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %34, label %4
4: ; preds = %2
%5 = sext i32 %0 to i64
%6 = add i32 %1, -1
%7 = and i32 %1, 7
%8 = icmp ult i32 %6, 7
br i1 %8, label %24, label %9
9: ; preds = %4
%10 = and i32 %1, -8
br label %11
11: ; preds = %11, %9
%12 = phi i64 [ 1, %9 ], [ %21, %11 ]
%13 = phi i32 [ 0, %9 ], [ %22, %11 ]
%14 = mul nsw i64 %12, %5
%15 = mul nsw i64 %14, %5
%16 = mul nsw i64 %15, %5
%17 = mul nsw i64 %16, %5
%18 = mul nsw i64 %17, %5
%19 = mul nsw i64 %18, %5
%20 = mul nsw i64 %19, %5
%21 = mul nsw i64 %20, %5
%22 = add i32 %13, 8
%23 = icmp eq i32 %22, %10
br i1 %23, label %24, label %11
24: ; preds = %11, %4
%25 = phi i64 [ undef, %4 ], [ %21, %11 ]
%26 = phi i64 [ 1, %4 ], [ %21, %11 ]
%27 = icmp eq i32 %7, 0
br i1 %27, label %34, label %28
28: ; preds = %24, %28
%29 = phi i64 [ %31, %28 ], [ %26, %24 ]
%30 = phi i32 [ %32, %28 ], [ 0, %24 ]
%31 = mul nsw i64 %29, %5
%32 = add i32 %30, 1
%33 = icmp eq i32 %32, %7
br i1 %33, label %34, label %28
34: ; preds = %24, %28, %2
%35 = phi i64 [ 1, %2 ], [ %25, %24 ], [ %31, %28 ]
ret i64 %35
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void s337_set_data_type_dep(uint8_t *p_s337, uint8_t i_data_type_dep) {
  p_s337[4] &= ~0x1f;
  p_s337[4] |= i_data_type_dep & 0x1f;
}


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

x86 assembly (clang, -O2):
<s337_set_data_type_dep>:
mov    0x10(%rdi),%eax
and    $0xffffffe0,%eax
and    $0x1f,%esi
or     %eax,%esi
mov    %esi,0x10(%rdi)
ret

LLVM IR (-O0):
define void @s337_set_data_type_dep(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 = getelementptr inbounds i32, i32* %5, i64 4
%7 = load i32, i32* %6
%8 = and i32 %7, -32
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = and i32 %9, 31
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 4
%13 = load i32, i32* %12
%14 = or i32 %13, %10
store i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @s337_set_data_type_dep(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = load i32, i32* %3
%5 = and i32 %4, -32
%6 = and i32 %1, 31
%7 = or i32 %5, %6
store i32 %7, i32* %3
ret void
}
int is_num_in_array(int *p, int array_size, int n) {
  int i;
  for (i = 0; i < array_size; i++) {
    if (p[i] == n) {
      return 1;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<is_num_in_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1154 <is_num_in_array+0x54>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1141 <is_num_in_array+0x41>
movl   $0x1,-0x4(%rbp)
jmp    115b <is_num_in_array+0x5b>
jmp    1146 <is_num_in_array+0x46>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <is_num_in_array+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_num_in_array>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <is_num_in_array+0x1e>
mov    %esi,%ecx
xor    %esi,%esi
nopl   (%rax)
cmp    %edx,(%rdi,%rsi,4)
je     111f <is_num_in_array+0x1f>
add    $0x1,%rsi
cmp    %rsi,%rcx
jne    1110 <is_num_in_array+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_num_in_array(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %2
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ -1, %3 ], [ -1, %7 ], [ 1, %9 ]
ret i32 %16
}
unsigned long tegra_dvfs_get_rate(struct clk *c) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.clk = type opaque
define i64 @tegra_dvfs_get_rate(%struct.clk* nocapture readnone %0) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ print_subset(int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < (1 << n); i++) {
    print_subset(n, i);
  }
  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>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
cmp    %ecx,%eax
jge    1176 <main+0x56>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <print_subset@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <main+0x26>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ecx
cmp    $0x1f,%ecx
je     116b <main+0x4b>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ecx,%edi
mov    %ebx,%esi
call   1030 <print_subset@plt>
add    $0x1,%ebx
mov    0xc(%rsp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    %eax,%ebx
jl     1150 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\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 = icmp eq i32 %4, 31
br i1 %5, label %6, label %7
6: ; preds = %7, %0
ret i32 0
7: ; preds = %0, %7
%8 = phi i32 [ %12, %7 ], [ %4, %0 ]
%9 = phi i32 [ %11, %7 ], [ 0, %0 ]
%10 = call i32 @print_subset(i32 %8, i32 %9)
%11 = add nuw nsw i32 %9, 1
%12 = load i32, i32* %1
%13 = shl nuw i32 1, %12
%14 = icmp slt i32 %11, %13
br i1 %14, label %7, label %6
}
IR0AX1(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ (*p0) = (((float *)11111111)[x1]); }


x86 assembly (clang, -O0):
<IR0AX1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movslq -0x14(%rbp),%rcx
mov    $0xa98ac7,%eax
movss  (%rax,%rcx,4),%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0AX1>:
movslq %esi,%rax
movss  0xa98ac7(,%rax,4),%xmm0
movss  %xmm0,(%rdx)
ret

LLVM IR (-O0):
define i32 @IR0AX1(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load i32, i32* %11
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds float, float* inttoptr (i64 11111111 to float*), i64 %17
%19 = load float, float* %18
%20 = load float*, float** %12
store float %19, float* %20
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @IR0AX1(double %0, double %1, i32 %2, i32 %3, float* nocapture writeonly %4, float* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds float, float* inttoptr (i64 11111111 to float*), i64 %7
%9 = load float, float* %8
store float %9, float* %4
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ __complete(int);
uint64_t complete64(int slot) { return (uint64_t)__complete(slot); }


x86 assembly (clang, -O0):
<complete64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <__complete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<complete64>:
jmp    1030 <__complete@plt>

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

LLVM IR (-O2):
define i32 @complete64(i32 %0) {
%2 = tail call i32 @__complete(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/
__softboundcets_propagate_metadata_shadow_stack_from(int, int /*<<< orphan*/);
char *strrchr(char const *, int);
__attribute__((__weak__, __always___)) char *
softboundcets_strrchr(const char *s, int c) {
  char *ret_ptr = strrchr(s, c);
  __softboundcets_propagate_metadata_shadow_stack_from(1, 0);
  return ret_ptr;
}


x86 assembly (clang, -O0):
<softboundcets_strrchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <__softboundcets_propagate_metadata_shadow_stack_from@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundcets_strrchr>:
push   %rbx
call   1030 <strrchr@plt>
mov    %rax,%rbx
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <__softboundcets_propagate_metadata_shadow_stack_from@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define weak i8* @softboundcets_strrchr(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
%7 = load i32, i32* %4
%8 = call i8* @strrchr(i8* %6, i32 %7)
store i8* %8, i8** %5
%9 = call i32 @__softboundcets_propagate_metadata_shadow_stack_from(i32 1, i32 0)
%10 = load i8*, i8** %5
ret i8* %10
}

LLVM IR (-O2):
define weak i8* @softboundcets_strrchr(i8* %0, i32 %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 %1)
%4 = tail call i32 @__softboundcets_propagate_metadata_shadow_stack_from(i32 1, i32 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ count_nibbles(int /*<<< orphan*/);
int /*<<< orphan*/ get_test_data(int /*<<< orphan*/);
int /*<<< orphan*/ scan_left(int /*<<< orphan*/);
void test_scan_left() { scan_left(count_nibbles(get_test_data(0))); }


x86 assembly (clang, -O0):
<test_scan_left>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1050 <get_test_data@plt>
mov    %eax,%edi
call   1040 <count_nibbles@plt>
mov    %eax,%edi
call   1030 <scan_left@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_scan_left>:
push   %rax
xor    %edi,%edi
call   1050 <get_test_data@plt>
mov    %eax,%edi
call   1040 <count_nibbles@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <scan_left@plt>

LLVM IR (-O0):
define void @test_scan_left() {
%1 = call i32 @get_test_data(i32 0)
%2 = call i32 @count_nibbles(i32 %1)
%3 = call i32 @scan_left(i32 %2)
ret void
}

LLVM IR (-O2):
define void @test_scan_left() {
%1 = tail call i32 @get_test_data(i32 0)
%2 = tail call i32 @count_nibbles(i32 %1)
%3 = tail call i32 @scan_left(i32 %2)
ret void
}
int cr_positive_set(unsigned this_cr) { return (this_cr & 0x4); }


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

x86 assembly (clang, -O2):
<cr_positive_set>:
mov    %edi,%eax
and    $0x4,%eax
ret

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

LLVM IR (-O2):
define i32 @cr_positive_set(i32 %0) {
%2 = and i32 %0, 4
ret i32 %2
}