xunge/DecIR huggingface dataset:
/* Variables and functions */
double nan(char const *);
double module_libc_nan(const char *tag) { return nan(tag); }


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

x86 assembly (clang, -O2):
<module_libc_nan>:
jmp    1030 <nan@plt>

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

LLVM IR (-O2):
define double @module_libc_nan(i8* %0) {
%2 = tail call double @nan(i8* %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("IFSPMonitoria - <3");
  return 0;
}


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

LLVM IR (-O0):
@.str = [19 x i8] c"IFSPMonitoria - <3\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 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"IFSPMonitoria - <3\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
double bytes_to_kb(const double bytes) { return bytes / 1024.0; }


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

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

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

LLVM IR (-O2):
define double @bytes_to_kb(double %0) {
%2 = fmul double %0, 0x3F50000000000000
ret double %2
}
int divide(int a, int b) { return a / b; }


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

x86 assembly (clang, -O2):
<divide>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @divide(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 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @divide(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};

/* Variables and functions */
char *stringFieldInSubmissionSource(struct sqlConnection *, int, char *);
char *visiGeneAbUrl(struct sqlConnection *conn, int id) {
  return stringFieldInSubmissionSource(conn, id, "abUrl");
}


x86 assembly (clang, -O0):
<visiGeneAbUrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <stringFieldInSubmissionSource@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<visiGeneAbUrl>:
lea    0xee9(%rip),%rdx
jmp    1030 <stringFieldInSubmissionSource@plt>

LLVM IR (-O0):
%struct.sqlConnection = type { i32 }
@.str = [6 x i8] c"abUrl\00"
define i8* @visiGeneAbUrl(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca %struct.sqlConnection*
%4 = alloca i32
store %struct.sqlConnection* %0, %struct.sqlConnection** %3
store i32 %1, i32* %4
%5 = load %struct.sqlConnection*, %struct.sqlConnection** %3
%6 = load i32, i32* %4
%7 = call i8* @stringFieldInSubmissionSource(%struct.sqlConnection* %5, i32 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* %7
}

LLVM IR (-O2):
%struct.sqlConnection = type { i32 }
@.str = [6 x i8] c"abUrl\00"
define i8* @visiGeneAbUrl(%struct.sqlConnection* %0, i32 %1) {
%3 = tail call i8* @stringFieldInSubmissionSource(%struct.sqlConnection* %0, i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  puts("Hello World from iOS!");
  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 <puts@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 = [22 x i8] c"Hello World from iOS!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Hello World from iOS!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void make_segv() {
  volatile int *p;
  int i;
  p = (volatile int *)0x9;
  i = *p;
}


x86 assembly (clang, -O0):
<make_segv>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_segv>:
mov    0x9,%eax
ret

LLVM IR (-O0):
define void @make_segv() {
%1 = alloca i32*
%2 = alloca i32
store i32* inttoptr (i64 9 to i32*), i32** %1
%3 = load i32*, i32** %1
%4 = load volatile i32, i32* %3
store i32 %4, i32* %2
ret void
}

LLVM IR (-O2):
define void @make_segv() {
%1 = load volatile i32, i32* inttoptr (i64 9 to i32*)
ret void
}
int bittest(value) { return ((value & ~(-value)) == 0); }


x86 assembly (clang, -O0):
<bittest>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bittest>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @bittest(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 0, %4
%6 = xor i32 %5, -1
%7 = and i32 %3, %6
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @bittest(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("hello world from process id %d\n", getpid());
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"hello world from process id %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getpid()
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [32 x i8] c"hello world from process id %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void hidden(char *name, char *value) {
  printf("<INPUT TYPE=hidden NAME=\"%s\" VALUE=\"%s\">\n", name, value);
}


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

x86 assembly (clang, -O2):
<hidden>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"<INPUT TYPE=hidden NAME=\22%s\22 VALUE=\22%s\22>\0A\00"
define void @hidden(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 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"<INPUT TYPE=hidden NAME=\22%s\22 VALUE=\22%s\22>\0A\00"
define void @hidden(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
double clamp(double d) {
  if (d < 0.0)
    return 0.0;
  else if (d > 1.0)
    return 1.0;
  else
    return d;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1124 <clamp+0x24>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1157 <clamp+0x57>
movsd  -0x10(%rbp),%xmm0
movsd  0xecf(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <clamp+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1157 <clamp+0x57>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
movsd  0xef8(%rip),%xmm1
minsd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm2,%xmm0
andnpd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @clamp(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %13
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp ogt double %8, 1.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store double 1.000000e+00, double* %2
br label %13
11: ; preds = %7
%12 = load double, double* %3
store double %12, double* %2
br label %13
13: ; preds = %11, %10, %6
%14 = load double, double* %2
ret double %14
}

LLVM IR (-O2):
define double @clamp(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 1.000000e+00
%4 = select i1 %3, double 1.000000e+00, double %0
%5 = select i1 %2, double 0.000000e+00, double %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int Quit(int argc, char **argv) {
  printf("Calling from Quit\n");
  return 1;
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"Calling from Quit\0A\00"
define i32 @Quit(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [18 x i8] c"Calling from Quit\00"
define i32 @Quit(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M160_f(char *s) {
  debug("M160_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


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

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

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

LLVM IR (-O2):
@.str = [47 x i8] c"M160_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M160_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ SCOTCHFNUMSIZEOF(int *const);
void scotchfnumsizeof__(int *const sizeptr) { SCOTCHFNUMSIZEOF(sizeptr); }


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

x86 assembly (clang, -O2):
<scotchfnumsizeof__>:
jmp    1030 <SCOTCHFNUMSIZEOF@plt>

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

LLVM IR (-O2):
define void @scotchfnumsizeof__(i32* %0) {
%2 = tail call i32 @SCOTCHFNUMSIZEOF(i32* %0)
ret void
}
unsigned long b_smp_enqueue(void *ptr) {
  unsigned long tlong;
  asm volatile("call 0x00100110" : "=a"(tlong) : "a"(ptr));
  return tlong;
}


x86 assembly (clang, -O0):
<b_smp_enqueue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
call   100110 <completed.0+0xfc0f0>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_smp_enqueue>:
mov    %rdi,%rax
call   100110 <completed.0+0xfc0f0>
ret

LLVM IR (-O0):
define i64 @b_smp_enqueue(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 asm sideeffect "call 0x00100110", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i8* %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @b_smp_enqueue(i8* %0) {
%2 = tail call i64 asm sideeffect "call 0x00100110", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i64 %2
}
/* Variables and functions */
scalar_t__ ERROR_OCCURRED();
int adjust_tp_compare(int c) {
  if (ERROR_OCCURRED()) {
    return -2;
  } else if (c < -1 || c > 1) {
    return c < -1 ? -1 : 1;
  } else {
    return c;
  }
}


x86 assembly (clang, -O0):
<adjust_tp_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <ERROR_OCCURRED@plt>
cmp    $0x0,%rax
je     1138 <adjust_tp_compare+0x28>
movl   $0xfffffffe,-0x4(%rbp)
jmp    116d <adjust_tp_compare+0x5d>
cmpl   $0xffffffff,-0x8(%rbp)
jl     114c <adjust_tp_compare+0x3c>
cmpl   $0x1,-0x8(%rbp)
jle    1167 <adjust_tp_compare+0x57>
mov    -0x8(%rbp),%edx
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    $0xffffffff,%edx
cmovl  %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    116d <adjust_tp_compare+0x5d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjust_tp_compare>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <ERROR_OCCURRED@plt>
mov    %rax,%rcx
mov    $0xfffffffe,%eax
test   %rcx,%rcx
je     1129 <adjust_tp_compare+0x19>
pop    %rbx
ret
lea    -0x2(%rbx),%eax
cmp    $0xfffffffc,%eax
ja     1140 <adjust_tp_compare+0x30>
xor    %eax,%eax
cmp    $0xffffffff,%ebx
setge  %al
add    %eax,%eax
add    $0xffffffff,%eax
pop    %rbx
ret
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @adjust_tp_compare(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i64 (...) @ERROR_OCCURRED()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -2, i32* %2
br label %20
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, -1
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = icmp sgt i32 %11, 1
br i1 %12, label %13, label %18
13: ; preds = %10, %7
%14 = load i32, i32* %3
%15 = icmp slt i32 %14, -1
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 -1, i32 1
store i32 %17, i32* %2
br label %20
18: ; preds = %10
%19 = load i32, i32* %3
store i32 %19, i32* %2
br label %20
20: ; preds = %18, %13, %6
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @adjust_tp_compare(i32 %0) {
%2 = tail call i64 (...) @ERROR_OCCURRED()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = add i32 %0, -2
%6 = icmp ult i32 %5, -3
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = icmp slt i32 %0, -1
%9 = select i1 %8, i32 -1, i32 1
br label %10
10: ; preds = %4, %1, %7
%11 = phi i32 [ %9, %7 ], [ -2, %1 ], [ %0, %4 ]
ret i32 %11
}
/* Variables and functions */
int SelectionSortRecursiveHelper(int *, int);
int SelectionSortRecursive(int *nums, int numsSize) {
  if (!nums) {
    return 1;
  }
  if (numsSize < 0) {
    return 2;
  }
  return SelectionSortRecursiveHelper(nums, numsSize);
}


x86 assembly (clang, -O0):
<SelectionSortRecursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1136 <SelectionSortRecursive+0x26>
movl   $0x1,-0x4(%rbp)
jmp    115b <SelectionSortRecursive+0x4b>
cmpl   $0x0,-0x14(%rbp)
jge    114c <SelectionSortRecursive+0x3c>
movl   $0x2,-0x4(%rbp)
jmp    115b <SelectionSortRecursive+0x4b>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <SelectionSortRecursiveHelper@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SelectionSortRecursive>:
test   %rdi,%rdi
je     111e <SelectionSortRecursive+0xe>
test   %esi,%esi
js     1124 <SelectionSortRecursive+0x14>
jmp    1030 <SelectionSortRecursiveHelper@plt>
mov    $0x1,%eax
ret
mov    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @SelectionSortRecursive(i32* %0, i32 %1) {
%3 = icmp eq i32* %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = icmp slt i32 %1, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @SelectionSortRecursiveHelper(i32* %0, i32 %1)
br label %8
8: ; preds = %4, %2, %6
%9 = phi i32 [ %7, %6 ], [ 1, %2 ], [ 2, %4 ]
ret i32 %9
}
/* Variables and functions */
int djb2(char *);
int /*<<< orphan*/ printf(char *, char *, int);
int main() {
  char s[] = "a14bcef";
  printf("hash(%s) = %u\n", s, djb2(s));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <djb2@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x66656362343161,%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <djb2@plt>
lea    0xeb8(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [8 x i8] c"a14bcef\00"
@.str = [15 x i8] c"hash(%s) = %u\0A\00"
define i32 @main() {
%1 = alloca [8 x i8]
%2 = bitcast [8 x i8]* %1 to i8*
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%5 = call i32 @djb2(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"hash(%s) = %u\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 28821925148242273, i64* %1
%3 = call i32 @djb2(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3)
ret i32 0
}
void main(int i) {}


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

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

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

LLVM IR (-O2):
define void @main(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ format_time();
int /*<<< orphan*/ struct_tm_mktime();
int main() {
  struct_tm_mktime();
  format_time();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @struct_tm_mktime()
%2 = tail call i32 (...) @format_time()
ret i32 0
}
void *f(void *a) { return a; }


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

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

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

LLVM IR (-O2):
define i8* @f(i8* readnone returned %0) {
ret i8* %0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int UINT32_C(int);
scalar_t__ rand();
uint32_t get8rand() { return ((uint32_t)rand()) & UINT32_C(0xFF); }


x86 assembly (clang, -O0):
<get8rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x4(%rbp)
mov    $0xff,%edi
call   1030 <UINT32_C@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
and    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get8rand>:
push   %rbx
xor    %eax,%eax
call   1040 <rand@plt>
mov    %rax,%rbx
mov    $0xff,%edi
call   1030 <UINT32_C@plt>
and    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get8rand() {
%1 = call i64 (...) @rand()
%2 = trunc i64 %1 to i32
%3 = call i32 @UINT32_C(i32 255)
%4 = and i32 %2, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @get8rand() {
%1 = tail call i64 (...) @rand()
%2 = trunc i64 %1 to i32
%3 = tail call i32 @UINT32_C(i32 255)
%4 = and i32 %3, %2
ret i32 %4
}
void checkcache_process_thread_start(void) {}


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

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

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

LLVM IR (-O2):
define void @checkcache_process_thread_start() {
ret void
}
/* Variables and functions */
long GetDecNum();
long GetHexNum();
scalar_t__ Token(char *);
long GetNum() {
  if (Token("0x"))
    return GetHexNum();
  return GetDecNum();
}


x86 assembly (clang, -O0):
<GetNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <Token@plt>
cmp    $0x0,%rax
je     115e <GetNum+0x2e>
mov    $0x0,%al
call   1050 <GetHexNum@plt>
mov    %rax,-0x8(%rbp)
jmp    1169 <GetNum+0x39>
mov    $0x0,%al
call   1030 <GetDecNum@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetNum>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <Token@plt>
test   %rax,%rax
je     114a <GetNum+0x1a>
xor    %eax,%eax
pop    %rcx
jmp    1050 <GetHexNum@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <GetDecNum@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"0x\00"
define i64 @GetNum() {
%1 = tail call i64 @Token(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i64 (...) @GetHexNum()
br label %7
5: ; preds = %0
%6 = tail call i64 (...) @GetDecNum()
br label %7
7: ; preds = %5, %3
%8 = phi i64 [ %4, %3 ], [ %6, %5 ]
ret i64 %8
}
int f(int x) {
  x = x + 2;
  return x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    0x2(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = add nsw i32 %0, 2
ret i32 %2
}
INI_btl_proof_str_ctx() {}


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

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

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

LLVM IR (-O2):
define i32 @INI_btl_proof_str_ctx() {
ret i32 undef
}
int XF_strcmp(const char *str1, const char *str2) {
  while (*str1 == *str2) {
    if (*str1 == '\0')
      return 0;
    str1++;
    str2++;
  }
  return *str1 - *str2;
}


x86 assembly (clang, -O0):
<XF_strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    115b <XF_strcmp+0x5b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <XF_strcmp+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    116e <XF_strcmp+0x6e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <XF_strcmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<XF_strcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jne    1124 <XF_strcmp+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %al,%al
je     112d <XF_strcmp+0x2d>
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
cmp    %cl,%al
je     1110 <XF_strcmp+0x10>
movsbl %al,%eax
movsbl %cl,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @XF_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = phi i8 [ %4, %2 ], [ %15, %11 ]
%20 = sext i8 %18 to i32
%21 = sext i8 %19 to i32
%22 = sub nsw i32 %20, %21
br label %23
23: ; preds = %6, %17
%24 = phi i32 [ %22, %17 ], [ 0, %6 ]
ret i32 %24
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, unsigned int);
void dump_deg_seq(unsigned int *nodes, int N) {
  int i;
  for (i = 0; i < N; i++) {
    printf("%d: %d\n", i, nodes[i]);
  }
}


x86 assembly (clang, -O0):
<dump_deg_seq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <dump_deg_seq+0x4a>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <dump_deg_seq+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_deg_seq>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <dump_deg_seq+0x37>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <dump_deg_seq+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%d: %d\0A\00"
define void @dump_deg_seq(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %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 slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i32, i32* %5
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%d: %d\0A\00"
define void @dump_deg_seq(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ aeabi_uldivmod(unsigned long long, unsigned long long);
int /*<<< orphan*/ ulldiv_t_return(int /*<<< orphan*/);
void __aeabi_uldivmod(unsigned long long num, unsigned long long den) {
  ulldiv_t_return(aeabi_uldivmod(num, den));
}


x86 assembly (clang, -O0):
<__aeabi_uldivmod>:
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   1040 <aeabi_uldivmod@plt>
mov    %eax,%edi
call   1030 <ulldiv_t_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__aeabi_uldivmod>:
push   %rax
call   1040 <aeabi_uldivmod@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <ulldiv_t_return@plt>

LLVM IR (-O0):
define void @__aeabi_uldivmod(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i32 @aeabi_uldivmod(i64 %5, i64 %6)
%8 = call i32 @ulldiv_t_return(i32 %7)
ret void
}

LLVM IR (-O2):
define void @__aeabi_uldivmod(i64 %0, i64 %1) {
%3 = tail call i32 @aeabi_uldivmod(i64 %0, i64 %1)
%4 = tail call i32 @ulldiv_t_return(i32 %3)
ret void
}
/* Variables and functions */
int is_prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  scanf("%d", &number);
  printf("%d", is_prime(number));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1040 <is_prime@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @is_prime(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
double time(int /*<<< orphan*/ *);
double get_sec_since_epoch() {
  double sec;
  sec = time(NULL);
  return sec;
}


x86 assembly (clang, -O0):
<get_sec_since_epoch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sec_since_epoch>:
xor    %edi,%edi
jmp    1030 <time@plt>

LLVM IR (-O0):
define double @get_sec_since_epoch() {
%1 = alloca double
%2 = call double @time(i32* null)
store double %2, double* %1
%3 = load double, double* %1
ret double %3
}

LLVM IR (-O2):
define double @get_sec_since_epoch() {
%1 = tail call double @time(i32* null)
ret double %1
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
__attribute__((pure, const)) uint32_t htooe32(uint32_t x) {
  x = ((x >> 16U) & 0xffffU) | ((x << 16U) & 0xffff0000U);
  return ((x >> 8U) & 0xff00ffU) | ((x << 8U) & 0xff00ff00U);
}


x86 assembly (clang, -O0):
<htooe32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0xffff,%eax
mov    -0x4(%rbp),%ecx
shl    $0x10,%ecx
and    $0xffff0000,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xff00ff,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff00ff00,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @htooe32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 16
%5 = and i32 %4, 65535
%6 = load i32, i32* %2
%7 = shl i32 %6, 16
%8 = and i32 %7, -65536
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = lshr i32 %10, 8
%12 = and i32 %11, 16711935
%13 = load i32, i32* %2
%14 = shl i32 %13, 8
%15 = and i32 %14, -16711936
%16 = or i32 %12, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @htooe32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ start_timer(struct timeval *);
void get_time(struct timeval *ptimer_handle) { start_timer(ptimer_handle); }


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

x86 assembly (clang, -O2):
<get_time>:
jmp    1030 <start_timer@plt>

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

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @get_time(%struct.timeval* %0) {
%2 = tail call i32 @start_timer(%struct.timeval* %0)
ret void
}
/* Type definitions */
struct timespec {
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int nanosleep(struct timespec *, struct timespec *);
void full_sleep(struct timespec *req) {
  struct timespec rem = {0};
  if (nanosleep(req, &rem) == -1)
    full_sleep(&rem);
}


x86 assembly (clang, -O0):
<full_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <nanosleep@plt>
cmp    $0xffffffff,%eax
jne    116b <full_sleep+0x3b>
lea    -0x10(%rbp),%rdi
call   1050 <full_sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<full_sleep>:
push   %rax
movl   $0x0,(%rsp)
mov    %rsp,%rsi
call   1030 <nanosleep@plt>
cmp    $0xffffffff,%eax
je     1137 <full_sleep+0x17>
pop    %rax
ret
mov    %rsp,%rdi
call   1040 <full_sleep@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
define void @full_sleep(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
%3 = alloca %struct.timespec
store %struct.timespec* %0, %struct.timespec** %2
%4 = bitcast %struct.timespec* %3 to i8*
%5 = load %struct.timespec*, %struct.timespec** %2
%6 = call i32 @nanosleep(%struct.timespec* %5, %struct.timespec* %3)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define void @full_sleep(%struct.timespec* %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 0, i32* %4
%5 = call i32 @nanosleep(%struct.timespec* %0, %struct.timespec* %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xef() {
  Assert_real((isdigit(239) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              1200, ("isdigit should be 0 for 0xef"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xef\00"
define void @t_isdigit_0xef() {
%1 = tail call i64 @isdigit(i32 239)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1200, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/);
int /*<<< orphan*/ *malloc(int);
int /*<<< orphan*/ realloc(int /*<<< orphan*/ *, int);
int main() {
  malloc(sizeof(int));
  realloc(NULL, sizeof(int));
  free(realloc(malloc(sizeof(int)), sizeof(int)));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1040 <malloc@plt>
xor    %eax,%eax
mov    %eax,%edi
mov    $0x4,%esi
call   1050 <realloc@plt>
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
mov    $0x4,%esi
call   1050 <realloc@plt>
mov    %eax,%edi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
xor    %edi,%edi
mov    $0x4,%esi
call   1050 <realloc@plt>
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
mov    $0x4,%esi
call   1050 <realloc@plt>
mov    %eax,%edi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32* @malloc(i32 4)
%2 = call i32 @realloc(i32* null, i32 4)
%3 = call i32* @malloc(i32 4)
%4 = call i32 @realloc(i32* %3, i32 4)
%5 = call i32 @free(i32 %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
%2 = tail call i32 @realloc(i32* null, i32 4)
%3 = tail call i32* @malloc(i32 4)
%4 = tail call i32 @realloc(i32* %3, i32 4)
%5 = tail call i32 @free(i32 %4)
ret i32 0
}
void *atomic_ptr_cas_gcc(void *volatile *ptr, void *oldval, void *newval) {
  __atomic_compare_exchange_n(ptr, &oldval, newval, 0, 5, 5);
  return oldval;
}


x86 assembly (clang, -O0):
<atomic_ptr_cas_gcc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rdx
lock cmpxchg %rdx,(%rcx)
mov    %rax,%rcx
sete   %al
mov    %al,-0x31(%rbp)
mov    %rcx,-0x30(%rbp)
test   $0x1,%al
jne    1151 <atomic_ptr_cas_gcc+0x51>
mov    -0x40(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    %rcx,(%rax)
mov    -0x31(%rbp),%al
and    $0x1,%al
mov    %al,-0x21(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_ptr_cas_gcc>:
mov    %rsi,%rax
lock cmpxchg %rdx,(%rdi)
cmove  %rsi,%rax
ret

LLVM IR (-O0):
define i8* @atomic_ptr_cas_gcc(i8** %0, i8* %1, i8* %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8**, i8*** %4
%10 = load i8*, i8** %6
store i8* %10, i8** %7
%11 = bitcast i8** %9 to i64*
%12 = bitcast i8** %5 to i64*
%13 = bitcast i8** %7 to i64*
%14 = load i64, i64* %12
%15 = load i64, i64* %13
%16 = cmpxchg volatile i64* %11, i64 %14, i64 %15 seq_cst seq_cst
%17 = extractvalue { i64, i1 } %16, 0
%18 = extractvalue { i64, i1 } %16, 1
br i1 %18, label %20, label %19
19: ; preds = %3
store i64 %17, i64* %12
br label %20
20: ; preds = %19, %3
%21 = zext i1 %18 to i8
store i8 %21, i8* %8
%22 = load i8, i8* %8
%23 = trunc i8 %22 to i1
%24 = load i8*, i8** %5
ret i8* %24
}

LLVM IR (-O2):
define i8* @atomic_ptr_cas_gcc(i8** %0, i8* %1, i8* %2) {
%4 = bitcast i8** %0 to i64*
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint i8* %2 to i64
%7 = cmpxchg volatile i64* %4, i64 %5, i64 %6 seq_cst seq_cst
%8 = extractvalue { i64, i1 } %7, 1
%9 = extractvalue { i64, i1 } %7, 0
%10 = inttoptr i64 %9 to i8*
%11 = select i1 %8, i8* %1, i8* %10
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, double, double);
int /*<<< orphan*/ stderr;
void progress_dir_v2(char *form, int in0, double in1, double in2, double in3,
                     double in4, double in5, int in6, double in7, int in8) {
  fprintf(stderr, form, in0, in1, in2);
}


x86 assembly (clang, -O0):
<progress_dir_v2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
movsd  %xmm3,-0x30(%rbp)
movsd  %xmm4,-0x38(%rbp)
mov    %edx,-0x3c(%rbp)
movsd  %xmm5,-0x48(%rbp)
mov    %ecx,-0x4c(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1030 <fprintf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<progress_dir_v2>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @progress_dir_v2(i8* %0, i32 %1, double %2, double %3, double %4, double %5, double %6, i32 %7, double %8, i32 %9) {
%11 = alloca i8*
%12 = alloca i32
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca i32
%19 = alloca double
%20 = alloca i32
store i8* %0, i8** %11
store i32 %1, i32* %12
store double %2, double* %13
store double %3, double* %14
store double %4, double* %15
store double %5, double* %16
store double %6, double* %17
store i32 %7, i32* %18
store double %8, double* %19
store i32 %9, i32* %20
%21 = load i32, i32* @stderr
%22 = load i8*, i8** %11
%23 = load i32, i32* %12
%24 = load double, double* %13
%25 = load double, double* %14
%26 = call i32 @fprintf(i32 %21, i8* %22, i32 %23, double %24, double %25)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @progress_dir_v2(i8* %0, i32 %1, double %2, double %3, double %4, double %5, double %6, i32 %7, double %8, i32 %9) {
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* %0, i32 %1, double %2, double %3)
ret void
}
/* Variables and functions */
int fb_exec(int);
int fb_reset(void) { return fb_exec(0x24); }


x86 assembly (clang, -O0):
<fb_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x24,%edi
call   1030 <fb_exec@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_reset>:
mov    $0x24,%edi
jmp    1030 <fb_exec@plt>

LLVM IR (-O0):
define i32 @fb_reset() {
%1 = call i32 @fb_exec(i32 36)
ret i32 %1
}

LLVM IR (-O2):
define i32 @fb_reset() {
%1 = tail call i32 @fb_exec(i32 36)
ret i32 %1
}