xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ cgau2(double *, int, double *, double *, int, int);
void cgau2_packet(double *x, int sigInLength, double *f, int sigOutLength,
                  double ys) {
  cgau2(x, sigInLength, f, f + sigInLength, sigOutLength, 1);
  return;
}


x86 assembly (clang, -O0):
<cgau2_packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x18(%rbp),%rcx
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x1,%r9d
call   1030 <cgau2@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgau2_packet>:
mov    %ecx,%r8d
movslq %esi,%rsi
lea    (%rdx,%rsi,8),%rcx
mov    $0x1,%r9d
jmp    1030 <cgau2@plt>

LLVM IR (-O0):
define void @cgau2_packet(double* %0, i32 %1, double* %2, i32 %3, double %4) {
%6 = alloca double*
%7 = alloca i32
%8 = alloca double*
%9 = alloca i32
%10 = alloca double
store double* %0, double** %6
store i32 %1, i32* %7
store double* %2, double** %8
store i32 %3, i32* %9
store double %4, double* %10
%11 = load double*, double** %6
%12 = load i32, i32* %7
%13 = load double*, double** %8
%14 = load double*, double** %8
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %14, i64 %16
%18 = load i32, i32* %9
%19 = call i32 @cgau2(double* %11, i32 %12, double* %13, double* %17, i32 %18, i32 1)
ret void
}

LLVM IR (-O2):
define void @cgau2_packet(double* %0, i32 %1, double* %2, i32 %3, double %4) {
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds double, double* %2, i64 %6
%8 = tail call i32 @cgau2(double* %0, i32 %1, double* %2, double* %7, i32 %3, i32 1)
ret void
}
void gtk_widget_get_events() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_get_events() {
ret void
}
void ExttFieldTypeAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttFieldTypeAuxTable() {
ret void
}
/* Variables and functions */
int mkstemps(char *, int);
int no_resourceLeak_mkstemps_02(char *template, int suffixlen) {
  return mkstemps(template, suffixlen);
}


x86 assembly (clang, -O0):
<no_resourceLeak_mkstemps_02>:
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 <mkstemps@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_resourceLeak_mkstemps_02>:
jmp    1030 <mkstemps@plt>

LLVM IR (-O0):
define i32 @no_resourceLeak_mkstemps_02(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 i32 @mkstemps(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @no_resourceLeak_mkstemps_02(i8* %0, i32 %1) {
%3 = tail call i32 @mkstemps(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
size_t strlen(const char *str) {
  long len = 0;
  while (*str++)
    len++;
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1139 <strlen+0x39>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
void test_fork() {
  unsigned long int max = 9999999999999999, i, n1 = 1, n2 = 0;
  for (i = 2; i < max; i++) {
    int temp = n1 + n2;
    n2 = n1;
    n1 = temp;
  }
}


x86 assembly (clang, -O0):
<test_fork>:
push   %rbp
mov    %rsp,%rbp
movabs $0x2386f26fc0ffff,%rax
mov    %rax,-0x8(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1164 <test_fork+0x64>
mov    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
movslq -0x24(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112a <test_fork+0x2a>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_fork() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
store i64 9999999999999999, i64* %1
store i64 1, i64* %3
store i64 0, i64* %4
store i64 2, i64* %2
br label %6
6: ; preds = %18, %0
%7 = load i64, i64* %2
%8 = load i64, i64* %1
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = add i64 %11, %12
%14 = trunc i64 %13 to i32
store i32 %14, i32* %5
%15 = load i64, i64* %3
store i64 %15, i64* %4
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
store i64 %17, i64* %3
br label %18
18: ; preds = %10
%19 = load i64, i64* %2
%20 = add i64 %19, 1
store i64 %20, i64* %2
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @test_fork() {
ret void
}
float f_sin_xx_8(float xx) {
  return 0.7853981633974483 + xx * (-0.08074551202387524 +
                                    xx * (0.002490393182719242 +
                                          xx * (-3.657233242102226e-05 +
                                                xx * (3.089664734016052e-07))));
}


x86 assembly (clang, -O0):
<f_sin_xx_8>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x4(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  -0x4(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
movsd  0xee3(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  0xedf(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xebf(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xea7(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe8f(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_sin_xx_8>:
cvtss2sd %xmm0,%xmm0
movsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef0(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xeec(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xee8(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xee4(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @f_sin_xx_8(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = load float, float* %2
%10 = fpext float %9 to double
%11 = call double @llvm.fmuladd.f64(double %10, double 0x3E94BC00EB9ED001, double 0xBF032CA7C603B161)
%12 = call double @llvm.fmuladd.f64(double %8, double %11, double 0x3F6466BBA8C448CE)
%13 = call double @llvm.fmuladd.f64(double %6, double %12, double 0xBFB4ABBCE570FA47)
%14 = call double @llvm.fmuladd.f64(double %4, double %13, double 0x3FE921FB54442D18)
%15 = fptrunc double %14 to float
ret float %15
}

LLVM IR (-O2):
define float @f_sin_xx_8(float %0) {
%2 = fpext float %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 0x3E94BC00EB9ED001, double 0xBF032CA7C603B161)
%4 = tail call double @llvm.fmuladd.f64(double %2, double %3, double 0x3F6466BBA8C448CE)
%5 = tail call double @llvm.fmuladd.f64(double %2, double %4, double 0xBFB4ABBCE570FA47)
%6 = tail call double @llvm.fmuladd.f64(double %2, double %5, double 0x3FE921FB54442D18)
%7 = fptrunc double %6 to float
ret float %7
}
/* Variables and functions */
int bitcount(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() { printf("%d\n%d\n", bitcount(0b11111), bitcount(0b010101)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1f,%edi
call   1040 <bitcount@plt>
mov    %eax,-0x4(%rbp)
mov    $0x15,%edi
call   1040 <bitcount@plt>
mov    -0x4(%rbp),%esi
mov    %eax,%edx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1f,%edi
call   1040 <bitcount@plt>
mov    %eax,%ebx
mov    $0x15,%edi
call   1040 <bitcount@plt>
lea    0xec2(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d\0A%d\0A\00"
define i32 @main() {
%1 = call i32 @bitcount(i32 31)
%2 = call i32 @bitcount(i32 21)
%3 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d\0A%d\0A\00"
define i32 @main() {
%1 = tail call i32 @bitcount(i32 31)
%2 = tail call i32 @bitcount(i32 21)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ toto(int *);
int bar2() {
  int res;
  toto(&res);
  return res;
}


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

x86 assembly (clang, -O2):
<bar2>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <toto@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bar2() {
%1 = alloca i32
%2 = call i32 @toto(i32* %1)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @bar2() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @toto(i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}
/* Variables and functions */
scalar_t__ geteuid();
int isroot(void) {
  if (geteuid() == 0)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<isroot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <geteuid@plt>
cmp    $0x0,%rax
jne    1135 <isroot+0x25>
movl   $0x1,-0x4(%rbp)
jmp    113c <isroot+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isroot>:
push   %rax
xor    %eax,%eax
call   1030 <geteuid@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isroot() {
%1 = alloca i32
%2 = call i64 (...) @geteuid()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @isroot() {
%1 = tail call i64 (...) @geteuid()
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ readfile();
int /*<<< orphan*/ writefile();
int main(int argn, char **argv) {
  writefile();
  readfile();
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @writefile()
%6 = call i32 (...) @readfile()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @writefile()
%4 = tail call i32 (...) @readfile()
ret i32 0
}
/* Variables and functions */
scalar_t__ pow(float, int);
float sqrt(scalar_t__);
float calcDistance(float valx1, float valy1, float valx2, float valy2) {
  return sqrt(pow(valx1 - valx2, 2) + pow(valy1 - valy2, 2));
}


x86 assembly (clang, -O0):
<calcDistance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %rax,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    -0x18(%rbp),%rdi
add    %rax,%rdi
call   1040 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcDistance>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm3,0xc(%rsp)
movss  %xmm1,0x8(%rsp)
subss  %xmm2,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %rax,%rbx
movss  0x8(%rsp),%xmm0
subss  0xc(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
add    %rax,%rbx
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define float @calcDistance(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %7
%11 = fsub float %9, %10
%12 = call i64 @pow(float %11, i32 2)
%13 = load float, float* %6
%14 = load float, float* %8
%15 = fsub float %13, %14
%16 = call i64 @pow(float %15, i32 2)
%17 = add nsw i64 %12, %16
%18 = call float @sqrt(i64 %17)
ret float %18
}

LLVM IR (-O2):
define float @calcDistance(float %0, float %1, float %2, float %3) {
%5 = fsub float %0, %2
%6 = tail call i64 @pow(float %5, i32 2)
%7 = fsub float %1, %3
%8 = tail call i64 @pow(float %7, i32 2)
%9 = add nsw i64 %8, %6
%10 = tail call float @sqrt(i64 %9)
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void b_putchar_16(short idx, short *cells, int size) {
  putchar((int)cells[idx]);
}


x86 assembly (clang, -O0):
<b_putchar_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movswq -0x2(%rbp),%rcx
movswl (%rax,%rcx,2),%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_putchar_16>:
movslq %edi,%rax
movswl (%rsi,%rax,2),%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @b_putchar_16(i16 signext %0, i16* %1, i32 %2) {
%4 = alloca i16
%5 = alloca i16*
%6 = alloca i32
store i16 %0, i16* %4
store i16* %1, i16** %5
store i32 %2, i32* %6
%7 = load i16*, i16** %5
%8 = load i16, i16* %4
%9 = sext i16 %8 to i64
%10 = getelementptr inbounds i16, i16* %7, i64 %9
%11 = load i16, i16* %10
%12 = sext i16 %11 to i32
%13 = call i32 @putchar(i32 %12)
ret void
}

LLVM IR (-O2):
define void @b_putchar_16(i16 signext %0, i16* nocapture %1, i32 %2) {
%4 = sext i16 %0 to i64
%5 = getelementptr inbounds i16, i16* %1, i64 %4
%6 = load i16, i16* %5
%7 = sext i16 %6 to i32
%8 = tail call i32 @putchar(i32 %7)
ret void
}
/* Variables and functions */
int faculty(int /*<<< orphan*/);
int /*<<< orphan*/ power(int, int);
int main(void) { return faculty(power(5, 8)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
mov    $0x8,%esi
call   1040 <power@plt>
mov    %eax,%edi
call   1030 <faculty@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x8,%esi
call   1040 <power@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <faculty@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @power(i32 5, i32 8)
%3 = call i32 @faculty(i32 %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @power(i32 5, i32 8)
%2 = tail call i32 @faculty(i32 %1)
ret i32 %2
}
/* Variables and functions */
double strtod(char const *, char **);
double GO_atof(const char *s) { return strtod(s, (char **)NULL); }


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

x86 assembly (clang, -O2):
<GO_atof>:
xor    %esi,%esi
jmp    1030 <strtod@plt>

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

LLVM IR (-O2):
define double @GO_atof(i8* nocapture %0) {
%2 = tail call double @strtod(i8* nocapture %0, i8** null)
ret double %2
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int compLT(char *key1, char *key2) {
  int rc = 0;
  if (strcmp(key1, key2) < 0)
    rc = 1;
  return rc;
}


x86 assembly (clang, -O0):
<compLT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jge    1145 <compLT+0x35>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compLT>:
push   %rax
call   1030 <strcmp@plt>
shr    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @compLT(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i64 @strcmp(i8* %6, i8* %7)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %5
br label %11
11: ; preds = %10, %2
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @compLT(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = lshr i64 %3, 63
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
float *_zero_arr_plus_float_fn(float *, int, int, char const *, unsigned int);
float *_zero_arr_inplace_plus_float_fn(float **x, int orig_i,
                                       const char *filename, unsigned lineno) {
  *x = _zero_arr_plus_float_fn(*x, 1, orig_i, filename, lineno);
  return *x;
}


x86 assembly (clang, -O0):
<_zero_arr_inplace_plus_float_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x1,%esi
call   1030 <_zero_arr_plus_float_fn@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_zero_arr_inplace_plus_float_fn>:
push   %rbx
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    $0x1,%esi
call   1030 <_zero_arr_plus_float_fn@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define float* @_zero_arr_inplace_plus_float_fn(float** %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca float**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store float** %0, float*** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load float**, float*** %5
%10 = load float*, float** %9
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = call float* @_zero_arr_plus_float_fn(float* %10, i32 1, i32 %11, i8* %12, i32 %13)
%15 = load float**, float*** %5
store float* %14, float** %15
%16 = load float**, float*** %5
%17 = load float*, float** %16
ret float* %17
}

LLVM IR (-O2):
define float* @_zero_arr_inplace_plus_float_fn(float** nocapture %0, i32 %1, i8* %2, i32 %3) {
%5 = load float*, float** %0
%6 = tail call float* @_zero_arr_plus_float_fn(float* %5, i32 1, i32 %1, i8* %2, i32 %3)
store float* %6, float** %0
ret float* %6
}
/* Variables and functions */
int cbuf(int, int, int);
cbuf13(int f, int n) { return (cbuf(f, n, 13)); }


x86 assembly (clang, -O0):
<cbuf13>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0xd,%edx
call   1030 <cbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf13>:
mov    $0xd,%edx
jmp    1030 <cbuf@plt>

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

LLVM IR (-O2):
define i32 @cbuf13(i32 %0, i32 %1) {
%3 = tail call i32 @cbuf(i32 %0, i32 %1, i32 13)
ret i32 %3
}
/* Variables and functions */
int ENOMEM;
int /*<<< orphan*/ printf(char *, char *);
int putenv(char *str) {
  printf("WARNING: putenv('%s')\n", str);
  return ENOMEM;
}


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

x86 assembly (clang, -O2):
<putenv>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"WARNING: putenv('%s')\0A\00"
@ENOMEM = global i32 0
define i32 @putenv(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @ENOMEM
ret i32 %5
}

LLVM IR (-O2):
@.str = [23 x i8] c"WARNING: putenv('%s')\0A\00"
@ENOMEM = global i32 0
define i32 @putenv(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @ENOMEM
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ link_error1();
void test6(int x, int y) {
  if ((x <= y) || (y < x)) {
  } else
    link_error1();
}


x86 assembly (clang, -O0):
<test6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1136 <test6+0x26>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    113b <test6+0x2b>
jmp    1142 <test6+0x32>
mov    $0x0,%al
call   1030 <link_error1@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test6(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sle i32 %5, %6
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %8, %2
br label %15
13: ; preds = %8
%14 = call i32 (...) @link_error1()
br label %15
15: ; preds = %13, %12
ret void
}

LLVM IR (-O2):
define void @test6(i32 %0, i32 %1) {
ret void
}
void AONBatMonEnable(void) {
  (*((volatile unsigned long *)(0x40095000 + 0x00000000))) =
      0x00000002 | 0x00000001;
}


x86 assembly (clang, -O0):
<AONBatMonEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40095000,%eax
movq   $0x3,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AONBatMonEnable>:
movq   $0x3,0x40095000
ret

LLVM IR (-O0):
define void @AONBatMonEnable() {
store volatile i64 3, i64* inttoptr (i64 1074352128 to i64*)
ret void
}

LLVM IR (-O2):
define void @AONBatMonEnable() {
store volatile i64 3, i64* inttoptr (i64 1074352128 to i64*)
ret void
}
int absMathInteger(int i) {
  if (i >= 0) {
    return i;
  } else {
    return -i;
  }
}


x86 assembly (clang, -O0):
<absMathInteger>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111c <absMathInteger+0x1c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <absMathInteger+0x24>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<absMathInteger>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @absMathInteger(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %3
store i32 %7, i32* %2
br label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sub nsw i32 0, %9
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @absMathInteger(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
uint32_t naive_clz(uint32_t x) {
  uint32_t m, i;
  assert(x != 0);
  m = 0x80000000u;
  i = 0;
  while ((x & m) == 0) {
    i++;
    m >>= 1;
  }
  return i;
}


x86 assembly (clang, -O0):
<naive_clz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x80000000,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
jne    1160 <naive_clz+0x50>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113a <naive_clz+0x2a>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<naive_clz>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
test   %ebx,%ebx
setne  %dil
call   1030 <assert@plt>
test   %ebx,%ebx
js     113b <naive_clz+0x2b>
mov    $0x80000000,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
sar    %ecx
test   %ebx,%ecx
je     1130 <naive_clz+0x20>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @naive_clz(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
store i32 -2147483648, i32* %3
store i32 0, i32* %4
br label %9
9: ; preds = %14, %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = and i32 %10, %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %9
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
%17 = load i32, i32* %3
%18 = ashr i32 %17, 1
store i32 %18, i32* %3
br label %9
19: ; preds = %9
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @naive_clz(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = icmp sgt i32 %0, -1
br i1 %5, label %6, label %13
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ 0, %1 ]
%8 = phi i32 [ %10, %6 ], [ -2147483648, %1 ]
%9 = add nuw nsw i32 %7, 1
%10 = ashr i32 %8, 1
%11 = and i32 %10, %0
%12 = icmp eq i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %1
%14 = phi i32 [ 0, %1 ], [ %9, %6 ]
ret i32 %14
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ addNode(struct node *, int /*<<< orphan*/);
int /*<<< orphan*/ initNode(int);
void addNewNode(struct node *ptr, int val) { addNode(ptr, initNode(val)); }


x86 assembly (clang, -O0):
<addNewNode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <initNode@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <addNode@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addNewNode>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <initNode@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <addNode@plt>

LLVM IR (-O0):
%struct.node = type { i32 }
define void @addNewNode(%struct.node* %0, i32 %1) {
%3 = alloca %struct.node*
%4 = alloca i32
store %struct.node* %0, %struct.node** %3
store i32 %1, i32* %4
%5 = load %struct.node*, %struct.node** %3
%6 = load i32, i32* %4
%7 = call i32 @initNode(i32 %6)
%8 = call i32 @addNode(%struct.node* %5, i32 %7)
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
define void @addNewNode(%struct.node* %0, i32 %1) {
%3 = tail call i32 @initNode(i32 %1)
%4 = tail call i32 @addNode(%struct.node* %0, i32 %3)
ret void
}
void pthread_mutex_unlock() {}


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

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

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

LLVM IR (-O2):
define void @pthread_mutex_unlock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ console_tx_hex16(unsigned short);
void print_spew_hex16(unsigned short value) { console_tx_hex16(value); }


x86 assembly (clang, -O0):
<print_spew_hex16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <console_tx_hex16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_spew_hex16>:
jmp    1030 <console_tx_hex16@plt>

LLVM IR (-O0):
define void @print_spew_hex16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @console_tx_hex16(i16 zeroext %3)
ret void
}

LLVM IR (-O2):
define void @print_spew_hex16(i16 zeroext %0) {
%2 = tail call i32 @console_tx_hex16(i16 zeroext %0)
ret void
}
/* Variables and functions */
int byte_at(size_t, size_t, int);
int poison_at(size_t start, size_t len) { return byte_at(start, len, 0xa9); }


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

x86 assembly (clang, -O2):
<poison_at>:
mov    $0xa9,%edx
jmp    1030 <byte_at@plt>

LLVM IR (-O0):
define i32 @poison_at(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 = call i32 @byte_at(i64 %5, i64 %6, i32 169)
ret i32 %7
}

LLVM IR (-O2):
define i32 @poison_at(i64 %0, i64 %1) {
%3 = tail call i32 @byte_at(i64 %0, i64 %1, i32 169)
ret i32 %3
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, ...);
void handler() {
  printf("signal handler func\n");
  printf("pid is %d\n", getpid());
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rax
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rcx
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"signal handler func\0A\00"
@.str.1 = [11 x i8] c"pid is %d\0A\00"
define void @handler() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getpid()
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret void
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"pid is %d\0A\00"
@str = [20 x i8] c"signal handler func\00"
define void @handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void switch1() {
  int x = 2;
  switch (x) {
  case 1:
    puts("valor de x == 1");
    break;
  case 2:
    puts("valor de x == 2");
  }
}


x86 assembly (clang, -O0):
<switch1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x1,%eax
je     1144 <switch1+0x34>
jmp    1133 <switch1+0x23>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     1155 <switch1+0x45>
jmp    1161 <switch1+0x51>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
jmp    1161 <switch1+0x51>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"valor de x == 1\00"
@.str.1 = [16 x i8] c"valor de x == 2\00"
define void @switch1() {
%1 = alloca i32
store i32 2, i32* %1
%2 = load i32, i32* %1
switch i32 %2, label %7 [
i32 1, label %3
i32 2, label %5
]
3: ; preds = %0
%4 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %0, %3
ret void
}

LLVM IR (-O2):
@.str.1 = [16 x i8] c"valor de x == 2\00"
define void @switch1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ function();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int result = 0;
  function();
  result = add(5, 7);
  printf("5 + 7 = %d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1050 <function@plt>
mov    $0x5,%edi
mov    $0x7,%esi
call   1030 <add@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <function@plt>
mov    $0x5,%edi
mov    $0x7,%esi
call   1030 <add@plt>
lea    0xeb2(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"5 + 7 = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @function()
%2 = tail call i32 @add(i32 5, i32 7)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ejtag_switch(int, long);
int mips_ejtag_write_w(unsigned int addr, unsigned int data) {
  int cmd[2];
  addr &= 0x1fffffff;
  cmd[0] = addr;
  cmd[1] = data;
  ejtag_switch(0x2000, (long)cmd);
  return 0;
}


x86 assembly (clang, -O0):
<mips_ejtag_write_w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1fffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rsi
mov    $0x2000,%edi
call   1030 <ejtag_switch@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mips_ejtag_write_w>:
push   %rax
and    $0x1fffffff,%edi
mov    %edi,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%rsi
mov    $0x2000,%edi
call   1030 <ejtag_switch@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mips_ejtag_write_w(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i32]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = and i32 %6, 536870911
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %8, i32* %9
%10 = load i32, i32* %4
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %10, i32* %11
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%13 = ptrtoint i32* %12 to i64
%14 = call i32 @ejtag_switch(i32 8192, i64 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @mips_ejtag_write_w(i32 %0, i32 %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = and i32 %0, 536870911
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 %5, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 %1, i32* %7
%8 = ptrtoint [2 x i32]* %3 to i64
%9 = call i32 @ejtag_switch(i32 8192, i64 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void isAlreadyUnlocked(void) { printf("That is already unlocked.\n"); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"That is already unlocked.\0A\00"
define void @isAlreadyUnlocked() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"That is already unlocked.\00"
define void @isAlreadyUnlocked() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void blogc_print_usage(void) {
  printf("usage: blogc "
         "[-h] [-v] [-d] [-i] [-l [-e SOURCE]] [-D KEY=VALUE ...] [-p KEY]\n"
         "             [-t TEMPLATE] [-o OUTPUT] [SOURCE ...]\n");
}


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

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

LLVM IR (-O0):
@.str = [131 x i8] c"usage: blogc [-h] [-v] [-d] [-i] [-l [-e SOURCE]] [-D KEY=VALUE ...] [-p KEY]\0A [-t TEMPLATE] [-o OUTPUT] [SOURCE ...]\0A\00"
define void @blogc_print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [130 x i8] c"usage: blogc [-h] [-v] [-d] [-i] [-l [-e SOURCE]] [-D KEY=VALUE ...] [-p KEY]\0A [-t TEMPLATE] [-o OUTPUT] [SOURCE ...]\00"
define void @blogc_print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([130 x i8], [130 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct list_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ scan_sexp(char *, struct list_t **);
struct list_t *scan(char *input) {
  struct list_t *sexp = NULL;
  scan_sexp(input, &sexp);
  return sexp;
}


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

x86 assembly (clang, -O2):
<scan>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rsi
call   1030 <scan_sexp@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.list_t = type { i32 }
define %struct.list_t* @scan(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.list_t*
store i8* %0, i8** %2
store %struct.list_t* null, %struct.list_t** %3
%4 = load i8*, i8** %2
%5 = call i32 @scan_sexp(i8* %4, %struct.list_t** %3)
%6 = load %struct.list_t*, %struct.list_t** %3
ret %struct.list_t* %6
}

LLVM IR (-O2):
%struct.list_t = type { i32 }
define %struct.list_t* @scan(i8* %0) {
%2 = alloca %struct.list_t*
%3 = bitcast %struct.list_t** %2 to i8*
store %struct.list_t* null, %struct.list_t** %2
%4 = call i32 @scan_sexp(i8* %0, %struct.list_t** %2)
%5 = load %struct.list_t*, %struct.list_t** %2
ret %struct.list_t* %5
}
/* Variables and functions */
int Find(int *, int);
int Union(int *set, int p, int q) {
  int root_p = Find(set, p);
  int root_q = Find(set, q);
  set[root_p] = root_q;
  return root_q;
}


x86 assembly (clang, -O0):
<Union>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <Find@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <Find@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Union>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rdi,%rbx
call   1030 <Find@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <Find@plt>
movslq %ebp,%rcx
mov    %eax,(%rbx,%rcx,4)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @Union(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @Find(i32* %0, i32 %1)
%5 = tail call i32 @Find(i32* %0, i32 %2)
%6 = sext i32 %4 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
store i32 %5, i32* %7
ret i32 %5
}
void test___atomic_add_fetch_2(int *mem) { __atomic_add_fetch(mem, 1, 4); }


x86 assembly (clang, -O0):
<test___atomic_add_fetch_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,%eax
lock xadd %eax,(%rdx)
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test___atomic_add_fetch_2>:
lock addl $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @test___atomic_add_fetch_2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
store i32 1, i32* %3
%6 = load i32, i32* %3
%7 = atomicrmw add i32* %5, i32 %6 acq_rel
%8 = add i32 %7, %6
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @test___atomic_add_fetch_2(i32* nocapture %0) {
%2 = atomicrmw add i32* %0, i32 1 acq_rel
ret void
}
int test_imm_BCuint16_mem(unsigned short *val) {
  return ((*val) & (-0xBC << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_BCuint16_mem>:
movzwl (%rdi),%eax
test   $0xff44,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_BCuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -188
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
size_t bellIndex(int, int);
void setBell(int *bellTri, int row, int col, int value) {
  size_t index = bellIndex(row, col);
  bellTri[index] = value;
}


x86 assembly (clang, -O0):
<setBell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <bellIndex@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setBell>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdi,%rbx
mov    %esi,%edi
mov    %edx,%esi
call   1030 <bellIndex@plt>
mov    %ebp,(%rbx,%rax,4)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @setBell(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i64
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = call i64 @bellIndex(i32 %10, i32 %11)
store i64 %12, i64* %9
%13 = load i32, i32* %8
%14 = load i32*, i32** %5
%15 = load i64, i64* %9
%16 = getelementptr inbounds i32, i32* %14, i64 %15
store i32 %13, i32* %16
ret void
}

LLVM IR (-O2):
define void @setBell(i32* nocapture writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i64 @bellIndex(i32 %1, i32 %2)
%6 = getelementptr inbounds i32, i32* %0, i64 %5
store i32 %3, i32* %6
ret void
}
void mce_intel_feature_init(struct cpuinfo_x86 *c) {}


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

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

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

LLVM IR (-O2):
%struct.cpuinfo_x86 = type opaque
define void @mce_intel_feature_init(%struct.cpuinfo_x86* nocapture %0) {
ret void
}
int test_primitive() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @test_primitive() {
ret i32 0
}
void status() { ; }


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

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

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

LLVM IR (-O2):
define void @status() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvSetNumLeadInPixels(char byBoardNum, short wNumLeadInPixels) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvSetNumLeadInPixels>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
lea    0xed4(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvSetNumLeadInPixels(i8 signext %0, i16 signext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvSetNumLeadInPixels(i8 signext %0, i16 signext %1) {
%3 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}