xunge/DecIR huggingface dataset:
int more_calls(char x) {
  if (x > 'A') {
    return 'a' - x;
  } else {
    return 'A' - x;
  }
}


x86 assembly (clang, -O0):
<more_calls>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jle    112a <more_calls+0x2a>
movsbl -0x5(%rbp),%ecx
mov    $0x61,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1138 <more_calls+0x38>
movsbl -0x5(%rbp),%ecx
mov    $0x41,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<more_calls>:
xor    %eax,%eax
cmp    $0x42,%dil
setge  %al
shl    $0x5,%eax
sub    %edi,%eax
add    $0x41,%eax
ret

LLVM IR (-O0):
define i32 @more_calls(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sgt i32 %5, 65
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = sub nsw i32 97, %9
store i32 %10, i32* %2
br label %15
11: ; preds = %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 65, %13
store i32 %14, i32* %2
br label %15
15: ; preds = %11, %7
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @more_calls(i8 signext %0) {
%2 = icmp sgt i8 %0, 65
%3 = select i1 %2, i32 97, i32 65
%4 = sext i8 %0 to i32
%5 = sub nsw i32 %3, %4
ret i32 %5
}
double Esz2(double l, double m, double n) {
  return (n * n - l * l / 2) * -0.03709;
}


x86 assembly (clang, -O0):
<Esz2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xed9(%rip),%xmm3
divsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xea6(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Esz2>:
mulsd  %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
mulsd  %xmm2,%xmm2
addsd  %xmm2,%xmm0
mulsd  0xeec(%rip),%xmm0
ret

LLVM IR (-O0):
define double @Esz2(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = load double, double* %6
%9 = load double, double* %4
%10 = load double, double* %4
%11 = fmul double %9, %10
%12 = fdiv double %11, 2.000000e+00
%13 = fneg double %12
%14 = call double @llvm.fmuladd.f64(double %7, double %8, double %13)
%15 = fmul double %14, -3.709000e-02
ret double %15
}

LLVM IR (-O2):
define double @Esz2(double %0, double %1, double %2) {
%4 = fmul double %0, %0
%5 = fmul double %4, -5.000000e-01
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = fmul double %6, -3.709000e-02
ret double %7
}
long lmin(a, b)
long a, b;
{ return (a < b ? a : b); }


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

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

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

LLVM IR (-O2):
define i64 @lmin(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ output_name(char *);
int /*<<< orphan*/ printf(char *, char *);
void main(void) {
  char *name;
  name = malloc(11);
  if (name != NULL)
    output_name(name);
  free(name);
  printf("name=%s", name);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xb,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116a <main+0x2a>
mov    -0x8(%rbp),%rdi
call   1060 <output_name@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rsi
lea    0xe82(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xb,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115b <main+0x1b>
mov    %rbx,%rdi
call   1060 <output_name@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xe96(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"name=%s\00"
define void @main() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 11)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i8*, i8** %1
%7 = call i32 @output_name(i8* %6)
br label %8
8: ; preds = %5, %0
%9 = load i8*, i8** %1
%10 = call i32 @free(i8* %9)
%11 = load i8*, i8** %1
%12 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"name=%s\00"
define void @main() {
%1 = tail call dereferenceable_or_null(11) i8* @malloc(i32 11)
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @output_name(i8* %1)
br label %5
5: ; preds = %3, %0
%6 = tail call i32 @free(i8* %1)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
int main(void) { int a[1]; }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [1 x i32]
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
unsigned int unused_integer_underflow_Bad() {
  unsigned int n = 0;
  if (n-- == 0) {
    return n;
  } else {
    return n;
  }
}


x86 assembly (clang, -O0):
<unused_integer_underflow_Bad>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jne    112a <unused_integer_underflow_Bad+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1130 <unused_integer_underflow_Bad+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @unused_integer_underflow_Bad() {
ret i32 -1
}
int nextLexShort(char **readPointer) {
  int first = *(unsigned char *)(*readPointer);
  int second = *((unsigned char *)(*readPointer) + 1);
  return first + 256 * second;
}


x86 assembly (clang, -O0):
<nextLexShort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl 0x1(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextLexShort>:
mov    (%rdi),%rax
movzwl (%rax),%eax
ret

LLVM IR (-O0):
define i32 @nextLexShort(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
%4 = alloca i32
store i8** %0, i8*** %2
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
store i32 %8, i32* %3
%9 = load i8**, i8*** %2
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = mul nsw i32 256, %15
%17 = add nsw i32 %14, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @nextLexShort(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %2, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
ret i32 %9
}
/* Variables and functions */
float sin(float);
float Float_sin(float x) { return sin(x); }


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

x86 assembly (clang, -O2):
<Float_sin>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define float @Float_sin(float %0) {
%2 = tail call float @sin(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x1a() {
  Assert_real((isspace(26) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              135, ("isspace should be 0 for 0x1a"));
}


x86 assembly (clang, -O0):
<t_isspace_0x1a>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1a,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x87,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0x1a>:
push   %rax
mov    $0x1a,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x87,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x1a\00"
define void @t_isspace_0x1a() {
%1 = call i64 @isspace(i32 26)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 135, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x1a\00"
define void @t_isspace_0x1a() {
%1 = tail call i64 @isspace(i32 26)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 135, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int pick2(n, i, j)
int n, *i, *j;
{
  *i = n * ran1();
  while ((*j = n * ran1()) == *i)
    ;
  return (0);
}


x86 assembly (clang, -O0):
<pick2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <ran1@plt>
mov    -0x1c(%rbp),%ecx
imul   %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <ran1@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
imul   %ecx,%eax
mov    -0x18(%rbp),%rcx
mov    %eax,(%rcx)
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jne    1168 <pick2+0x58>
jmp    113c <pick2+0x2c>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pick2>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <ran1@plt>
imul   %ebp,%eax
mov    %eax,(%rbx)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <ran1@plt>
imul   %ebp,%eax
mov    %eax,(%r14)
cmp    (%rbx),%eax
je     1130 <pick2+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @pick2(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 = call i32 (...) @ran1()
%9 = mul nsw i32 %7, %8
%10 = load i32*, i32** %5
store i32 %9, i32* %10
br label %11
11: ; preds = %19, %3
%12 = load i32, i32* %4
%13 = call i32 (...) @ran1()
%14 = mul nsw i32 %12, %13
%15 = load i32*, i32** %6
store i32 %14, i32* %15
%16 = load i32*, i32** %5
%17 = load i32, i32* %16
%18 = icmp eq i32 %14, %17
br i1 %18, label %19, label %20
19: ; preds = %11
br label %11
20: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
define i32 @pick2(i32 %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = tail call i32 (...) @ran1()
%5 = mul nsw i32 %4, %0
store i32 %5, i32* %1
br label %6
6: ; preds = %6, %3
%7 = tail call i32 (...) @ran1()
%8 = mul nsw i32 %7, %0
store i32 %8, i32* %2
%9 = load i32, i32* %1
%10 = icmp eq i32 %8, %9
br i1 %10, label %6, label %11
11: ; preds = %6
ret i32 0
}
void callee(int i) {}


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

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

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

LLVM IR (-O2):
define void @callee(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void pound(int n) {
  while (n-- > 0)
    printf("#");
  printf("\n");
}


x86 assembly (clang, -O0):
<pound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jle    1140 <pound+0x30>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
jmp    111b <pound+0xb>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pound>:
push   %rbx
test   %edi,%edi
jle    1132 <pound+0x22>
mov    %edi,%ebx
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <pound+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @pound(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @putchar(i32 35)
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
%9 = tail call i32 @putchar(i32 10)
ret void
}
void XkbKeyTypesForCoreSymbols() {}


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

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

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

LLVM IR (-O2):
define void @XkbKeyTypesForCoreSymbols() {
ret void
}
int main() {
  int arr1[10] = {10};
  int arr2[10] = {1, 2};
  static int arr3[10] = {0};
  int i = 0;
  int sum = 0;
  while (i < 10) {
    sum += arr1[i];
    sum += arr2[i];
    sum += arr3[i++];
  }
  return sum;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1030 <memset@plt>
movl   $0xa,-0x30(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1030 <memset@plt>
movl   $0x1,-0x60(%rbp)
movl   $0x2,-0x5c(%rbp)
movl   $0x0,-0x64(%rbp)
movl   $0x0,-0x68(%rbp)
cmpl   $0xa,-0x64(%rbp)
jge    11ab <main+0x9b>
movslq -0x64(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
add    -0x68(%rbp),%eax
mov    %eax,-0x68(%rbp)
movslq -0x64(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%eax
add    -0x68(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x64(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x64(%rbp)
movslq %eax,%rcx
lea    0x2ea3(%rip),%rax
mov    (%rax,%rcx,4),%eax
add    -0x68(%rbp),%eax
mov    %eax,-0x68(%rbp)
jmp    1162 <main+0x52>
mov    -0x68(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 13
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ perror(char *);
void error(char *msg, FILE *fd_log) {
  if (fd_log == NULL) {
    perror(msg);
  } else {
    fprintf(fd_log, "%s\n", msg);
    fclose(fd_log);
  }
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1169 <error+0x29>
mov    -0x8(%rbp),%rdi
call   1050 <perror@plt>
jmp    1186 <error+0x46>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe88(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rbx
mov    %rdi,%rdx
test   %rsi,%rsi
jne    115b <error+0x1b>
mov    %rdx,%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    %rsi,%rbx
lea    0xe9b(%rip),%rsi
mov    %rbx,%rdi
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @error(i8* %0, i32* %1) {
%3 = icmp eq i32* %1, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @perror(i8* %0)
br label %9
6: ; preds = %2
%7 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @fclose(i32* %1)
br label %9
9: ; preds = %6, %4
%10 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(unsigned short, int /*<<< orphan*/ *);
unsigned short unicode_to_cp1251(unsigned short);
void cp1251_putc(unsigned short ch, FILE *fout) {
  ch = unicode_to_cp1251(ch);
  if (!ch)
    ch = '?';
  putc(ch, fout);
}


x86 assembly (clang, -O0):
<cp1251_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <unicode_to_cp1251@plt>
mov    %ax,-0x2(%rbp)
cmpw   $0x0,-0x2(%rbp)
jne    1151 <cp1251_putc+0x31>
movw   $0x3f,-0x2(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x10(%rbp),%rsi
movzwl %ax,%edi
call   1040 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cp1251_putc>:
push   %rbx
mov    %rsi,%rbx
call   1030 <unicode_to_cp1251@plt>
test   %ax,%ax
mov    $0x3f,%ecx
cmovne %eax,%ecx
movzwl %cx,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <putc@plt>

LLVM IR (-O0):
define void @cp1251_putc(i16 zeroext %0, i32* %1) {
%3 = alloca i16
%4 = alloca i32*
store i16 %0, i16* %3
store i32* %1, i32** %4
%5 = load i16, i16* %3
%6 = call zeroext i16 @unicode_to_cp1251(i16 zeroext %5)
store i16 %6, i16* %3
%7 = load i16, i16* %3
%8 = icmp ne i16 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %2
store i16 63, i16* %3
br label %10
10: ; preds = %9, %2
%11 = load i16, i16* %3
%12 = load i32*, i32** %4
%13 = call i32 @putc(i16 zeroext %11, i32* %12)
ret void
}

LLVM IR (-O2):
define void @cp1251_putc(i16 zeroext %0, i32* nocapture %1) {
%3 = tail call zeroext i16 @unicode_to_cp1251(i16 zeroext %0)
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i16 63, i16 %3
%6 = tail call i32 @putc(i16 zeroext %5, i32* %1)
ret void
}
void RTSpinlockCreate(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSpinlockCreate() {
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
void int64Clear(int64_t *data) { *data = 0; }


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

x86 assembly (clang, -O2):
<int64Clear>:
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @int64Clear(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
store i64 0, i64* %3
ret void
}

LLVM IR (-O2):
define void @int64Clear(i64* nocapture writeonly %0) {
store i64 0, i64* %0
ret void
}
/* Variables and functions */
int __min_cost(int **, int);
int assignment(int (*m)[100], int n) { return __min_cost(m, n); }


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

x86 assembly (clang, -O2):
<assignment>:
jmp    1030 <__min_cost@plt>

LLVM IR (-O0):
define i32 @assignment([100 x i32]* %0, i32 %1) {
%3 = alloca [100 x i32]*
%4 = alloca i32
store [100 x i32]* %0, [100 x i32]** %3
store i32 %1, i32* %4
%5 = load [100 x i32]*, [100 x i32]** %3
%6 = bitcast [100 x i32]* %5 to i32**
%7 = load i32, i32* %4
%8 = call i32 @__min_cost(i32** %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @assignment([100 x i32]* %0, i32 %1) {
%3 = bitcast [100 x i32]* %0 to i32**
%4 = tail call i32 @__min_cost(i32** %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void tomato(void) { printf("hello, this is tomoto.c's output.\n"); }


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"hello, this is tomoto.c's output.\0A\00"
define void @tomato() {
%1 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [34 x i8] c"hello, this is tomoto.c's output.\00"
define void @tomato() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret void
}
void rcc_init() {}


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

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

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

LLVM IR (-O2):
define void @rcc_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void sig_alarm_handler(int signum) {
  printf("You ran out of time, closing!\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"You ran out of time, closing!\0A\00"
define void @sig_alarm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [30 x i8] c"You ran out of time, closing!\00"
define void @sig_alarm_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
struct proc_dir_entry *proc_mkdir(const char *name,
                                  struct proc_dir_entry *parent) {
  return ((void *)0);
}


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

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

LLVM IR (-O0):
%struct.proc_dir_entry = type opaque
define %struct.proc_dir_entry* @proc_mkdir(i8* %0, %struct.proc_dir_entry* %1) {
%3 = alloca i8*
%4 = alloca %struct.proc_dir_entry*
store i8* %0, i8** %3
store %struct.proc_dir_entry* %1, %struct.proc_dir_entry** %4
ret %struct.proc_dir_entry* null
}

LLVM IR (-O2):
%struct.proc_dir_entry = type opaque
define noalias %struct.proc_dir_entry* @proc_mkdir(i8* nocapture readnone %0, %struct.proc_dir_entry* nocapture readnone %1) {
ret %struct.proc_dir_entry* null
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char *stpcpy(char *, char const *);
int main(int argc, char *argv[]) {
  char *p;
  char buf[32] = "abcdefghijklmnopqrstuvwxyz";
  const char *src = "helloworld";
  p = stpcpy(buf, src);
  assert(*p == '\0');
  assert((p - buf) == 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xeb7(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   1030 <stpcpy@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rax
lea    -0x40(%rbp),%rcx
sub    %rcx,%rax
cmp    $0xa,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.buf = [32 x i8] c"abcdefghijklmnopqrstuvwxyz\00\00\00\00\00\00"
@.str = [11 x i8] c"helloworld\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca [32 x i8]
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [32 x i8]* %7 to i8*
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %8
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%11 = load i8*, i8** %8
%12 = call i8* @stpcpy(i8* %10, i8* %11)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 0
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i8*, i8** %6
%20 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%21 = ptrtoint i8* %19 to i64
%22 = ptrtoint i8* %20 to i64
%23 = sub i64 %21, %22
%24 = icmp eq i64 %23, 10
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @assert(i32 1)
%4 = tail call i32 @assert(i32 1)
ret i32 0
}
void av_murmur3_alloc() {}


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

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

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

LLVM IR (-O2):
define void @av_murmur3_alloc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pchar(char);
void prints(char *_str) {
  int index = 0;
  while (_str[index] != 0) {
    pchar(_str[index]);
    index++;
  }
}


x86 assembly (clang, -O0):
<prints>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <prints+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <pchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <prints+0x13>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @prints(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @pchar(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void gprsharp_now() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<gprsharp_now>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @gprsharp_now() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @gprsharp_now() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int isNull(void *p) {
  if (p == NULL) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isNull>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <isNull+0x1f>
movl   $0x1,-0x4(%rbp)
jmp    1126 <isNull+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNull>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isNull(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
int do_974() { return 974; }


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

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

LLVM IR (-O0):
define i32 @do_974() {
ret i32 974
}

LLVM IR (-O2):
define i32 @do_974() {
ret i32 974
}
/* Variables and functions */
scalar_t__ clock();
int getticks_(void) { return (int)clock(); }


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

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

LLVM IR (-O0):
define i32 @getticks_() {
%1 = call i64 (...) @clock()
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @getticks_() {
%1 = tail call i64 (...) @clock()
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Variables and functions */
int fibbo(int);
int /*<<< orphan*/ printf(char *, int);
void main(void) {
  int m = fibbo(8);
  printf("%d\n", m);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
call   1030 <fibbo@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @fibbo(i32 8)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
struct lock {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __coverity_exclusive_lock_acquire__(struct lock *);
void lock_caller(struct lock *l, const char *caller) {
  __coverity_exclusive_lock_acquire__(l);
}


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

x86 assembly (clang, -O2):
<lock_caller>:
jmp    1030 <__coverity_exclusive_lock_acquire__@plt>

LLVM IR (-O0):
%struct.lock = type { i32 }
define void @lock_caller(%struct.lock* %0, i8* %1) {
%3 = alloca %struct.lock*
%4 = alloca i8*
store %struct.lock* %0, %struct.lock** %3
store i8* %1, i8** %4
%5 = load %struct.lock*, %struct.lock** %3
%6 = call i32 @__coverity_exclusive_lock_acquire__(%struct.lock* %5)
ret void
}

LLVM IR (-O2):
%struct.lock = type { i32 }
define void @lock_caller(%struct.lock* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @__coverity_exclusive_lock_acquire__(%struct.lock* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ process_get_current();
unsigned int process_get_priority(int /*<<< orphan*/);
unsigned int process_get_current_priority() {
  return process_get_priority(process_get_current());
}


x86 assembly (clang, -O0):
<process_get_current_priority>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <process_get_current@plt>
mov    %eax,%edi
call   1030 <process_get_priority@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_get_current_priority>:
push   %rax
xor    %eax,%eax
call   1040 <process_get_current@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <process_get_priority@plt>

LLVM IR (-O0):
define i32 @process_get_current_priority() {
%1 = call i32 (...) @process_get_current()
%2 = call i32 @process_get_priority(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @process_get_current_priority() {
%1 = tail call i32 (...) @process_get_current()
%2 = tail call i32 @process_get_priority(i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
extern void sleep_for_sec(int sec) { sleep(sec); }


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

x86 assembly (clang, -O2):
<sleep_for_sec>:
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define void @sleep_for_sec(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_stream_get_format_info() {
  printf("NOT IMPLEMENTED:"
         "pa_stream_get_format_info"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [42 x i8] c"NOT IMPLEMENTED:pa_stream_get_format_info\00"
define i32 @pa_stream_get_format_info() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/);
int cldd(char sentence[1000], int alphabet[2][26]) {
  int counter = 0;
  for (; counter < 26; counter++) {
    printf("%c -> %d \n", counter + 97, 0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<cldd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1a,-0x14(%rbp)
jge    1153 <cldd+0x43>
mov    -0x14(%rbp),%esi
add    $0x61,%esi
lea    0xec2(%rip),%rdi
xor    %edx,%edx
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <cldd+0x17>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cldd>:
push   %r14
push   %rbx
push   %rax
mov    $0x61,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
xor    %edx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x7b,%ebx
jne    1120 <cldd+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"%c -> %d \0A\00"
define i32 @cldd(i8* nocapture readnone %0, [26 x i32]* nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %7, %3 ]
%5 = add nuw nsw i32 %4, 97
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5, i32 0)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, 26
br i1 %8, label %9, label %3
9: ; preds = %3
ret i32 0
}
int __eeprom_wait_for_last_operation(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @__eeprom_wait_for_last_operation() {
ret i32 1
}

LLVM IR (-O2):
define i32 @__eeprom_wait_for_last_operation() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ assert(size_t);
void *malloc(size_t);
int /*<<< orphan*/ secure_memset(void *, char, size_t);
void *secure_malloc(size_t len) {
  void *ptr;
  assert(len);
  if (!(ptr = malloc(len)))
    return (NULL);
  secure_memset(ptr, '\0', len);
  return (ptr);
}


x86 assembly (clang, -O0):
<secure_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1169 <secure_malloc+0x39>
movq   $0x0,-0x8(%rbp)
jmp    1180 <secure_malloc+0x50>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1050 <secure_memset@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<secure_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <assert@plt>
mov    %r14,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1159 <secure_malloc+0x29>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1050 <secure_memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @secure_malloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = call i32 @assert(i64 %5)
%7 = load i64, i64* %3
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %1
store i8* null, i8** %2
br label %16
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = load i64, i64* %3
%14 = call i32 @secure_memset(i8* %12, i8 signext 0, i64 %13)
%15 = load i8*, i8** %4
store i8* %15, i8** %2
br label %16
16: ; preds = %11, %10
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
define i8* @secure_malloc(i64 %0) {
%2 = tail call i32 @assert(i64 %0)
%3 = tail call i8* @malloc(i64 %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @secure_memset(i8* %3, i8 signext 0, i64 %0)
br label %7
7: ; preds = %1, %5
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void err(char *err) {
  printf("[ERROR]: %s\n", err);
  exit(-1);
}


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"[ERROR]: %s\0A\00"
define void @err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c"[ERROR]: %s\0A\00"
define void @err(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *f2(void *p) {
  int i;
  for (i = 0; i < 100000; i++) {
    printf("2\n");
  }
  return NULL;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x186a0,-0xc(%rbp)
jge    114a <f2+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <f2+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rbp
push   %rbx
push   %rax
mov    $0x186a0,%ebp
lea    0xee1(%rip),%rbx
nop
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0xffffffff,%ebp
jne    1120 <f2+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@str = [2 x i8] c"2\00"
define noalias i8* @f2(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %5, %2 ]
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 100000
br i1 %6, label %7, label %2
7: ; preds = %2
ret i8* null
}
void foo144() {}


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

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

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

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