xunge/DecIR huggingface dataset:
int main() {
  static long nb_pas = 10000000;
  double pas;
  int i;
  double x, pi, som = 0.0;
  pas = 1.0 / (double)nb_pas;
#pragma omp parallel for reduction(+ : som) private(x)
  for (i = 1; i <= nb_pas; i++) {
    x = (i - 0.5) * pas;
    som = som + 4.0 / (1.0 + x * x);
  }
  pi = pas * som;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
cvtsi2sdq 0x2f04(%rip),%xmm1
movsd  0xedc(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    0x2ee1(%rip),%rax
jg     11a2 <main+0xa2>
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  0xebe(%rip),%xmm1
subsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm2
movsd  0xe85(%rip),%xmm1
addsd  %xmm1,%xmm2
movsd  0xe81(%rip),%xmm1
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1134 <main+0x34>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@main.nb_pas = internal global i64 10000000
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %6
%7 = load i64, i64* @main.nb_pas
%8 = sitofp i64 %7 to double
%9 = fdiv double 1.000000e+00, %8
store double %9, double* %2
store i32 1, i32* %3
br label %10
10: ; preds = %27, %0
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = load i64, i64* @main.nb_pas
%14 = icmp sle i64 %12, %13
br i1 %14, label %15, label %30
15: ; preds = %10
%16 = load i32, i32* %3
%17 = sitofp i32 %16 to double
%18 = fsub double %17, 5.000000e-01
%19 = load double, double* %2
%20 = fmul double %18, %19
store double %20, double* %4
%21 = load double, double* %6
%22 = load double, double* %4
%23 = load double, double* %4
%24 = call double @llvm.fmuladd.f64(double %22, double %23, double 1.000000e+00)
%25 = fdiv double 4.000000e+00, %24
%26 = fadd double %21, %25
store double %26, double* %6
br label %27
27: ; preds = %15
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %10
30: ; preds = %10
%31 = load double, double* %2
%32 = load double, double* %6
%33 = fmul double %31, %32
store double %33, double* %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
char *filename_non_directory(char *);
char *info_file_in_path(char *, char *);
char *xstrdup(char *);
char *info_absolute_file(char *fname) {
  char *containing_dir = xstrdup(fname);
  char *base = filename_non_directory(containing_dir);
  if (base > containing_dir)
    base[-1] = '\0';
  return info_file_in_path(filename_non_directory(fname), containing_dir);
}


x86 assembly (clang, -O0):
<info_absolute_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <xstrdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <filename_non_directory@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    116c <info_absolute_file+0x3c>
mov    -0x18(%rbp),%rax
movb   $0x0,-0x1(%rax)
mov    -0x8(%rbp),%rdi
call   1050 <filename_non_directory@plt>
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1040 <info_file_in_path@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<info_absolute_file>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <xstrdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <filename_non_directory@plt>
cmp    %rbx,%rax
jbe    1150 <info_absolute_file+0x20>
movb   $0x0,-0x1(%rax)
mov    %r14,%rdi
call   1050 <filename_non_directory@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <info_file_in_path@plt>

LLVM IR (-O0):
define i8* @info_absolute_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @xstrdup(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @filename_non_directory(i8* %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = load i8*, i8** %3
%11 = icmp ugt i8* %9, %10
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 -1
store i8 0, i8* %14
br label %15
15: ; preds = %12, %1
%16 = load i8*, i8** %2
%17 = call i8* @filename_non_directory(i8* %16)
%18 = load i8*, i8** %3
%19 = call i8* @info_file_in_path(i8* %17, i8* %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @info_absolute_file(i8* %0) {
%2 = tail call i8* @xstrdup(i8* %0)
%3 = tail call i8* @filename_non_directory(i8* %2)
%4 = icmp ugt i8* %3, %2
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %3, i64 -1
store i8 0, i8* %6
br label %7
7: ; preds = %5, %1
%8 = tail call i8* @filename_non_directory(i8* %0)
%9 = tail call i8* @info_file_in_path(i8* %8, i8* %2)
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void swap(int *x, int *y) {
  int tmp = *x;
  *x = *y;
  *y = tmp;
  printf("%d %d\n", *x, *y);
}


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

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%edx
mov    (%rsi),%eax
mov    %eax,(%rdi)
mov    %edx,(%rsi)
mov    (%rdi),%esi
lea    0xedf(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
%5 = load i32, i32* %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %3)
ret void
}
/* Variables and functions */
int do_test();
int main(void) { return do_test(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @do_test()
ret i32 %1
}
int sum(const int x, const int y) { return x + y; }


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

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

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

LLVM IR (-O2):
define i32 @sum(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
int be_a_jackal(key_t *sKey) {}


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

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

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

LLVM IR (-O2):
define i32 @be_a_jackal(i32* nocapture readnone %0) {
ret i32 undef
}
int hashfunct(str, hash_size)
register char str[];
int hash_size;
{
  register int hashval;
  register int locstr;
  hashval = 0;
  locstr = 0;
  while (str[locstr]) {
    hashval = (hashval << 1) + (unsigned char)str[locstr++];
    hashval %= hash_size;
  }
  return hashval;
}


x86 assembly (clang, -O0):
<hashfunct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115d <hashfunct+0x5d>
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    -0x8(%rbp),%rcx
mov    -0x14(%rbp),%edx
mov    %edx,%esi
add    $0x1,%esi
mov    %esi,-0x14(%rbp)
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
jmp    1119 <hashfunct+0x19>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashfunct>:
mov    (%rdi),%al
test   %al,%al
je     1127 <hashfunct+0x27>
add    $0x1,%rdi
xor    %edx,%edx
nopl   0x0(%rax)
movzbl %al,%eax
lea    (%rax,%rdx,2),%eax
cltd
idiv   %esi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hashfunct+0x10>
mov    %edx,%eax
ret
xor    %edx,%edx
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @hashfunct(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %10, %5 ], [ 0, %2 ]
%7 = phi i8 [ %15, %5 ], [ %3, %2 ]
%8 = phi i32 [ %13, %5 ], [ 0, %2 ]
%9 = shl i32 %8, 1
%10 = add nuw nsw i64 %6, 1
%11 = zext i8 %7 to i32
%12 = add nsw i32 %9, %11
%13 = srem i32 %12, %1
%14 = getelementptr inbounds i8, i8* %0, i64 %10
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %5, %2
%18 = phi i32 [ 0, %2 ], [ %13, %5 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ nothing();
int main(void) {
  nothing();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @nothing()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void freeInts(int *ints) { free(ints); }


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

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

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

LLVM IR (-O2):
define void @freeInts(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char const *, scalar_t__);
char *sp_extname_p(char *);
scalar_t__ strlen(char const *);
char *sp_extname(char *path) {
  const char *p = sp_extname_p(path);
  if (p != path)
    memmove(path, p, strlen(p) + 1);
  return path;
}


x86 assembly (clang, -O0):
<sp_extname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <sp_extname_p@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     1184 <sp_extname+0x54>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1050 <memmove@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sp_extname>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <sp_extname_p@plt>
cmp    %rbx,%rax
je     115b <sp_extname+0x2b>
mov    %rax,%r14
mov    %rax,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <memmove@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @sp_extname(i8* returned %0) {
%2 = tail call i8* @sp_extname_p(i8* %0)
%3 = icmp eq i8* %2, %0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%6 = add nsw i64 %5, 1
%7 = tail call i32 @memmove(i8* %0, i8* %2, i64 %6)
br label %8
8: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ cutils_fmtc_repr(char *, size_t, char const *, int);
bool cutils_cdar_DynamicArray_char_format(const char *i, char **b, size_t *s) {
  cutils_fmtc_repr(*b, *s, i, 1);
  return true;
}


x86 assembly (clang, -O0):
<cutils_cdar_DynamicArray_char_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
mov    -0x8(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <cutils_fmtc_repr@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cdar_DynamicArray_char_format>:
push   %rax
mov    %rdi,%rax
mov    (%rsi),%rdi
mov    (%rdx),%rsi
mov    %rax,%rdx
mov    $0x1,%ecx
call   1030 <cutils_fmtc_repr@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @cutils_cdar_DynamicArray_char_format(i8* %0, i8** nocapture %1, i64* nocapture %2) {
%4 = load i8*, i8** %1
%5 = load i64, i64* %2
%6 = tail call i32 @cutils_fmtc_repr(i8* %4, i64 %5, i8* %0, i32 1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char);
char *skipwhite(char *cp) {
  for (; *cp; ++cp) {
    if (!isspace(*cp)) {
      return cp;
    }
  }
  return cp;
}


x86 assembly (clang, -O0):
<skipwhite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1161 <skipwhite+0x51>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    114b <skipwhite+0x3b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1169 <skipwhite+0x59>
jmp    1150 <skipwhite+0x40>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <skipwhite+0xc>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipwhite>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1138 <skipwhite+0x28>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
je     1138 <skipwhite+0x28>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skipwhite+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skipwhite(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i32 @isspace(i8 signext %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
int eingabe(int input) {
  if (input > 0 && input < 1000) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<eingabe>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    112a <eingabe+0x2a>
cmpl   $0x3e8,-0x8(%rbp)
jge    112a <eingabe+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1131 <eingabe+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eingabe>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x3e7,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @eingabe(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 999
%4 = zext i1 %3 to i32
ret i32 %4
}
void test1(void) {
  int a = 2;
  __asm__("movl $3, %[t] \n" : [t] "=rm"(a) : :);
  assert(a == 3);
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
movl   $0x3,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rax
movl   $0x2,0x4(%rsp)
movl   $0x3,0x4(%rsp)
xor    %edi,%edi
cmpl   $0x3,0x4(%rsp)
sete   %dil
xor    %eax,%eax
call   1030 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @test1() {
%1 = alloca i32
store i32 2, i32* %1
%2 = load i32, i32* %1
%3 = icmp eq i32 %2, 3
%4 = zext i1 %3 to i32
%5 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %4)
ret void
}

LLVM IR (-O2):
define void @test1() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 3
%5 = zext i1 %4 to i32
%6 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %5)
ret void
}
const char *str_expr_comma() { return "comma"; }


x86 assembly (clang, -O0):
<str_expr_comma>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_expr_comma>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"comma\00"
define i8* @str_expr_comma() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"comma\00"
define i8* @str_expr_comma() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
int hash(char *str, int M) {
  char *k = str;
  int h = 0;
  for (; *k != '\0'; k++)
    h = (127 * h + *k) % M;
  return h;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114f <hash+0x4f>
imul   $0x7f,-0x1c(%rbp),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111a <hash+0x1a>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%al
test   %al,%al
je     112d <hash+0x2d>
add    $0x1,%rdi
xor    %edx,%edx
nopl   0x0(%rax)
movsbl %al,%ecx
mov    %edx,%eax
shl    $0x7,%eax
sub    %edx,%eax
add    %ecx,%eax
cltd
idiv   %esi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash+0x10>
mov    %edx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %14, %5 ], [ %3, %2 ]
%7 = phi i32 [ %12, %5 ], [ 0, %2 ]
%8 = phi i8* [ %13, %5 ], [ %0, %2 ]
%9 = sext i8 %6 to i32
%10 = mul nsw i32 %7, 127
%11 = add nsw i32 %10, %9
%12 = srem i32 %11, %1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %17
}
void angine_press(int x, int y) {}


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

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

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

LLVM IR (-O2):
define void @angine_press(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ Interpolate_2(int /*<<< orphan*/, int, int /*<<< orphan*/,
                                 int, int);
void Interp3(uint32_t *pc, uint32_t c1, uint32_t c2) {
  *pc = Interpolate_2(c1, 7, c2, 1, 3);
}


x86 assembly (clang, -O0):
<Interp3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%edx
mov    $0x7,%esi
mov    $0x1,%ecx
mov    $0x3,%r8d
call   1030 <Interpolate_2@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interp3>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
mov    $0x7,%esi
mov    $0x1,%ecx
mov    $0x3,%r8d
call   1030 <Interpolate_2@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @Interp3(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* %5
%8 = load i32, i32* %6
%9 = call i32 @Interpolate_2(i32 %7, i32 7, i32 %8, i32 1, i32 3)
%10 = load i32*, i32** %4
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @Interp3(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = tail call i32 @Interpolate_2(i32 %1, i32 7, i32 %2, i32 1, i32 3)
store i32 %4, i32* %0
ret void
}
int nextPowerOfFour(long x) {
  int count = 1;
  while (x > 4) {
    count += 1;
    x >>= 2;
  }
  return count;
}


x86 assembly (clang, -O0):
<nextPowerOfFour>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpq   $0x4,-0x8(%rbp)
jle    1134 <nextPowerOfFour+0x34>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x2,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <nextPowerOfFour+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextPowerOfFour>:
mov    $0x1,%eax
cmp    $0x5,%rdi
jl     1130 <nextPowerOfFour+0x30>
mov    $0x1,%eax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%eax
shr    $0x2,%rcx
cmp    $0x13,%rdi
mov    %rcx,%rdi
ja     1120 <nextPowerOfFour+0x20>
ret

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

LLVM IR (-O2):
define i32 @nextPowerOfFour(i64 %0) {
%2 = icmp sgt i64 %0, 4
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = lshr i64 %5, 2
%8 = icmp ugt i64 %5, 19
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ put_byte(int, int);
__attribute__((always_)) void patch_NCAS_3_2_0_1219_extra(void) {
  put_byte(0x10084B13, 0xEA);
}


x86 assembly (clang, -O0):
<patch_NCAS_3_2_0_1219_extra>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10084b13,%edi
mov    $0xea,%esi
call   1030 <put_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<patch_NCAS_3_2_0_1219_extra>:
mov    $0x10084b13,%edi
mov    $0xea,%esi
jmp    1030 <put_byte@plt>

LLVM IR (-O0):
define void @patch_NCAS_3_2_0_1219_extra() {
%1 = call i32 @put_byte(i32 268978963, i32 234)
ret void
}

LLVM IR (-O2):
define void @patch_NCAS_3_2_0_1219_extra() {
%1 = tail call i32 @put_byte(i32 268978963, i32 234)
ret void
}
/* Variables and functions */
scalar_t__ rint(double);
long LRound(double a) { return ((long)rint(a)); }


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

x86 assembly (clang, -O2):
<LRound>:
jmp    1030 <rint@plt>

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

LLVM IR (-O2):
define i64 @LRound(double %0) {
%2 = tail call i64 @rint(double %0)
ret i64 %2
}
/* Variables and functions */
int imprimir(int);
int multiplicar(int n1, int n2) { return imprimir(n1 * n2); }


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

x86 assembly (clang, -O2):
<multiplicar>:
imul   %esi,%edi
jmp    1030 <imprimir@plt>

LLVM IR (-O0):
define i32 @multiplicar(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 = mul nsw i32 %5, %6
%8 = call i32 @imprimir(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @multiplicar(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 @imprimir(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fpga_open();
int /*<<< orphan*/ led(int, int, int, int);
int main(int argn, char *argv[]) {
  fpga_open();
  led(0, 255, 0, 0);
  led(1, 255, 0, 255);
  led(2, 0, 255, 255);
  led(3, 255, 255, 0);
  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)
mov    $0x0,%al
call   1040 <fpga_open@plt>
xor    %ecx,%ecx
mov    $0xff,%esi
mov    %ecx,%edi
mov    %ecx,%edx
call   1030 <led@plt>
mov    $0x1,%edi
mov    $0xff,%ecx
xor    %edx,%edx
mov    %ecx,%esi
call   1030 <led@plt>
mov    $0x2,%edi
xor    %esi,%esi
mov    $0xff,%ecx
mov    %ecx,%edx
call   1030 <led@plt>
mov    $0x3,%edi
mov    $0xff,%edx
xor    %ecx,%ecx
mov    %edx,%esi
call   1030 <led@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fpga_open@plt>
xor    %edi,%edi
mov    $0xff,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <led@plt>
mov    $0x1,%edi
mov    $0xff,%esi
xor    %edx,%edx
mov    $0xff,%ecx
call   1030 <led@plt>
mov    $0x2,%edi
xor    %esi,%esi
mov    $0xff,%edx
mov    $0xff,%ecx
call   1030 <led@plt>
mov    $0x3,%edi
mov    $0xff,%esi
mov    $0xff,%edx
xor    %ecx,%ecx
call   1030 <led@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 (...) @fpga_open()
%7 = call i32 @led(i32 0, i32 255, i32 0, i32 0)
%8 = call i32 @led(i32 1, i32 255, i32 0, i32 255)
%9 = call i32 @led(i32 2, i32 0, i32 255, i32 255)
%10 = call i32 @led(i32 3, i32 255, i32 255, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @fpga_open()
%4 = tail call i32 @led(i32 0, i32 255, i32 0, i32 0)
%5 = tail call i32 @led(i32 1, i32 255, i32 0, i32 255)
%6 = tail call i32 @led(i32 2, i32 0, i32 255, i32 255)
%7 = tail call i32 @led(i32 3, i32 255, i32 255, i32 0)
ret i32 0
}
int strcmp(const char *l, const char *r) {
  while (*l && *l == *r) {
    l++;
    r++;
  }
  return *(const unsigned char *)l - *(const unsigned char *)r;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <strcmp+0x47>
jmp    1164 <strcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
test   %al,%al
je     1123 <strcmp+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1125 <strcmp+0x25>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
movzbl %al,%eax
movzbl (%rsi),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = phi i8 [ 0, %2 ], [ 0, %11 ], [ %6, %5 ]
%19 = zext i8 %18 to i32
%20 = load i8, i8* %17
%21 = zext i8 %20 to i32
%22 = sub nsw i32 %19, %21
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ hello();
main(void) {
  hello();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @hello()
ret i32 0
}
int baz(void) {
  printf("%s:%s\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/Boshin/workspace/refs/heads/baseline/"
         "ARMToolChain/source/glibc-2.21/elf/tst-deep1mod1.c",
         __func__);
  return 20;
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee5(%rip),%rsi
lea    0xf90(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x14,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"%s:%s\0A\00"
@.str.1 = [178 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Boshin/workspace/refs/heads/baseline/ARMToolChain/source/glibc-2.21/elf/tst-deep1mod1.c\00"
@__func__.baz = [4 x i8] c"baz\00"
define i32 @baz() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__func__.baz, i64 0, i64 0))
ret i32 20
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s:%s\0A\00"
@.str.1 = [178 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Boshin/workspace/refs/heads/baseline/ARMToolChain/source/glibc-2.21/elf/tst-deep1mod1.c\00"
@__func__.baz = [4 x i8] c"baz\00"
define i32 @baz() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__func__.baz, i64 0, i64 0))
ret i32 20
}
/* Variables and functions */
void cpu_get_performance_info(unsigned char **p_model, unsigned char **p_mhz) {
  *p_model = NULL;
  *p_mhz = NULL;
}


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

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

LLVM IR (-O0):
define void @cpu_get_performance_info(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
store i8* null, i8** %5
%6 = load i8**, i8*** %4
store i8* null, i8** %6
ret void
}

LLVM IR (-O2):
define void @cpu_get_performance_info(i8** nocapture writeonly %0, i8** nocapture writeonly %1) {
store i8* null, i8** %0
store i8* null, i8** %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printbinary(unsigned char);
void printarbin(unsigned char *value, int amount) {
  for (int i = 0; i < amount; i++)
    printbinary(value[i]);
}


x86 assembly (clang, -O0):
<printarbin>:
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    1151 <printarbin+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <printbinary@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printarbin+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printarbin>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1143 <printarbin+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%r14,%rbx,1),%edi
call   1030 <printbinary@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <printarbin+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @printarbin(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @printbinary(i8 zeroext %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int Size(void *item) {
  int *p = (int *)item - 2;
  assert(item != NULL);
  assert(p[0] == 0x42);
  return p[1];
}


x86 assembly (clang, -O0):
<Size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
cmpl   $0x42,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Size>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x42,-0x8(%rbx)
sete   %dil
call   1030 <assert@plt>
mov    -0x4(%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Size(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = getelementptr inbounds i32, i32* %5, i64 -2
store i32* %6, i32** %3
%7 = load i8*, i8** %2
%8 = icmp ne i8* %7, null
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, 66
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load i32*, i32** %3
%18 = getelementptr inbounds i32, i32* %17, i64 1
%19 = load i32, i32* %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @Size(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -8
%3 = bitcast i8* %2 to i32*
%4 = icmp ne i8* %0, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 66
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = getelementptr inbounds i8, i8* %0, i64 -4
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
ret i32 %13
}
float rng_frand(struct anon$18 *rngh) {
  unsigned int return_value_rng_urand$1;
  return_value_rng_urand$1 = rng_urand(rngh);
  return (float)((double)return_value_rng_urand$1 / 4.294967e+9);
}


x86 assembly (clang, -O0):
<rng_frand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
call   1030 <rng_urand@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  0xec6(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rng_frand>:
push   %rax
xor    %eax,%eax
call   1030 <rng_urand@plt>
mov    %eax,%eax
cvtsi2sd %rax,%xmm0
divsd  0xed9(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%"struct.anon$18" = type opaque
define float @rng_frand(%"struct.anon$18"* %0) {
%2 = alloca %"struct.anon$18"*
%3 = alloca i32
store %"struct.anon$18"* %0, %"struct.anon$18"** %2
%4 = load %"struct.anon$18"*, %"struct.anon$18"** %2
%5 = call i32 (%"struct.anon$18"*, ...) bitcast (i32 (...)* @rng_urand to i32 (%"struct.anon$18"*, ...)*)(%"struct.anon$18"* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = uitofp i32 %6 to double
%8 = fdiv double %7, 0x41EFFFFFDB000000
%9 = fptrunc double %8 to float
ret float %9
}

LLVM IR (-O2):
%"struct.anon$18" = type opaque
define float @rng_frand(%"struct.anon$18"* %0) {
%2 = tail call i32 (%"struct.anon$18"*, ...) bitcast (i32 (...)* @rng_urand to i32 (%"struct.anon$18"*, ...)*)(%"struct.anon$18"* %0)
%3 = uitofp i32 %2 to double
%4 = fdiv double %3, 0x41EFFFFFDB000000
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int strlen(char *);
scalar_t__ strncmp(char *, char *, int);
int startsWith(char *string, char *prefix) {
  int stringLength = strlen(string);
  int prefixLength = strlen(prefix);
  return (prefixLength <= stringLength)
             ? (strncmp(prefix, string, prefixLength) == 0)
             : 0;
}


x86 assembly (clang, -O0):
<startsWith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1178 <startsWith+0x58>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
jmp    1182 <startsWith+0x62>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    1182 <startsWith+0x62>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startsWith>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %eax,%edx
xor    %eax,%eax
cmp    %ebp,%edx
jg     1157 <startsWith+0x37>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @startsWith(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = load i32, i32* %5
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %21
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = load i8*, i8** %3
%17 = load i32, i32* %6
%18 = call i64 @strncmp(i8* %15, i8* %16, i32 %17)
%19 = icmp eq i64 %18, 0
%20 = zext i1 %19 to i32
br label %22
21: ; preds = %2
br label %22
22: ; preds = %21, %14
%23 = phi i32 [ %20, %14 ], [ 0, %21 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @startsWith(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp sgt i32 %4, %3
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i64 @strncmp(i8* %1, i8* %0, i32 %4)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 0, %2 ]
ret i32 %11
}
const void *key(const void *datum) { return datum; }


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

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

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

LLVM IR (-O2):
define i8* @key(i8* readnone returned %0) {
ret i8* %0
}
void PDMR3QueryDeviceLun(void) {}


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

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

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

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