xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ fork();
int process_fork(int nproc) {
  int j;
  for (j = 1; j < nproc; j++) {
    if (fork() == 0)
      return (j);
  }
  return (0);
}


x86 assembly (clang, -O0):
<process_fork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115d <process_fork+0x4d>
mov    $0x0,%al
call   1030 <fork@plt>
cmp    $0x0,%rax
jne    114a <process_fork+0x3a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <process_fork+0x54>
jmp    114f <process_fork+0x3f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <process_fork+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_fork>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
cmp    $0x2,%edi
jl     1145 <process_fork+0x35>
mov    %edi,%ebp
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <fork@plt>
test   %rax,%rax
je     1145 <process_fork+0x35>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1130 <process_fork+0x20>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @process_fork(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %10
3: ; preds = %1, %7
%4 = phi i32 [ %8, %7 ], [ 1, %1 ]
%5 = tail call i64 (...) @fork()
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %3
10: ; preds = %3, %7, %1
%11 = phi i32 [ 0, %1 ], [ 0, %7 ], [ %4, %3 ]
ret i32 %11
}
int get_year(float R) {
  int i = 0;
  double area = 3.1415926 * R / 2;
  int sum;
  while ((sum = i * 50 + 1) < area) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<get_year>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee7(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xed3(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
imul   $0x32,-0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cvtsi2sd %eax,%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1161 <get_year+0x61>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <get_year+0x36>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_year>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
mov    $0xffffffff,%eax
mov    $0x1,%ecx
xchg   %ax,%ax
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
add    $0x1,%eax
add    $0x32,%ecx
ucomisd %xmm1,%xmm0
ja     1120 <get_year+0x20>
ret

LLVM IR (-O0):
define i32 @get_year(float %0) {
%2 = alloca float
%3 = alloca i32
%4 = alloca double
%5 = alloca i32
store float %0, float* %2
store i32 0, i32* %3
%6 = load float, float* %2
%7 = fpext float %6 to double
%8 = fmul double 0x400921FB4D12D84A, %7
%9 = fdiv double %8, 2.000000e+00
store double %9, double* %4
br label %10
10: ; preds = %17, %1
%11 = load i32, i32* %3
%12 = mul nsw i32 %11, 50
%13 = add nsw i32 %12, 1
store i32 %13, i32* %5
%14 = sitofp i32 %13 to double
%15 = load double, double* %4
%16 = fcmp olt double %14, %15
br i1 %16, label %17, label %20
17: ; preds = %10
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %10
20: ; preds = %10
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @get_year(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x400921FB4D12D84A
%4 = fmul double %3, 5.000000e-01
br label %5
5: ; preds = %5, %1
%6 = phi i32 [ 0, %1 ], [ %11, %5 ]
%7 = mul nsw i32 %6, 50
%8 = or i32 %7, 1
%9 = sitofp i32 %8 to double
%10 = fcmp ogt double %4, %9
%11 = add nuw nsw i32 %6, 1
br i1 %10, label %5, label %12
12: ; preds = %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup2(int, int);
int /*<<< orphan*/ execlp(char *, char *, char *, int /*<<< orphan*/ *);
extern void be_dc(int p[2]) {
  dup2(p[0], 0);
  dup2(p[0], 1);
  close(p[0]);
  close(p[1]);
  execlp("dc", "dc", "-", NULL);
}


x86 assembly (clang, -O0):
<be_dc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <dup2@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1030 <dup2@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <close@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
call   1040 <close@plt>
lea    0xe89(%rip),%rsi
lea    0xe85(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
mov    %rsi,%rdi
call   1050 <execlp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be_dc>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
xor    %esi,%esi
call   1030 <dup2@plt>
mov    (%rbx),%edi
mov    $0x1,%esi
call   1030 <dup2@plt>
mov    (%rbx),%edi
call   1040 <close@plt>
mov    0x4(%rbx),%edi
call   1040 <close@plt>
lea    0xea1(%rip),%rdi
lea    0xe9d(%rip),%rdx
mov    %rdi,%rsi
xor    %ecx,%ecx
pop    %rbx
jmp    1050 <execlp@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"dc\00"
@.str.1 = [2 x i8] c"-\00"
define void @be_dc(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = call i32 @dup2(i32 %5, i32 0)
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = call i32 @dup2(i32 %9, i32 1)
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = call i32 @close(i32 %13)
%15 = load i32*, i32** %2
%16 = getelementptr inbounds i32, i32* %15, i64 1
%17 = load i32, i32* %16
%18 = call i32 @close(i32 %17)
%19 = call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"dc\00"
@.str.1 = [2 x i8] c"-\00"
define void @be_dc(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @dup2(i32 %2, i32 0)
%4 = load i32, i32* %0
%5 = tail call i32 @dup2(i32 %4, i32 1)
%6 = load i32, i32* %0
%7 = tail call i32 @close(i32 %6)
%8 = getelementptr inbounds i32, i32* %0, i64 1
%9 = load i32, i32* %8
%10 = tail call i32 @close(i32 %9)
%11 = tail call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
/* Variables and functions */
double pow(double, double);
double th_Power(double x, double p) {
  if (x == 0.0 && p == 0.0)
    return 1.0;
  return pow(x, p);
}


x86 assembly (clang, -O0):
<th_Power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1164 <th_Power+0x54>
jp     1164 <th_Power+0x54>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1164 <th_Power+0x54>
jp     1164 <th_Power+0x54>
movsd  0xea6(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1178 <th_Power+0x68>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<th_Power>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jne    112d <th_Power+0x1d>
jp     112d <th_Power+0x1d>
ucomisd %xmm2,%xmm1
jne    112d <th_Power+0x1d>
jp     112d <th_Power+0x1d>
movsd  0xed4(%rip),%xmm0
ret
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @th_Power(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = fcmp oeq double %6, 0.000000e+00
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load double, double* %5
%10 = fcmp oeq double %9, 0.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %8
store double 1.000000e+00, double* %3
br label %16
12: ; preds = %8, %2
%13 = load double, double* %4
%14 = load double, double* %5
%15 = call double @pow(double %13, double %14)
store double %15, double* %3
br label %16
16: ; preds = %12, %11
%17 = load double, double* %3
ret double %17
}

LLVM IR (-O2):
define double @th_Power(double %0, double %1) {
%3 = fcmp oeq double %0, 0.000000e+00
%4 = fcmp oeq double %1, 0.000000e+00
%5 = and i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call double @pow(double %0, double %1)
br label %8
8: ; preds = %2, %6
%9 = phi double [ %7, %6 ], [ 1.000000e+00, %2 ]
ret double %9
}
/* Variables and functions */
double sqrt(double const);
double vec3_norm(const double v[3]) {
  return sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
}


x86 assembly (clang, -O0):
<vec3_norm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_norm>:
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1141 <vec3_norm+0x31>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @vec3_norm(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %6)
%10 = tail call double @sqrt(double %9)
ret double %10
}
main() {
  char a, *b, c[3];
  int i, *j, k[3];
  a = 'N';
  b = &(c[2]);
  j = &(k[0]);
  for (i = 0; i < 3; i++) {
    *b = a - (char)i;
    b--;
    *j = i + 5;
    j++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x4e,-0x5(%rbp)
lea    -0x13(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
lea    -0x2c(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    117a <main+0x7a>
movsbl -0x5(%rbp),%eax
mov    -0x18(%rbp),%ecx
movsbl %cl,%ecx
sub    %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%ecx
add    $0x5,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <main+0x2a>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
char *CatStrLen(char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *CatStr(char *Dest, const char *Src) {
  return (CatStrLen(Dest, Src, (Src ? strlen(Src) : 0)));
}


x86 assembly (clang, -O0):
<CatStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115c <CatStr+0x3c>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
jmp    1166 <CatStr+0x46>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    1166 <CatStr+0x46>
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
call   1040 <CatStrLen@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CatStr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
test   %rsi,%rsi
je     113b <CatStr+0x1b>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%edx
jmp    113d <CatStr+0x1d>
xor    %edx,%edx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <CatStrLen@plt>

LLVM IR (-O0):
define i8* @CatStr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = call i32 @strlen(i8* %10)
br label %13
12: ; preds = %2
br label %13
13: ; preds = %12, %9
%14 = phi i32 [ %11, %9 ], [ 0, %12 ]
%15 = call i8* @CatStrLen(i8* %5, i8* %6, i32 %14)
ret i8* %15
}

LLVM IR (-O2):
define i8* @CatStr(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @strlen(i8* %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 0, %2 ]
%8 = tail call i8* @CatStrLen(i8* %0, i8* %1, i32 %7)
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ sleep(int);
int main() {
  int a = 0;
  scanf("%d", &a);
  while (a > 0) {
    printf("%d\n", a);
    a = a - 1;
    sleep(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    1187 <main+0x57>
mov    -0x8(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1156 <main+0x26>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xebc(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
test   %esi,%esi
jle    117f <main+0x4f>
lea    0xea6(%rip),%rbx
nopl   (%rax)
mov    %rbx,%rdi
call   1030 <printf@plt>
addl   $0xffffffff,0xc(%rsp)
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    0xc(%rsp),%esi
test   %esi,%esi
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%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 sgt i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %0, %6
%7 = phi i32 [ %12, %6 ], [ %4, %0 ]
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %1
%10 = add nsw i32 %9, -1
store i32 %10, i32* %1
%11 = call i32 @sleep(i32 1)
%12 = load i32, i32* %1
%13 = icmp sgt i32 %12, 0
br i1 %13, label %6, label %14
14: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ startFunction(int, char *, char *);
int manageDURIPFunction(int portno, char *filename, char *cmd) {
  startFunction(portno, filename, cmd);
  return 0;
}


x86 assembly (clang, -O0):
<manageDURIPFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <startFunction@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @manageDURIPFunction(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @startFunction(i32 %7, i8* %8, i8* %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @manageDURIPFunction(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @startFunction(i32 %0, i8* %1, i8* %2)
ret i32 0
}
int test_imm_1Aint64_lowword_reg(long long val) {
  return ((val) & (0x1A << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_1Aint64_lowword_reg>:
test   $0x1a,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_1Aint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 26
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int clad_comparef(float one, float two) {
  if (one < two)
    return -1;
  if (one > two)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<clad_comparef>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    112d <clad_comparef+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <clad_comparef+0x4f>
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1148 <clad_comparef+0x48>
movl   $0x1,-0x4(%rbp)
jmp    114f <clad_comparef+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clad_comparef>:
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
seta   %cl
ucomiss %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @clad_comparef(float %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp olt float %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %16
10: ; preds = %2
%11 = load float, float* %4
%12 = load float, float* %5
%13 = fcmp ogt float %11, %12
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 1, i32* %3
br label %16
15: ; preds = %10
store i32 0, i32* %3
br label %16
16: ; preds = %15, %14, %9
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @clad_comparef(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = fcmp ogt float %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ str;

/* Variables and functions */
int /*<<< orphan*/ strncat(char *, char *, int);
void vlas(int size) {
  char z[size];
  char str[] = "hi";
  strncat(z, str, sizeof(str));
}


x86 assembly (clang, -O0):
<vlas>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
mov    0xebc(%rip),%ax
mov    %ax,-0x1b(%rbp)
mov    0xeb4(%rip),%al
mov    %al,-0x19(%rbp)
lea    -0x1b(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncat@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlas>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,%eax
mov    %rsp,%rdi
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdi
mov    %rdi,%rsp
movb   $0x0,-0x2(%rbp)
movw   $0x6968,-0x4(%rbp)
lea    -0x4(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncat@plt>
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
@__const.vlas.str = [3 x i8] c"hi\00"
define void @vlas(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca [3 x i8]
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %3
%9 = alloca i8, i64 %7
store i64 %7, i64* %4
%10 = bitcast [3 x i8]* %5 to i8*
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%12 = call i32 @strncat(i8* %9, i8* %11, i32 3)
%13 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
@__const.vlas.str = [3 x i8] c"hi\00"
define void @vlas(i32 %0) {
%2 = alloca [3 x i8]
%3 = zext i32 %0 to i64
%4 = alloca i8, i64 %3
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%6 = call i32 @strncat(i8* %4, i8* %5, i32 3)
ret void
}
/* Variables and functions */
float pow(float const, float);
float GammaToLinear(const float gamma) { return pow(gamma, 2.2f); }


x86 assembly (clang, -O0):
<GammaToLinear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xed6(%rip),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GammaToLinear>:
movss  0xee8(%rip),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define float @GammaToLinear(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @pow(float %3, float 0x40019999A0000000)
ret float %4
}

LLVM IR (-O2):
define float @GammaToLinear(float %0) {
%2 = tail call float @pow(float %0, float 0x40019999A0000000)
ret float %2
}
int copystring(char *buf, int maxlen, const char *s) {
  int i;
  for (i = 0; i < maxlen; ++i) {
    buf[i] = s[i];
    if (!s[i])
      break;
  }
  return i;
}


x86 assembly (clang, -O0):
<copystring>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1162 <copystring+0x62>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
jne    114f <copystring+0x4f>
jmp    1162 <copystring+0x62>
jmp    1154 <copystring+0x54>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1116 <copystring+0x16>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<copystring>:
test   %esi,%esi
jle    1129 <copystring+0x29>
mov    %esi,%esi
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rdx,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
cmpb   $0x0,(%rdx,%rax,1)
je     1128 <copystring+0x28>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <copystring+0x10>
mov    %esi,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @copystring(i8* nocapture writeonly %0, i32 %1, i8* nocapture %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %19
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %14
%8 = phi i64 [ 0, %5 ], [ %15, %14 ]
%9 = getelementptr inbounds i8, i8* %2, i64 %8
%10 = load i8, i8* %9
%11 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 %10, i8* %11
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %7
%15 = add nuw nsw i64 %8, 1
%16 = icmp eq i64 %15, %6
br i1 %16, label %19, label %7
17: ; preds = %7
%18 = trunc i64 %8 to i32
br label %19
19: ; preds = %14, %17, %3
%20 = phi i32 [ 0, %3 ], [ %18, %17 ], [ %1, %14 ]
ret i32 %20
}
void genbc1t_out() {}


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

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

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

LLVM IR (-O2):
define void @genbc1t_out() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cgi_error(char *, size_t);
int /*<<< orphan*/ exit(int);
void *realloc(void *, size_t);
void *cgi_realloc(void *oldbuf, size_t bytes) {
  void *buf = realloc(oldbuf, bytes);
  if (buf == NULL) {
    cgi_error("realloc failed for %d bytes", bytes);
    exit(1);
  }
  return buf;
}


x86 assembly (clang, -O0):
<cgi_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1176 <cgi_realloc+0x46>
mov    -0x10(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <cgi_error@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgi_realloc>:
push   %rbx
mov    %rsi,%rbx
call   1040 <realloc@plt>
test   %rax,%rax
je     1140 <cgi_realloc+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <cgi_error@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"realloc failed for %d bytes\00"
define i8* @cgi_realloc(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 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i64, i64* %4
%13 = call i32 @cgi_error(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@.str = [28 x i8] c"realloc failed for %d bytes\00"
define noalias i8* @cgi_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @cgi_error(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %1)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ WregPair(int);
int /*<<< orphan*/ Ws(char *);
int /*<<< orphan*/ Wx(int, int);
int Winst96(int i, int code) {
  int regpair = ((code >> 3) & 6) + 24;
  int value = ((code >> 2) & 0x30) | (code & 0xf);
  Ws("adiw  ");
  WregPair(regpair);
  Ws(", $");
  Wx(value, 2);
  return 0;
}


x86 assembly (clang, -O0):
<Winst96>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x3,%eax
and    $0x6,%eax
add    $0x18,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x2,%eax
and    $0x30,%eax
mov    -0x8(%rbp),%ecx
and    $0xf,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
lea    0xe98(%rip),%rdi
call   1030 <Ws@plt>
mov    -0xc(%rbp),%edi
call   1040 <WregPair@plt>
lea    0xe8b(%rip),%rdi
call   1030 <Ws@plt>
mov    -0x10(%rbp),%edi
mov    $0x2,%esi
call   1050 <Wx@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Winst96>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
shr    $0x3,%ebx
and    $0x6,%ebx
or     $0x18,%ebx
mov    %esi,%ebp
shr    $0x2,%ebp
and    $0x30,%ebp
and    $0xf,%esi
or     %esi,%ebp
lea    0xeae(%rip),%rdi
call   1030 <Ws@plt>
mov    %ebx,%edi
call   1040 <WregPair@plt>
lea    0xea2(%rip),%rdi
call   1030 <Ws@plt>
mov    %ebp,%edi
mov    $0x2,%esi
call   1050 <Wx@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"adiw \00"
@.str.1 = [4 x i8] c", $\00"
define i32 @Winst96(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = ashr i32 %7, 3
%9 = and i32 %8, 6
%10 = add nsw i32 %9, 24
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = ashr i32 %11, 2
%13 = and i32 %12, 48
%14 = load i32, i32* %4
%15 = and i32 %14, 15
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = call i32 @Ws(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%18 = load i32, i32* %5
%19 = call i32 @WregPair(i32 %18)
%20 = call i32 @Ws(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%21 = load i32, i32* %6
%22 = call i32 @Wx(i32 %21, i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"adiw \00"
@.str.1 = [4 x i8] c", $\00"
define i32 @Winst96(i32 %0, i32 %1) {
%3 = lshr i32 %1, 3
%4 = and i32 %3, 6
%5 = or i32 %4, 24
%6 = lshr i32 %1, 2
%7 = and i32 %6, 48
%8 = and i32 %1, 15
%9 = or i32 %7, %8
%10 = tail call i32 @Ws(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @WregPair(i32 %5)
%12 = tail call i32 @Ws(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%13 = tail call i32 @Wx(i32 %9, i32 2)
ret i32 0
}
/* Variables and functions */
int kkk();
int main() { return kkk(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @kkk()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ core7_print(char *, char *, char *, char const *);
void U_EMRMOVETOEX_print(const char *contents) {
  core7_print("U_EMRMOVETOEX", "ptl:", "", contents);
}


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

x86 assembly (clang, -O2):
<U_EMRMOVETOEX_print>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
lea    0xeed(%rip),%rsi
lea    0xeea(%rip),%rdx
jmp    1030 <core7_print@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"U_EMRMOVETOEX\00"
@.str.1 = [5 x i8] c"ptl:\00"
@.str.2 = [1 x i8] zeroinitializer
define void @U_EMRMOVETOEX_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @core7_print(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"U_EMRMOVETOEX\00"
@.str.1 = [5 x i8] c"ptl:\00"
@.str.2 = [1 x i8] zeroinitializer
define void @U_EMRMOVETOEX_print(i8* %0) {
%2 = tail call i32 @core7_print(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *zone(size_t size) {
  void *space = malloc(size);
  if (!space) {
    fprintf(stderr, "Out of memory\n");
    die();
  }
  return space;
}


x86 assembly (clang, -O0):
<zone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1170 <zone+0x40>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1050 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zone>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115a <zone+0x2a>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1050 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory\0A\00"
define i8* @zone(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 ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (...) @die()
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory\0A\00"
define noalias i8* @zone(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 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @die()
br label %8
8: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
char *strrchr(char *, char);
char *pathname(char *path) {
  char *p;
  if (path == NULL)
    return path;
  p = strrchr(path, '/');
  if (p == NULL)
    return path;
  p++;
  return p;
}


x86 assembly (clang, -O0):
<pathname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <pathname+0x24>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1172 <pathname+0x62>
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115e <pathname+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1172 <pathname+0x62>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathname>:
test   %rdi,%rdi
je     1133 <pathname+0x23>
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,%rcx
add    $0x1,%rax
test   %rcx,%rcx
cmove  %rbx,%rax
pop    %rbx
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @pathname(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i8* @strrchr(i8* %0, i8 signext 47)
%5 = icmp eq i8* %4, null
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = select i1 %5, i8* %0, i8* %6
br label %8
8: ; preds = %3, %1
%9 = phi i8* [ null, %1 ], [ %7, %3 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ writeCommand1parm(char *, unsigned int);
int ledToggle(unsigned int id) {
  if (id <= 3) {
    writeCommand1parm("LEDT", id);
  } else {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ledToggle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
ja     1139 <ledToggle+0x29>
mov    -0x8(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <writeCommand1parm@plt>
jmp    1145 <ledToggle+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <ledToggle+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ledToggle>:
mov    $0xffffffff,%eax
cmp    $0x3,%edi
ja     112f <ledToggle+0x1f>
push   %rax
mov    %edi,%esi
lea    0xedc(%rip),%rdi
call   1030 <writeCommand1parm@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"LEDT\00"
define i32 @ledToggle(i32 %0) {
%2 = icmp ult i32 %0, 4
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @writeCommand1parm(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 0, %3 ], [ -1, %1 ]
ret i32 %6
}
void Style_setValign(struct ExcelStyle *tmp) {}


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

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

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

LLVM IR (-O2):
%struct.ExcelStyle = type opaque
define void @Style_setValign(%struct.ExcelStyle* nocapture %0) {
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
char file_exists(const char *p) {
  struct stat st;
  if (stat(p, &st) == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jne    113c <file_exists+0x2c>
movb   $0x1,-0x1(%rbp)
jmp    1140 <file_exists+0x30>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define signext i8 @file_exists(i8* %0) {
%2 = alloca i8
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i8 1, i8* %2
br label %10
9: ; preds = %1
store i8 0, i8* %2
br label %10
10: ; preds = %9, %8
%11 = load i8, i8* %2
ret i8 %11
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define signext i8 @file_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i8
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void printFileReadError() { fprintf(stderr, "Could not read file\n"); }


x86 assembly (clang, -O0):
<printFileReadError>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printFileReadError>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Could not read file\0A\00"
define void @printFileReadError() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Could not read file\0A\00"
define void @printFileReadError() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int get_length(void *, unsigned long *);
int length(void *index, unsigned long *length) {
  return (get_length(index, length));
}


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

x86 assembly (clang, -O2):
<length>:
jmp    1030 <get_length@plt>

LLVM IR (-O0):
define i32 @length(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
store i8* %0, i8** %3
store i64* %1, i64** %4
%5 = load i8*, i8** %3
%6 = load i64*, i64** %4
%7 = call i32 @get_length(i8* %5, i64* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @length(i8* %0, i64* %1) {
%3 = tail call i32 @get_length(i8* %0, i64* %1)
ret i32 %3
}
/* Variables and functions */
int strlen(char *);
void cutereturn(char *s) {
  int len = strlen(s);
  if (s[len - 1] == '\n')
    s[len - 1] = 0;
}


x86 assembly (clang, -O0):
<cutereturn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1153 <cutereturn+0x43>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutereturn>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1127 <cutereturn+0x17>
movb   $0x0,-0x1(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @cutereturn(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %9
8: ; preds = %1
store i8 0, i8* %5
br label %9
9: ; preds = %8, %1
ret void
}
int test_imm_F9uint8_mem(unsigned char *val) {
  return ((*val) & (-0xF9 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F9uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 7
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}