xunge/DecIR huggingface dataset:
void RandomFunc(unsigned char input[1], unsigned char output[1]) {
  unsigned char state[1];
  unsigned char local1;
  {
    state[0UL] = input[0UL] + (unsigned char)219;
    local1 = 0UL;
    while (local1 < 1UL) {
      state[0UL] |= (state[0UL] & (unsigned char)63) << 4UL;
      local1++;
    }
    output[0UL] = state[0UL] ^ (unsigned char)236;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
add    $0xdb,%eax
mov    %al,-0x11(%rbp)
movb   $0x0,-0x12(%rbp)
movzbl -0x12(%rbp),%eax
cmp    $0x1,%rax
jae    114d <RandomFunc+0x4d>
movzbl -0x11(%rbp),%ecx
and    $0x3f,%ecx
shl    $0x4,%ecx
movzbl -0x11(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x11(%rbp)
mov    -0x12(%rbp),%al
add    $0x1,%al
mov    %al,-0x12(%rbp)
jmp    111f <RandomFunc+0x1f>
movzbl -0x11(%rbp),%eax
xor    $0xec,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%al
add    $0xdb,%al
mov    %eax,%ecx
shl    $0x4,%cl
or     %al,%cl
xor    $0xec,%cl
mov    %cl,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1 x i8]
%6 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = add nsw i32 %10, 219
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %12, i8* %13
store i8 0, i8* %6
br label %14
14: ; preds = %18, %2
%15 = load i8, i8* %6
%16 = zext i8 %15 to i64
%17 = icmp ult i64 %16, 1
br i1 %17, label %18, label %31
18: ; preds = %14
%19 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = and i32 %21, 63
%23 = shl i32 %22, 4
%24 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = or i32 %26, %23
%28 = trunc i32 %27 to i8
store i8 %28, i8* %24
%29 = load i8, i8* %6
%30 = add i8 %29, 1
store i8 %30, i8* %6
br label %14
31: ; preds = %14
%32 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = xor i32 %34, 236
%36 = trunc i32 %35 to i8
%37 = load i8*, i8** %4
%38 = getelementptr inbounds i8, i8* %37, i64 0
store i8 %36, i8* %38
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, -37
%5 = shl i8 %4, 4
%6 = or i8 %5, %4
%7 = xor i8 %6, -20
store i8 %7, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void greet(void) {
  clear();
  printf("WELCOME TO GAME OF TIC_TAC_TOE\n");
  sleep(5);
}


x86 assembly (clang, -O0):
<greet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <clear@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
call   1050 <sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<greet>:
push   %rax
xor    %eax,%eax
call   1040 <clear@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
pop    %rax
jmp    1050 <sleep@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"WELCOME TO GAME OF TIC_TAC_TOE\0A\00"
define void @greet() {
%1 = call i32 (...) @clear()
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @sleep(i32 5)
ret void
}

LLVM IR (-O2):
@str = [31 x i8] c"WELCOME TO GAME OF TIC_TAC_TOE\00"
define void @greet() {
%1 = tail call i32 (...) @clear()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 5)
ret void
}
/* Variables and functions */
scalar_t__ __cmpdf2(long, long);
int __gedf2(long long a1, long long a2) {
  return (__cmpdf2((long)a1, (long)a2) >= 0) - 1;
}


x86 assembly (clang, -O0):
<__gedf2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <__cmpdf2@plt>
cmp    $0x0,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__gedf2>:
push   %rax
call   1030 <__cmpdf2@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__gedf2(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i64 @__cmpdf2(i64 %5, i64 %6)
%8 = icmp sge i64 %7, 0
%9 = zext i1 %8 to i32
%10 = sub nsw i32 %9, 1
ret i32 %10
}

LLVM IR (-O2):
define i32 @__gedf2(i64 %0, i64 %1) {
%3 = tail call i64 @__cmpdf2(i64 %0, i64 %1)
%4 = ashr i64 %3, 63
%5 = trunc i64 %4 to i32
ret i32 %5
}
int isspace(int c) {
  return ((c == '\f') || (c == '\n') || (c == '\r') || (c == ' ') ||
          (c == '\t') || (c == '\v'))
             ? 1
             : 0;
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0xc,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
cmpl   $0xb,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 13, label %5
i32 12, label %5
i32 10, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 11
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
char *my_strchr(const char *str, const int x) {
  while (*(str++) && *str != x)
    ;
  if (*str == x)
    return ((char *)str);
  return (NULL);
}


x86 assembly (clang, -O0):
<my_strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
je     113b <my_strchr+0x3b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    114b <my_strchr+0x4b>
jmp    1150 <my_strchr+0x50>
jmp    110b <my_strchr+0xb>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    116d <my_strchr+0x6d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1175 <my_strchr+0x75>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strchr>:
mov    (%rdi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %al,%al
movzbl 0x1(%rdi),%eax
lea    0x1(%rdi),%rdi
movsbl %al,%ecx
je     1123 <my_strchr+0x23>
cmp    %esi,%ecx
jne    1110 <my_strchr+0x10>
xor    %eax,%eax
cmp    %esi,%ecx
cmove  %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @my_strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
br label %4
4: ; preds = %4, %2
%5 = phi i8 [ %3, %2 ], [ %9, %4 ]
%6 = phi i8* [ %0, %2 ], [ %7, %4 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = icmp eq i8 %5, 0
%9 = load i8, i8* %7
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, %1
%12 = select i1 %8, i1 true, i1 %11
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = sext i8 %9 to i32
%15 = icmp eq i32 %14, %1
%16 = select i1 %15, i8* %7, i8* null
ret i8* %16
}
/* Variables and functions */
int open_serial_port(char const *);
int init_multiplex(const char *tty_dev) { return open_serial_port(tty_dev); }


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

x86 assembly (clang, -O2):
<init_multiplex>:
jmp    1030 <open_serial_port@plt>

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

LLVM IR (-O2):
define i32 @init_multiplex(i8* %0) {
%2 = tail call i32 @open_serial_port(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xf5() {
  Assert_real((islower(245) == 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_islower.c",
              1230, ("islower should be 0 for 0xf5"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xf5>:
push   %rax
mov    $0xf5,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4ce,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xf5\00"
define void @t_islower_0xf5() {
%1 = call i64 @islower(i32 245)
%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 1230, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xf5\00"
define void @t_islower_0xf5() {
%1 = tail call i64 @islower(i32 245)
%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 1230, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char *temp_dir_loc() { return "XDG_RUNTIME_DIR"; }


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"XDG_RUNTIME_DIR\00"
define i8* @temp_dir_loc() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int uint8_t;
typedef int int32_t;

/* Variables and functions */
int decode_signed8(uint8_t *apdu, int32_t *value) {
  if (value) {
    if (apdu[0] & 0x80)
      *value = 0xFFFFFF00;
    else
      *value = 0;
    *value |= ((int32_t)(((int32_t)apdu[0]) & 0x000000ff));
  }
  return 1;
}


x86 assembly (clang, -O0):
<decode_signed8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1158 <decode_signed8+0x58>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     113a <decode_signed8+0x3a>
mov    -0x10(%rbp),%rax
movl   $0xffffff00,(%rax)
jmp    1144 <decode_signed8+0x44>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_signed8>:
test   %rsi,%rsi
je     1116 <decode_signed8+0x16>
movsbl (%rdi),%eax
and    $0xffffff00,%eax
mov    %eax,(%rsi)
movzbl (%rdi),%ecx
or     %eax,%ecx
mov    %ecx,(%rsi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @decode_signed8(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 = icmp ne i32* %5, null
br i1 %6, label %7, label %25
7: ; preds = %2
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = and i32 %10, 128
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = load i32*, i32** %4
store i32 -256, i32* %14
br label %17
15: ; preds = %7
%16 = load i32*, i32** %4
store i32 0, i32* %16
br label %17
17: ; preds = %15, %13
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 0
%20 = load i32, i32* %19
%21 = and i32 %20, 255
%22 = load i32*, i32** %4
%23 = load i32, i32* %22
%24 = or i32 %23, %21
store i32 %24, i32* %22
br label %25
25: ; preds = %17, %2
ret i32 1
}

LLVM IR (-O2):
define i32 @decode_signed8(i32* nocapture %0, i32* writeonly %1) {
%3 = icmp eq i32* %1, null
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = load i32, i32* %0
%6 = and i32 %5, 128
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 0, i32 -256
store i32 %8, i32* %1
%9 = load i32, i32* %0
%10 = and i32 %9, 255
%11 = or i32 %8, %10
store i32 %11, i32* %1
br label %12
12: ; preds = %4, %2
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ ft_itoa(int);
int /*<<< orphan*/ ft_putstr_fd(int, int /*<<< orphan*/);
void ft_putint_fd(int fd, int n) { ft_putstr_fd(fd, ft_itoa(n)); }


x86 assembly (clang, -O0):
<ft_putint_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <ft_itoa@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1040 <ft_putstr_fd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putint_fd>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <ft_itoa@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ft_putstr_fd@plt>

LLVM IR (-O0):
define void @ft_putint_fd(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 = call i32 @ft_itoa(i32 %6)
%8 = call i32 @ft_putstr_fd(i32 %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @ft_putint_fd(i32 %0, i32 %1) {
%3 = tail call i32 @ft_itoa(i32 %1)
%4 = tail call i32 @ft_putstr_fd(i32 %0, i32 %3)
ret void
}
int mtd_parse_partitions(struct mtd_info *parent, const char **_mtdparts,
                         struct mtd_partition **_parts, int *_nparts) {
  *_nparts = 0;
  return 0;
}


x86 assembly (clang, -O0):
<mtd_parse_partitions>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtd_parse_partitions>:
movl   $0x0,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.mtd_info = type opaque
%struct.mtd_partition = type opaque
define i32 @mtd_parse_partitions(%struct.mtd_info* %0, i8** %1, %struct.mtd_partition** %2, i32* %3) {
%5 = alloca %struct.mtd_info*
%6 = alloca i8**
%7 = alloca %struct.mtd_partition**
%8 = alloca i32*
store %struct.mtd_info* %0, %struct.mtd_info** %5
store i8** %1, i8*** %6
store %struct.mtd_partition** %2, %struct.mtd_partition*** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %8
store i32 0, i32* %9
ret i32 0
}

LLVM IR (-O2):
%struct.mtd_info = type opaque
%struct.mtd_partition = type opaque
define i32 @mtd_parse_partitions(%struct.mtd_info* nocapture readnone %0, i8** nocapture readnone %1, %struct.mtd_partition** nocapture readnone %2, i32* nocapture writeonly %3) {
store i32 0, i32* %3
ret i32 0
}
/* Variables and functions */
int FE_TONEAREST;
int __fesetround(int);
int fesetround(int r) {
  if (r & ~(FE_TONEAREST))
    return -1;
  return __fesetround(r);
}


x86 assembly (clang, -O0):
<fesetround>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ec3(%rip),%rcx
mov    (%rcx),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1141 <fesetround+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <fesetround+0x3c>
mov    -0x8(%rbp),%edi
call   1030 <__fesetround@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fesetround>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
not    %eax
test   %edi,%eax
je     1125 <fesetround+0x15>
mov    $0xffffffff,%eax
ret
jmp    1030 <__fesetround@plt>

LLVM IR (-O0):
@FE_TONEAREST = global i32 0
define i32 @fesetround(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @FE_TONEAREST
%6 = xor i32 %5, -1
%7 = and i32 %4, %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %13
10: ; preds = %1
%11 = load i32, i32* %3
%12 = call i32 @__fesetround(i32 %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@FE_TONEAREST = global i32 0
define i32 @fesetround(i32 %0) {
%2 = load i32, i32* @FE_TONEAREST
%3 = xor i32 %2, -1
%4 = and i32 %3, %0
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @__fesetround(i32 %0)
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ %7, %6 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
scalar_t__ listen(int, int);
int /*<<< orphan*/ perr_exit(char *);
void Listen(int fd, int backlog) {
  if (listen(fd, backlog) < 0)
    perr_exit("listen error");
}


x86 assembly (clang, -O0):
<Listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <listen@plt>
cmp    $0x0,%rax
jge    114f <Listen+0x2f>
lea    0xeb6(%rip),%rdi
call   1040 <perr_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Listen>:
push   %rax
call   1030 <listen@plt>
test   %rax,%rax
js     112d <Listen+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <perr_exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"listen error\00"
define void @Listen(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 = call i64 @listen(i32 %5, i32 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @perr_exit(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"listen error\00"
define void @Listen(i32 %0, i32 %1) {
%3 = tail call i64 @listen(i32 %0, i32 %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perr_exit(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ esc(char *);
int /*<<< orphan*/ padding(int);
void vt52home(void) {
  esc("H");
  padding(5);
}


x86 assembly (clang, -O0):
<vt52home>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <esc@plt>
mov    $0x5,%edi
call   1030 <padding@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vt52home>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <esc@plt>
mov    $0x5,%edi
pop    %rax
jmp    1030 <padding@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"H\00"
define void @vt52home() {
%1 = call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @padding(i32 5)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"H\00"
define void @vt52home() {
%1 = tail call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @padding(i32 5)
ret void
}
int is_empty(int row, int col, char board[8][8]) {
  return board[row][col] == ' ';
}


x86 assembly (clang, -O0):
<is_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_empty>:
movslq %edi,%rax
movslq %esi,%rcx
lea    (%rdx,%rax,8),%rdx
xor    %eax,%eax
cmpb   $0x20,(%rcx,%rdx,1)
sete   %al
ret

LLVM IR (-O0):
define i32 @is_empty(i32 %0, i32 %1, [8 x i8]* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca [8 x i8]*
store i32 %0, i32* %4
store i32 %1, i32* %5
store [8 x i8]* %2, [8 x i8]** %6
%7 = load [8 x i8]*, [8 x i8]** %6
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 %9
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [8 x i8], [8 x i8]* %10, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 32
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @is_empty(i32 %0, i32 %1, [8 x i8]* nocapture %2) {
%4 = sext i32 %0 to i64
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 %4, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 32
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, long);
int strlen(char *);
void putcol(char *file, long col) {
  if (col > 0)
    sprintf(file + strlen(file), ",%ld", col);
}


x86 assembly (clang, -O0):
<putcol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    1165 <putcol+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
cltq
add    %rax,%rdi
mov    -0x10(%rbp),%rdx
lea    0xea0(%rip),%rsi
call   1040 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putcol>:
test   %rsi,%rsi
jle    1150 <putcol+0x30>
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
movslq %eax,%rdi
add    %r14,%rdi
lea    0xebf(%rip),%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <sprintf@plt>
ret

LLVM IR (-O0):
@.str = [5 x i8] c",%ld\00"
define void @putcol(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
%13 = load i64, i64* %4
%14 = call i32 @sprintf(i8* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %13)
br label %15
15: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c",%ld\00"
define void @putcol(i8* %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = tail call i32 @strlen(i8* %0)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = tail call i32 @sprintf(i8* dereferenceable(1) %7, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %1)
br label %9
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
char *strerror(int);
void perror(const char *s) {
  int err = errno;
  fputs(s, stderr);
  fputs(": ", stderr);
  fputs(strerror(err), stderr);
  fputs("\n", stderr);
}


x86 assembly (clang, -O0):
<perror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%esi
lea    0xea6(%rip),%rdi
call   1030 <fputs@plt>
mov    -0xc(%rbp),%edi
call   1040 <strerror@plt>
mov    %rax,%rdi
mov    0x2e6f(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%esi
lea    0xe7b(%rip),%rdi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perror>:
push   %rbp
push   %rbx
push   %rax
mov    0x2eae(%rip),%rax
mov    (%rax),%ebp
mov    0x2ead(%rip),%rbx
mov    (%rbx),%esi
call   1030 <fputs@plt>
mov    (%rbx),%esi
lea    0xebd(%rip),%rdi
call   1030 <fputs@plt>
mov    %ebp,%edi
call   1040 <strerror@plt>
mov    (%rbx),%esi
mov    %rax,%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
lea    0xea1(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fputs@plt>

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

LLVM IR (-O2):
@errno = global i32 0
@stderr = global i32 0
@.str = [3 x i8] c": \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @perror(i8* %0) {
%2 = load i32, i32* @errno
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* %0, i32 %3)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i8* @strerror(i32 %2)
%8 = load i32, i32* @stderr
%9 = tail call i32 @fputs(i8* %7, i32 %8)
%10 = load i32, i32* @stderr
%11 = tail call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret void
}
/* Type definitions */
struct quickHeap {
  int dummy;
};

/* Variables and functions */
int findElemInQuickHeap(struct quickHeap *, void *);
int /*<<< orphan*/ removeFromQuickHeapN(struct quickHeap *, int);
int removeFromQuickHeapByElem(struct quickHeap *h, void *elem) {
  int n = findElemInQuickHeap(h, elem);
  if (n < 0)
    return 0;
  removeFromQuickHeapN(h, n);
  return 1;
}


x86 assembly (clang, -O0):
<removeFromQuickHeapByElem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <findElemInQuickHeap@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1156 <removeFromQuickHeapByElem+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1169 <removeFromQuickHeapByElem+0x49>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <removeFromQuickHeapN@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeFromQuickHeapByElem>:
push   %rbx
mov    %rdi,%rbx
call   1030 <findElemInQuickHeap@plt>
test   %eax,%eax
js     113e <removeFromQuickHeapByElem+0x1e>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <removeFromQuickHeapN@plt>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.quickHeap = type { i32 }
define i32 @removeFromQuickHeapByElem(%struct.quickHeap* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.quickHeap*
%5 = alloca i8*
%6 = alloca i32
store %struct.quickHeap* %0, %struct.quickHeap** %4
store i8* %1, i8** %5
%7 = load %struct.quickHeap*, %struct.quickHeap** %4
%8 = load i8*, i8** %5
%9 = call i32 @findElemInQuickHeap(%struct.quickHeap* %7, i8* %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 0, i32* %3
br label %17
13: ; preds = %2
%14 = load %struct.quickHeap*, %struct.quickHeap** %4
%15 = load i32, i32* %6
%16 = call i32 @removeFromQuickHeapN(%struct.quickHeap* %14, i32 %15)
store i32 1, i32* %3
br label %17
17: ; preds = %13, %12
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.quickHeap = type { i32 }
define i32 @removeFromQuickHeapByElem(%struct.quickHeap* %0, i8* %1) {
%3 = tail call i32 @findElemInQuickHeap(%struct.quickHeap* %0, i8* %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @removeFromQuickHeapN(%struct.quickHeap* %0, i32 %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Type definitions */
struct vm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ get_missing_item(int *, struct vm *);
int /*<<< orphan*/ get_present_item(int *, struct vm *);
int /*<<< orphan*/ printf(char *);
void item_retrieval_tests(int stats[3], struct vm *vm) {
  printf("Testing item retrieval :\n");
  get_missing_item(stats, vm);
  get_present_item(stats, vm);
  printf("\n");
}


x86 assembly (clang, -O0):
<item_retrieval_tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <get_missing_item@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <get_present_item@plt>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<item_retrieval_tests>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xeaf(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <get_missing_item@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <get_present_item@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

LLVM IR (-O0):
%struct.vm = type { i32 }
@.str = [26 x i8] c"Testing item retrieval :\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @item_retrieval_tests(i32* %0, %struct.vm* %1) {
%3 = alloca i32*
%4 = alloca %struct.vm*
store i32* %0, i32** %3
store %struct.vm* %1, %struct.vm** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%6 = load i32*, i32** %3
%7 = load %struct.vm*, %struct.vm** %4
%8 = call i32 @get_missing_item(i32* %6, %struct.vm* %7)
%9 = load i32*, i32** %3
%10 = load %struct.vm*, %struct.vm** %4
%11 = call i32 @get_present_item(i32* %9, %struct.vm* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.vm = type { i32 }
@str = [25 x i8] c"Testing item retrieval :\00"
define void @item_retrieval_tests(i32* %0, %struct.vm* %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @get_missing_item(i32* %0, %struct.vm* %1)
%5 = tail call i32 @get_present_item(i32* %0, %struct.vm* %1)
%6 = tail call i32 @putchar(i32 10)
ret void
}
void pr30828(char *p) {}


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

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

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

LLVM IR (-O2):
define void @pr30828(i8* nocapture %0) {
ret void
}
/* Variables and functions */
size_t hashtable_hash(const char *string) {
  size_t hash = 0;
  int ch = 0;
  while ((ch = *string++))
    hash = ch + (hash << 6) + (hash << 16) - hash;
  return hash;
}


x86 assembly (clang, -O0):
<hashtable_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     115c <hashtable_hash+0x5c>
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
shl    $0x10,%rcx
add    %rcx,%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <hashtable_hash+0x17>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashtable_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112a <hashtable_hash+0x2a>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbq %cl,%rcx
imul   $0x1003f,%rax,%rax
add    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hashtable_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @hashtable_hash(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 i64 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %5 to i64
%10 = mul i64 %6, 65599
%11 = add i64 %10, %9
%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 [ 0, %1 ], [ %11, %4 ]
ret i64 %15
}
char norm(const char c) {
  switch (c) {
  case 'A':
  case 'a':
    return 'A';
  case 'C':
  case 'c':
    return 'C';
  case 'G':
  case 'g':
    return 'G';
  case 'T':
  case 't':
    return 'T';
  default:
    return 'N';
  }
}


x86 assembly (clang, -O0):
<norm>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x33,%eax
ja     1158 <norm+0x58>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x41,-0x1(%rbp)
jmp    115c <norm+0x5c>
movb   $0x43,-0x1(%rbp)
jmp    115c <norm+0x5c>
movb   $0x47,-0x1(%rbp)
jmp    115c <norm+0x5c>
movb   $0x54,-0x1(%rbp)
jmp    115c <norm+0x5c>
movb   $0x4e,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<norm>:
add    $0xffffffbf,%edi
cmp    $0x33,%edi
ja     1123 <norm+0x23>
mov    $0x41,%al
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x43,%al
ret
mov    $0x47,%al
ret
mov    $0x54,%al
ret
mov    $0x4e,%al
ret

LLVM IR (-O0):
define signext i8 @norm(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 65, label %6
i32 97, label %6
i32 67, label %7
i32 99, label %7
i32 71, label %8
i32 103, label %8
i32 84, label %9
i32 116, label %9
]
6: ; preds = %1, %1
store i8 65, i8* %2
br label %11
7: ; preds = %1, %1
store i8 67, i8* %2
br label %11
8: ; preds = %1, %1
store i8 71, i8* %2
br label %11
9: ; preds = %1, %1
store i8 84, i8* %2
br label %11
10: ; preds = %1
store i8 78, i8* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @norm(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %6 [
i32 65, label %7
i32 97, label %7
i32 67, label %3
i32 99, label %3
i32 71, label %4
i32 103, label %4
i32 84, label %5
i32 116, label %5
]
3: ; preds = %1, %1
br label %7
4: ; preds = %1, %1
br label %7
5: ; preds = %1, %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %1, %6, %5, %4, %3
%8 = phi i8 [ 78, %6 ], [ 84, %5 ], [ 71, %4 ], [ 67, %3 ], [ 65, %1 ], [ 65, %1 ]
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_cmd_line(int argc, char *argv[]) {
  int i;
  for (i = 0; i < argc; i++)
    printf("%s ", argv[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_cmd_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115a <print_cmd_line+0x4a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <print_cmd_line+0x16>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_cmd_line>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1157 <print_cmd_line+0x37>
mov    %rsi,%r15
mov    %edi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_cmd_line+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define void @print_cmd_line(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ _exit(int);
ssize_t _read(int fd, void *buf, size_t count) {
  _exit(-1);
  return -1;
}


x86 assembly (clang, -O0):
<_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<_read>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @_read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define i32 @_read(i32 %0, i8* nocapture readnone %1, i64 %2) {
%4 = tail call i32 @_exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_welcome(void) {
  printf("dbf file system image generation tool version "
         "0.2.0"
         ".\n");
  printf("DBFFS version "
         "0.1.0"
         "\n\n");
}


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

x86 assembly (clang, -O2):
<print_welcome>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf11(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"dbf file system image generation tool version 0.2.0.\0A\00"
@.str.1 = [22 x i8] c"DBFFS version 0.1.0\0A\0A\00"
define void @print_welcome() {
%1 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [53 x i8] c"dbf file system image generation tool version 0.2.0.\00"
@str.2 = [21 x i8] c"DBFFS version 0.1.0\0A\00"
define void @print_welcome() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.2, i64 0, i64 0))
ret void
}
int is_digit(char c) { return c >= 48 && c <= 57; }


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <is_digit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void SIO1_writeCtrl32(unsigned long val) {}


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

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

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

LLVM IR (-O2):
define void @SIO1_writeCtrl32(i64 %0) {
ret void
}
int isprime(int num, int half) {
  if (half == 1)
    return 1;
  else if (num % half == 0)
    return 0;
  else
    return isprime(num, half - 1);
}


x86 assembly (clang, -O0):
<isprime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1134 <isprime+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1161 <isprime+0x51>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1150 <isprime+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1161 <isprime+0x51>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <isprime@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprime>:
mov    $0x1,%ecx
cmp    $0x1,%esi
je     1121 <isprime+0x21>
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1124 <isprime+0x24>
add    $0xffffffff,%esi
cmp    $0x1,%esi
jne    1110 <isprime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @isprime(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 1
br i1 %3, label %11, label %6
4: ; preds = %6
%5 = icmp eq i32 %10, 1
br i1 %5, label %11, label %6
6: ; preds = %2, %4
%7 = phi i32 [ %10, %4 ], [ %1, %2 ]
%8 = srem i32 %0, %7
%9 = icmp eq i32 %8, 0
%10 = add nsw i32 %7, -1
br i1 %9, label %11, label %4
11: ; preds = %4, %6, %2
%12 = phi i32 [ 1, %2 ], [ 0, %6 ], [ 1, %4 ]
ret i32 %12
}
void gtk_tree_row_reference_inserted() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @RTEnvGetExecEnvP() {
ret void
}
__attribute__((always_)) const double trunck(double x) {
  return (double)(int)x;
}


x86 assembly (clang, -O0):
<trunck>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<trunck>:
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @trunck(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
%5 = sitofp i32 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @trunck(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
ret double %3
}