xunge/DecIR huggingface dataset:
int is_utf32_le(const unsigned char *data) {
  return data[0] == 0x00 && data[1] == 0x00 && data[2] == 0xFE &&
         data[3] == 0xFF;
}


x86 assembly (clang, -O0):
<is_utf32_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    115f <is_utf32_le+0x5f>
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    115f <is_utf32_le+0x5f>
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%ecx
xor    %eax,%eax
cmp    $0xfe,%ecx
mov    %al,-0x9(%rbp)
jne    115f <is_utf32_le+0x5f>
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
cmp    $0xff,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_utf32_le>:
xor    %eax,%eax
cmpb   $0x0,(%rdi)
je     1108 <is_utf32_le+0x8>
ret
cmpb   $0x0,0x1(%rdi)
jne    1107 <is_utf32_le+0x7>
cmpb   $0xfe,0x2(%rdi)
jne    1107 <is_utf32_le+0x7>
xor    %eax,%eax
cmpb   $0xff,0x3(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_utf32_le(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %17
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, -2
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %0, i64 3
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, -1
%16 = zext i1 %15 to i32
br label %17
17: ; preds = %12, %8, %4, %1
%18 = phi i32 [ 0, %8 ], [ 0, %4 ], [ 0, %1 ], [ %16, %12 ]
ret i32 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void ullint_put(unsigned long long int number, FILE *stream) {
  if (number > (unsigned long long int)9) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
    ullint_put(number / (unsigned long long int)10, stream);
#pragma GCC diagnostic pop
  }
  fputc('0' + (char)(number % (unsigned long long int)10), stream);
}


x86 assembly (clang, -O0):
<ullint_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x9,-0x8(%rbp)
jbe    1155 <ullint_put+0x35>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1040 <ullint_put@plt>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %dl,%al
movsbl %al,%eax
add    $0x30,%eax
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ullint_put>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
movabs $0xcccccccccccccccd,%r15
cc cc cc
cmp    $0xa,%rdi
jb     1150 <ullint_put+0x30>
mov    %rbx,%rax
mul    %r15
mov    %rdx,%rdi
shr    $0x3,%rdi
mov    %r14,%rsi
call   1040 <ullint_put@plt>
mov    %rbx,%rax
mul    %r15
shr    $0x2,%edx
and    $0xfffffffe,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%ebx
or     $0x30,%bl
movzbl %bl,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @ullint_put(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
store i64 %0, i64* %3
store i32* %1, i32** %4
%5 = load i64, i64* %3
%6 = icmp ugt i64 %5, 9
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i64, i64* %3
%9 = udiv i64 %8, 10
%10 = load i32*, i32** %4
br label %11
11: ; preds = %7, %2
%12 = load i64, i64* %3
%13 = urem i64 %12, 10
%14 = trunc i64 %13 to i8
%15 = sext i8 %14 to i32
%16 = add nsw i32 48, %15
%17 = trunc i32 %16 to i8
%18 = load i32*, i32** %4
%19 = call i32 @fputc(i8 signext %17, i32* %18)
ret void
}

LLVM IR (-O2):
define void @ullint_put(i64 %0, i32* nocapture %1) {
%3 = icmp ugt i64 %0, 9
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = udiv i64 %0, 10
tail call void @ullint_put(i64 %5, i32* %1)
br label %6
6: ; preds = %4, %2
%7 = urem i64 %0, 10
%8 = trunc i64 %7 to i8
%9 = or i8 %8, 48
%10 = tail call i32 @fputc(i8 signext %9, i32* %1)
ret void
}
/* Variables and functions */
int simple_escape_str(char *, char const *, size_t);
int escape_str(char *dst, const char *src, size_t n) {
  return simple_escape_str(dst, src, n);
}


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

x86 assembly (clang, -O2):
<escape_str>:
jmp    1030 <simple_escape_str@plt>

LLVM IR (-O0):
define i32 @escape_str(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** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @simple_escape_str(i8* %7, i8* %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @escape_str(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @simple_escape_str(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
long unsigned int gcd(long unsigned int x, long unsigned int y) {
  while (x != y) {
    if (x > y) {
      x -= y;
    } else {
      y -= x;
    }
  }
  return x;
  __builtin_unreachable();
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1150 <gcd+0x50>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    113c <gcd+0x3c>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    114b <gcd+0x4b>
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <gcd+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rdi,%rax
cmp    %rsi,%rdi
je     112e <gcd+0x2e>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
cmp    %rax,%rsi
mov    $0x0,%edx
cmovb  %rsi,%rdx
mov    %rax,%rdi
cmovb  %rcx,%rdi
sub    %rdx,%rax
sub    %rdi,%rsi
cmp    %rsi,%rax
jne    1110 <gcd+0x10>
ret

LLVM IR (-O0):
define i64 @gcd(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
br label %5
5: ; preds = %21, %2
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = icmp ne i64 %6, %7
br i1 %8, label %9, label %22
9: ; preds = %5
%10 = load i64, i64* %3
%11 = load i64, i64* %4
%12 = icmp ugt i64 %10, %11
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load i64, i64* %4
%15 = load i64, i64* %3
%16 = sub i64 %15, %14
store i64 %16, i64* %3
br label %21
17: ; preds = %9
%18 = load i64, i64* %3
%19 = load i64, i64* %4
%20 = sub i64 %19, %18
store i64 %20, i64* %4
br label %21
21: ; preds = %17, %13
br label %5
22: ; preds = %5
%23 = load i64, i64* %3
ret i64 %23
}

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %11, %4 ], [ %1, %2 ]
%6 = phi i64 [ %9, %4 ], [ %0, %2 ]
%7 = icmp ult i64 %5, %6
%8 = select i1 %7, i64 %5, i64 0
%9 = sub i64 %6, %8
%10 = select i1 %7, i64 0, i64 %6
%11 = sub i64 %5, %10
%12 = icmp eq i64 %9, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i64 [ %0, %2 ], [ %9, %4 ]
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ delay();
int main(void) {
  (*(volatile unsigned long *)(0xE01FC000 + 0x000)) = 2;
  (*(volatile unsigned long *)(0xE0028000 + 0x18)) |= (1 << 16);
  while (1) {
    (*(volatile unsigned long *)(0xE0028000 + 0x14)) |= (1 << 16);
    delay();
    (*(volatile unsigned long *)(0xE0028000 + 0x1C)) |= (1 << 16);
    delay();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xe01fc000,%eax
movq   $0x2,(%rax)
mov    $0xe0028018,%eax
mov    (%rax),%rcx
or     $0x10000,%rcx
mov    $0xe0028018,%eax
mov    %rcx,(%rax)
mov    $0xe0028014,%eax
mov    (%rax),%rcx
or     $0x10000,%rcx
mov    %rcx,-0x18(%rbp)
mov    $0xe0028014,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <delay@plt>
mov    $0xe002801c,%eax
mov    (%rax),%rcx
or     $0x10000,%rcx
mov    %rcx,-0x10(%rbp)
mov    $0xe002801c,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <delay@plt>
jmp    1142 <main+0x32>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xe0028014,%ebx
movq   $0x2,0x1d3fec(%rbx)
orq    $0x10000,0x4(%rbx)
nopl   0x0(%rax)
orq    $0x10000,(%rbx)
xor    %eax,%eax
call   1030 <delay@plt>
orq    $0x10000,0x8(%rbx)
xor    %eax,%eax
call   1030 <delay@plt>
jmp    1130 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
store volatile i64 2, i64* inttoptr (i64 3760177152 to i64*)
%2 = load volatile i64, i64* inttoptr (i64 3758260248 to i64*)
%3 = or i64 %2, 65536
store volatile i64 %3, i64* inttoptr (i64 3758260248 to i64*)
br label %4
4: ; preds = %0, %4
%5 = load volatile i64, i64* inttoptr (i64 3758260244 to i64*)
%6 = or i64 %5, 65536
store volatile i64 %6, i64* inttoptr (i64 3758260244 to i64*)
%7 = call i32 (...) @delay()
%8 = load volatile i64, i64* inttoptr (i64 3758260252 to i64*)
%9 = or i64 %8, 65536
store volatile i64 %9, i64* inttoptr (i64 3758260252 to i64*)
%10 = call i32 (...) @delay()
br label %4
}

LLVM IR (-O2):
define i32 @main() {
store volatile i64 2, i64* inttoptr (i64 3760177152 to i64*)
%1 = load volatile i64, i64* inttoptr (i64 3758260248 to i64*)
%2 = or i64 %1, 65536
store volatile i64 %2, i64* inttoptr (i64 3758260248 to i64*)
br label %3
3: ; preds = %0, %3
%4 = load volatile i64, i64* inttoptr (i64 3758260244 to i64*)
%5 = or i64 %4, 65536
store volatile i64 %5, i64* inttoptr (i64 3758260244 to i64*)
%6 = tail call i32 (...) @delay()
%7 = load volatile i64, i64* inttoptr (i64 3758260252 to i64*)
%8 = or i64 %7, 65536
store volatile i64 %8, i64* inttoptr (i64 3758260252 to i64*)
%9 = tail call i32 (...) @delay()
br label %3
}
/* Variables and functions */
double sqrt(int);
double findLandingPosition(double height, double horizonSpeed) {
  return horizonSpeed * sqrt(2 * height / 9810.0);
}


x86 assembly (clang, -O0):
<findLandingPosition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xed4(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xebf(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findLandingPosition>:
push   %rax
movsd  %xmm1,(%rsp)
addsd  %xmm0,%xmm0
divsd  0xede(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @findLandingPosition(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fmul double 2.000000e+00, %6
%8 = fdiv double %7, 9.810000e+03
%9 = fptosi double %8 to i32
%10 = call double @sqrt(i32 %9)
%11 = fmul double %5, %10
ret double %11
}

LLVM IR (-O2):
define double @findLandingPosition(double %0, double %1) {
%3 = fmul double %0, 2.000000e+00
%4 = fdiv double %3, 9.810000e+03
%5 = fptosi double %4 to i32
%6 = tail call double @sqrt(i32 %5)
%7 = fmul double %6, %1
ret double %7
}
/* Type definitions */
struct ct_path {
  int dummy;
};

/* Variables and functions */
int ct_path_compare_path(struct ct_path const *const,
                         struct ct_path const *const);
int compare_paths(void const *first, void const *second) {
  struct ct_path const *const *path1 = first;
  struct ct_path const *const *path2 = second;
  return ct_path_compare_path(*path1, *path2);
}


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

x86 assembly (clang, -O2):
<compare_paths>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <ct_path_compare_path@plt>

LLVM IR (-O0):
%struct.ct_path = type { i32 }
define i32 @compare_paths(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.ct_path**
%6 = alloca %struct.ct_path**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.ct_path**
store %struct.ct_path** %8, %struct.ct_path*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to %struct.ct_path**
store %struct.ct_path** %10, %struct.ct_path*** %6
%11 = load %struct.ct_path**, %struct.ct_path*** %5
%12 = load %struct.ct_path*, %struct.ct_path** %11
%13 = load %struct.ct_path**, %struct.ct_path*** %6
%14 = load %struct.ct_path*, %struct.ct_path** %13
%15 = call i32 @ct_path_compare_path(%struct.ct_path* %12, %struct.ct_path* %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.ct_path = type { i32 }
define i32 @compare_paths(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to %struct.ct_path**
%4 = bitcast i8* %1 to %struct.ct_path**
%5 = load %struct.ct_path*, %struct.ct_path** %3
%6 = load %struct.ct_path*, %struct.ct_path** %4
%7 = tail call i32 @ct_path_compare_path(%struct.ct_path* %5, %struct.ct_path* %6)
ret i32 %7
}
int main() {
  int x;
  int y;
  int a;
  int b;
  a = x + y;
  b = x - y;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
store i32 %8, i32* %4
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = sub nsw i32 %9, %10
store i32 %11, i32* %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void usage() { fprintf(stdout, "Usage: ciscocrack <encrypted password>\n"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [40 x i8] c"Usage: ciscocrack <encrypted password>\0A\00"
define void @usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [40 x i8] c"Usage: ciscocrack <encrypted password>\0A\00"
define void @usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr,
          "Usage: %s -d NUMDIR -f NUMFILES -h -t NUMTHRD\n"
          "\t -h Help!\n"
          "\t -l Number of loops:               Default: 1000\n"
          "\t -t Number of threads to generate: Default: 30\n",
          progname);
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [156 x i8] c"Usage: %s -d NUMDIR -f NUMFILES -h -t NUMTHRD\0A\09 -h Help!\0A\09 -l Number of loops: Default: 1000\0A\09 -t Number of threads to generate: Default: 30\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([156 x i8], [156 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [156 x i8] c"Usage: %s -d NUMDIR -f NUMFILES -h -t NUMTHRD\0A\09 -h Help!\0A\09 -l Number of loops: Default: 1000\0A\09 -t Number of threads to generate: Default: 30\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([156 x i8], [156 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
void ARGBToRGB565Row_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToRGB565Row_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IntDisable(unsigned long);
int /*<<< orphan*/ IntUnregister(unsigned long);
void UARTIntUnregister(unsigned long ulBase) {
  unsigned long ulInt;
  ;
  ulInt = ((ulBase == 0x4000C000) ? 21 : ((ulBase == 0x4000D000) ? 22 : 49));
  IntDisable(ulInt);
  IntUnregister(ulInt);
}


x86 assembly (clang, -O0):
<UARTIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x4000c000,-0x8(%rbp)
40
jne    1147 <UARTIntUnregister+0x27>
mov    $0x15,%eax
mov    %eax,-0x14(%rbp)
jmp    1162 <UARTIntUnregister+0x42>
mov    -0x8(%rbp),%rdx
mov    $0x31,%eax
mov    $0x16,%ecx
cmp    $0x4000d000,%rdx
cmove  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <IntDisable@plt>
mov    -0x10(%rbp),%rdi
call   1040 <IntUnregister@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTIntUnregister>:
push   %rbx
cmp    $0x4000d000,%rdi
mov    $0x16,%eax
mov    $0x31,%ecx
cmove  %rax,%rcx
cmp    $0x4000c000,%rdi
mov    $0x15,%ebx
cmovne %rcx,%rbx
mov    %rbx,%rdi
call   1030 <IntDisable@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <IntUnregister@plt>

LLVM IR (-O0):
define void @UARTIntUnregister(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp eq i64 %4, 1073790976
br i1 %5, label %6, label %7
6: ; preds = %1
br label %12
7: ; preds = %1
%8 = load i64, i64* %2
%9 = icmp eq i64 %8, 1073795072
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 22, i32 49
br label %12
12: ; preds = %7, %6
%13 = phi i32 [ 21, %6 ], [ %11, %7 ]
%14 = sext i32 %13 to i64
store i64 %14, i64* %3
%15 = load i64, i64* %3
%16 = call i32 @IntDisable(i64 %15)
%17 = load i64, i64* %3
%18 = call i32 @IntUnregister(i64 %17)
ret void
}

LLVM IR (-O2):
define void @UARTIntUnregister(i64 %0) {
%2 = icmp eq i64 %0, 1073790976
%3 = icmp eq i64 %0, 1073795072
%4 = select i1 %3, i64 22, i64 49
%5 = select i1 %2, i64 21, i64 %4
%6 = tail call i32 @IntDisable(i64 %5)
%7 = tail call i32 @IntUnregister(i64 %5)
ret void
}
/* Variables and functions */
double log(float);
short DProb2Short(float p) {
  if (p <= 0.000001)
    return 32767;
  return (short)(log(p) * -2371.8);
}


x86 assembly (clang, -O0):
<DProb2Short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1143 <DProb2Short+0x33>
movw   $0x7fff,-0x2(%rbp)
jmp    1161 <DProb2Short+0x51>
movss  -0x8(%rbp),%xmm0
call   1030 <log@plt>
movsd  0xeb3(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DProb2Short>:
push   %rax
cvtss2sd %xmm0,%xmm1
mov    $0x7fff,%ax
movsd  0xedf(%rip),%xmm2
ucomisd %xmm1,%xmm2
jae    1138 <DProb2Short+0x28>
call   1030 <log@plt>
mulsd  0xed4(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @DProb2Short(float %0) {
%2 = alloca i16
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp ole double %5, 0x3EB0C6F7A0B5ED8D
br i1 %6, label %7, label %8
7: ; preds = %1
store i16 32767, i16* %2
br label %13
8: ; preds = %1
%9 = load float, float* %3
%10 = call double @log(float %9)
%11 = fmul double %10, -2.371800e+03
%12 = fptosi double %11 to i16
store i16 %12, i16* %2
br label %13
13: ; preds = %8, %7
%14 = load i16, i16* %2
ret i16 %14
}

LLVM IR (-O2):
define signext i16 @DProb2Short(float %0) {
%2 = fpext float %0 to double
%3 = fcmp ugt double %2, 0x3EB0C6F7A0B5ED8D
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call double @log(float %0)
%6 = fmul double %5, -2.371800e+03
%7 = fptosi double %6 to i16
br label %8
8: ; preds = %1, %4
%9 = phi i16 [ %7, %4 ], [ 32767, %1 ]
ret i16 %9
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void test_func(int i) {
  assert(0);
  return;
}


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

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

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

LLVM IR (-O2):
define void @test_func(i32 %0) {
%2 = tail call i32 @assert(i32 0)
ret void
}
void s_reset(int *items, int *_size) { *_size = 0; }


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

x86 assembly (clang, -O2):
<s_reset>:
movl   $0x0,(%rsi)
ret

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

LLVM IR (-O2):
define void @s_reset(i32* nocapture readnone %0, i32* nocapture writeonly %1) {
store i32 0, i32* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ actualise_stats(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, char *);
char *reason_phrase(int);
void send_status(FILE *client, int code) {
  fprintf(client, "HTTP/1.1 %d %s", code, reason_phrase(code));
  actualise_stats(code);
}


x86 assembly (clang, -O0):
<send_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <reason_phrase@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%edx
mov    %rax,%rcx
lea    0xe9a(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <actualise_stats@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_status>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
call   1050 <reason_phrase@plt>
lea    0xeb9(%rip),%rsi
mov    %r14,%rdi
mov    %ebx,%edx
mov    %rax,%rcx
call   1030 <fprintf@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <actualise_stats@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"HTTP/1.1 %d %s\00"
define void @send_status(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 = load i32, i32* %4
%8 = call i8* @reason_phrase(i32 %7)
%9 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %8)
%10 = load i32, i32* %4
%11 = call i32 @actualise_stats(i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"HTTP/1.1 %d %s\00"
define void @send_status(i32* nocapture %0, i32 %1) {
%3 = tail call i8* @reason_phrase(i32 %1)
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %3)
%5 = tail call i32 @actualise_stats(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ seed;

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int read(int, void *, int);
int /*<<< orphan*/ srand(unsigned int volatile);
void seed_prng(void) {
  int rc;
  volatile unsigned int seed;
  int fd = open("/dev/urandom", O_RDONLY);
  if (fd >= 0) {
    rc = read(fd, (void *)&seed, sizeof(seed));
    close(fd);
  }
  srand(seed);
}


x86 assembly (clang, -O0):
<seed_prng>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
lea    0xea8(%rip),%rdi
call   1060 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1186 <seed_prng+0x46>
mov    -0xc(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1040 <read@plt>
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
mov    -0x8(%rbp),%edi
call   1050 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seed_prng>:
push   %rbx
sub    $0x10,%rsp
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
lea    0xeab(%rip),%rdi
call   1060 <open@plt>
test   %eax,%eax
js     1178 <seed_prng+0x38>
mov    %eax,%ebx
lea    0xc(%rsp),%rsi
mov    %eax,%edi
mov    $0x4,%edx
call   1040 <read@plt>
mov    %ebx,%edi
call   1030 <close@plt>
mov    0xc(%rsp),%edi
add    $0x10,%rsp
pop    %rbx
jmp    1050 <srand@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/urandom\00"
@O_RDONLY = global i32 0
define void @seed_prng() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = load i32, i32* @O_RDONLY
%5 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %0
%9 = load i32, i32* %3
%10 = bitcast i32* %2 to i8*
%11 = call i32 @read(i32 %9, i8* %10, i32 4)
store i32 %11, i32* %1
%12 = load i32, i32* %3
%13 = call i32 @close(i32 %12)
br label %14
14: ; preds = %8, %0
%15 = load volatile i32, i32* %2
%16 = call i32 @srand(i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/urandom\00"
@O_RDONLY = global i32 0
define void @seed_prng() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @read(i32 %4, i8* %2, i32 4)
%8 = tail call i32 @close(i32 %4)
br label %9
9: ; preds = %6, %0
%10 = load volatile i32, i32* %1
%11 = tail call i32 @srand(i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parse_raw_message(char *, char *, char **);
void parse_message(char *message, char http_message[20][100]) {
  char *token = "\r\n";
  parse_raw_message(message, token, http_message);
}


x86 assembly (clang, -O0):
<parse_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <parse_raw_message@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_message>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <parse_raw_message@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
define void @parse_message(i8* %0, [100 x i8]* %1) {
%3 = alloca i8*
%4 = alloca [100 x i8]*
%5 = alloca i8*
store i8* %0, i8** %3
store [100 x i8]* %1, [100 x i8]** %4
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = load i8*, i8** %3
%7 = load i8*, i8** %5
%8 = load [100 x i8]*, [100 x i8]** %4
%9 = bitcast [100 x i8]* %8 to i8**
%10 = call i32 @parse_raw_message(i8* %6, i8* %7, i8** %9)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define void @parse_message(i8* %0, [100 x i8]* %1) {
%3 = bitcast [100 x i8]* %1 to i8**
%4 = tail call i32 @parse_raw_message(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3)
ret void
}
int f(int x) {
  if (x != 0 && x != 1)
    return -2;
  else
    return !x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1127 <f+0x27>
cmpl   $0x1,-0x8(%rbp)
je     1127 <f+0x27>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1138 <f+0x38>
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %ecx,%ecx
test   %edi,%edi
sete   %cl
cmp    $0x2,%edi
mov    $0xfffffffe,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp ult i32 %0, 2
%3 = icmp eq i32 %0, 0
%4 = zext i1 %3 to i32
%5 = select i1 %2, i32 %4, i32 -2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *, size_t);
void *malloc(size_t);
void *emalloc(size_t nb) {
  void *p = malloc(nb);
  if (!p)
    err(1, "unable to allocate %zu bytes", nb);
  return p;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1159 <emalloc+0x39>
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
lea    0xeac(%rip),%rsi
call   1030 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1148 <emalloc+0x28>
lea    0xec5(%rip),%rsi
mov    $0x1,%edi
mov    %r14,%rdx
call   1030 <err@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [29 x i8] c"unable to allocate %zu bytes\00"
define i8* @emalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @err(i32 1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [29 x i8] c"unable to allocate %zu bytes\00"
define noalias i8* @emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef void FILE;

/* Variables and functions */
void *popen(char const *, char const *);
void *do_popen(const char *cmd, const char *mode) {
  FILE *f = popen(cmd, mode);
  return f;
}


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

x86 assembly (clang, -O2):
<do_popen>:
jmp    1030 <popen@plt>

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

LLVM IR (-O2):
define noalias i8* @do_popen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i8* @popen(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ Delay_ms(int);
int /*<<< orphan*/ Display_Time();
int /*<<< orphan*/ Init_Main();
int /*<<< orphan*/ Read_Time();
int /*<<< orphan*/ Transform_Time();
void main() {
  Delay_ms(100);
  Init_Main();
  while (1) {
    Read_Time();
    Transform_Time();
    Display_Time();
    Delay_ms(1000);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%edi
call   1050 <Delay_ms@plt>
mov    $0x0,%al
call   1040 <Init_Main@plt>
mov    $0x0,%al
call   1070 <Read_Time@plt>
mov    $0x0,%al
call   1060 <Transform_Time@plt>
mov    $0x0,%al
call   1030 <Display_Time@plt>
mov    $0x3e8,%edi
call   1050 <Delay_ms@plt>
jmp    1165 <main+0x15>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x64,%edi
call   1050 <Delay_ms@plt>
xor    %eax,%eax
call   1040 <Init_Main@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1070 <Read_Time@plt>
xor    %eax,%eax
call   1060 <Transform_Time@plt>
xor    %eax,%eax
call   1030 <Display_Time@plt>
mov    $0x3e8,%edi
call   1050 <Delay_ms@plt>
jmp    1170 <main+0x20>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @Delay_ms(i32 100)
%2 = call i32 (...) @Init_Main()
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @Read_Time()
%5 = call i32 (...) @Transform_Time()
%6 = call i32 (...) @Display_Time()
%7 = call i32 @Delay_ms(i32 1000)
br label %3
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @Delay_ms(i32 100)
%2 = tail call i32 (...) @Init_Main()
br label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @Read_Time()
%5 = tail call i32 (...) @Transform_Time()
%6 = tail call i32 (...) @Display_Time()
%7 = tail call i32 @Delay_ms(i32 1000)
br label %3
}
unsigned long hash1(unsigned char *str) {
  unsigned long hash = 5381;
  int c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<hash1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hash1+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash1+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash1>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <hash1+0x2c>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash1+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hash1(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = zext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void set_socket_tos(int socket, uint8_t ip_tos) {
  int result;
  fprintf(
      stderr,
      "No way to set the TOS value for leaving packets on that platform.\n");
}


x86 assembly (clang, -O0):
<set_socket_tos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_socket_tos>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [67 x i8] c"No way to set the TOS value for leaving packets on that platform.\0A\00"
define void @set_socket_tos(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* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [67 x i8] c"No way to set the TOS value for leaving packets on that platform.\0A\00"
define void @set_socket_tos(i32 %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
ret void
}
int node_to_pxm(int node) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @node_to_pxm(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ datum;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void put_char(char *where, char datum) { memcpy(where, &datum, sizeof(datum)); }


x86 assembly (clang, -O0):
<put_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_char>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @put_char(i8* %0, i8 signext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @memcpy(i8* %0, i8* %3, i32 1)
ret void
}
int not_picked3() { return 10; }


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

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

LLVM IR (-O0):
define i32 @not_picked3() {
ret i32 10
}

LLVM IR (-O2):
define i32 @not_picked3() {
ret i32 10
}
void zero(long int bigIntegers[]) { return; }


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

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

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

LLVM IR (-O2):
define void @zero(i64* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ configadd(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
int /*<<< orphan*/ strtolower(char *);
void ConfigOverride(const char *var, const char *val) {
  char lcvar[128];
  strcpy(lcvar, var);
  strtolower(lcvar);
  configadd(lcvar, val);
}


x86 assembly (clang, -O0):
<ConfigOverride>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x90(%rbp),%rdi
call   1040 <strtolower@plt>
lea    -0x90(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <configadd@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConfigOverride>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rsi,%r14
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strtolower@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <configadd@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ConfigOverride(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [128 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%10 = call i32 @strtolower(i8* %9)
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%12 = load i8*, i8** %4
%13 = call i32 @configadd(i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
define void @ConfigOverride(i8* %0, i8* %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* %0)
%6 = call i32 @strtolower(i8* %4)
%7 = call i32 @configadd(i8* %4, i8* %1)
ret void
}
/* Type definitions */
struct expr {
  int dummy;
};

/* Variables and functions */
double atof(int /*<<< orphan*/);
int /*<<< orphan*/ expr_string_value(struct expr *, void *);
double _symbol_double_value(struct expr *this, void *context) {
  return atof(expr_string_value(this, context));
}


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

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

LLVM IR (-O0):
%struct.expr = type { i32 }
define double @_symbol_double_value(%struct.expr* %0, i8* %1) {
%3 = alloca %struct.expr*
%4 = alloca i8*
store %struct.expr* %0, %struct.expr** %3
store i8* %1, i8** %4
%5 = load %struct.expr*, %struct.expr** %3
%6 = load i8*, i8** %4
%7 = call i32 @expr_string_value(%struct.expr* %5, i8* %6)
%8 = call double @atof(i32 %7)
ret double %8
}

LLVM IR (-O2):
%struct.expr = type { i32 }
define double @_symbol_double_value(%struct.expr* %0, i8* %1) {
%3 = tail call i32 @expr_string_value(%struct.expr* %0, i8* %1)
%4 = tail call double @atof(i32 %3)
ret double %4
}
unsigned int general_int_hash_func(unsigned int key) {
  key += ~(key << 15);
  key ^= (key >> 10);
  key += (key << 3);
  key ^= (key >> 6);
  key += ~(key << 11);
  key ^= (key >> 16);
  return key;
}


x86 assembly (clang, -O0):
<general_int_hash_func>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xf,%eax
xor    $0xffffffff,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0xa,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x6,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xb,%eax
xor    $0xffffffff,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<general_int_hash_func>:
mov    %edi,%eax
shl    $0xf,%eax
not    %eax
add    %edi,%eax
mov    %eax,%ecx
shr    $0xa,%ecx
xor    %eax,%ecx
lea    (%rcx,%rcx,8),%eax
mov    %eax,%ecx
shr    $0x6,%ecx
xor    %eax,%ecx
mov    %ecx,%edx
shl    $0xb,%edx
not    %edx
add    %ecx,%edx
mov    %edx,%eax
shr    $0x10,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @general_int_hash_func(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 15
%5 = xor i32 %4, -1
%6 = load i32, i32* %2
%7 = add i32 %6, %5
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = lshr i32 %8, 10
%10 = load i32, i32* %2
%11 = xor i32 %10, %9
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = shl i32 %12, 3
%14 = load i32, i32* %2
%15 = add i32 %14, %13
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = lshr i32 %16, 6
%18 = load i32, i32* %2
%19 = xor i32 %18, %17
store i32 %19, i32* %2
%20 = load i32, i32* %2
%21 = shl i32 %20, 11
%22 = xor i32 %21, -1
%23 = load i32, i32* %2
%24 = add i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = lshr i32 %25, 16
%27 = load i32, i32* %2
%28 = xor i32 %27, %26
store i32 %28, i32* %2
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @general_int_hash_func(i32 %0) {
%2 = shl i32 %0, 15
%3 = xor i32 %2, -1
%4 = add i32 %3, %0
%5 = lshr i32 %4, 10
%6 = xor i32 %5, %4
%7 = mul i32 %6, 9
%8 = lshr i32 %7, 6
%9 = xor i32 %8, %7
%10 = shl i32 %9, 11
%11 = xor i32 %10, -1
%12 = add i32 %9, %11
%13 = lshr i32 %12, 16
%14 = xor i32 %13, %12
ret i32 %14
}
int time() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @time() {
ret i32 0
}
void *malloc(int nbytes) {
  char variable[nbytes];
  return &variable;
}


x86 assembly (clang, -O0):
<malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
mov    %rcx,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,%ecx
mov    %rsp,%rax
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
define i8* @malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i8, i64 %6
store i64 %6, i64* %4
%9 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define noalias i8* @malloc(i32 %0) {
%2 = zext i32 %0 to i64
%3 = alloca i8, i64 %2
ret i8* %3
}