xunge/DecIR huggingface dataset:
/* Variables and functions */
int random();
int nrand(int n) { return random() % n; }


x86 assembly (clang, -O0):
<nrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrand>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <random@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @nrand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @random()
%4 = load i32, i32* %2
%5 = srem i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @nrand(i32 %0) {
%2 = tail call i32 (...) @random()
%3 = srem i32 %2, %0
ret i32 %3
}
unsigned int hash(char *v, signed int M) {
  signed int h = 0;
  signed int a = 127;
  v += 2;
  for (; *v != '\0'; v++) {
    h = (a * h + (signed int)*v) % M;
  }
  return ((unsigned int)h);
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x7f,-0x14(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115d <hash+0x5d>
mov    -0x14(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1125 <hash+0x25>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    0x2(%rdi),%al
test   %al,%al
je     112d <hash+0x2d>
add    $0x3,%rdi
xor    %edx,%edx
nopl   (%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 i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 127, i32* %6
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 2
store i8* %8, i8** %3
br label %9
9: ; preds = %24, %2
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %27
14: ; preds = %9
%15 = load i32, i32* %6
%16 = load i32, i32* %5
%17 = mul nsw i32 %15, %16
%18 = load i8*, i8** %3
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = add nsw i32 %17, %20
%22 = load i32, i32* %4
%23 = srem i32 %21, %22
store i32 %23, i32* %5
br label %24
24: ; preds = %14
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %3
br label %9
27: ; preds = %9
%28 = load i32, i32* %5
ret i32 %28
}

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 2
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %2, %6
%7 = phi i8 [ %15, %6 ], [ %4, %2 ]
%8 = phi i8* [ %14, %6 ], [ %3, %2 ]
%9 = phi i32 [ %13, %6 ], [ 0, %2 ]
%10 = sext i8 %7 to i32
%11 = mul nsw i32 %9, 127
%12 = add nsw i32 %11, %10
%13 = srem i32 %12, %1
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %6
17: ; preds = %6, %2
%18 = phi i32 [ 0, %2 ], [ %13, %6 ]
ret i32 %18
}
__attribute__((noreturn)) void abort(char *text) {
  writeString(text);
  __asm__ __volatile__("cli");
  hang();
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <writeString@plt>
cli
mov    $0x0,%al
call   1040 <hang@plt>

x86 assembly (clang, -O2):
<abort>:
push   %rax
xor    %eax,%eax
call   1030 <writeString@plt>
cli
xor    %eax,%eax
call   1040 <hang@plt>

LLVM IR (-O0):
define void @abort(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @writeString to i32 (i8*, ...)*)(i8* %3)
%5 = call i32 (...) @hang()
unreachable
}

LLVM IR (-O2):
define void @abort(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @writeString to i32 (i8*, ...)*)(i8* %0)
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
%3 = tail call i32 (...) @hang()
unreachable
}
int test_imm_35int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x35 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_35int64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0x35,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_35int64_highword_mem>:
testb  $0x35,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_35int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 53
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_35int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 227633266688
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
char *pushudec(s, num)
register char *s;
register unsigned num;
{
  register unsigned reduction;
  while (num >= 10) {
    reduction = num / 10;
    *--s = num - 10 * reduction + '0';
    num = reduction;
  }
  *--s = num + '0';
  return s;
}


x86 assembly (clang, -O0):
<pushudec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jb     114f <pushudec+0x4f>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
imul   $0xa,-0x10(%rbp),%ecx
sub    %ecx,%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110b <pushudec+0xb>
mov    -0xc(%rbp),%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pushudec>:
mov    %rdi,%rax
cmp    $0xa,%esi
jb     1137 <pushudec+0x37>
mov    $0xcccccccd,%r8d
xchg   %ax,%ax
mov    %esi,%ecx
imul   %r8,%rcx
shr    $0x23,%rcx
lea    (%rcx,%rcx,1),%edi
lea    (%rdi,%rdi,4),%edi
mov    %esi,%edx
sub    %edi,%edx
add    $0x30,%dl
mov    %dl,-0x1(%rax)
add    $0xffffffffffffffff,%rax
cmp    $0x63,%esi
mov    %ecx,%esi
ja     1110 <pushudec+0x10>
jmp    1139 <pushudec+0x39>
mov    %esi,%ecx
add    $0x30,%cl
mov    %cl,-0x1(%rax)
add    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i8* @pushudec(i8* writeonly %0, i32 %1) {
%3 = icmp ugt i32 %1, 9
br i1 %3, label %4, label %14
4: ; preds = %2, %4
%5 = phi i8* [ %12, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = udiv i32 %6, 10
%8 = mul i32 %7, -10
%9 = add i32 %8, %6
%10 = trunc i32 %9 to i8
%11 = add i8 %10, 48
%12 = getelementptr inbounds i8, i8* %5, i64 -1
store i8 %11, i8* %12
%13 = icmp ugt i32 %6, 99
br i1 %13, label %4, label %14
14: ; preds = %4, %2
%15 = phi i32 [ %1, %2 ], [ %7, %4 ]
%16 = phi i8* [ %0, %2 ], [ %12, %4 ]
%17 = trunc i32 %15 to i8
%18 = add nuw nsw i8 %17, 48
%19 = getelementptr inbounds i8, i8* %16, i64 -1
store i8 %18, i8* %19
ret i8* %19
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t mil_int_min(int32_t a, int32_t b) {
  if (a > b)
    return b;
  else
    return a;
}


x86 assembly (clang, -O0):
<mil_int_min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1127 <mil_int_min+0x27>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <mil_int_min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mil_int_min>:
mov    %rdi,%rax
cmp    %rsi,%rdi
cmovg  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @mil_int_min(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x90() {
  Assert_real((isdigit(144) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              725, ("isdigit should be 0 for 0x90"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x90\00"
define void @t_isdigit_0x90() {
%1 = tail call i64 @isdigit(i32 144)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 725, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void do_something(long t) {
  int i = 0;
  for (i = 0; i < t; i++)
    for (i = 0; i < t; i++)
      for (i - 0; i < t; i++)
        ;
}


x86 assembly (clang, -O0):
<do_something>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    1180 <do_something+0x80>
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    116d <do_something+0x6d>
movslq -0xc(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    115a <do_something+0x5a>
jmp    114c <do_something+0x4c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1139 <do_something+0x39>
jmp    115f <do_something+0x5f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <do_something+0x2b>
jmp    1172 <do_something+0x72>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <do_something+0x16>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @do_something(i64 %0) {
ret void
}
int main() {
  int ADDITION = 127 + 9783;
  int SUBTRACTION = 104 - 49;
  int MULTIPLICATION = 17 * 19;
  int DIVISION = 42 / 7;
  int MODULUS = 17 % 2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x26b6,-0x8(%rbp)
movl   $0x37,-0xc(%rbp)
movl   $0x143,-0x10(%rbp)
movl   $0x6,-0x14(%rbp)
movl   $0x1,-0x18(%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
%6 = alloca i32
store i32 0, i32* %1
store i32 9910, i32* %2
store i32 55, i32* %3
store i32 323, i32* %4
store i32 6, i32* %5
store i32 1, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void ccolor(int pos, int n, char color) {
  asm volatile("movl $0xC, %%eax; int $0x80" : : "b"(pos), "c"(n), "d"(color));
}


x86 assembly (clang, -O0):
<ccolor>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %dl,%al
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0xc(%rbp),%ebx
mov    -0x10(%rbp),%ecx
mov    -0x11(%rbp),%dl
mov    $0xc,%eax
int    $0x80
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccolor>:
push   %rbx
mov    %esi,%ecx
mov    %edi,%ebx
mov    $0xc,%eax
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define void @ccolor(i32 %0, i32 %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i8, i8* %6
ret void
}

LLVM IR (-O2):
define void @ccolor(i32 %0, i32 %1, i8 signext %2) {
tail call void asm sideeffect "movl $$0xC, %eax; int $$0x80", "{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1, i8 %2)
ret void
}
/* Variables and functions */
int countWords(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("Mots: %u\n", countWords("dict.txt"));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee2(%rip),%rdi
call   1040 <countWords@plt>
lea    0xecc(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Mots: %u\0A\00"
@.str.1 = [9 x i8] c"dict.txt\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @countWords(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Mots: %u\0A\00"
@.str.1 = [9 x i8] c"dict.txt\00"
define i32 @main() {
%1 = tail call i32 @countWords(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i, j;
  if (i == 1337) {
    while (i < 15) {
      if (i == 2) {
        printf("1\n");
        goto next;
      }
      i++;
    }
  }
  while (i < 15) {
    if (i == 3) {
    next:
      printf("2\n");
    }
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x539,-0x8(%rbp)
jne    1169 <main+0x59>
jmp    1131 <main+0x21>
cmpl   $0xf,-0x8(%rbp)
jge    1164 <main+0x54>
cmpl   $0x2,-0x8(%rbp)
jne    1156 <main+0x46>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
jmp    1187 <main+0x77>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1131 <main+0x21>
jmp    1169 <main+0x59>
jmp    116e <main+0x5e>
cmpl   $0xf,-0x8(%rbp)
jge    11a1 <main+0x91>
cmpl   $0x3,-0x8(%rbp)
jne    1193 <main+0x83>
jmp    1187 <main+0x77>
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    116e <main+0x5e>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct redfish_client {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ redfish_disconnect(struct redfish_client *);
int /*<<< orphan*/ redfish_release_client(struct redfish_client *);
void redfish_disconnect_and_release(struct redfish_client *cli) {
  redfish_disconnect(cli);
  redfish_release_client(cli);
}


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

x86 assembly (clang, -O2):
<redfish_disconnect_and_release>:
push   %rbx
mov    %rdi,%rbx
call   1030 <redfish_disconnect@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <redfish_release_client@plt>

LLVM IR (-O0):
%struct.redfish_client = type { i32 }
define void @redfish_disconnect_and_release(%struct.redfish_client* %0) {
%2 = alloca %struct.redfish_client*
store %struct.redfish_client* %0, %struct.redfish_client** %2
%3 = load %struct.redfish_client*, %struct.redfish_client** %2
%4 = call i32 @redfish_disconnect(%struct.redfish_client* %3)
%5 = load %struct.redfish_client*, %struct.redfish_client** %2
%6 = call i32 @redfish_release_client(%struct.redfish_client* %5)
ret void
}

LLVM IR (-O2):
%struct.redfish_client = type { i32 }
define void @redfish_disconnect_and_release(%struct.redfish_client* %0) {
%2 = tail call i32 @redfish_disconnect(%struct.redfish_client* %0)
%3 = tail call i32 @redfish_release_client(%struct.redfish_client* %0)
ret void
}
/* Variables and functions */
int randd();
int rrange(int min, int max) {
  int rval = (int)(randd() * (max - min) + min);
  return rval;
}


x86 assembly (clang, -O0):
<rrange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <randd@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
imul   %ecx,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rrange>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <randd@plt>
sub    %ebp,%ebx
imul   %ebx,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rrange(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 (...) @randd()
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = mul nsw i32 %6, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @rrange(i32 %0, i32 %1) {
%3 = tail call i32 (...) @randd()
%4 = sub nsw i32 %1, %0
%5 = mul nsw i32 %3, %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
void start_text(char *st, int type) {
  if (type == 0)
    st[0] = 'A';
  else if (type == 1)
    st[0] = 'G';
  else if (type == 2)
    st[0] = 'T';
  st[1] = 'T';
  st[2] = 'G';
  st[3] = '\0';
}


x86 assembly (clang, -O0):
<start_text>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1121 <start_text+0x21>
mov    -0x8(%rbp),%rax
movb   $0x41,(%rax)
jmp    1152 <start_text+0x52>
cmpl   $0x1,-0xc(%rbp)
jne    1137 <start_text+0x37>
mov    -0x8(%rbp),%rax
movb   $0x47,(%rax)
jmp    114d <start_text+0x4d>
cmpl   $0x2,-0xc(%rbp)
jne    1148 <start_text+0x48>
mov    -0x8(%rbp),%rax
movb   $0x54,(%rax)
jmp    114d <start_text+0x4d>
jmp    1152 <start_text+0x52>
mov    -0x8(%rbp),%rax
movb   $0x54,0x1(%rax)
mov    -0x8(%rbp),%rax
movb   $0x47,0x2(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_text>:
cmp    $0x2,%esi
ja     1113 <start_text+0x13>
shl    $0x3,%esi
mov    $0x544741,%eax
mov    %esi,%ecx
shr    %cl,%eax
mov    %al,(%rdi)
movw   $0x4754,0x1(%rdi)
movb   $0x0,0x3(%rdi)
ret

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

LLVM IR (-O2):
define void @start_text(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp ult i32 %1, 3
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = trunc i32 %1 to i24
%6 = shl i24 %5, 3
%7 = lshr i24 5523265, %6
%8 = trunc i24 %7 to i8
store i8 %8, i8* %0
br label %9
9: ; preds = %2, %4
%10 = getelementptr inbounds i8, i8* %0, i64 1
store i8 84, i8* %10
%11 = getelementptr inbounds i8, i8* %0, i64 2
store i8 71, i8* %11
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 0, i8* %12
ret void
}
/* Variables and functions */
void *kzmem_alloc(int);
int /*<<< orphan*/ putcurrent();
void *thread_kmalloc(int size) {
  putcurrent();
  return kzmem_alloc(size);
}


x86 assembly (clang, -O0):
<thread_kmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <putcurrent@plt>
mov    -0x4(%rbp),%edi
call   1040 <kzmem_alloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_kmalloc>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <putcurrent@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <kzmem_alloc@plt>

LLVM IR (-O0):
define i8* @thread_kmalloc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @putcurrent()
%4 = load i32, i32* %2
%5 = call i8* @kzmem_alloc(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @thread_kmalloc(i32 %0) {
%2 = tail call i32 (...) @putcurrent()
%3 = tail call i8* @kzmem_alloc(i32 %0)
ret i8* %3
}
unsigned long ldbs_peek4(unsigned char *src) {
  unsigned long u = src[3];
  u = (u << 8) | src[2];
  u = (u << 8) | src[1];
  u = (u << 8) | src[0];
  return u;
}


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

x86 assembly (clang, -O2):
<ldbs_peek4>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i64 @ldbs_peek4(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 3
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = shl i64 %8, 8
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 2
%12 = load i8, i8* %11
%13 = zext i8 %12 to i64
%14 = or i64 %9, %13
store i64 %14, i64* %3
%15 = load i64, i64* %3
%16 = shl i64 %15, 8
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8, i8* %18
%20 = zext i8 %19 to i64
%21 = or i64 %16, %20
store i64 %21, i64* %3
%22 = load i64, i64* %3
%23 = shl i64 %22, 8
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i64 0
%26 = load i8, i8* %25
%27 = zext i8 %26 to i64
%28 = or i64 %23, %27
store i64 %28, i64* %3
%29 = load i64, i64* %3
ret i64 %29
}

LLVM IR (-O2):
define i64 @ldbs_peek4(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = shl nuw nsw i64 %4, 16
%9 = shl nuw nsw i64 %7, 8
%10 = or i64 %9, %8
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i64
%14 = or i64 %10, %13
%15 = shl nuw nsw i64 %14, 8
%16 = load i8, i8* %0
%17 = zext i8 %16 to i64
%18 = or i64 %15, %17
ret i64 %18
}
void *w_quick_sort_int_new() {
  int *i = (int *)malloc(sizeof(int));
  return i;
}


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

x86 assembly (clang, -O2):
<w_quick_sort_int_new>:
mov    $0x4,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @w_quick_sort_int_new() {
%1 = alloca i32*
%2 = call i8* @malloc(i64 4)
%3 = bitcast i8* %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = bitcast i32* %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define noalias i8* @w_quick_sort_int_new() {
%1 = tail call dereferenceable_or_null(4) i8* @malloc(i64 4)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main() { fprintf(stderr, "hello world!\n"); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"hello world!\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"hello world!\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int execute_lchown32() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_lchown32() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Say(char *, int);
void hit(void) { Say("I hate you, sack of feed!", 1); }


x86 assembly (clang, -O0):
<hit>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <Say@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hit>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <Say@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"I hate you, sack of feed!\00"
define void @hit() {
%1 = call i32 @Say(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"I hate you, sack of feed!\00"
define void @hit() {
%1 = tail call i32 @Say(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ separate(int *, int, int, int *, int *);
void quick_sortR(int tab[], int d, int f) {
  if (f - d > 7) {
    int s, r;
    separate(tab, d, f, &s, &r);
    quick_sortR(tab, d, s);
    quick_sortR(tab, r, f);
  }
}


x86 assembly (clang, -O0):
<quick_sortR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
cmp    $0x7,%eax
jle    1176 <quick_sortR+0x56>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    -0x14(%rbp),%rcx
lea    -0x18(%rbp),%r8
call   1030 <separate@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <quick_sortR@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sortR@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sortR>:
mov    %edx,%eax
sub    %esi,%eax
cmp    $0x8,%eax
jl     116b <quick_sortR+0x4b>
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1030 <separate@plt>
mov    0xc(%rsp),%edx
mov    %r14,%rdi
mov    %ebp,%esi
call   1040 <quick_sortR@plt>
mov    0x8(%rsp),%esi
mov    %r14,%rdi
mov    %ebx,%edx
call   1040 <quick_sortR@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quick_sortR(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = sub nsw i32 %2, %1
%7 = icmp sgt i32 %6, 7
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = call i32 @separate(i32* %0, i32 %1, i32 %2, i32* %4, i32* %5)
%12 = load i32, i32* %4
%13 = load i32, i32* %5
br label %14
14: ; preds = %8, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int c;
  for (c = 0; c <= 255; c++) {
    printf("\n%d %c", c, c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jg     1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"\0A%d %c\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putdec(int);
int /*<<< orphan*/ puts0(char *);
void system(void) {
  puts0("\r\nsize of int ");
  putdec(sizeof(int));
  puts0("\r\nsize of long int ");
  putdec(sizeof(long int));
  puts0("\r\nsize of short int ");
  putdec(sizeof(short int));
  puts0("\r\nsize of char ");
  putdec(sizeof(char));
}


x86 assembly (clang, -O0):
<system>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <puts0@plt>
mov    $0x4,%edi
call   1030 <putdec@plt>
lea    0xece(%rip),%rdi
call   1040 <puts0@plt>
mov    $0x8,%edi
call   1030 <putdec@plt>
lea    0xecc(%rip),%rdi
call   1040 <puts0@plt>
mov    $0x2,%edi
call   1030 <putdec@plt>
lea    0xecb(%rip),%rdi
call   1040 <puts0@plt>
mov    $0x1,%edi
call   1030 <putdec@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<system>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts0@plt>
mov    $0x4,%edi
call   1030 <putdec@plt>
lea    0xed1(%rip),%rdi
call   1040 <puts0@plt>
mov    $0x8,%edi
call   1030 <putdec@plt>
lea    0xecf(%rip),%rdi
call   1040 <puts0@plt>
mov    $0x2,%edi
call   1030 <putdec@plt>
lea    0xece(%rip),%rdi
call   1040 <puts0@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <putdec@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"\0D\0Asize of int \00"
@.str.1 = [20 x i8] c"\0D\0Asize of long int \00"
@.str.2 = [21 x i8] c"\0D\0Asize of short int \00"
@.str.3 = [16 x i8] c"\0D\0Asize of char \00"
define void @system() {
%1 = call i32 @puts0(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @putdec(i32 4)
%3 = call i32 @puts0(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @putdec(i32 8)
%5 = call i32 @puts0(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @putdec(i32 2)
%7 = call i32 @puts0(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @putdec(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"\0D\0Asize of int \00"
@.str.1 = [20 x i8] c"\0D\0Asize of long int \00"
@.str.2 = [21 x i8] c"\0D\0Asize of short int \00"
@.str.3 = [16 x i8] c"\0D\0Asize of char \00"
define void @system() {
%1 = tail call i32 @puts0(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putdec(i32 4)
%3 = tail call i32 @puts0(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @putdec(i32 8)
%5 = tail call i32 @puts0(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @putdec(i32 2)
%7 = tail call i32 @puts0(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 @putdec(i32 1)
ret void
}
unsigned int calcphaseinc(unsigned int fnum, unsigned int block,
                          unsigned int multi) {
  unsigned int pginc;
  pginc = (fnum << block) >> 1;
  switch (multi) {
  case 0:
    return (pginc >> 1);
    break;
  case 11:
    multi = 10;
    break;
  case 13:
    multi = 12;
    break;
  case 14:
    multi = 15;
    break;
  default:
    break;
  }
  return (pginc * multi);
}


x86 assembly (clang, -O0):
<calcphaseinc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%cl
shl    %cl,%eax
shr    %eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %rax,-0x20(%rbp)
sub    $0xe,%rax
ja     1171 <calcphaseinc+0x71>
mov    -0x20(%rbp),%rax
lea    0xeca(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x14(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1180 <calcphaseinc+0x80>
movl   $0xa,-0x10(%rbp)
jmp    1176 <calcphaseinc+0x76>
movl   $0xc,-0x10(%rbp)
jmp    1176 <calcphaseinc+0x76>
movl   $0xf,-0x10(%rbp)
jmp    1176 <calcphaseinc+0x76>
jmp    1176 <calcphaseinc+0x76>
mov    -0x14(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcphaseinc>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
cmp    $0xe,%edx
ja     1134 <calcphaseinc+0x34>
mov    %edx,%ecx
lea    0xeec(%rip),%rsi
movslq (%rsi,%rcx,4),%rcx
add    %rsi,%rcx
jmp    *%rcx
shr    $0x2,%eax
ret
mov    $0xa,%edx
jmp    1134 <calcphaseinc+0x34>
mov    $0xc,%edx
jmp    1134 <calcphaseinc+0x34>
mov    $0xf,%edx
shr    %eax
imul   %edx,%eax
ret

LLVM IR (-O0):
define i32 @calcphaseinc(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = shl i32 %9, %10
%12 = lshr i32 %11, 1
store i32 %12, i32* %8
%13 = load i32, i32* %7
switch i32 %13, label %20 [
i32 0, label %14
i32 11, label %17
i32 13, label %18
i32 14, label %19
]
14: ; preds = %3
%15 = load i32, i32* %8
%16 = lshr i32 %15, 1
store i32 %16, i32* %4
br label %25
17: ; preds = %3
store i32 10, i32* %7
br label %21
18: ; preds = %3
store i32 12, i32* %7
br label %21
19: ; preds = %3
store i32 15, i32* %7
br label %21
20: ; preds = %3
br label %21
21: ; preds = %20, %19, %18, %17
%22 = load i32, i32* %8
%23 = load i32, i32* %7
%24 = mul i32 %22, %23
store i32 %24, i32* %4
br label %25
25: ; preds = %21, %14
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @calcphaseinc(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, %1
%5 = lshr i32 %4, 1
switch i32 %2, label %11 [
i32 0, label %6
i32 11, label %8
i32 13, label %9
i32 14, label %10
]
6: ; preds = %3
%7 = lshr i32 %4, 2
br label %14
8: ; preds = %3
br label %11
9: ; preds = %3
br label %11
10: ; preds = %3
br label %11
11: ; preds = %3, %10, %9, %8
%12 = phi i32 [ %2, %3 ], [ 15, %10 ], [ 12, %9 ], [ 10, %8 ]
%13 = mul i32 %12, %5
br label %14
14: ; preds = %11, %6
%15 = phi i32 [ %13, %11 ], [ %7, %6 ]
ret i32 %15
}
double f_x2_612_prime(double x) { return 2 * x; }


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

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

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

LLVM IR (-O2):
define double @f_x2_612_prime(double %0) {
%2 = fmul double %0, 2.000000e+00
ret double %2
}
/* Variables and functions */
double exp(double);
double my_func(double x, void *params) { return exp(x); }


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

x86 assembly (clang, -O2):
<my_func>:
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @my_func(double %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
store double %0, double* %3
store i8* %1, i8** %4
%5 = load double, double* %3
%6 = call double @exp(double %5)
ret double %6
}

LLVM IR (-O2):
define double @my_func(double %0, i8* nocapture readnone %1) {
%3 = tail call double @exp(double %0)
ret double %3
}
/* Variables and functions */
void *check_arakoon_realloc_null(void *ptr __attribute__((__unused__)),
                                 size_t s __attribute__((__unused__))) {
  return NULL;
}


x86 assembly (clang, -O0):
<check_arakoon_realloc_null>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @check_arakoon_realloc_null(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @check_arakoon_realloc_null(i8* nocapture readnone %0, i64 %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int toes;
  toes = 10;
  printf("toes = %d\n", toes);
  printf("two toes = %d\n", 2 * toes);
  printf("toes^2 = %d\n", toes * toes);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
shl    $0x1,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    $0x14,%esi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x64,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"toes = %d\0A\00"
@.str.1 = [15 x i8] c"two toes = %d\0A\00"
@.str.2 = [13 x i8] c"toes^2 = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 20)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 100)
ret i32 0
}
void setValue(int *entry, int value) { *(entry + 5) = value; }


x86 assembly (clang, -O0):
<setValue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setValue>:
mov    %esi,0x14(%rdi)
ret

LLVM IR (-O0):
define void @setValue(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
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 5
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @setValue(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 5
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_write_byte(int);
void create_arc(int speed, int radius) {
  ;
  create_write_byte(137);
  create_write_byte(((speed & 0xFFFF) >> 8));
  create_write_byte((speed & 0xFF));
  create_write_byte(((radius & 0xFFFF) >> 8));
  create_write_byte((radius & 0xFF));
  ;
}


x86 assembly (clang, -O0):
<create_arc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x89,%edi
call   1030 <create_write_byte@plt>
mov    -0x4(%rbp),%edi
and    $0xffff,%edi
sar    $0x8,%edi
call   1030 <create_write_byte@plt>
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <create_write_byte@plt>
mov    -0x8(%rbp),%edi
and    $0xffff,%edi
sar    $0x8,%edi
call   1030 <create_write_byte@plt>
mov    -0x8(%rbp),%edi
and    $0xff,%edi
call   1030 <create_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_arc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0x89,%edi
call   1030 <create_write_byte@plt>
movzbl %bh,%edi
call   1030 <create_write_byte@plt>
movzbl %bl,%edi
call   1030 <create_write_byte@plt>
mov    %ebp,%ebx
movzbl %bh,%edi
call   1030 <create_write_byte@plt>
movzbl %bl,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <create_write_byte@plt>

LLVM IR (-O0):
define void @create_arc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @create_write_byte(i32 137)
%6 = load i32, i32* %3
%7 = and i32 %6, 65535
%8 = ashr i32 %7, 8
%9 = call i32 @create_write_byte(i32 %8)
%10 = load i32, i32* %3
%11 = and i32 %10, 255
%12 = call i32 @create_write_byte(i32 %11)
%13 = load i32, i32* %4
%14 = and i32 %13, 65535
%15 = ashr i32 %14, 8
%16 = call i32 @create_write_byte(i32 %15)
%17 = load i32, i32* %4
%18 = and i32 %17, 255
%19 = call i32 @create_write_byte(i32 %18)
ret void
}

LLVM IR (-O2):
define void @create_arc(i32 %0, i32 %1) {
%3 = tail call i32 @create_write_byte(i32 137)
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = tail call i32 @create_write_byte(i32 %5)
%7 = and i32 %0, 255
%8 = tail call i32 @create_write_byte(i32 %7)
%9 = lshr i32 %1, 8
%10 = and i32 %9, 255
%11 = tail call i32 @create_write_byte(i32 %10)
%12 = and i32 %1, 255
%13 = tail call i32 @create_write_byte(i32 %12)
ret void
}