xunge/DecIR huggingface dataset:
/* Variables and functions */
double sin(float);
float custom_n0(float x) {
  return 1.0 + 0.5 * sin(x / 3.14159265358979323846264338327950288) *
                   sin(x / 3.14159265358979323846264338327950288);
}


x86 assembly (clang, -O0):
<custom_n0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeda(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  0xeca(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea8(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe7f(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<custom_n0>:
sub    $0x18,%rsp
cvtss2sd %xmm0,%xmm0
divsd  0xee0(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
call   1030 <sin@plt>
mulsd  0xed1(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0xeba(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @custom_n0(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fdiv double %4, 0x400921FB54442D18
%6 = fptrunc double %5 to float
%7 = call double @sin(float %6)
%8 = fmul double 5.000000e-01, %7
%9 = load float, float* %2
%10 = fpext float %9 to double
%11 = fdiv double %10, 0x400921FB54442D18
%12 = fptrunc double %11 to float
%13 = call double @sin(float %12)
%14 = call double @llvm.fmuladd.f64(double %8, double %13, double 1.000000e+00)
%15 = fptrunc double %14 to float
ret float %15
}

LLVM IR (-O2):
define float @custom_n0(float %0) {
%2 = fpext float %0 to double
%3 = fdiv double %2, 0x400921FB54442D18
%4 = fptrunc double %3 to float
%5 = tail call double @sin(float %4)
%6 = fmul double %5, 5.000000e-01
%7 = tail call double @sin(float %4)
%8 = tail call double @llvm.fmuladd.f64(double %6, double %7, double 1.000000e+00)
%9 = fptrunc double %8 to float
ret float %9
}
int iabs2(int x) { return (x) * (x); }


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

x86 assembly (clang, -O2):
<iabs2>:
mov    %edi,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @iabs2(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
int find_sharp(char *str, int index) {
  while (str[index] != '#')
    index++;
  return index;
}


x86 assembly (clang, -O0):
<find_sharp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x23,%eax
je     112e <find_sharp+0x2e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110b <find_sharp+0xb>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_sharp>:
movslq %esi,%rcx
lea    -0x1(%rcx),%eax
add    %rcx,%rdi
nopl   0x0(%rax)
add    $0x1,%eax
cmpb   $0x23,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <find_sharp+0x10>
ret

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

LLVM IR (-O2):
define i32 @find_sharp(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %9, %4 ], [ %3, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 35
%9 = add i64 %5, 1
br i1 %8, label %10, label %4
10: ; preds = %4
%11 = trunc i64 %5 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, double);
int main() {
  int x, y;
  for (x = 100; x >= 0; x--) {
    printf("%3d %3d %15.4lf\n", 100 - x, 1, (double)x);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     115c <main+0x4c>
mov    $0x64,%esi
sub    -0x8(%rbp),%esi
cvtsi2sdl -0x8(%rbp),%xmm0
lea    0xebc(%rip),%rdi
mov    $0x1,%edx
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x64,%ebp
xor    %ebx,%ebx
lea    0xede(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
add    $0xffffffff,%ebp
add    $0x1,%ebx
cmp    $0x65,%ebx
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"%3d %3d %15.4lf\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 100, %0 ], [ %6, %1 ]
%3 = sub nuw nsw i32 100, %2
%4 = sitofp i32 %2 to double
%5 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3, i32 1, double %4)
%6 = add nsw i32 %2, -1
%7 = icmp eq i32 %2, 0
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}
/* Variables and functions */
int sock_printf_error(int, char *);
int sock_send_error(int fd, char *message) {
  return sock_printf_error(fd, message);
}


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

x86 assembly (clang, -O2):
<sock_send_error>:
jmp    1030 <sock_printf_error@plt>

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

LLVM IR (-O2):
define i32 @sock_send_error(i32 %0, i8* %1) {
%3 = tail call i32 @sock_printf_error(i32 %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ srand(int);
void init_rand(void) { srand(1500450271); }


x86 assembly (clang, -O0):
<init_rand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x596f0ddf,%edi
call   1030 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_rand>:
mov    $0x596f0ddf,%edi
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @init_rand() {
%1 = call i32 @srand(i32 1500450271)
ret void
}

LLVM IR (-O2):
define void @init_rand() {
%1 = tail call i32 @srand(i32 1500450271)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ itoa_len(char *, int, int);
int packet_pack_head(char *packet, int content_len, int func) {
  int len = 0;
  itoa_len(packet + len, content_len, 4);
  len += 4;
  itoa_len(packet + len, func, 2);
  len += 2;
  return len;
}


x86 assembly (clang, -O0):
<packet_pack_head>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
mov    $0x4,%edx
call   1030 <itoa_len@plt>
mov    -0x14(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
mov    -0x10(%rbp),%esi
mov    $0x2,%edx
call   1030 <itoa_len@plt>
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<packet_pack_head>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
mov    $0x4,%edx
call   1030 <itoa_len@plt>
add    $0x4,%rbx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x2,%edx
call   1030 <itoa_len@plt>
mov    $0x6,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @packet_pack_head(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i8*, i8** %4
%9 = load i32, i32* %7
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i32, i32* %5
%13 = call i32 @itoa_len(i8* %11, i32 %12, i32 4)
%14 = load i32, i32* %7
%15 = add nsw i32 %14, 4
store i32 %15, i32* %7
%16 = load i8*, i8** %4
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i32, i32* %6
%21 = call i32 @itoa_len(i8* %19, i32 %20, i32 2)
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 2
store i32 %23, i32* %7
%24 = load i32, i32* %7
ret i32 %24
}

LLVM IR (-O2):
define i32 @packet_pack_head(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @itoa_len(i8* %0, i32 %1, i32 4)
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = tail call i32 @itoa_len(i8* %5, i32 %2, i32 2)
ret i32 6
}
/* Variables and functions */
int /*<<< orphan*/ free(float *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, float);
void nine() {
  float *p = (float *)malloc(sizeof(float));
  *p = 12.5f;
  printf("The value of p is: %f\n", *p);
  free(p);
}


x86 assembly (clang, -O0):
<nine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  0xeae(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nine>:
push   %rbx
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movl   $0x41480000,(%rax)
lea    0xeb9(%rip),%rdi
movss  0xead(%rip),%xmm0
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"The value of p is: %f\0A\00"
define void @nine() {
%1 = alloca float*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to float*
store float* %3, float** %1
%4 = load float*, float** %1
store float 1.250000e+01, float* %4
%5 = load float*, float** %1
%6 = load float, float* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float %6)
%8 = load float*, float** %1
%9 = call i32 @free(float* %8)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"The value of p is: %f\0A\00"
define void @nine() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to float*
store float 1.250000e+01, float* %2
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float 1.250000e+01)
%4 = tail call i32 @free(float* %2)
ret void
}
regx0adrx1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((p0[x0]) <= (((double *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<regx0adrx1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movslq -0x20(%rbp),%rcx
mov    $0xa98ac7,%eax
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jb     114d <regx0adrx1+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1154 <regx0adrx1+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0adrx1>:
movslq %edi,%rcx
movslq %esi,%rax
movsd  0xa98ac7(,%rax,8),%xmm0
xor    %eax,%eax
ucomisd (%rdx,%rcx,8),%xmm0
setae  %al
ret

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

LLVM IR (-O2):
define i32 @regx0adrx1(double %0, double %1, i32 %2, i32 %3, double* nocapture %4, double* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds double, double* %4, i64 %7
%9 = load double, double* %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds double, double* inttoptr (i64 11111111 to double*), i64 %10
%12 = load double, double* %11
%13 = fcmp ole double %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ set_finished();
void stop_func(int argc, char **argv) {
  printf("Shutting down...\n");
  set_finished();
}


x86 assembly (clang, -O0):
<stop_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <set_finished@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop_func>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <set_finished@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Shutting down...\0A\00"
define void @stop_func(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @set_finished()
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"Shutting down...\00"
define void @stop_func(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @set_finished()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ x_fun();
int main() {
  x_fun();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @x_fun()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ op_to_ea(char *, int /*<<< orphan*/);
void i_add_ea(void) { op_to_ea("add", 0); }


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

x86 assembly (clang, -O2):
<i_add_ea>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
jmp    1030 <op_to_ea@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"add\00"
define void @i_add_ea() {
%1 = call i32 @op_to_ea(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"add\00"
define void @i_add_ea() {
%1 = tail call i32 @op_to_ea(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret void
}
BOOST_AUTO_TEST_CASE(cos) { TESTCASE1(cos, 0, 1); }


x86 assembly (clang, -O0):
<BOOST_AUTO_TEST_CASE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <TESTCASE1@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BOOST_AUTO_TEST_CASE>:
xor    %esi,%esi
mov    $0x1,%edx
xor    %eax,%eax
jmp    1030 <TESTCASE1@plt>

LLVM IR (-O0):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %4, i32 0, i32 1)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %0, i32 0, i32 1)
ret i32 undef
}
/* Variables and functions */
void *sum_int_list(void *state, void *data, void *param) {
  void *ret = NULL;
  (*(int *)state) += ((*(int *)data) * (*(int *)param));
  (*(int *)data) *= (*(int *)param);
  return ret = data;
}


x86 assembly (clang, -O0):
<sum_int_list>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
imul   (%rax),%ecx
mov    -0x8(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
imul   (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_int_list>:
mov    %rsi,%rax
mov    (%rdx),%ecx
imul   (%rsi),%ecx
add    %ecx,(%rdi)
mov    (%rsi),%ecx
imul   (%rdx),%ecx
mov    %ecx,(%rsi)
ret

LLVM IR (-O0):
define i8* @sum_int_list(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store i8* null, i8** %7
%8 = load i8*, i8** %5
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = load i8*, i8** %6
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
%14 = mul nsw i32 %10, %13
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to i32*
%17 = load i32, i32* %16
%18 = add nsw i32 %17, %14
store i32 %18, i32* %16
%19 = load i8*, i8** %6
%20 = bitcast i8* %19 to i32*
%21 = load i32, i32* %20
%22 = load i8*, i8** %5
%23 = bitcast i8* %22 to i32*
%24 = load i32, i32* %23
%25 = mul nsw i32 %24, %21
store i32 %25, i32* %23
%26 = load i8*, i8** %5
store i8* %26, i8** %7
ret i8* %26
}

LLVM IR (-O2):
define i8* @sum_int_list(i8* nocapture %0, i8* returned %1, i8* nocapture %2) {
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %4
%6 = bitcast i8* %2 to i32*
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, %5
%9 = bitcast i8* %0 to i32*
%10 = load i32, i32* %9
%11 = add nsw i32 %10, %8
store i32 %11, i32* %9
%12 = load i32, i32* %6
%13 = load i32, i32* %4
%14 = mul nsw i32 %13, %12
store i32 %14, i32* %4
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b;
  scanf("%d", &a);
  scanf("%d", &b);
  if ((b & (1 << a)) == 0) {
    printf("0");
  } else {
    printf("1");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    117a <main+0x5a>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
jmp    1186 <main+0x66>
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
mov    0xc(%rsp),%ecx
bt     %ecx,%eax
mov    $0x31,%edi
adc    $0xffffffff,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = shl nuw i32 1, %8
%10 = and i32 %9, %7
%11 = icmp eq i32 %10, 0
%12 = select i1 %11, i32 48, i32 49
%13 = call i32 @putchar(i32 %12)
ret i32 0
}
long int max(long int a, long int b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @max(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @max(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
char *borrow() {
  char *hi = "test";
  return hi;
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"test\00"
define i8* @borrow() {
%1 = alloca i8*
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
define i8* @borrow() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ DelayTime(int);
int /*<<< orphan*/ iRobot_Dock();
int /*<<< orphan*/ iRobot_Start();
int /*<<< orphan*/ iRobot_Stop();
void IRobotStopCleaningAndDock() {
  iRobot_Start();
  iRobot_Dock();
  iRobot_Stop();
  DelayTime(2000);
  iRobot_Start();
  iRobot_Dock();
  iRobot_Stop();
}


x86 assembly (clang, -O0):
<IRobotStopCleaningAndDock>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <iRobot_Start@plt>
mov    $0x0,%al
call   1060 <iRobot_Dock@plt>
mov    $0x0,%al
call   1050 <iRobot_Stop@plt>
mov    $0x7d0,%edi
call   1040 <DelayTime@plt>
mov    $0x0,%al
call   1030 <iRobot_Start@plt>
mov    $0x0,%al
call   1060 <iRobot_Dock@plt>
mov    $0x0,%al
call   1050 <iRobot_Stop@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IRobotStopCleaningAndDock>:
push   %rax
xor    %eax,%eax
call   1030 <iRobot_Start@plt>
xor    %eax,%eax
call   1060 <iRobot_Dock@plt>
xor    %eax,%eax
call   1050 <iRobot_Stop@plt>
mov    $0x7d0,%edi
call   1040 <DelayTime@plt>
xor    %eax,%eax
call   1030 <iRobot_Start@plt>
xor    %eax,%eax
call   1060 <iRobot_Dock@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <iRobot_Stop@plt>

LLVM IR (-O0):
define void @IRobotStopCleaningAndDock() {
%1 = call i32 (...) @iRobot_Start()
%2 = call i32 (...) @iRobot_Dock()
%3 = call i32 (...) @iRobot_Stop()
%4 = call i32 @DelayTime(i32 2000)
%5 = call i32 (...) @iRobot_Start()
%6 = call i32 (...) @iRobot_Dock()
%7 = call i32 (...) @iRobot_Stop()
ret void
}

LLVM IR (-O2):
define void @IRobotStopCleaningAndDock() {
%1 = tail call i32 (...) @iRobot_Start()
%2 = tail call i32 (...) @iRobot_Dock()
%3 = tail call i32 (...) @iRobot_Stop()
%4 = tail call i32 @DelayTime(i32 2000)
%5 = tail call i32 (...) @iRobot_Start()
%6 = tail call i32 (...) @iRobot_Dock()
%7 = tail call i32 (...) @iRobot_Stop()
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
double *crear_vector(int tam) {
  double *v;
  v = (double *)malloc(tam * sizeof(double));
  return v;
}


x86 assembly (clang, -O0):
<crear_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crear_vector>:
shl    $0x3,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define double* @crear_vector(i32 %0) {
%2 = alloca i32
%3 = alloca double*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 8
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to double*
store double* %9, double** %3
%10 = load double*, double** %3
ret double* %10
}

LLVM IR (-O2):
define double* @crear_vector(i32 %0) {
%2 = shl i32 %0, 3
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to double*
ret double* %4
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR5A_set(void) { return U_WMRCORENONE_set("U_WMR5A"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR5A\00"
define i8* @U_WMR5A_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_WMR5A\00"
define i8* @U_WMR5A_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*/ barrier();
void smp_wmb() { barrier(); }


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

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

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

LLVM IR (-O2):
define void @smp_wmb() {
%1 = tail call i32 (...) @barrier()
ret void
}
/* Variables and functions */
int PnameRef();
PcellNameRef() {
  int b = -1;
  ;
  b = PnameRef();
  return (b);
}


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

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

LLVM IR (-O0):
define i32 @PcellNameRef() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = call i32 (...) @PnameRef()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @PcellNameRef() {
%1 = tail call i32 (...) @PnameRef()
ret i32 %1
}
unsigned xrop3_61_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D | S;
  stk3 = ~stk3;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_61_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_61_1_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
lea    (%rcx,%rdi,1),%eax
mov    %esi,%edx
shl    $0x8,%edx
or     %esi,%edx
xor    $0xffffff00,%ecx
or     %edx,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_61_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %10
%27 = xor i32 %26, -1
store i32 %27, i32* %10
%28 = load i32, i32* %7
%29 = load i32, i32* %10
%30 = or i32 %28, %29
store i32 %30, i32* %9
%31 = load i32, i32* %6
%32 = load i32, i32* %9
%33 = xor i32 %31, %32
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = load i32, i32* %6
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %5
%39 = load i32, i32* %6
%40 = and i32 %38, %39
%41 = or i32 %37, %40
ret i32 %41
}

LLVM IR (-O2):
define i32 @xrop3_61_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = mul nuw nsw i32 %6, 257
%8 = xor i32 %4, -256
%9 = or i32 %7, %8
%10 = xor i32 %5, -1
%11 = and i32 %9, %10
%12 = or i32 %11, %3
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ fibonacci(unsigned int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int main() {
  unsigned int x;
  printf("Input the count (>0) of fibonacci numbers: ");
  scanf("%d", &x);
  printf("fibonacci sequence: ");
  (void)fibonacci(x);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <fibonacci@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
lea    0xeca(%rip),%rdi
call   1040 <printf@plt>
mov    0x4(%rsp),%edi
call   1050 <fibonacci@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Input the count (>0) of fibonacci numbers: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"fibonacci sequence: \00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = call i32 @fibonacci(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c"Input the count (>0) of fibonacci numbers: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"fibonacci sequence: \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* %1
%7 = call i32 @fibonacci(i32 %6)
%8 = call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
scalar_t__ read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ write(int, char *, int);
void disp_stdin(void) {
  char buffer;
  while (read(0, &buffer, 1) != 0)
    write(1, &buffer, 1);
}


x86 assembly (clang, -O0):
<disp_stdin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0x0,%rax
je     1157 <disp_stdin+0x37>
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
jmp    1128 <disp_stdin+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disp_stdin>:
push   %rbx
sub    $0x10,%rsp
lea    0xf(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1040 <read@plt>
test   %rax,%rax
je     1166 <disp_stdin+0x46>
lea    0xf(%rsp),%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <read@plt>
test   %rax,%rax
jne    1140 <disp_stdin+0x20>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @disp_stdin() {
%1 = alloca i8
br label %2
2: ; preds = %5, %0
%3 = call i64 @read(i32 0, i8* %1, i32 1)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = call i32 @write(i32 1, i8* %1, i32 1)
br label %2
7: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @disp_stdin() {
%1 = alloca i8
%2 = call i64 @read(i32 0, i8* %1, i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %0, %4
%5 = call i32 @write(i32 1, i8* %1, i32 1)
%6 = call i64 @read(i32 0, i8* %1, i32 1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %4
8: ; preds = %4, %0
ret void
}
/* Variables and functions */
char *stdc_73EAE03D(char const *, int);
char *strrchr(const char *s, int c) { return stdc_73EAE03D(s, c); }


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

x86 assembly (clang, -O2):
<strrchr>:
jmp    1030 <stdc_73EAE03D@plt>

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = tail call i8* @stdc_73EAE03D(i8* %0, i32 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("usage: [--daemon] NAME\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"usage: [--daemon] NAME\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [23 x i8] c"usage: [--daemon] NAME\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int SIM_power_draincap(double, int, int);
double SIM_array_comp_bit_mismatch_cap(void) {
  return (3 * SIM_power_draincap((20.0 * 0.0875), 1, 1) +
          SIM_power_draincap((20.0 * 0.0875), 1, 2));
}


x86 assembly (clang, -O0):
<SIM_array_comp_bit_mismatch_cap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xee0(%rip),%xmm0
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <SIM_power_draincap@plt>
imul   $0x3,%eax,%eax
mov    %eax,-0x4(%rbp)
movsd  0xec6(%rip),%xmm0
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <SIM_power_draincap@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIM_array_comp_bit_mismatch_cap>:
push   %rbx
movsd  0xee7(%rip),%xmm0
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <SIM_power_draincap@plt>
lea    (%rax,%rax,2),%ebx
movsd  0xecd(%rip),%xmm0
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <SIM_power_draincap@plt>
add    %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @SIM_array_comp_bit_mismatch_cap() {
%1 = call i32 @SIM_power_draincap(double 1.750000e+00, i32 1, i32 1)
%2 = mul nsw i32 3, %1
%3 = call i32 @SIM_power_draincap(double 1.750000e+00, i32 1, i32 2)
%4 = add nsw i32 %2, %3
%5 = sitofp i32 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @SIM_array_comp_bit_mismatch_cap() {
%1 = tail call i32 @SIM_power_draincap(double 1.750000e+00, i32 1, i32 1)
%2 = mul nsw i32 %1, 3
%3 = tail call i32 @SIM_power_draincap(double 1.750000e+00, i32 1, i32 2)
%4 = add nsw i32 %2, %3
%5 = sitofp i32 %4 to double
ret double %5
}
void __attribute__((section(".fini"))) func2(void) {}


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


x86 assembly (clang, -O2):
<func2>:
ret
add    $0x8,%rsp
ret


LLVM IR (-O0):
define void @func2() section ".fini" {
ret void
}

LLVM IR (-O2):
define void @func2() section ".fini" {
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 *);
int main(void) {
  char *code = "#include<stdio.h> \nint main(void){ \n\tputs(\"hello "
               "world!\"); \n\treturn 0; \n}";
  FILE *file;
  file = fopen("hello.c", "w");
  if (file)
    fprintf(file, code);
  fclose(file);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xef9(%rip),%rdi
lea    0xefa(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1179 <main+0x49>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf12(%rip),%rdi
lea    0xf13(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1165 <main+0x35>
lea    0xead(%rip),%rdi
mov    $0x49,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [74 x i8] c"#include<stdio.h> \0Aint main(void){ \0A\09puts(\22hello world!\22); \0A\09return 0; \0A}\00"
@.str.1 = [8 x i8] c"hello.c\00"
@.str.2 = [2 x i8] c"w\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32*
store i32 0, i32* %1
store i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i32*, i32** %3
%9 = load i8*, i8** %2
%10 = call i32 @fprintf(i32* %8, i8* %9)
br label %11
11: ; preds = %7, %0
%12 = load i32*, i32** %3
%13 = call i32 @fclose(i32* %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [74 x i8] c"#include<stdio.h> \0Aint main(void){ \0A\09puts(\22hello world!\22); \0A\09return 0; \0A}\00"
@.str.1 = [8 x i8] c"hello.c\00"
@.str.2 = [2 x i8] c"w\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i64 73, i64 1, i32* %1)
br label %5
5: ; preds = %3, %0
%6 = tail call i32 @fclose(i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x = 10, y = 20;
  y *= x;
  printf("integer multiplication: %d\n", y);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [28 x i8] c"integer multiplication: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 200)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  if (n & 1) {
    printf("%d is odd\n", n);
  } else {
    printf("%d is even\n", n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1162 <main+0x42>
mov    -0x8(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
jmp    1171 <main+0x51>
mov    -0x8(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
test   $0x1,%sil
lea    0xecd(%rip),%rax
lea    0xebb(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"%d is odd\0A\00"
@.str.2 = [12 x i8] c"%d is even\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0)
%8 = call i32 @printf(i8* %7, i32 %4)
ret i32 0
}
/* Variables and functions */
char *proc(char const *);
char *wrap_strdup(const char *str) { return proc(str); }


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

x86 assembly (clang, -O2):
<wrap_strdup>:
jmp    1030 <proc@plt>

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

LLVM IR (-O2):
define i8* @wrap_strdup(i8* %0) {
%2 = tail call i8* @proc(i8* %0)
ret i8* %2
}
/* Type definitions */
struct bkey {
  int dummy;
};
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int bkey_u64s(struct bkey const *);
struct bkey *bkey_next(const struct bkey *k) {
  __u64 *d = (void *)k;
  return (struct bkey *)(d + bkey_u64s(k));
}


x86 assembly (clang, -O0):
<bkey_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <bkey_u64s@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bkey_next>:
push   %rbx
mov    %rdi,%rbx
call   1030 <bkey_u64s@plt>
cltq
lea    (%rbx,%rax,4),%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.bkey = type { i32 }
define %struct.bkey* @bkey_next(%struct.bkey* %0) {
%2 = alloca %struct.bkey*
%3 = alloca i32*
store %struct.bkey* %0, %struct.bkey** %2
%4 = load %struct.bkey*, %struct.bkey** %2
%5 = bitcast %struct.bkey* %4 to i8*
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = load %struct.bkey*, %struct.bkey** %2
%9 = call i32 @bkey_u64s(%struct.bkey* %8)
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %7, i64 %10
%12 = bitcast i32* %11 to %struct.bkey*
ret %struct.bkey* %12
}

LLVM IR (-O2):
%struct.bkey = type { i32 }
define %struct.bkey* @bkey_next(%struct.bkey* %0) {
%2 = tail call i32 @bkey_u64s(%struct.bkey* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds %struct.bkey, %struct.bkey* %0, i64 %3, i32 0
%5 = bitcast i32* %4 to %struct.bkey*
ret %struct.bkey* %5
}
__attribute__((visibility("hidden"))) int gd_get_ep_type(int ep_fd) {
  return 0;
}


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

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

LLVM IR (-O0):
define hidden i32 @gd_get_ep_type(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 0
}

LLVM IR (-O2):
define hidden i32 @gd_get_ep_type(i32 %0) {
ret i32 0
}