xunge/DecIR huggingface dataset:
/* Variables and functions */
int issep(char);
int ischange(char ch1, char ch2) {
  int retval;
  int a = issep(ch1);
  int b = issep(ch2);
  if ((a != b))
    retval = 1;
  else
    retval = 0;
  return retval;
}


x86 assembly (clang, -O0):
<ischange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <issep@plt>
mov    %eax,-0xc(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <issep@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     1154 <ischange+0x44>
movl   $0x1,-0x8(%rbp)
jmp    115b <ischange+0x4b>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ischange>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1030 <issep@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <issep@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
setne  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ischange(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @issep(i8 signext %0)
%4 = tail call i32 @issep(i8 signext %1)
%5 = icmp ne i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int main(int input) {
  char i = 0;
  while (input) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1129 <main+0x29>
mov    -0x9(%rbp),%al
add    $0x1,%al
mov    %al,-0x9(%rbp)
jmp    1112 <main+0x12>
movsbl -0x9(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char);
int main() {
  printf("%s, %s%c", "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
lea    0xedc(%rip),%rsi
lea    0xedb(%rip),%rdx
mov    $0xa,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"%s, %s%c\00"
@.str.1 = [6 x i8] c"hello\00"
@.str.2 = [6 x i8] c"world\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s, %s%c\00"
@.str.1 = [6 x i8] c"hello\00"
@.str.2 = [6 x i8] c"world\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8 signext 10)
ret i32 0
}
void main() {
  int i;
  double f;
  i = 5;
  f = 3.14159;
  f = i + f;
  f = 10;
  i = (int)f;
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x4(%rbp)
movsd  0xef5(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca double
store i32 5, i32* %1
store double 3.141590e+00, double* %2
%3 = load i32, i32* %1
%4 = sitofp i32 %3 to double
%5 = load double, double* %2
%6 = fadd double %4, %5
store double %6, double* %2
store double 1.000000e+01, double* %2
%7 = load double, double* %2
%8 = fptosi double %7 to i32
store i32 %8, i32* %1
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
double err_rel(double x, double y) { return (x - y) / x; }


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

x86 assembly (clang, -O2):
<err_rel>:
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
divsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @err_rel(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 = fsub double %5, %6
%8 = load double, double* %3
%9 = fdiv double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @err_rel(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fdiv double %3, %0
ret double %4
}
int compat_sched_getcpu(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @compat_sched_getcpu() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ absolute();
int /*<<< orphan*/ trb16(int /*<<< orphan*/);
void trbAbs16(void) { trb16(absolute()); }


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

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

LLVM IR (-O0):
define void @trbAbs16() {
%1 = call i32 (...) @absolute()
%2 = call i32 @trb16(i32 %1)
ret void
}

LLVM IR (-O2):
define void @trbAbs16() {
%1 = tail call i32 (...) @absolute()
%2 = tail call i32 @trb16(i32 %1)
ret void
}
void ui_show_indeterminate_progress() {}


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

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

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

LLVM IR (-O2):
define void @ui_show_indeterminate_progress() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int indeks(int i, int n) {
  if (i >= n || i < 0) {
    printf("Index poza zakresem \n");
    exit(1);
    return 0;
  } else
    return i;
}


x86 assembly (clang, -O0):
<indeks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1144 <indeks+0x24>
cmpl   $0x0,-0x4(%rbp)
jge    115a <indeks+0x3a>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indeks>:
test   %edi,%edi
js     112b <indeks+0xb>
cmp    %esi,%edi
jge    112b <indeks+0xb>
mov    %edi,%eax
ret
push   %rax
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Index poza zakresem \0A\00"
define i32 @indeks(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 sge i32 %5, %6
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8, %2
%12 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@str = [21 x i8] c"Index poza zakresem \00"
define i32 @indeks(i32 returned %0, i32 %1) {
%3 = icmp sge i32 %0, %1
%4 = icmp slt i32 %0, 0
%5 = or i1 %4, %3
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_emacs_lisp_comments() {
  test_parser_verify_parse(test_parser_sourcefile("emacslisp", " ;;comment"),
                           "emacslisp", "", ";;comment", 0);
}


x86 assembly (clang, -O0):
<test_emacs_lisp_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xec2(%rip),%rdx
lea    0xebd(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_emacs_lisp_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xedb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xecb(%rip),%rdx
lea    0xec6(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"emacslisp\00"
@.str.1 = [11 x i8] c" ;;comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c";;comment\00"
define void @test_emacs_lisp_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"emacslisp\00"
@.str.1 = [11 x i8] c" ;;comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c";;comment\00"
define void @test_emacs_lisp_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getlogin();
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int main() { puts(getlogin()); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @getlogin()
%2 = call i32 @puts(i32 %1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getlogin()
%2 = tail call i32 @puts(i32 %1)
ret i32 0
}
int formaTriangulo(int a, int b, int c) {
  return a + b > c && b + c > a && a + c > b;
}


x86 assembly (clang, -O0):
<formaTriangulo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0xd(%rbp)
jle    1144 <formaTriangulo+0x44>
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x4(%rbp),%ecx
mov    %al,-0xd(%rbp)
jle    1144 <formaTriangulo+0x44>
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<formaTriangulo>:
lea    (%rsi,%rdi,1),%eax
cmp    %edx,%eax
setg   %al
lea    (%rdx,%rsi,1),%ecx
cmp    %edi,%ecx
setg   %cl
and    %al,%cl
add    %edi,%edx
cmp    %esi,%edx
setg   %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @formaTriangulo(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 = add nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = icmp sgt i32 %9, %10
br i1 %11, label %12, label %24
12: ; preds = %3
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
%16 = load i32, i32* %4
%17 = icmp sgt i32 %15, %16
br i1 %17, label %18, label %24
18: ; preds = %12
%19 = load i32, i32* %4
%20 = load i32, i32* %6
%21 = add nsw i32 %19, %20
%22 = load i32, i32* %5
%23 = icmp sgt i32 %21, %22
br label %24
24: ; preds = %18, %12, %3
%25 = phi i1 [ false, %12 ], [ false, %3 ], [ %23, %18 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @formaTriangulo(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = icmp sgt i32 %4, %2
%6 = add nsw i32 %2, %1
%7 = icmp sgt i32 %6, %0
%8 = select i1 %5, i1 %7, i1 false
%9 = add nsw i32 %2, %0
%10 = icmp sgt i32 %9, %1
%11 = select i1 %8, i1 %10, i1 false
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char const *);
FILE *elhash_fopen(char const *file_name, char const *mode) {
  return fopen(file_name, mode);
}


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

x86 assembly (clang, -O2):
<elhash_fopen>:
jmp    1030 <fopen@plt>

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

LLVM IR (-O2):
define noalias i32* @elhash_fopen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
ret i32* %3
}
unsigned quickhash(char *sym) {
  register unsigned int hash = 0;
  register unsigned c;
  while ((c = *sym++))
    hash = hash * 9 ^ c;
  return hash;
}


x86 assembly (clang, -O0):
<quickhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     113c <quickhash+0x3c>
imul   $0x9,-0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <quickhash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickhash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <quickhash+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rax,%rax,8),%eax
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <quickhash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @quickhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 9
%11 = xor i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char **argv) {
  double pettycash = 10.5;
  double grandtotal = 500.50;
  printf("pettycash=%.2f\n", pettycash);
  pettycash = 10.5 / 11;
  printf("pettycash=%.2f\n", pettycash);
  printf("grandtotal=%.2f\n", grandtotal);
  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)
movsd  0xee2(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xecd(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
movsd  0xea7(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf00(%rip),%rbx
movsd  0xee0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xed8(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
movsd  0xec9(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"pettycash=%.2f\0A\00"
@.str.1 = [17 x i8] c"grandtotal=%.2f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 1.050000e+01, double* %6
store double 5.005000e+02, double* %7
%8 = load double, double* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %8)
store double 0x3FEE8BA2E8BA2E8C, double* %6
%10 = load double, double* %6
%11 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %10)
%12 = load double, double* %7
%13 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"pettycash=%.2f\0A\00"
@.str.1 = [17 x i8] c"grandtotal=%.2f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double 1.050000e+01)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double 0x3FEE8BA2E8BA2E8C)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double 5.005000e+02)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ fatal(char *, char const *, char const *);
int /*<<< orphan*/ *fopen(char const *, char const *);
FILE *efopen(const char *filename, const char *mode) {
  FILE *file;
  errno = 0;
  if (NULL == (file = fopen(filename, mode)) || errno != 0)
    fatal("fopen(%s, %s) failed:", filename, mode);
  return file;
}


x86 assembly (clang, -O0):
<efopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fopen@plt>
mov    %rax,%rcx
mov    %rcx,-0x18(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
je     116e <efopen+0x4e>
mov    0x2e7c(%rip),%rax
cmpq   $0x0,(%rax)
je     1182 <efopen+0x62>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe83(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<efopen>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
mov    0x2eab(%rip),%r12
movq   $0x0,(%r12)
call   1030 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1151 <efopen+0x31>
cmpq   $0x0,(%r12)
je     1163 <efopen+0x43>
lea    0xea8(%rip),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <fatal@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@errno = global i64 0
@.str = [22 x i8] c"fopen(%s, %s) failed:\00"
define i32* @efopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
store i64 0, i64* @errno
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = icmp eq i32* null, %8
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = load i64, i64* @errno
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %10, %2
%14 = load i8*, i8** %3
%15 = load i8*, i8** %4
%16 = call i32 @fatal(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %15)
br label %17
17: ; preds = %13, %10
%18 = load i32*, i32** %5
ret i32* %18
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [22 x i8] c"fopen(%s, %s) failed:\00"
define noalias i32* @efopen(i8* %0, i8* %1) {
store i64 0, i64* @errno
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
%5 = load i64, i64* @errno
%6 = icmp ne i64 %5, 0
%7 = select i1 %4, i1 true, i1 %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @fatal(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %10
10: ; preds = %2, %8
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ put8(unsigned char);
void jae_rj(unsigned char saut) {
  put8(0x73);
  put8(saut);
}


x86 assembly (clang, -O0):
<jae_rj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x73,%edi
call   1030 <put8@plt>
movzbl -0x1(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jae_rj>:
push   %rbx
mov    %edi,%ebx
mov    $0x73,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @jae_rj(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @put8(i8 zeroext 115)
%4 = load i8, i8* %2
%5 = call i32 @put8(i8 zeroext %4)
ret void
}

LLVM IR (-O2):
define void @jae_rj(i8 zeroext %0) {
%2 = tail call i32 @put8(i8 zeroext 115)
%3 = tail call i32 @put8(i8 zeroext %0)
ret void
}
void gtk_action_set_visible() {}


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

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

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

LLVM IR (-O2):
define void @gtk_action_set_visible() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_sys_cfg_eapol_gwk_hsk_usage(void) {
  printf("\nUsage : sys_cfg_eapol_gwk_hsk [<TIMEOUT> <RETRIES>]\n");
  printf("\nIf TIMEOUT and number of RETRIES are both provided, a 'set' is "
         "performed.");
  printf("\nIf no parameter is provided,a 'get' is performed.");
  printf("\nTIMEOUT and number of RETRIES should be greater than or equal to "
         "zero\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_sys_cfg_eapol_gwk_hsk_usage>:
push   %rax
lea    0xf56(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
lea    0xf0b(%rip),%rdi
call   1040 <printf@plt>
lea    0xf67(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"\0AUsage : sys_cfg_eapol_gwk_hsk [<TIMEOUT> <RETRIES>]\0A\00"
@.str.1 = [75 x i8] c"\0AIf TIMEOUT and number of RETRIES are both provided, a 'set' is performed.\00"
@.str.2 = [51 x i8] c"\0AIf no parameter is provided,a 'get' is performed.\00"
@.str.3 = [72 x i8] c"\0ATIMEOUT and number of RETRIES should be greater than or equal to zero\0A\00"
define void @print_sys_cfg_eapol_gwk_hsk_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [75 x i8] c"\0AIf TIMEOUT and number of RETRIES are both provided, a 'set' is performed.\00"
@.str.2 = [51 x i8] c"\0AIf no parameter is provided,a 'get' is performed.\00"
@str = [53 x i8] c"\0AUsage : sys_cfg_eapol_gwk_hsk [<TIMEOUT> <RETRIES>]\00"
@str.4 = [71 x i8] c"\0ATIMEOUT and number of RETRIES should be greater than or equal to zero\00"
define void @print_sys_cfg_eapol_gwk_hsk_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
unsigned long long rdtsc();
int main() {
  unsigned long long cycles = rdtsc();
  cycles = rdtsc() - cycles;
  printf("Time is %d\n", (unsigned)cycles);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <rdtsc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <rdtsc@plt>
sub    %ebx,%eax
lea    0xec5(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"Time is %d\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @rdtsc()
%2 = tail call i64 (...) @rdtsc()
%3 = sub i64 %2, %1
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
int is_white(char c) {
  switch (c) {
  case ' ':
  case '\t':
  case '\f':
  case '\n':
  case '\r':
    return 1;
  default:
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_white>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffff7,%eax
sub    $0x2,%eax
jb     1147 <is_white+0x47>
jmp    1122 <is_white+0x22>
mov    -0xc(%rbp),%eax
add    $0xfffffff4,%eax
sub    $0x2,%eax
jb     1147 <is_white+0x47>
jmp    1136 <is_white+0x36>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
jne    1153 <is_white+0x53>
jmp    1147 <is_white+0x47>
movl   $0x1,-0x4(%rbp)
jmp    115f <is_white+0x5f>
jmp    1158 <is_white+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_white>:
cmp    $0x20,%edi
ja     111d <is_white+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100003600,%rdx
bt     %rcx,%rdx
jae    111d <is_white+0x1d>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_white(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
switch i32 %5, label %7 [
i32 32, label %6
i32 9, label %6
i32 12, label %6
i32 10, label %6
i32 13, label %6
]
6: ; preds = %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %9
7: ; preds = %1
br label %8
8: ; preds = %7
store i32 0, i32* %2
br label %9
9: ; preds = %8, %6
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_white(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 32, label %4
i32 9, label %4
i32 12, label %4
i32 10, label %4
i32 13, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
double milesToYards(double miles) { return miles * 1760.0; }


x86 assembly (clang, -O0):
<milesToYards>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<milesToYards>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @milesToYards(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.760000e+03
ret double %4
}

LLVM IR (-O2):
define double @milesToYards(double %0) {
%2 = fmul double %0, 1.760000e+03
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ FIBMAP;
int ioctl(int, int /*<<< orphan*/, int *);
int /*<<< orphan*/ perror(char *);
int get_block(int fd, int logical_block) {
  int ret;
  ret = ioctl(fd, FIBMAP, &logical_block);
  if (ret < 0) {
    perror("ioctl");
    return -1;
  }
  return logical_block;
}


x86 assembly (clang, -O0):
<get_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1030 <ioctl@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1168 <get_block+0x48>
lea    0xea9(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <get_block+0x4e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_block>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
test   %eax,%eax
js     1142 <get_block+0x22>
mov    0x4(%rsp),%eax
pop    %rcx
ret
lea    0xeb7(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@FIBMAP = global i32 0
@.str = [6 x i8] c"ioctl\00"
define i32 @get_block(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i32, i32* @FIBMAP
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %3)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %2
%10 = load i32, i32* %3
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ -1, %7 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i = 0, j;
  if (i < 200) {
    printf("1\n");
    if (i == 1 || i == 2 || i == 3) {
      printf("2\n");
    }
  }
  printf("3\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xc8,-0x8(%rbp)
jge    116e <main+0x5e>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x1,-0x8(%rbp)
je     115d <main+0x4d>
cmpl   $0x2,-0x8(%rbp)
je     115d <main+0x4d>
cmpl   $0x3,-0x8(%rbp)
jne    1169 <main+0x59>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
jmp    116e <main+0x5e>
lea    0xe91(%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>
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [2 x i8] c"1\00"
@str.3 = [2 x i8] c"3\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
float fastpow(float, float);
float linear_to_srgb(float clr) {
  if (clr <= 0.0031308f)
    return 12.92f * clr * 255.0f;
  return 1.055f * 255.0f * fastpow(clr, 0.41666666f) - 14.025f;
}


x86 assembly (clang, -O0):
<linear_to_srgb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  0xedb(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1152 <linear_to_srgb+0x42>
movss  0xedd(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  0xecc(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1181 <linear_to_srgb+0x71>
movss  -0x8(%rbp),%xmm0
movss  0xead(%rip),%xmm1
call   1030 <fastpow@plt>
movss  0xe98(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xe90(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear_to_srgb>:
push   %rax
movss  0xee7(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    113d <linear_to_srgb+0x2d>
movss  0xee6(%rip),%xmm1
call   1030 <fastpow@plt>
mulss  0xedd(%rip),%xmm0
addss  0xed9(%rip),%xmm0
pop    %rax
ret
mulss  0xebf(%rip),%xmm0
mulss  0xebb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @linear_to_srgb(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp ole float %4, 0x3F69A5C380000000
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load float, float* %3
%8 = fmul float 0x4029D70A40000000, %7
%9 = fmul float %8, 2.550000e+02
store float %9, float* %2
br label %14
10: ; preds = %1
%11 = load float, float* %3
%12 = call float @fastpow(float %11, float 0x3FDAAAAAA0000000)
%13 = call float @llvm.fmuladd.f32(float 0x4070D06660000000, float %12, float 0xC02C0CCCC0000000)
store float %13, float* %2
br label %14
14: ; preds = %10, %6
%15 = load float, float* %2
ret float %15
}

LLVM IR (-O2):
define float @linear_to_srgb(float %0) {
%2 = fcmp ugt float %0, 0x3F69A5C380000000
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = fmul float %0, 0x4029D70A40000000
%5 = fmul float %4, 2.550000e+02
br label %9
6: ; preds = %1
%7 = tail call float @fastpow(float %0, float 0x3FDAAAAAA0000000)
%8 = tail call float @llvm.fmuladd.f32(float %7, float 0x4070D06660000000, float 0xC02C0CCCC0000000)
br label %9
9: ; preds = %6, %3
%10 = phi float [ %5, %3 ], [ %8, %6 ]
ret float %10
}
int dispense(int amount, int *fif, int *twn, int *ten) {
  *fif = amount / 50;
  amount = amount % 50;
  *twn = amount / 20;
  amount = amount % 20;
  *ten = amount / 10;
  amount = amount % 10;
}


x86 assembly (clang, -O0):
<dispense>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x32,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
mov    $0x32,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dispense>:
movslq %edi,%r8
imul   $0x51eb851f,%r8,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x24,%rdi
add    %eax,%edi
mov    %edi,(%rsi)
imul   $0x32,%edi,%eax
sub    %eax,%r8d
movsbl %r8b,%eax
imul   $0x67,%eax,%eax
movzwl %ax,%eax
movswl %ax,%esi
shr    $0xf,%eax
shr    $0xb,%esi
add    %al,%sil
movsbl %sil,%eax
mov    %eax,(%rdx)
movzbl %al,%eax
shl    $0x2,%eax
lea    (%rax,%rax,4),%eax
sub    %al,%r8b
movsbl %r8b,%eax
imul   $0x67,%eax,%eax
movzwl %ax,%edx
shr    $0xa,%eax
shr    $0xf,%edx
add    %al,%dl
movsbl %dl,%eax
mov    %eax,(%rcx)
ret

LLVM IR (-O0):
define i32 @dispense(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
%10 = load i32, i32* %6
%11 = sdiv i32 %10, 50
%12 = load i32*, i32** %7
store i32 %11, i32* %12
%13 = load i32, i32* %6
%14 = srem i32 %13, 50
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = sdiv i32 %15, 20
%17 = load i32*, i32** %8
store i32 %16, i32* %17
%18 = load i32, i32* %6
%19 = srem i32 %18, 20
store i32 %19, i32* %6
%20 = load i32, i32* %6
%21 = sdiv i32 %20, 10
%22 = load i32*, i32** %9
store i32 %21, i32* %22
%23 = load i32, i32* %6
%24 = srem i32 %23, 10
store i32 %24, i32* %6
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @dispense(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = sdiv i32 %0, 50
store i32 %5, i32* %1
%6 = srem i32 %0, 50
%7 = trunc i32 %6 to i8
%8 = sdiv i8 %7, 20
%9 = sext i8 %8 to i32
store i32 %9, i32* %2
%10 = srem i8 %7, 20
%11 = sdiv i8 %10, 10
%12 = sext i8 %11 to i32
store i32 %12, i32* %3
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ etp_set_idle_timeout(unsigned int);
void eio_set_idle_timeout(unsigned int seconds) {
  etp_set_idle_timeout(seconds);
}


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

x86 assembly (clang, -O2):
<eio_set_idle_timeout>:
jmp    1030 <etp_set_idle_timeout@plt>

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

LLVM IR (-O2):
define void @eio_set_idle_timeout(i32 %0) {
%2 = tail call i32 @etp_set_idle_timeout(i32 %0)
ret void
}
/* Type definitions */
struct cpu_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _mem_free(struct cpu_t *, char *, int);
void cpu_destroy(struct cpu_t *cpu) {
  do {
    _mem_free(
        cpu,
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/bitbckt/DCPU/refs/heads/master/src/cpu.c",
        264);
    (cpu) = NULL;
  } while (0);
}


x86 assembly (clang, -O0):
<cpu_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x108,%edx
call   1030 <_mem_free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_destroy>:
lea    0xee9(%rip),%rsi
mov    $0x108,%edx
jmp    1030 <_mem_free@plt>

LLVM IR (-O0):
%struct.cpu_t = type { i32 }
@.str = [131 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitbckt/DCPU/refs/heads/master/src/cpu.c\00"
define void @cpu_destroy(%struct.cpu_t* %0) {
%2 = alloca %struct.cpu_t*
store %struct.cpu_t* %0, %struct.cpu_t** %2
br label %3
3: ; preds = %1
%4 = load %struct.cpu_t*, %struct.cpu_t** %2
%5 = call i32 @_mem_free(%struct.cpu_t* %4, i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i32 264)
store %struct.cpu_t* null, %struct.cpu_t** %2
br label %6
6: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.cpu_t = type { i32 }
@.str = [131 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitbckt/DCPU/refs/heads/master/src/cpu.c\00"
define void @cpu_destroy(%struct.cpu_t* %0) {
%2 = tail call i32 @_mem_free(%struct.cpu_t* %0, i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i32 264)
ret void
}
int nand_wait_rb_mode(void) { return 1 ? 1 : 0; }


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

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

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

LLVM IR (-O2):
define i32 @nand_wait_rb_mode() {
ret i32 1
}
/* Variables and functions */
int lis(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int arr[8] = {10, 22, 9, 33, 21, 50, 41, 60};
  printf("LIS is : %d\n", lis(arr, 8));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
call   1030 <lis@plt>
mov    %eax,%esi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <lis@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [8 x i32] [i32 10, i32 22, i32 9, i32 33, i32 21, i32 50, i32 41, i32 60]
@.str = [13 x i8] c"LIS is : %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
store i32 0, i32* %1
%3 = bitcast [8 x i32]* %2 to i8*
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%5 = call i32 @lis(i32* %4, i32 8)
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [8 x i32] [i32 10, i32 22, i32 9, i32 33, i32 21, i32 50, i32 41, i32 60]
@.str = [13 x i8] c"LIS is : %d\0A\00"
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @lis(i32* %3, i32 8)
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
int f(char x, char y, char z) { return x + y + z; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
add    %ecx,%eax
movsbl -0x3(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @f(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = load i8, i8* %5
%10 = sext i8 %9 to i32
%11 = add nsw i32 %8, %10
%12 = load i8, i8* %6
%13 = sext i8 %12 to i32
%14 = add nsw i32 %11, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = sext i8 %0 to i32
%5 = sext i8 %1 to i32
%6 = add nsw i32 %5, %4
%7 = sext i8 %2 to i32
%8 = add nsw i32 %6, %7
ret i32 %8
}
int fibo(int n) {
  if (n < 1) {
    return 0;
  } else if (n == 1) {
    return 1;
  } else {
    return fibo(n - 1) + fibo(n - 2);
  }
}


x86 assembly (clang, -O0):
<fibo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    1131 <fibo+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116a <fibo+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fibo+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <fibo+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibo@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibo@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibo>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1140 <fibo+0x30>
mov    %edi,%ebx
lea    -0x1(%rbx),%ebp
xor    %r14d,%r14d
test   %ebp,%ebp
je     1145 <fibo+0x35>
lea    -0x1(%rbx),%edi
call   1030 <fibo@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%r14d
add    $0xfffffffe,%ebp
cmp    $0x2,%ebx
mov    %ecx,%ebx
ja     1120 <fibo+0x10>
xor    %eax,%eax
jmp    114a <fibo+0x3a>
xor    %r14d,%r14d
jmp    114d <fibo+0x3d>
mov    $0x1,%eax
add    %eax,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibo(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %17, label %3
3: ; preds = %1, %7
%4 = phi i32 [ %10, %7 ], [ %0, %1 ]
%5 = phi i32 [ %11, %7 ], [ 0, %1 ]
%6 = icmp eq i32 %4, 1
br i1 %6, label %13, label %7
7: ; preds = %3
%8 = add nsw i32 %4, -1
%9 = tail call i32 @fibo(i32 %8)
%10 = add nsw i32 %4, -2
%11 = add nsw i32 %9, %5
%12 = icmp ult i32 %4, 3
br i1 %12, label %13, label %3
13: ; preds = %3, %7
%14 = phi i32 [ %11, %7 ], [ %5, %3 ]
%15 = phi i32 [ 0, %7 ], [ 1, %3 ]
%16 = add nsw i32 %15, %14
br label %17
17: ; preds = %13, %1
%18 = phi i32 [ %16, %13 ], [ 0, %1 ]
ret i32 %18
}