xunge/DecIR huggingface dataset:
/* Variables and functions */
int strlen(char const *);
char *strnsrch(char const *, char const *, int);
char *strsrch(const char *s1, const char *s2) {
  int ls1;
  ls1 = strlen(s1);
  return (strnsrch(s1, s2, ls1));
}


x86 assembly (clang, -O0):
<strsrch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <strnsrch@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsrch>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strnsrch@plt>

LLVM IR (-O0):
define i8* @strsrch(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i8* @strnsrch(i8* %8, i8* %9, i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @strsrch(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i8* @strnsrch(i8* %0, i8* %1, i32 %3)
ret i8* %4
}
void f_empty_goto_loop_semicolon() {
f_empty_goto_loop_semicolon_label:;
  goto f_empty_goto_loop_semicolon_label;
}


x86 assembly (clang, -O0):
<f_empty_goto_loop_semicolon>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <f_empty_goto_loop_semicolon+0x9>
jmp    1109 <f_empty_goto_loop_semicolon+0x9>

x86 assembly (clang, -O2):
<f_empty_goto_loop_semicolon>:
jmp    1100 <f_empty_goto_loop_semicolon>

LLVM IR (-O0):
define void @f_empty_goto_loop_semicolon() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @f_empty_goto_loop_semicolon() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
struct ib_decode_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ib_flush(struct ib_decode_state *);
void ib_decode_end(struct ib_decode_state *state) { ib_flush(state); }


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

x86 assembly (clang, -O2):
<ib_decode_end>:
jmp    1030 <ib_flush@plt>

LLVM IR (-O0):
%struct.ib_decode_state = type { i32 }
define void @ib_decode_end(%struct.ib_decode_state* %0) {
%2 = alloca %struct.ib_decode_state*
store %struct.ib_decode_state* %0, %struct.ib_decode_state** %2
%3 = load %struct.ib_decode_state*, %struct.ib_decode_state** %2
%4 = call i32 @ib_flush(%struct.ib_decode_state* %3)
ret void
}

LLVM IR (-O2):
%struct.ib_decode_state = type { i32 }
define void @ib_decode_end(%struct.ib_decode_state* %0) {
%2 = tail call i32 @ib_flush(%struct.ib_decode_state* %0)
ret void
}
double calculate_discriminant(double a, double b, double c) {
  return b * b - 4 * a * c;
}


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

x86 assembly (clang, -O2):
<calculate_discriminant>:
mulsd  0xef8(%rip),%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @calculate_discriminant(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* %5
%8 = load double, double* %5
%9 = load double, double* %4
%10 = fmul double 4.000000e+00, %9
%11 = load double, double* %6
%12 = fmul double %10, %11
%13 = fneg double %12
%14 = call double @llvm.fmuladd.f64(double %7, double %8, double %13)
ret double %14
}

LLVM IR (-O2):
define double @calculate_discriminant(double %0, double %1, double %2) {
%4 = fmul double %0, -4.000000e+00
%5 = fmul double %4, %2
%6 = tail call double @llvm.fmuladd.f64(double %1, double %1, double %5)
ret double %6
}
unsigned func1(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @func1() {
ret i32 0
}
int cDigitLengthOfCSI(int csi) {
  if ((csi < 256) && (csi > -256)) {
    return 1;
  }
  if ((csi < 65536) && (csi > -65536)) {
    return 2;
  }
  if ((csi < 16777216) && (csi > -16777216)) {
    return 3;
  }
  return 4;
}


x86 assembly (clang, -O0):
<cDigitLengthOfCSI>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jge    112d <cDigitLengthOfCSI+0x2d>
cmpl   $0xffffff00,-0x8(%rbp)
jle    112d <cDigitLengthOfCSI+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1180 <cDigitLengthOfCSI+0x80>
cmpl   $0x10000,-0x8(%rbp)
jge    1153 <cDigitLengthOfCSI+0x53>
cmpl   $0xffff0000,-0x8(%rbp)
jle    1153 <cDigitLengthOfCSI+0x53>
movl   $0x2,-0x4(%rbp)
jmp    1180 <cDigitLengthOfCSI+0x80>
cmpl   $0x1000000,-0x8(%rbp)
jge    1179 <cDigitLengthOfCSI+0x79>
cmpl   $0xff000000,-0x8(%rbp)
jle    1179 <cDigitLengthOfCSI+0x79>
movl   $0x3,-0x4(%rbp)
jmp    1180 <cDigitLengthOfCSI+0x80>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cDigitLengthOfCSI>:
lea    0xff(%rdi),%ecx
mov    $0x1,%eax
cmp    $0x1ff,%ecx
jb     113a <cDigitLengthOfCSI+0x3a>
lea    0xffff(%rdi),%ecx
mov    $0x2,%eax
cmp    $0x1ffff,%ecx
jb     113a <cDigitLengthOfCSI+0x3a>
add    $0xffffff,%edi
cmp    $0x1ffffff,%edi
mov    $0x4,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @cDigitLengthOfCSI(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 256
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, -256
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %25
10: ; preds = %6, %1
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 65536
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i32, i32* %3
%15 = icmp sgt i32 %14, -65536
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 2, i32* %2
br label %25
17: ; preds = %13, %10
%18 = load i32, i32* %3
%19 = icmp slt i32 %18, 16777216
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = load i32, i32* %3
%22 = icmp sgt i32 %21, -16777216
br i1 %22, label %23, label %24
23: ; preds = %20
store i32 3, i32* %2
br label %25
24: ; preds = %20, %17
store i32 4, i32* %2
br label %25
25: ; preds = %24, %23, %16, %9
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @cDigitLengthOfCSI(i32 %0) {
%2 = add i32 %0, 255
%3 = icmp ult i32 %2, 511
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = add i32 %0, 65535
%6 = icmp ult i32 %5, 131071
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = add i32 %0, 16777215
%9 = icmp ult i32 %8, 33554431
%10 = select i1 %9, i32 3, i32 4
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %1 ], [ 2, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int func();
void main(void) {
  int x;
  x = func();
}


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @func()
ret void
}
int main(void) {
  int y;
  int x;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int sanitize_input(const char *input, unsigned int input_len) {
  unsigned int i = 0;
  while (i < input_len && i != ';' && i != '=')
    i++;
  return i;
}


x86 assembly (clang, -O0):
<sanitize_input>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x11(%rbp)
jae    113c <sanitize_input+0x3c>
xor    %eax,%eax
cmpl   $0x3b,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     113c <sanitize_input+0x3c>
cmpl   $0x3d,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    114c <sanitize_input+0x4c>
jmp    115a <sanitize_input+0x5a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <sanitize_input+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sanitize_input>:
xor    %eax,%eax
test   %esi,%esi
je     1123 <sanitize_input+0x23>
cs nopw 0x0(%rax,%rax,1)
cmp    $0x3b,%eax
je     1123 <sanitize_input+0x23>
cmp    $0x3d,%eax
je     1123 <sanitize_input+0x23>
add    $0x1,%eax
cmp    %eax,%esi
jne    1110 <sanitize_input+0x10>
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @sanitize_input(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, 59
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %5
%15 = icmp ne i32 %14, 61
br label %16
16: ; preds = %13, %10, %6
%17 = phi i1 [ false, %10 ], [ false, %6 ], [ %15, %13 ]
br i1 %17, label %18, label %21
18: ; preds = %16
%19 = load i32, i32* %5
%20 = add i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %16
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @sanitize_input(i8* nocapture readnone %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %6
%5 = phi i32 [ %7, %6 ], [ 0, %2 ]
switch i32 %5, label %6 [
i32 61, label %9
i32 59, label %9
]
6: ; preds = %4
%7 = add nuw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %6, %4, %4, %2
%10 = phi i32 [ 0, %2 ], [ %5, %4 ], [ %5, %4 ], [ %1, %6 ]
ret i32 %10
}
int Max(int Lhs, int Rhs) { return Lhs > Rhs ? Lhs : Rhs; }


x86 assembly (clang, -O0):
<Max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <Max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <Max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @Max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printmsg(char *);
int main() {
  printmsg("Hello,World!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello,World!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printmsg(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello,World!\0A\00"
define i32 @main() {
%1 = tail call i32 @printmsg(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int gcd(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(int argc, const char *argv[]) {
  int i, j;
  scanf("%i %i", &i, &j);
  printf("%i", gcd(i, j));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1050 <gcd@plt>
mov    %eax,%esi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1050 <gcd@plt>
lea    0xeab(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%i %i\00"
@.str.1 = [3 x i8] c"%i\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %6, i32* %7)
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = call i32 @gcd(i32 %9, i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%i %i\00"
@.str.1 = [3 x i8] c"%i\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @gcd(i32 %8, i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
const char *cJSON_Version(void) {
  static char version[15];
  sprintf(version, "%i.%i.%i", 1, 4, 5);
  return version;
}


x86 assembly (clang, -O0):
<cJSON_Version>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f0e(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x1,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
call   1030 <sprintf@plt>
lea    0x2eeb(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cJSON_Version>:
push   %rbx
lea    0x2f11(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 4, i32 5)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}

LLVM IR (-O2):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 4, i32 5)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}
/* Type definitions */
typedef scalar_t__ ulong;

/* Variables and functions */
int neq(ulong x, ulong y) { return x != y; }


x86 assembly (clang, -O0):
<neq>:
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):
<neq>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @neq(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 ne i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @neq(i64 %0, i64 %1) {
%3 = icmp ne i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ strtoll(char *, char **, int /*<<< orphan*/);
int64_t __attribute__((weak)) fio_atol(char **pstr) {
  return strtoll((char *)*pstr, (char **)pstr, 0);
}


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

x86 assembly (clang, -O2):
<fio_atol>:
mov    %rdi,%rsi
mov    (%rdi),%rdi
xor    %edx,%edx
jmp    1030 <strtoll@plt>

LLVM IR (-O0):
define weak i32 @fio_atol(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = load i8**, i8*** %2
%6 = call i32 @strtoll(i8* %4, i8** %5, i32 0)
ret i32 %6
}

LLVM IR (-O2):
define weak i32 @fio_atol(i8** %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @strtoll(i8* %2, i8** %0, i32 0)
ret i32 %3
}
void shutdown_meshscope() {}


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

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

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

LLVM IR (-O2):
define void @shutdown_meshscope() {
ret void
}
int sestej(int a) {
  int r = 0;
  while (a > 0) {
    r += a % 10;
    a /= 10;
  }
  return r;
}


x86 assembly (clang, -O0):
<sestej>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113c <sestej+0x3c>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <sestej+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sestej>:
xor    %eax,%eax
test   %edi,%edi
jle    112d <sestej+0x2d>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
add    %ecx,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <sestej+0x10>
ret

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

LLVM IR (-O2):
define i32 @sestej(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = urem i32 %5, 10
%7 = add nuw nsw i32 %4, %6
%8 = udiv i32 %5, 10
%9 = icmp ult i32 %5, 10
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ croots_nearZero(double);
double roundZero(double r) {
  if (croots_nearZero(r))
    return 0.0;
  else
    return r;
}


x86 assembly (clang, -O0):
<roundZero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <croots_nearZero@plt>
cmp    $0x0,%rax
je     113e <roundZero+0x2e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1148 <roundZero+0x38>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundZero>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <croots_nearZero@plt>
movsd  (%rsp),%xmm0
test   %rax,%rax
je     1128 <roundZero+0x18>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @roundZero(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = call i64 @croots_nearZero(double %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store double 0.000000e+00, double* %2
br label %10
8: ; preds = %1
%9 = load double, double* %3
store double %9, double* %2
br label %10
10: ; preds = %8, %7
%11 = load double, double* %2
ret double %11
}

LLVM IR (-O2):
define double @roundZero(double %0) {
%2 = tail call i64 @croots_nearZero(double %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, double %0, double 0.000000e+00
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, char *, int);
int32_t extract_32bits(char *p) {
  int32_t tmp;
  memcpy(&tmp, p, sizeof(int32_t));
  return tmp;
}


x86 assembly (clang, -O0):
<extract_32bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @extract_32bits(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
/* Type definitions */
struct timeval {
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double dclock() {
  double the_time, norm_sec;
  struct timeval tv;
  gettimeofday(&tv, NULL);
  the_time = tv.tv_usec * 1.0e-6;
  return the_time;
}


x86 assembly (clang, -O0):
<dclock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  0xed3(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dclock>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  (%rsp),%xmm0
mulsd  0xed8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { double }
define double @dclock() {
%1 = alloca double
%2 = alloca double
%3 = alloca %struct.timeval
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%6 = load double, double* %5
%7 = fmul double %6, 0x3EB0C6F7A0B5ED8D
store double %7, double* %1
%8 = load double, double* %1
ret double %8
}

LLVM IR (-O2):
%struct.timeval = type { double }
define double @dclock() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = fmul double %5, 0x3EB0C6F7A0B5ED8D
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int ranInt(int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  srand(time(NULL));
  for (unsigned int i = 0; i <= 42; ++i)
    printf("%u\n", ranInt(42));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2a,-0x8(%rbp)
ja     1196 <main+0x56>
mov    $0x2a,%edi
call   1060 <ranInt@plt>
mov    %eax,%esi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1166 <main+0x26>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x2b,%ebp
lea    0xea3(%rip),%rbx
nopl   (%rax)
mov    $0x2a,%edi
call   1060 <ranInt@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1160 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
br label %4
3: ; preds = %4
ret i32 0
4: ; preds = %0, %4
%5 = phi i32 [ 0, %0 ], [ %8, %4 ]
%6 = tail call i32 @ranInt(i32 42)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %8, 43
br i1 %9, label %3, label %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("I like you!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"I like you!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"I like you!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
double coq_fadd(double x, double y) { return x + y; }


x86 assembly (clang, -O0):
<coq_fadd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<coq_fadd>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @coq_fadd(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @coq_fadd(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
void gdi_fast_mutex_lock(void) {}


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

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

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

LLVM IR (-O2):
define void @gdi_fast_mutex_lock() {
ret void
}
void dead_result2(int *data) {
  int j;
  j = data[2];
  data[j] = 2;
}


x86 assembly (clang, -O0):
<dead_result2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x2,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dead_result2>:
movslq 0x8(%rdi),%rax
movl   $0x2,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @dead_result2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 2
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32*, i32** %2
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
store i32 2, i32* %10
ret void
}

LLVM IR (-O2):
define void @dead_result2(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 2, i32* %5
ret void
}
unsigned char unsignedchar_ignoring_signedint(unsigned char x, signed int y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedchar_ignoring_signedint>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @unsignedchar_ignoring_signedint(i8 returned zeroext %0, i32 %1) {
ret i8 %0
}
/* Variables and functions */
float truncf(float);
float nearbyintf(float x) { return truncf(x); }


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

x86 assembly (clang, -O2):
<nearbyintf>:
jmp    1030 <truncf@plt>

LLVM IR (-O0):
define float @nearbyintf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.trunc.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @nearbyintf(float %0) {
%2 = tail call float @llvm.trunc.f32(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
char *convert(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  printf("%s\n", convert(argv[1], atoi(argv[2])));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <convert@plt>
mov    %rax,%rsi
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rbx
mov    0x10(%rsi),%rdi
call   1050 <atoi@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <convert@plt>
lea    0xeb1(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = tail call i8* @convert(i8* %4, i32 %7)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void version() {
  printf("Copyright (C) 2013.\n"
         "License GPLv2+: GNU GPL version 2 or later"
         " <http://gnu.org/licenses/old-licenses/gpl-2.0.html>.\n"
         "This is free software: you are free to change and"
         " redistribute it.\n"
         "There is NO WARRANTY, to the extent permitted by law.\n"
         "\n"
         "Written by %s.\n",
         "Luis Ortega Perez de Villar");
}


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

x86 assembly (clang, -O2):
<version>:
lea    0xee9(%rip),%rdi
lea    0xfe0(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [254 x i8] c"Copyright (C) 2013.\0ALicense GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/old-licenses/gpl-2.0.html>.\0AThis is free software: you are free to change and redistribute it.\0AThere is NO WARRANTY, to the extent permitted by law.\0A\0AWritten by %s.\0A\00"
@.str.1 = [28 x i8] c"Luis Ortega Perez de Villar\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([254 x i8], [254 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [254 x i8] c"Copyright (C) 2013.\0ALicense GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/old-licenses/gpl-2.0.html>.\0AThis is free software: you are free to change and redistribute it.\0AThere is NO WARRANTY, to the extent permitted by law.\0A\0AWritten by %s.\0A\00"
@.str.1 = [28 x i8] c"Luis Ortega Perez de Villar\00"
define void @version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([254 x i8], [254 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int errno;
int ferrno(void) { return errno ? (-errno) + (-256) : 0; }


x86 assembly (clang, -O0):
<ferrno>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
cmpl   $0x0,(%rax)
je     112c <ferrno+0x2c>
xor    %eax,%eax
mov    0x2ec3(%rip),%rcx
sub    (%rcx),%eax
add    $0xffffff00,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <ferrno+0x36>
xor    %eax,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <ferrno+0x36>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ferrno>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    $0xffffff00,%eax
sub    %ecx,%eax
test   %ecx,%ecx
cmove  %ecx,%eax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @ferrno() {
%1 = load i32, i32* @errno
%2 = icmp ne i32 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = load i32, i32* @errno
%5 = sub nsw i32 0, %4
%6 = add nsw i32 %5, -256
br label %8
7: ; preds = %0
br label %8
8: ; preds = %7, %3
%9 = phi i32 [ %6, %3 ], [ 0, %7 ]
ret i32 %9
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @ferrno() {
%1 = load i32, i32* @errno
%2 = icmp eq i32 %1, 0
%3 = sub i32 -256, %1
%4 = select i1 %2, i32 0, i32 %3
ret i32 %4
}
/* Variables and functions */
unsigned int fast_random(unsigned long *, unsigned int);
unsigned int fast_random_callback(void *ctx, unsigned int max_value) {
  unsigned long *seed = (unsigned long *)ctx;
  return fast_random(seed, max_value);
}


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

x86 assembly (clang, -O2):
<fast_random_callback>:
jmp    1030 <fast_random@plt>

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

LLVM IR (-O2):
define i32 @fast_random_callback(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i64*
%4 = tail call i32 @fast_random(i64* %3, i32 %1)
ret i32 %4
}
int d01(int a) { return (a * 17 + 29) % 1553; }


x86 assembly (clang, -O0):
<d01>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x11,-0x4(%rbp),%eax
add    $0x1d,%eax
mov    $0x611,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d01>:
mov    %edi,%eax
shl    $0x4,%eax
add    %edi,%eax
add    $0x1d,%eax
cltq
imul   $0x546633c3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x29,%rcx
add    %edx,%ecx
imul   $0x611,%ecx,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @d01(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 17
%5 = add nsw i32 %4, 29
%6 = srem i32 %5, 1553
ret i32 %6
}

LLVM IR (-O2):
define i32 @d01(i32 %0) {
%2 = mul nsw i32 %0, 17
%3 = add nsw i32 %2, 29
%4 = srem i32 %3, 1553
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void testMenu() { printf("This menu is working!"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"This menu is working!\00"
define void @testMenu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"This menu is working!\00"
define void @testMenu() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int const min(int const, int const);
int MIN(const int x, const int y, const int z) {
  return (int)min(x, min(y, z));
}


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

x86 assembly (clang, -O2):
<MIN>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
mov    %edx,%esi
call   1030 <min@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <min@plt>

LLVM IR (-O0):
define i32 @MIN(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 = load i32, i32* %6
%10 = call i32 @min(i32 %8, i32 %9)
%11 = call i32 @min(i32 %7, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @MIN(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @min(i32 %1, i32 %2)
%5 = tail call i32 @min(i32 %0, i32 %4)
ret i32 %5
}
/* Variables and functions */
double Melder_round_tieDown(double);
double Melder_round_tieUp(double);
double Melder_round_tieTowardsZero(double x) {
  return x >= 0.0 ? Melder_round_tieDown(x) : Melder_round_tieUp(x);
}


x86 assembly (clang, -O0):
<Melder_round_tieTowardsZero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1153 <Melder_round_tieTowardsZero+0x33>
movsd  -0x8(%rbp),%xmm0
call   1030 <Melder_round_tieDown@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    1162 <Melder_round_tieTowardsZero+0x42>
movsd  -0x8(%rbp),%xmm0
call   1040 <Melder_round_tieUp@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Melder_round_tieTowardsZero>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    112f <Melder_round_tieTowardsZero+0xf>
jmp    1040 <Melder_round_tieUp@plt>
jmp    1030 <Melder_round_tieDown@plt>

LLVM IR (-O0):
define double @Melder_round_tieTowardsZero(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = call double @Melder_round_tieDown(double %6)
br label %11
8: ; preds = %1
%9 = load double, double* %2
%10 = call double @Melder_round_tieUp(double %9)
br label %11
11: ; preds = %8, %5
%12 = phi double [ %7, %5 ], [ %10, %8 ]
ret double %12
}

LLVM IR (-O2):
define double @Melder_round_tieTowardsZero(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call double @Melder_round_tieDown(double %0)
br label %7
5: ; preds = %1
%6 = tail call double @Melder_round_tieUp(double %0)
br label %7
7: ; preds = %5, %3
%8 = phi double [ %4, %3 ], [ %6, %5 ]
ret double %8
}
void ScaleAddRow_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @ScaleAddRow_AVX2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dump_log();
void log_dump_handler(void) { dump_log(); }


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

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

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

LLVM IR (-O2):
define void @log_dump_handler() {
%1 = tail call i32 (...) @dump_log()
ret void
}
void g_utf8_strdown() {}


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

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

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

LLVM IR (-O2):
define void @g_utf8_strdown() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int isFemale = 1;
  if (isFemale) {
    printf("false");
  } else {
    printf("true");
  }
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1148 <main+0x38>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
jmp    1154 <main+0x44>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"false\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Variables and functions */
float func(float, float);
float step(float, double);
float func1(float x, float y) {
  float v = func(x, y);
  return 1. - step(v, 0.0);
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <func@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
call   1040 <step@plt>
cvtss2sd %xmm0,%xmm1
movsd  0xea1(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
push   %rax
call   1030 <func@plt>
xorps  %xmm1,%xmm1
call   1040 <step@plt>
movss  0xeca(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @func1(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = call float @func(float %6, float %7)
store float %8, float* %5
%9 = load float, float* %5
%10 = call float @step(float %9, double 0.000000e+00)
%11 = fpext float %10 to double
%12 = fsub double 1.000000e+00, %11
%13 = fptrunc double %12 to float
ret float %13
}

LLVM IR (-O2):
define float @func1(float %0, float %1) {
%3 = tail call float @func(float %0, float %1)
%4 = tail call float @step(float %3, double 0.000000e+00)
%5 = fsub float 1.000000e+00, %4
ret float %5
}
unsigned int get_2_le(const unsigned char *ptr) {
  return ptr[0] | (ptr[1] << 8);
}


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

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

LLVM IR (-O0):
define i32 @get_2_le(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @get_2_le(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
void swap(int matrix[], int i, int j) {
  int temp;
  temp = matrix[i];
  matrix[i] = matrix[j];
  matrix[j] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}