xunge/DecIR huggingface dataset:
/* Variables and functions */
double pow(int, double);
double mtof(double f) {
  if (f <= -1500)
    return (0);
  else if (f > 1499)
    return (mtof(1499));
  else
    return (pow(2, (f - 69) / 12.0) * 440.0);
}


x86 assembly (clang, -O0):
<mtof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xecb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     114d <mtof+0x2d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11b3 <mtof+0x93>
movsd  -0x10(%rbp),%xmm0
movsd  0xeae(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    117b <mtof+0x5b>
movsd  0xe9c(%rip),%xmm0
call   1040 <mtof@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    11b3 <mtof+0x93>
movsd  -0x10(%rbp),%xmm0
movsd  0xe98(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe84(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  0xe66(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtof>:
push   %rax
xorpd  %xmm1,%xmm1
movsd  0xee3(%rip),%xmm2
ucomisd %xmm0,%xmm2
jae    115d <mtof+0x4d>
ucomisd 0xee5(%rip),%xmm0
jbe    1137 <mtof+0x27>
movsd  0xed3(%rip),%xmm0
jmp    1147 <mtof+0x37>
addsd  0xed9(%rip),%xmm0
divsd  0xed9(%rip),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movapd %xmm0,%xmm1
mulsd  0xecb(%rip),%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mtof(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ole double %4, -1.500000e+03
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %18
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp ogt double %8, 1.499000e+03
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call double @mtof(double 1.499000e+03)
store double %11, double* %2
br label %18
12: ; preds = %7
%13 = load double, double* %3
%14 = fsub double %13, 6.900000e+01
%15 = fdiv double %14, 1.200000e+01
%16 = call double @pow(i32 2, double %15)
%17 = fmul double %16, 4.400000e+02
store double %17, double* %2
br label %18
18: ; preds = %12, %10, %6
%19 = load double, double* %2
ret double %19
}

LLVM IR (-O2):
define double @mtof(double %0) {
%2 = fcmp ugt double %0, -1.500000e+03
br i1 %2, label %3, label %12
3: ; preds = %1
%4 = fcmp ogt double %0, 1.499000e+03
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = fadd double %0, -6.900000e+01
%7 = fdiv double %6, 1.200000e+01
br label %8
8: ; preds = %3, %5
%9 = phi double [ %7, %5 ], [ 0x405DCAAAAAAAAAAB, %3 ]
%10 = tail call double @pow(i32 2, double %9)
%11 = fmul double %10, 4.400000e+02
br label %12
12: ; preds = %8, %1
%13 = phi double [ 0.000000e+00, %1 ], [ %11, %8 ]
ret double %13
}
void *thr(void *arg) {
  *(int *)0 = 0;
  return 0;
}


x86 assembly (clang, -O0):
<thr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i8* @thr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
store i32 0, i32* null
ret i8* null
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_channel_map_compatible() {
  printf("NOT IMPLEMENTED:"
         "pa_channel_map_compatible"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"NOT IMPLEMENTED:pa_channel_map_compatible\0A\00"
define i32 @pa_channel_map_compatible() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [42 x i8] c"NOT IMPLEMENTED:pa_channel_map_compatible\00"
define i32 @pa_channel_map_compatible() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void alarm_nop() { return; }


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

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

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

LLVM IR (-O2):
define void @alarm_nop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_SMOOTH;
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
void init(void) {
  glClearColor(0.2, 0.8, 0.0, 0.0);
  glShadeModel(GL_SMOOTH);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
movsd  0xed4(%rip),%xmm0
movsd  0xed4(%rip),%xmm1
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm2
call   1030 <glClearColor@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1040 <glShadeModel@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1030 <glClearColor@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <glShadeModel@plt>

LLVM IR (-O0):
@GL_SMOOTH = global i32 0
define void @init() {
%1 = call i32 @glClearColor(double 2.000000e-01, double 8.000000e-01, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_SMOOTH
%3 = call i32 @glShadeModel(i32 %2)
ret void
}

LLVM IR (-O2):
@GL_SMOOTH = global i32 0
define void @init() {
%1 = tail call i32 @glClearColor(double 2.000000e-01, double 8.000000e-01, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_SMOOTH
%3 = tail call i32 @glShadeModel(i32 %2)
ret void
}
char *strcpy(char *dst, const char *src) {
  char *ptr = dst;
  while (*src) {
    *ptr++ = *src++;
  }
  return dst;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <strcpy+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1120 <strcpy+0x20>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret i8* %0
}
/* Variables and functions */
double cosh(double);
double sinh(double);
double tanh(double n) {
  if (cosh(n) == 0) {
    return 0. / 0.;
  }
  return sinh(n) / cosh(n);
}


x86 assembly (clang, -O0):
<tanh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cosh@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    115c <tanh+0x3c>
jp     115c <tanh+0x3c>
movsd  0xeae(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1186 <tanh+0x66>
movsd  -0x10(%rbp),%xmm0
call   1030 <sinh@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cosh@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tanh>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <cosh@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1148 <tanh+0x28>
jp     1148 <tanh+0x28>
movsd  0xebd(%rip),%xmm0
add    $0x18,%rsp
ret
movsd  0x8(%rsp),%xmm0
call   1030 <sinh@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <cosh@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define double @tanh(double %0) {
%2 = tail call double @cosh(double %0)
%3 = fcmp oeq double %2, 0.000000e+00
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call double @sinh(double %0)
%6 = tail call double @cosh(double %0)
%7 = fdiv double %5, %6
br label %8
8: ; preds = %1, %4
%9 = phi double [ %7, %4 ], [ 0x7FF8000000000000, %1 ]
ret double %9
}
/* Variables and functions */
void Sys_InitStreamThread(void) {}


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

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

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

LLVM IR (-O2):
define void @Sys_InitStreamThread() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_192() {
  Assert_real((isqrt(192) == 13),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              965, ("Integer square root of 192 should be 13"));
}


x86 assembly (clang, -O0):
<t_sqrt_192>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc0,%edi
call   1030 <isqrt@plt>
cmp    $0xd,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x3c5,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_192>:
push   %rax
mov    $0xc0,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xd,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x3c5,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 192 should be 13\00"
define void @t_sqrt_192() {
%1 = call i32 @isqrt(i32 192)
%2 = icmp eq i32 %1, 13
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 965, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 192 should be 13\00"
define void @t_sqrt_192() {
%1 = tail call i32 @isqrt(i32 192)
%2 = icmp eq i32 %1, 13
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 965, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PR_SET_NAME;
int /*<<< orphan*/ prctl(int /*<<< orphan*/, unsigned long);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
void *new_thread_2(void *arg) {
  prctl(PR_SET_NAME, (unsigned long)"New_thread_2");
  int iloop;
  for (iloop = 0;; iloop++) {
    printf("New thread 2 never return loop %d\n", iloop);
    sleep(1);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<new_thread_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
call   1040 <prctl@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1158 <new_thread_2+0x28>

x86 assembly (clang, -O2):
<new_thread_2>:
push   %r14
push   %rbx
push   %rax
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1040 <prctl@plt>
xor    %ebx,%ebx
lea    0xebb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
add    $0x1,%ebx
jmp    1160 <new_thread_2+0x30>

LLVM IR (-O0):
@PR_SET_NAME = global i32 0
@.str = [13 x i8] c"New_thread_2\00"
@.str.1 = [35 x i8] c"New thread 2 never return loop %d\0A\00"
define i8* @new_thread_2(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i32, i32* @PR_SET_NAME
%5 = call i32 @prctl(i32 %4, i64 ptrtoint ([13 x i8]* @.str to i64))
store i32 0, i32* %3
br label %6
6: ; preds = %10, %1
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 @sleep(i32 1)
br label %10
10: ; preds = %6
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %6
}

LLVM IR (-O2):
@PR_SET_NAME = global i32 0
@.str = [13 x i8] c"New_thread_2\00"
@.str.1 = [35 x i8] c"New thread 2 never return loop %d\0A\00"
define noalias i8* @new_thread_2(i8* nocapture readnone %0) {
%2 = load i32, i32* @PR_SET_NAME
%3 = tail call i32 @prctl(i32 %2, i64 ptrtoint ([13 x i8]* @.str to i64))
br label %4
4: ; preds = %4, %1
%5 = phi i32 [ 0, %1 ], [ %8, %4 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 @sleep(i32 1)
%8 = add nuw nsw i32 %5, 1
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int main() {
  printf("sizeof int:%d\n", sizeof(int));
  int x = -1;
  int n = 2;
  x = x >> n;
  x = x & (~((~(0)) << (32 - n)));
  printf("x :%d %x ", x, x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
sub    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
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    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0x3fffffff,%esi
mov    $0x3fffffff,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"sizeof int:%d\0A\00"
@.str.1 = [10 x i8] c"x :%d %x \00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 1073741823, i32 1073741823)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putc(char);
void arch_decomp_puts(const char *ptr) {
  char c;
  while ((c = *ptr++) != '\0') {
    if (c == '\n')
      putc('\r');
    putc(c);
  }
}


x86 assembly (clang, -O0):
<arch_decomp_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     1161 <arch_decomp_puts+0x51>
movsbl -0x9(%rbp),%eax
cmp    $0xa,%eax
jne    1153 <arch_decomp_puts+0x43>
mov    $0xd,%edi
call   1030 <putc@plt>
movsbl -0x9(%rbp),%edi
call   1030 <putc@plt>
jmp    111c <arch_decomp_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_decomp_puts>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
jmp    1136 <arch_decomp_puts+0x26>
nopl   0x0(%rax)
mov    $0xd,%edi
call   1030 <putc@plt>
add    $0x1,%r14
movsbl %bl,%edi
call   1030 <putc@plt>
movzbl (%r14),%ebx
cmp    $0xa,%bl
je     1120 <arch_decomp_puts+0x10>
test   %bl,%bl
jne    112a <arch_decomp_puts+0x1a>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @arch_decomp_puts(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %4, %8 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %10
i8 10, label %6
]
6: ; preds = %2
%7 = tail call i32 @putc(i8 signext 13)
br label %8
8: ; preds = %2, %6
%9 = tail call i32 @putc(i8 signext %5)
br label %2
10: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void premature_eof() {
  fprintf(stderr, "Premature eof while trying to read the record\n");
  exit(0);
}


x86 assembly (clang, -O0):
<premature_eof>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<premature_eof>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"Premature eof while trying to read the record\0A\00"
define void @premature_eof() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"Premature eof while trying to read the record\0A\00"
define void @premature_eof() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int system(char *);
int libc_system(char *command) { return system(command); }


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

x86 assembly (clang, -O2):
<libc_system>:
jmp    1030 <system@plt>

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

LLVM IR (-O2):
define i32 @libc_system(i8* nocapture %0) {
%2 = tail call i32 @system(i8* %0)
ret i32 %2
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRA9_set(void) { return U_WMRCORENONE_set("U_WMRA9"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRA9\00"
define i8* @U_WMRA9_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRA9\00"
define i8* @U_WMRA9_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_handler(int signum) { printf("io\n"); }


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [3 x i8] c"io\00"
define void @sig_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void log_message(char *filename, char *message) {
  FILE *logfile;
  logfile = fopen(filename, "a");
  if (!logfile)
    return;
  fprintf(logfile, "%s", message);
  fclose(logfile);
}


x86 assembly (clang, -O0):
<log_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <log_message+0x34>
jmp    1181 <log_message+0x51>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe8f(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_message>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xec2(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1165 <log_message+0x35>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@.str.1 = [3 x i8] c"%s\00"
define void @log_message(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = icmp ne i32* %8, null
br i1 %9, label %11, label %10
10: ; preds = %2
br label %17
11: ; preds = %2
%12 = load i32*, i32** %5
%13 = load i8*, i8** %4
%14 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = load i32*, i32** %5
%16 = call i32 @fclose(i32* %15)
br label %17
17: ; preds = %11, %10
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
define void @log_message(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @fputs(i8* %1, i32* %3)
%7 = tail call i32 @fclose(i32* %3)
br label %8
8: ; preds = %2, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
void sig_handler(int sig) {
  printf("So you think you can stop the bomb with ctrl-c, do you?\n");
  sleep(3);
  printf("Well...");
  fflush(stdout);
  sleep(1);
  printf("OK. :-)\n");
  exit(16);
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1060 <sleep@plt>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x10,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<sig_handler>:
push   %rax
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3,%edi
call   1070 <sleep@plt>
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x1,%edi
call   1070 <sleep@plt>
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
mov    $0x10,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [57 x i8] c"So you think you can stop the bomb with ctrl-c, do you?\0A\00"
@.str.1 = [8 x i8] c"Well...\00"
@stdout = global i32 0
@.str.2 = [9 x i8] c"OK. :-)\0A\00"
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @sleep(i32 3)
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
%8 = call i32 @sleep(i32 1)
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @exit(i32 16)
unreachable
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"Well...\00"
@stdout = global i32 0
@str = [56 x i8] c"So you think you can stop the bomb with ctrl-c, do you?\00"
@str.3 = [8 x i8] c"OK. :-)\00"
define void @sig_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 3)
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
%7 = tail call i32 @sleep(i32 1)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.3, i64 0, i64 0))
%9 = tail call i32 @exit(i32 16)
unreachable
}
int cc_debugfs_init(struct cc_drvdata *drvdata) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.cc_drvdata = type opaque
define i32 @cc_debugfs_init(%struct.cc_drvdata* nocapture readnone %0) {
ret i32 0
}
int test_imm_25int8_reg(signed char val) {
  return ((val) & (0x25 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_25int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x25,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_25int8_reg(i8 signext %0) {
%2 = and i8 %0, 37
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ uart0_putc(int /*<<< orphan*/);
void uart0_write(const char *str) {
  while (*str != '\0') {
    uart0_putc(*str++);
  }
}


x86 assembly (clang, -O0):
<uart0_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <uart0_write+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <uart0_putc@plt>
jmp    111c <uart0_write+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart0_write>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <uart0_write+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <uart0_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <uart0_write+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @uart0_write(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @uart0_putc(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
float d2f(double);
double gs_sin_degrees(float);
float d2fsin_d(double x) { return d2f(gs_sin_degrees(d2f(x))); }


x86 assembly (clang, -O0):
<d2fsin_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <d2f@plt>
call   1030 <gs_sin_degrees@plt>
call   1040 <d2f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2fsin_d>:
push   %rax
call   1040 <d2f@plt>
call   1030 <gs_sin_degrees@plt>
pop    %rax
jmp    1040 <d2f@plt>

LLVM IR (-O0):
define float @d2fsin_d(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call float @d2f(double %3)
%5 = call double @gs_sin_degrees(float %4)
%6 = call float @d2f(double %5)
ret float %6
}

LLVM IR (-O2):
define float @d2fsin_d(double %0) {
%2 = tail call float @d2f(double %0)
%3 = tail call double @gs_sin_degrees(float %2)
%4 = tail call float @d2f(double %3)
ret float %4
}
/* Variables and functions */
int climbStaris(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  printf("\r\nnum%d ,%d", 5, climbStaris(5));
  printf("\r\nnum%d ,%d", 6, climbStaris(6));
  printf("\r\nnum%d ,%d", 7, climbStaris(7));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
call   1040 <climbStaris@plt>
mov    %eax,%edx
lea    0xebe(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    $0x6,%edi
call   1040 <climbStaris@plt>
mov    %eax,%edx
lea    0xea1(%rip),%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    $0x7,%edi
call   1040 <climbStaris@plt>
mov    %eax,%edx
lea    0xe84(%rip),%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5,%edi
call   1040 <climbStaris@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x6,%edi
call   1040 <climbStaris@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x7,%edi
call   1040 <climbStaris@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"\0D\0Anum%d ,%d\00"
define i32 @main() {
%1 = tail call i32 @climbStaris(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 5, i32 %1)
%3 = tail call i32 @climbStaris(i32 6)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 6, i32 %3)
%5 = tail call i32 @climbStaris(i32 7)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 7, i32 %5)
ret i32 0
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int64_t cfs_stub_llistxattr(const char *path, char *list, size_t size) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<cfs_stub_llistxattr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfs_stub_llistxattr>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @cfs_stub_llistxattr(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @cfs_stub_llistxattr(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ select_features();
int /*<<< orphan*/ select_helpers();
int /*<<< orphan*/ setup();
int /*<<< orphan*/ test();
int valid_product();
int main(void) {
  int retValue_acc;
  int tmp;
  {
    {
      select_helpers();
      select_features();
      tmp = valid_product();
    }
    if (tmp) {
      {
        setup();
        test();
      }
    } else {
    }
    return (retValue_acc);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <select_helpers@plt>
mov    $0x0,%al
call   1040 <select_features@plt>
mov    $0x0,%al
call   1030 <valid_product@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1194 <main+0x44>
mov    $0x0,%al
call   1060 <setup@plt>
mov    $0x0,%al
call   1070 <test@plt>
jmp    1199 <main+0x49>
jmp    1199 <main+0x49>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <select_helpers@plt>
xor    %eax,%eax
call   1040 <select_features@plt>
xor    %eax,%eax
call   1030 <valid_product@plt>
test   %eax,%eax
je     1178 <main+0x28>
xor    %eax,%eax
call   1060 <setup@plt>
xor    %eax,%eax
call   1070 <test@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @select_helpers()
%5 = call i32 (...) @select_features()
%6 = call i32 (...) @valid_product()
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = call i32 (...) @setup()
%11 = call i32 (...) @test()
br label %13
12: ; preds = %0
br label %13
13: ; preds = %12, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @select_helpers()
%2 = tail call i32 (...) @select_features()
%3 = tail call i32 (...) @valid_product()
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = tail call i32 (...) @setup()
%7 = tail call i32 (...) @test()
br label %8
8: ; preds = %0, %5
ret i32 undef
}
void RTAvlUIntPtrGet(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlUIntPtrGet() {
ret void
}
int main() {
  int x = 0;
  if (++x != 1) {
    return 1;
  }
  if (x != 1) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x1,%eax
je     1130 <main+0x30>
movl   $0x1,-0x4(%rbp)
jmp    114d <main+0x4d>
cmpl   $0x1,-0x8(%rbp)
je     1146 <main+0x46>
movl   $0x1,-0x4(%rbp)
jmp    114d <main+0x4d>
movl   $0x0,-0x4(%rbp)
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 i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1, i32* %1
br label %12
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 1, i32* %1
br label %12
11: ; preds = %7
store i32 0, i32* %1
br label %12
12: ; preds = %11, %10, %6
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void sprotfree(void *ptr) { free((char *)ptr); }


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

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

LLVM IR (-O2):
define void @sprotfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _ACC_free(void *p) { free(p); }


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

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

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

LLVM IR (-O2):
define void @_ACC_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __wrap_write(int, char *, int);
int main(void) {
  while (1)
    __wrap_write(1, "test\n", 5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    0xed5(%rip),%rsi
mov    $0x5,%edx
call   1030 <__wrap_write@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x5,%edx
call   1030 <__wrap_write@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [6 x i8] c"test\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @__wrap_write(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
br label %2
}

LLVM IR (-O2):
@.str = [6 x i8] c"test\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @__wrap_write(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ write(int, char *, int);
main() {
  char buf[1024];
  int n;
  while ((n = read(0, buf, 1024)) > 0) {
    printf("n is %i \n", n);
    write(1, buf, n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rsi
xor    %edi,%edi
mov    $0x400,%edx
call   1050 <read@plt>
mov    %eax,-0x414(%rbp)
cmp    $0x0,%eax
jle    1192 <main+0x62>
mov    -0x414(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
lea    -0x410(%rbp),%rsi
mov    -0x414(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rsi
xor    %edi,%edi
mov    $0x400,%edx
call   1050 <read@plt>
test   %eax,%eax
jle    118e <main+0x5e>
mov    %eax,%ebp
lea    0xea9(%rip),%r14
mov    %rsp,%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <write@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
call   1050 <read@plt>
mov    %eax,%ebp
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"n is %i \0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 0, i8* %2, i32 1024)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %0, %5
%6 = phi i32 [ %9, %5 ], [ %3, %0 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @write(i32 1, i8* %2, i32 %6)
%9 = call i32 @read(i32 0, i8* %2, i32 1024)
%10 = icmp sgt i32 %9, 0
br i1 %10, label %5, label %11
11: ; preds = %5, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ POLICYQUALINFO;

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ POLICYQUALINFO_it;
POLICYQUALINFO *POLICYQUALINFO_new(void) {
  return (POLICYQUALINFO *)ASN1_item_new(&POLICYQUALINFO_it);
}


x86 assembly (clang, -O0):
<POLICYQUALINFO_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<POLICYQUALINFO_new>:
mov    0x2ed9(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@POLICYQUALINFO_it = global i32 0
define i32* @POLICYQUALINFO_new() {
%1 = call i64 @ASN1_item_new(i32* @POLICYQUALINFO_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@POLICYQUALINFO_it = global i32 0
define i32* @POLICYQUALINFO_new() {
%1 = tail call i64 @ASN1_item_new(i32* @POLICYQUALINFO_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
/* Variables and functions */
char *copy_string_adds_newline(char *);
char *fileGetContents(char *);
char *get_dash_string(char **str) {
  char *s = *str;
  if (*s == '-')
    *str = copy_string_adds_newline(s + 1);
  else
    *str = fileGetContents(s);
  return *str;
}


x86 assembly (clang, -O0):
<get_dash_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1163 <get_dash_string+0x43>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <copy_string_adds_newline@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    1176 <get_dash_string+0x56>
mov    -0x10(%rbp),%rdi
call   1040 <fileGetContents@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dash_string>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
cmpb   $0x2d,(%rdi)
jne    1137 <get_dash_string+0x17>
add    $0x1,%rdi
call   1030 <copy_string_adds_newline@plt>
jmp    113c <get_dash_string+0x1c>
call   1040 <fileGetContents@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @get_dash_string(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 45
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = tail call i8* @copy_string_adds_newline(i8* %6)
br label %10
8: ; preds = %1
%9 = tail call i8* @fileGetContents(i8* %2)
br label %10
10: ; preds = %8, %5
%11 = phi i8* [ %9, %8 ], [ %7, %5 ]
store i8* %11, i8** %0
ret i8* %11
}
int do_372() { return 372; }


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

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

LLVM IR (-O0):
define i32 @do_372() {
ret i32 372
}

LLVM IR (-O2):
define i32 @do_372() {
ret i32 372
}