xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void stSafeCFree(void *mem) {
  if (mem != NULL) {
    free(mem);
  }
}


x86 assembly (clang, -O0):
<stSafeCFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <stSafeCFree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stSafeCFree>:
test   %rdi,%rdi
je     111a <stSafeCFree+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @stSafeCFree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @stSafeCFree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int main() {
  int x;
  int y;
  x = 17;
  y = x++ + 1;
  return y;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x11,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 17, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
%6 = add nsw i32 %4, 1
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

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


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

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

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

LLVM IR (-O2):
define void @lambda_free_identifier(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int clc(char *, char *, int);
int /*<<< orphan*/ printf(char *, int, int);
void testrun(char *a1, char *a2, int l) {
  int cc;
  cc = clc(a1, a2, l);
  printf("%d bytes:%d\n", l, cc);
}


x86 assembly (clang, -O0):
<testrun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <clc@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testrun>:
push   %rbx
mov    %edx,%ebx
call   1040 <clc@plt>
lea    0xed1(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%d bytes:%d\0A\00"
define void @testrun(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @clc(i8* %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%d bytes:%d\0A\00"
define void @testrun(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @clc(i8* %0, i8* %1, i32 %2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4)
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *mm_malloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<mm_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @mm_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
double fatorial(double n) {
  if (n < 2)
    return 1;
  double x = n;
  double resultado = 1;
  while (x > 0) {
    resultado = resultado * x;
    x = x - 1;
  }
  return resultado;
}


x86 assembly (clang, -O0):
<fatorial>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112e <fatorial+0x2e>
movsd  0xee4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118b <fatorial+0x8b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xec8(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1181 <fatorial+0x81>
movsd  -0x20(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe95(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1145 <fatorial+0x45>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fatorial>:
movapd %xmm0,%xmm1
movsd  0xef4(%rip),%xmm0
ucomisd %xmm1,%xmm0
movsd  0xef0(%rip),%xmm0
ja     114e <fatorial+0x4e>
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jbe    114e <fatorial+0x4e>
movsd  0xedc(%rip),%xmm0
movsd  0xedc(%rip),%xmm3
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mulsd  %xmm1,%xmm0
addsd  %xmm3,%xmm1
ucomisd %xmm2,%xmm1
ja     1140 <fatorial+0x40>
ret

LLVM IR (-O0):
define double @fatorial(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
%6 = load double, double* %3
%7 = fcmp olt double %6, 2.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %1
store double 1.000000e+00, double* %2
br label %22
9: ; preds = %1
%10 = load double, double* %3
store double %10, double* %4
store double 1.000000e+00, double* %5
br label %11
11: ; preds = %14, %9
%12 = load double, double* %4
%13 = fcmp ogt double %12, 0.000000e+00
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = load double, double* %5
%16 = load double, double* %4
%17 = fmul double %15, %16
store double %17, double* %5
%18 = load double, double* %4
%19 = fsub double %18, 1.000000e+00
store double %19, double* %4
br label %11
20: ; preds = %11
%21 = load double, double* %5
store double %21, double* %2
br label %22
22: ; preds = %20, %8
%23 = load double, double* %2
ret double %23
}

LLVM IR (-O2):
define double @fatorial(double %0) {
%2 = fcmp uge double %0, 2.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = and i1 %2, %3
br i1 %4, label %5, label %11
5: ; preds = %1, %5
%6 = phi double [ %8, %5 ], [ 1.000000e+00, %1 ]
%7 = phi double [ %9, %5 ], [ %0, %1 ]
%8 = fmul double %7, %6
%9 = fadd double %7, -1.000000e+00
%10 = fcmp ogt double %9, 0.000000e+00
br i1 %10, label %5, label %11
11: ; preds = %5, %1
%12 = phi double [ 1.000000e+00, %1 ], [ %8, %5 ]
ret double %12
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_add_pd(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_sub_pd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d f(__m128d x, __m128d y, __m128d z) {
  y = _mm_add_pd(x, y);
  y = _mm_add_pd(z, y);
  return _mm_sub_pd(y, x);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <_mm_add_pd@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <_mm_add_pd@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <_mm_sub_pd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %edi,%ebp
call   1040 <_mm_add_pd@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <_mm_add_pd@plt>
mov    %eax,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_mm_sub_pd@plt>

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call i32 @_mm_add_pd(i32 %7, i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %5
%12 = call i32 @_mm_add_pd(i32 %10, i32 %11)
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = call i32 @_mm_sub_pd(i32 %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @_mm_add_pd(i32 %0, i32 %1)
%5 = tail call i32 @_mm_add_pd(i32 %2, i32 %4)
%6 = tail call i32 @_mm_sub_pd(i32 %5, i32 %0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int i = 1;
  int j = 2;
  printf("haha%d"
         "dada%d\n",
         i, j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec6(%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    $0x1,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"haha%ddada%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 1, i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
int main() {
  long unsigned int a, b, c;
  int counter;
  a = 2;
  b = 1;
  for (counter = 0; counter < 100; counter++) {
    printf("%lu, \n", a);
    c = a + b;
    a = b;
    b = c;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x2,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x64,-0x24(%rbp)
jge    117a <main+0x6a>
mov    -0x10(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1136 <main+0x26>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%r15d
mov    $0x2,%ebx
mov    $0x64,%ebp
lea    0xed2(%rip),%r14
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rax
add    %r15,%rax
mov    %r15,%rbx
mov    %rax,%r15
add    $0xffffffff,%ebp
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%lu, \0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = phi i64 [ 2, %0 ], [ %4, %1 ]
%4 = phi i64 [ 1, %0 ], [ %6, %1 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %3)
%6 = add i64 %3, %4
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 100
br i1 %8, label %9, label %1
9: ; preds = %1
ret i32 0
}
/* Variables and functions */
double M_LN10;
double log(double);
double log10(double x) { return log(x) / M_LN10; }


x86 assembly (clang, -O0):
<log10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
mov    0x2eb2(%rip),%rax
divsd  (%rax),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log10>:
push   %rax
call   1030 <log@plt>
mov    0x2ec3(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_LN10 = global double 0.000000e+00
define double @log10(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log(double %3)
%5 = load double, double* @M_LN10
%6 = fdiv double %4, %5
ret double %6
}

LLVM IR (-O2):
@M_LN10 = global double 0.000000e+00
define double @log10(double %0) {
%2 = tail call double @log(double %0)
%3 = load double, double* @M_LN10
%4 = fdiv double %2, %3
ret double %4
}
const char *IsZero(unsigned uInput) {
  if (uInput)
    return ("black");
  else
    return ("red");
}


x86 assembly (clang, -O0):
<IsZero>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1121 <IsZero+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112c <IsZero+0x2c>
lea    0xede(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsZero>:
test   %edi,%edi
lea    0xefd(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"black\00"
@.str.1 = [4 x i8] c"red\00"
define i8* @IsZero(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ rgph_f2u32(float);
int /*<<< orphan*/ rgph_u64_t1ha64s_u32(int /*<<< orphan*/, uintptr_t);
uint64_t rgph_u64_t1ha64s_f32(float value, uintptr_t seed) {
  return rgph_u64_t1ha64s_u32(rgph_f2u32(value), seed);
}


x86 assembly (clang, -O0):
<rgph_u64_t1ha64s_f32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <rgph_f2u32@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <rgph_u64_t1ha64s_u32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgph_u64_t1ha64s_f32>:
push   %rbx
mov    %rdi,%rbx
call   1040 <rgph_f2u32@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <rgph_u64_t1ha64s_u32@plt>

LLVM IR (-O0):
define i32 @rgph_u64_t1ha64s_f32(float %0, i64 %1) {
%3 = alloca float
%4 = alloca i64
store float %0, float* %3
store i64 %1, i64* %4
%5 = load float, float* %3
%6 = call i32 @rgph_f2u32(float %5)
%7 = load i64, i64* %4
%8 = call i32 @rgph_u64_t1ha64s_u32(i32 %6, i64 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @rgph_u64_t1ha64s_f32(float %0, i64 %1) {
%3 = tail call i32 @rgph_f2u32(float %0)
%4 = tail call i32 @rgph_u64_t1ha64s_u32(i32 %3, i64 %1)
ret i32 %4
}
int ad7476_register_ring_funcs_and_init(struct iio_dev *indio_dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @ad7476_register_ring_funcs_and_init(%struct.iio_dev* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _create_thread_init();
int /*<<< orphan*/ _wind_init();
int /*<<< orphan*/ wind_disable_interrupt();
int /*<<< orphan*/ wind_enable_interrupt();
int /*<<< orphan*/ wind_run();
int wind_os_launch(void) {
  wind_disable_interrupt();
  _wind_init();
  _create_thread_init();
  wind_enable_interrupt();
  wind_run();
  return 0;
}


x86 assembly (clang, -O0):
<wind_os_launch>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <wind_disable_interrupt@plt>
mov    $0x0,%al
call   1060 <_wind_init@plt>
mov    $0x0,%al
call   1070 <_create_thread_init@plt>
mov    $0x0,%al
call   1030 <wind_enable_interrupt@plt>
mov    $0x0,%al
call   1040 <wind_run@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wind_os_launch>:
push   %rax
xor    %eax,%eax
call   1050 <wind_disable_interrupt@plt>
xor    %eax,%eax
call   1060 <_wind_init@plt>
xor    %eax,%eax
call   1070 <_create_thread_init@plt>
xor    %eax,%eax
call   1030 <wind_enable_interrupt@plt>
xor    %eax,%eax
call   1040 <wind_run@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @wind_os_launch() {
%1 = call i32 (...) @wind_disable_interrupt()
%2 = call i32 (...) @_wind_init()
%3 = call i32 (...) @_create_thread_init()
%4 = call i32 (...) @wind_enable_interrupt()
%5 = call i32 (...) @wind_run()
ret i32 0
}

LLVM IR (-O2):
define i32 @wind_os_launch() {
%1 = tail call i32 (...) @wind_disable_interrupt()
%2 = tail call i32 (...) @_wind_init()
%3 = tail call i32 (...) @_create_thread_init()
%4 = tail call i32 (...) @wind_enable_interrupt()
%5 = tail call i32 (...) @wind_run()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int write(int, void const *, int /*<<< orphan*/ const);
int escribir(int fd, const void *buffer, const ssize_t buffsize) {
  lseek(fd, 0, SEEK_END);
  return write(fd, buffer, buffsize);
}


x86 assembly (clang, -O0):
<escribir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <lseek@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<escribir>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <lseek@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
@SEEK_END = global i32 0
define i32 @escribir(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* @SEEK_END
%9 = call i32 @lseek(i32 %7, i32 0, i32 %8)
%10 = load i32, i32* %4
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @write(i32 %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@SEEK_END = global i32 0
define i32 @escribir(i32 %0, i8* nocapture %1, i32 %2) {
%4 = load i32, i32* @SEEK_END
%5 = tail call i32 @lseek(i32 %0, i32 0, i32 %4)
%6 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ tmll();
int main(void) {
  tmll();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @tmll()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *);
int /*<<< orphan*/ output_byte(int);
void emit_pusha() {
  assem_debug("pusha\n");
  output_byte(0x60);
}


x86 assembly (clang, -O0):
<emit_pusha>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0x60,%edi
call   1040 <output_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_pusha>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0x60,%edi
pop    %rax
jmp    1040 <output_byte@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"pusha\0A\00"
define void @emit_pusha() {
%1 = call i32 @assem_debug(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @output_byte(i32 96)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"pusha\0A\00"
define void @emit_pusha() {
%1 = tail call i32 @assem_debug(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @output_byte(i32 96)
ret void
}
int euclidianMDC(int a, int b) {
  if (b == 0) {
    return a;
  } else {
    return euclidianMDC(b, a % b);
  }
}


x86 assembly (clang, -O0):
<euclidianMDC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <euclidianMDC+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <euclidianMDC+0x37>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <euclidianMDC@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<euclidianMDC>:
mov    %edi,%eax
test   %esi,%esi
je     111d <euclidianMDC+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <euclidianMDC+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @euclidianMDC(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
setsize(n) int n;
{ n; }


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

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

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

LLVM IR (-O2):
define i32 @setsize(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ gpio_done();
void coreCleanupGPIO(void) { gpio_done(); }


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

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

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

LLVM IR (-O2):
define void @coreCleanupGPIO() {
%1 = tail call i32 (...) @gpio_done()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int eq(char *left, char *right) { return !strcmp(left, right); }


x86 assembly (clang, -O0):
<eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @eq(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @eq(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int DigitSum(int);
int DigitalRoot(int n) {
  if ((n / 10) == 0) {
    return n;
  } else {
    return DigitalRoot(DigitSum(n));
  }
}


x86 assembly (clang, -O0):
<DigitalRoot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
jne    114a <DigitalRoot+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115c <DigitalRoot+0x3c>
mov    -0x8(%rbp),%edi
call   1030 <DigitSum@plt>
mov    %eax,%edi
call   1040 <DigitalRoot@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DigitalRoot>:
push   %rax
mov    %edi,%eax
lea    0x9(%rax),%ecx
cmp    $0x13,%ecx
jb     1131 <DigitalRoot+0x21>
nopl   0x0(%rax,%rax,1)
mov    %eax,%edi
call   1030 <DigitSum@plt>
mov    %eax,%ecx
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1120 <DigitalRoot+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @DigitalRoot(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = sdiv i32 %4, 10
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* %3
store i32 %8, i32* %2
br label %13
9: ; preds = %1
%10 = load i32, i32* %3
%11 = call i32 @DigitSum(i32 %10)
%12 = call i32 @DigitalRoot(i32 %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @DigitalRoot(i32 %0) {
%2 = add i32 %0, 9
%3 = icmp ult i32 %2, 19
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %6, %4 ], [ %0, %1 ]
%6 = tail call i32 @DigitSum(i32 %5)
%7 = add i32 %6, 9
%8 = icmp ult i32 %7, 19
br i1 %8, label %9, label %4
9: ; preds = %4, %1
%10 = phi i32 [ %0, %1 ], [ %6, %4 ]
ret i32 %10
}
int state_cmp(void *a, void *b) { return a != b; }


x86 assembly (clang, -O0):
<state_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<state_cmp>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @state_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp ne i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @state_cmp(i8* readnone %0, i8* readnone %1) {
%3 = icmp ne i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M912_f(char *s) {
  debug("M912_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M912_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M912_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M912_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M912_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M912_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M912_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ lrint(double);
int /*<<< orphan*/ lrintf(float);
int /*<<< orphan*/ lrintl(long double);
void uninitvar_lrint(void) {
  float f;
  (void)lrintf(f);
  double d;
  (void)lrint(d);
  long double ld;
  (void)lrintl(ld);
}


x86 assembly (clang, -O0):
<uninitvar_lrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  -0x4(%rbp),%xmm0
call   1040 <lrintf@plt>
movsd  -0x10(%rbp),%xmm0
call   1050 <lrint@plt>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <lrintl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_lrint>:
sub    $0x18,%rsp
call   1040 <lrintf@plt>
call   1050 <lrint@plt>
call   1030 <lrintl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_lrint() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
%4 = load float, float* %1
%5 = call i32 @lrintf(float %4)
%6 = load double, double* %2
%7 = call i32 @lrint(double %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = call i32 @lrintl(x86_fp80 %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_lrint() {
%1 = tail call i32 @lrintf(float undef)
%2 = tail call i32 @lrint(double undef)
%3 = tail call i32 @lrintl(x86_fp80 undef)
ret void
}
void glGetUniformiv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetUniformiv() {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  short x;
};
struct TYPE_4__ {
  TYPE_1__ max_ink_extent;
};
typedef TYPE_2__ XFontSetExtents;

/* Variables and functions */
void set_XFontSetExtents_max_ink_extent_x(void *_p, short _v) {
  ((XFontSetExtents *)_p)->max_ink_extent.x = (short)_v;
}


x86 assembly (clang, -O0):
<set_XFontSetExtents_max_ink_extent_x>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XFontSetExtents_max_ink_extent_x>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i16 }
define void @set_XFontSetExtents_max_ink_extent_x(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i16 %5, i16* %9
ret void
}

LLVM IR (-O2):
define void @set_XFontSetExtents_max_ink_extent_x(i8* nocapture writeonly %0, i16 signext %1) {
%3 = bitcast i8* %0 to i16*
store i16 %1, i16* %3
ret void
}
int test_trap() { return 0x3; }


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

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

LLVM IR (-O0):
define i32 @test_trap() {
ret i32 3
}

LLVM IR (-O2):
define i32 @test_trap() {
ret i32 3
}
int main() {
  int a, b, c, d, e;
  a = 1;
  b = 2;
  c = 3;
  e = a == b & d + c != d | 5 << a;
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x14(%rbp),%ecx
add    -0x10(%rbp),%ecx
cmp    -0x14(%rbp),%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
mov    $0x5,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %3
store i32 3, i32* %4
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = icmp eq i32 %7, %8
%10 = zext i1 %9 to i32
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %5
%15 = icmp ne i32 %13, %14
%16 = zext i1 %15 to i32
%17 = and i32 %10, %16
%18 = load i32, i32* %2
%19 = shl i32 5, %18
%20 = or i32 %17, %19
store i32 %20, i32* %6
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
void *memset_using_uint64_impl(void *, int, size_t);
void *memset(void *s, int c, size_t n) {
  return memset_using_uint64_impl(s, c, n);
}


x86 assembly (clang, -O0):
<memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <memset_using_uint64_impl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset>:
jmp    1030 <memset_using_uint64_impl@plt>

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

LLVM IR (-O2):
define i8* @memset(i8* %0, i32 %1, i64 %2) {
%4 = tail call i8* @memset_using_uint64_impl(i8* %0, i32 %1, i64 %2)
ret i8* %4
}
/* Variables and functions */
bool more_then(const char input[], int limit) {
  if ((input[limit - 1] != 0) && (input[limit - 1] != '\n'))
    return true;
  return false;
}


x86 assembly (clang, -O0):
<more_then>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114b <more_then+0x4b>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     114b <more_then+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <more_then+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<more_then>:
movslq %esi,%rax
mov    -0x1(%rax,%rdi,1),%al
test   %al,%al
setne  %cl
cmp    $0xa,%al
setne  %al
and    %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @more_then(i8* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
%8 = icmp ne i8 %6, 10
%9 = and i1 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int COLS;
int LINES;
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int lines, cols;
  initscr();
  endwin();
  lines = LINES;
  cols = COLS;
  printf("cols: %d rows: %d\n", cols, lines);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <initscr@plt>
mov    $0x0,%al
call   1050 <endwin@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e80(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <initscr@plt>
xor    %eax,%eax
call   1050 <endwin@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edx
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LINES = global i32 0
@COLS = global i32 0
@.str = [19 x i8] c"cols: %d rows: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @initscr()
%5 = call i32 (...) @endwin()
%6 = load i32, i32* @LINES
store i32 %6, i32* %2
%7 = load i32, i32* @COLS
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@LINES = global i32 0
@COLS = global i32 0
@.str = [19 x i8] c"cols: %d rows: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @endwin()
%3 = load i32, i32* @LINES
%4 = load i32, i32* @COLS
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %3)
ret i32 0
}
void ff_hevc_put_hevc_bi_qpel_h64_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_qpel_h64_8_sse4() {
ret void
}
/* Variables and functions */
int core7_safe(char const *);
int U_EMRRESIZEPALETTE_safe(const char *record) { return (core7_safe(record)); }


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

x86 assembly (clang, -O2):
<U_EMRRESIZEPALETTE_safe>:
jmp    1030 <core7_safe@plt>

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

LLVM IR (-O2):
define i32 @U_EMRRESIZEPALETTE_safe(i8* %0) {
%2 = tail call i32 @core7_safe(i8* %0)
ret i32 %2
}
void FPULazyStackingEnable(void) {
  (*((volatile unsigned long *)(0xE000EF34))) |= 0x80000000 | 0x40000000;
}


x86 assembly (clang, -O0):
<FPULazyStackingEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000ef34,%eax
mov    (%rax),%rcx
movabs $0xc0000000,%rax
or     %rax,%rcx
mov    $0xe000ef34,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FPULazyStackingEnable>:
mov    $0xe000ef34,%eax
lea    -0x2000ef34(%rax),%rcx
or     %rcx,(%rax)
ret

LLVM IR (-O0):
define void @FPULazyStackingEnable() {
%1 = load volatile i64, i64* inttoptr (i64 3758157620 to i64*)
%2 = or i64 %1, 3221225472
store volatile i64 %2, i64* inttoptr (i64 3758157620 to i64*)
ret void
}

LLVM IR (-O2):
define void @FPULazyStackingEnable() {
%1 = load volatile i64, i64* inttoptr (i64 3758157620 to i64*)
%2 = or i64 %1, 3221225472
store volatile i64 %2, i64* inttoptr (i64 3758157620 to i64*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
scalar_t__ isspace(int /*<<< orphan*/ const);
void scan_spaces(const uint8_t **bufptr) {
  const uint8_t *ptr = *bufptr;
  while (isspace(*ptr)) {
    ptr++;
  }
  *bufptr = ptr;
}


x86 assembly (clang, -O0):
<scan_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     114d <scan_spaces+0x3d>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    1127 <scan_spaces+0x17>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_spaces>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rbx
add    $0xfffffffffffffffc,%rbx
xchg   %ax,%ax
mov    0x4(%rbx),%edi
add    $0x4,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <scan_spaces+0x10>
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @scan_spaces(i32** nocapture %0) {
%2 = load i32*, i32** %0
br label %3
3: ; preds = %3, %1
%4 = phi i32* [ %2, %1 ], [ %8, %3 ]
%5 = load i32, i32* %4
%6 = tail call i64 @isspace(i32 %5)
%7 = icmp eq i64 %6, 0
%8 = getelementptr inbounds i32, i32* %4, i64 1
br i1 %7, label %9, label %3
9: ; preds = %3
store i32* %4, i32** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ esc(char *);
void deckpnm(void) { esc(">"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c">\00"
define void @deckpnm() {
%1 = tail call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((constructor)) void main_init() { printf("main_init\n"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"main_init\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @main_init, i8* null }]
define void @main_init() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @main_init, i8* null }]
@str = [10 x i8] c"main_init\00"
define void @main_init() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void or_reg32_imm32(int reg32, unsigned int imm32) {
  put8(0x81);
  put8(0xC8 + reg32);
  put32(imm32);
}


x86 assembly (clang, -O0):
<or_reg32_imm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x81,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
add    $0xc8,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<or_reg32_imm32>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x81,%edi
call   1030 <put8@plt>
add    $0xc8,%ebp
mov    %ebp,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @or_reg32_imm32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @put8(i32 129)
%6 = load i32, i32* %3
%7 = add nsw i32 200, %6
%8 = call i32 @put8(i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @put32(i32 %9)
ret void
}

LLVM IR (-O2):
define void @or_reg32_imm32(i32 %0, i32 %1) {
%3 = tail call i32 @put8(i32 129)
%4 = add nsw i32 %0, 200
%5 = tail call i32 @put8(i32 %4)
%6 = tail call i32 @put32(i32 %1)
ret void
}
int findTrailingZeros(int n) {
  int count = 0, i;
  for (i = 5; n / i >= 1; i *= 5)
    count += n / i;
  return count;
}


x86 assembly (clang, -O0):
<findTrailingZeros>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x1,%eax
jl     113e <findTrailingZeros+0x3e>
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
imul   $0x5,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <findTrailingZeros+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findTrailingZeros>:
xor    %ecx,%ecx
cmp    $0x5,%edi
jl     112e <findTrailingZeros+0x2e>
mov    %edi,%ecx
mov    $0xcccccccd,%eax
imul   %rcx,%rax
shr    $0x22,%rax
xor    %ecx,%ecx
mov    $0x5,%esi
nopl   (%rax)
add    %eax,%ecx
lea    (%rsi,%rsi,4),%esi
mov    %edi,%eax
cltd
idiv   %esi
test   %eax,%eax
jg     1120 <findTrailingZeros+0x20>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @findTrailingZeros(i32 %0) {
%2 = icmp sgt i32 %0, 4
br i1 %2, label %3, label %13
3: ; preds = %1
%4 = udiv i32 %0, 5
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ %11, %5 ], [ %4, %3 ]
%7 = phi i32 [ %10, %5 ], [ 5, %3 ]
%8 = phi i32 [ %9, %5 ], [ 0, %3 ]
%9 = add nsw i32 %6, %8
%10 = mul nuw nsw i32 %7, 5
%11 = sdiv i32 %0, %10
%12 = icmp sgt i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %5, %1
%14 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %14
}