xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ expand(char *, char *, int);
int /*<<< orphan*/ getinput(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char input[100], output[100];
  getinput(input, 100);
  expand(input, output, 100);
  printf("Output - %s\n", output);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0x64,%esi
call   1040 <getinput@plt>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
mov    $0x64,%edx
call   1050 <expand@plt>
lea    -0xe0(%rbp),%rsi
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1040 <getinput@plt>
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x64,%edx
call   1050 <expand@plt>
lea    0xe9a(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Output - %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
store i32 0, i32* %1
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @getinput(i8* %4, i32 100)
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%8 = call i32 @expand(i8* %6, i8* %7, i32 100)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 1
}

LLVM IR (-O2):
@.str = [13 x i8] c"Output - %s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @getinput(i8* %3, i32 100)
%6 = call i32 @expand(i8* %3, i8* %4, i32 100)
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 1
}
int minimum(int x, int y) { return x < y ? x : y; }


x86 assembly (clang, -O0):
<minimum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <minimum+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <minimum+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minimum>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @minimum(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @minimum(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ flags;
};
typedef TYPE_1__ XColor;

/* Variables and functions */
char get_XColor_flags(void *_p) { return (char)((XColor *)_p)->flags; }


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

x86 assembly (clang, -O2):
<get_XColor_flags>:
mov    (%rdi),%al
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define signext i8 @get_XColor_flags(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @get_XColor_flags(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i8
ret i8 %4
}
/* Variables and functions */
int munmap(void *, size_t);
int subhook_free_code(void *address, size_t size) {
  if (address == NULL) {
    return 0;
  }
  return munmap(address, size);
}


x86 assembly (clang, -O0):
<subhook_free_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <subhook_free_code+0x27>
movl   $0x0,-0x4(%rbp)
jmp    1147 <subhook_free_code+0x37>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <munmap@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subhook_free_code>:
test   %rdi,%rdi
je     111a <subhook_free_code+0xa>
jmp    1030 <munmap@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @subhook_free_code(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @munmap(i8* %0, i64 %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 0, %2 ]
ret i32 %7
}
int isOperator(char c) {
  return c == '+' || c == '-' || c == '*' || c == '/' || c == '%' || c == '^' ||
         c == '$';
}


x86 assembly (clang, -O0):
<isOperator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2b,%ecx
mov    %al,-0x2(%rbp)
je     1183 <isOperator+0x83>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2d,%ecx
mov    %al,-0x2(%rbp)
je     1183 <isOperator+0x83>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2a,%ecx
mov    %al,-0x2(%rbp)
je     1183 <isOperator+0x83>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2f,%ecx
mov    %al,-0x2(%rbp)
je     1183 <isOperator+0x83>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x25,%ecx
mov    %al,-0x2(%rbp)
je     1183 <isOperator+0x83>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5e,%ecx
mov    %al,-0x2(%rbp)
je     1183 <isOperator+0x83>
movsbl -0x1(%rbp),%eax
cmp    $0x24,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOperator>:
lea    -0x25(%rdi),%ecx
cmp    $0x39,%cl
ja     1121 <isOperator+0x21>
mov    $0x1,%eax
movzbl %cl,%ecx
movabs $0x200000000000561,%rdx
bt     %rcx,%rdx
jae    1121 <isOperator+0x21>
ret
xor    %eax,%eax
cmp    $0x24,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isOperator(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 43
br i1 %5, label %30, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 45
br i1 %9, label %30, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 42
br i1 %13, label %30, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 47
br i1 %17, label %30, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 37
br i1 %21, label %30, label %22
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 94
br i1 %25, label %30, label %26
26: ; preds = %22
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 36
br label %30
30: ; preds = %26, %22, %18, %14, %10, %6, %1
%31 = phi i1 [ true, %22 ], [ true, %18 ], [ true, %14 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %29, %26 ]
%32 = zext i1 %31 to i32
ret i32 %32
}

LLVM IR (-O2):
define i32 @isOperator(i8 signext %0) {
switch i8 %0, label %2 [
i8 94, label %5
i8 47, label %5
i8 45, label %5
i8 43, label %5
i8 42, label %5
i8 37, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 36
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
int count_lines(char *s) {
  int i = 0;
  while (*s != 0) {
    if (*s == '\n')
      i++;
    s++;
  }
  return i;
}


x86 assembly (clang, -O0):
<count_lines>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <count_lines+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1138 <count_lines+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <count_lines+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_lines>:
xor    %eax,%eax
jmp    1117 <count_lines+0x17>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0xa,%cl
je     1110 <count_lines+0x10>
test   %cl,%cl
jne    1113 <count_lines+0x13>
ret

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

LLVM IR (-O2):
define i32 @count_lines(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i32 [ 0, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %11
i8 10, label %6
]
6: ; preds = %2
%7 = add nsw i32 %4, 1
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
ret i32 0
}
/* Variables and functions */
int __show_config(int);
int show_alt_config(char **args, int num_args) { return __show_config(2); }


x86 assembly (clang, -O0):
<show_alt_config>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x2,%edi
call   1030 <__show_config@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_alt_config>:
mov    $0x2,%edi
jmp    1030 <__show_config@plt>

LLVM IR (-O0):
define i32 @show_alt_config(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = call i32 @__show_config(i32 2)
ret i32 %5
}

LLVM IR (-O2):
define i32 @show_alt_config(i8** nocapture readnone %0, i32 %1) {
%3 = tail call i32 @__show_config(i32 2)
ret i32 %3
}
/* Variables and functions */
__attribute__((weak)) void __explicit_bzero_hook(void *buf, size_t len) {}


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

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

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

LLVM IR (-O2):
define weak void @__explicit_bzero_hook(i8* %0, i64 %1) {
ret void
}
unsigned long gcd(unsigned long a, unsigned long b) {
  unsigned long r;
  if (a < b)
    do {
      typeof(a) __tmp = (a);
      (a) = (b);
      (b) = __tmp;
    } while (0);
  if (!b)
    return a;
  while ((r = a % b) != 0) {
    a = b;
    b = r;
  }
  return b;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    113c <gcd+0x3c>
jmp    111f <gcd+0x1f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    113c <gcd+0x3c>
cmpq   $0x0,-0x18(%rbp)
jne    1154 <gcd+0x54>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1190 <gcd+0x90>
jmp    1159 <gcd+0x59>
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmp    $0x0,%rdx
je     1188 <gcd+0x88>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1159 <gcd+0x59>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rdi,%rax
cmp    %rsi,%rdi
mov    %rsi,%rdx
cmovb  %rdi,%rdx
cmovb  %rsi,%rax
test   %rdx,%rdx
jne    112d <gcd+0x2d>
ret
nopw   0x0(%rax,%rax,1)
xor    %edx,%edx
div    %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1142 <gcd+0x42>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1120 <gcd+0x20>
xor    %edx,%edx
div    %ecx
jmp    1125 <gcd+0x25>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
%5 = select i1 %3, i64 %1, i64 %0
%6 = icmp eq i64 %4, 0
br i1 %6, label %12, label %7
7: ; preds = %2, %7
%8 = phi i64 [ %10, %7 ], [ %4, %2 ]
%9 = phi i64 [ %8, %7 ], [ %5, %2 ]
%10 = urem i64 %9, %8
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %2
%13 = phi i64 [ %5, %2 ], [ %8, %7 ]
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ SYS_munmap;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int main() {
  for (;;)
    syscall(SYS_munmap, 0, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <syscall@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <syscall@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
@SYS_munmap = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
%3 = load i32, i32* @SYS_munmap
%4 = call i32 @syscall(i32 %3, i32 0, i32 0)
br label %2
}

LLVM IR (-O2):
@SYS_munmap = global i32 0
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = load i32, i32* @SYS_munmap
%3 = tail call i32 @syscall(i32 %2, i32 0, i32 0)
br label %1
}
/* Variables and functions */
int ArgNum();
scalar_t__ GetFlag(int);
int Cnd_NeF(void) {
  int v = ArgNum();
  return (GetFlag(v) != GetFlag(ArgNum()));
}


x86 assembly (clang, -O0):
<Cnd_NeF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <ArgNum@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <GetFlag@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <ArgNum@plt>
mov    %eax,%edi
call   1030 <GetFlag@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cnd_NeF>:
push   %rbx
xor    %eax,%eax
call   1040 <ArgNum@plt>
mov    %eax,%edi
call   1030 <GetFlag@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <ArgNum@plt>
mov    %eax,%edi
call   1030 <GetFlag@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Cnd_NeF() {
%1 = alloca i32
%2 = call i32 (...) @ArgNum()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i64 @GetFlag(i32 %3)
%5 = call i32 (...) @ArgNum()
%6 = call i64 @GetFlag(i32 %5)
%7 = icmp ne i64 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @Cnd_NeF() {
%1 = tail call i32 (...) @ArgNum()
%2 = tail call i64 @GetFlag(i32 %1)
%3 = tail call i32 (...) @ArgNum()
%4 = tail call i64 @GetFlag(i32 %3)
%5 = icmp ne i64 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef long int32_t;
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
int /*<<< orphan*/ xdrrec_getint32(int /*<<< orphan*/ *, long *);
bool_t xdrrec_getlong(XDR *xdrs, long *lp) {
  int32_t v;
  bool_t r = xdrrec_getint32(xdrs, &v);
  *lp = v;
  return r;
}


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

x86 assembly (clang, -O2):
<xdrrec_getlong>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <xdrrec_getint32@plt>
mov    0x8(%rsp),%rcx
mov    %rcx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @xdrrec_getlong(i32* %0, i64* nocapture writeonly %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i32 @xdrrec_getint32(i32* %0, i64* %3)
%6 = load i64, i64* %3
store i64 %6, i64* %1
ret i32 %5
}
int ind(s1, s2) { return 2 * s1 + s2; }


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

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

LLVM IR (-O0):
define i32 @ind(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 = mul nsw i32 2, %5
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @ind(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 1
%4 = add nsw i32 %3, %1
ret i32 %4
}
float test_erff(float x) { return __builtin_erff(x); }


x86 assembly (clang, -O0):
<test_erff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <erff@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_erff>:
jmp    1030 <erff@plt>

LLVM IR (-O0):
define float @test_erff(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @erff(float %3)
ret float %4
}

LLVM IR (-O2):
define float @test_erff(float %0) {
%2 = tail call float @erff(float %0)
ret float %2
}
const char *Sort_Name(void) { return "Sort"; }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"Sort\00"
define i8* @Sort_Name() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
size_t min_size_t(size_t a, size_t b) { return a < b ? a : b; }


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

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

LLVM IR (-O0):
define i64 @min_size_t(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 = icmp ult i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @min_size_t(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
double LSKeyframeAnimationFunctionLinear(double t, double b, double c,
                                         double d) {
  return c * (t /= d) + b;
}


x86 assembly (clang, -O0):
<LSKeyframeAnimationFunctionLinear>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
divsd  %xmm1,%xmm2
movsd  %xmm2,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<LSKeyframeAnimationFunctionLinear>:
divsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @LSKeyframeAnimationFunctionLinear(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = load double, double* %8
%11 = load double, double* %5
%12 = fdiv double %11, %10
store double %12, double* %5
%13 = load double, double* %6
%14 = call double @llvm.fmuladd.f64(double %9, double %12, double %13)
ret double %14
}

LLVM IR (-O2):
define double @LSKeyframeAnimationFunctionLinear(double %0, double %1, double %2, double %3) {
%5 = fdiv double %0, %3
%6 = tail call double @llvm.fmuladd.f64(double %2, double %5, double %1)
ret double %6
}
/* Type definitions */
struct timespec {
  long tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, struct timespec *);
void delayMicrosecondsSys(unsigned int howLong) {
  struct timespec sleeper, dummy;
  sleeper.tv_sec = 0;
  sleeper.tv_nsec = (long)(howLong * 1000);
  nanosleep(&sleeper, &dummy);
}


x86 assembly (clang, -O0):
<delayMicrosecondsSys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
imul   $0x3e8,-0x4(%rbp),%eax
mov    %eax,%eax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <nanosleep@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delayMicrosecondsSys>:
sub    $0x28,%rsp
movq   $0x0,0x10(%rsp)
imul   $0x3e8,%edi,%eax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
lea    0x18(%rsp),%rsi
call   1030 <nanosleep@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @delayMicrosecondsSys(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
%4 = alloca %struct.timespec
store i32 %0, i32* %2
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 0, i64* %5
%6 = load i32, i32* %2
%7 = mul i32 %6, 1000
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i64 %8, i64* %9
%10 = call i32 @nanosleep(%struct.timespec* %3, %struct.timespec* %4)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @delayMicrosecondsSys(i32 %0) {
%2 = alloca %struct.timespec
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %2 to i8*
%5 = bitcast %struct.timespec* %3 to i8*
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 0, i64* %6
%7 = mul i32 %0, 1000
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i64 %8, i64* %9
%10 = call i32 @nanosleep(%struct.timespec* %2, %struct.timespec* %3)
ret void
}
void foo154() {}


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

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

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

LLVM IR (-O2):
define void @foo154() {
ret void
}
char *sha512hex(bitstr, bitcnt)
unsigned char *bitstr;
unsigned long bitcnt;
{ return ((char *)shacomp(512, 2, bitstr, bitcnt)); }


x86 assembly (clang, -O0):
<sha512hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x200,%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <shacomp@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha512hex>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    $0x200,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <shacomp@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @sha512hex(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 (i32, i32, i8*, i64, ...) bitcast (i32 (...)* @shacomp to i32 (i32, i32, i8*, i64, ...)*)(i32 512, i32 2, i8* %5, i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @sha512hex(i8* %0, i64 %1) {
%3 = tail call i32 (i32, i32, i8*, i64, ...) bitcast (i32 (...)* @shacomp to i32 (i32, i32, i8*, i64, ...)*)(i32 512, i32 2, i8* %0, i64 %1)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *strdups(char *str) {
  char *ptr = malloc(sizeof(char) * (strlen(str) + 1));
  strcpy(ptr, str);
  return ptr;
}


x86 assembly (clang, -O0):
<strdups>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdups>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdups(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = mul i64 1, %7
%9 = trunc i64 %8 to i32
%10 = call i8* @malloc(i32 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = call i32 @strcpy(i8* %11, i8* %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @strdups(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
scalar_t__ realloc(void *, unsigned int);
int /*<<< orphan*/ yyerror(char *);
void *yyrealloc(void *old, unsigned bytes) {
  void *ptr = (void *)realloc(old, bytes);
  if (ptr != 0)
    return (ptr);
  yyerror("yyparse: memory exhausted");
  return (0);
}


x86 assembly (clang, -O0):
<yyrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1157 <yyrealloc+0x37>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116b <yyrealloc+0x4b>
lea    0xea2(%rip),%rdi
call   1030 <yyerror@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyrealloc>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     112d <yyrealloc+0xd>
pop    %rcx
ret
lea    0xecc(%rip),%rdi
call   1030 <yyerror@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"yyparse: memory exhausted\00"
define i8* @yyrealloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = call i64 @realloc(i8* %7, i32 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i8*, i8** %6
store i8* %14, i8** %3
br label %17
15: ; preds = %2
%16 = call i32 @yyerror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i8* null, i8** %3
br label %17
17: ; preds = %15, %13
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [26 x i8] c"yyparse: memory exhausted\00"
define i8* @yyrealloc(i8* %0, i32 %1) {
%3 = tail call i64 @realloc(i8* %0, i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = inttoptr i64 %3 to i8*
br label %9
7: ; preds = %2
%8 = tail call i32 @yyerror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
%10 = phi i8* [ %6, %5 ], [ null, %7 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void checkLong(long value, char *mess) {
  if (value < 0) {
    printf(mess);
    printf("Try 'tiotest -h' for more information\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<checkLong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    115a <checkLong+0x3a>
mov    -0x10(%rbp),%rdi
call   1030 <printf@plt>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkLong>:
test   %rdi,%rdi
js     1136 <checkLong+0x6>
ret
push   %rax
mov    %rsi,%rdi
call   1040 <printf@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Try 'tiotest -h' for more information\0A\00"
define void @checkLong(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i64, i64* %3
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @printf(i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
@str = [38 x i8] c"Try 'tiotest -h' for more information\00"
define void @checkLong(i64 %0, i8* nocapture %1) {
%3 = icmp slt i64 %0, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i32 @printf(i8* dereferenceable(1) %1)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
int icomp_posdata(const void *s1, const void *s2) {
  return (((int)((unsigned int)(*(unsigned int *)s1) >> (unsigned int)8)) -
          ((int)((unsigned int)(*(unsigned int *)s2) >> (unsigned int)8)));
}


x86 assembly (clang, -O0):
<icomp_posdata>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shr    $0x8,%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
shr    $0x8,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<icomp_posdata>:
mov    (%rdi),%eax
shr    $0x8,%eax
mov    (%rsi),%ecx
shr    $0x8,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @icomp_posdata(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = lshr i32 %7, 8
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = lshr i32 %11, 8
%13 = sub nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @icomp_posdata(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = lshr i32 %4, 8
%6 = bitcast i8* %1 to i32*
%7 = load i32, i32* %6
%8 = lshr i32 %7, 8
%9 = sub nsw i32 %5, %8
ret i32 %9
}
/* Variables and functions */
scalar_t__ CallBack2(int, void *, void *);
int /*<<< orphan*/ CheckRunningInMainThread(char *);
int ActualToResourceItem(int igorMenuID, int actualItemNumber) {
  if (!CheckRunningInMainThread("ActualToResourceItem"))
    return 0;
  return (int)CallBack2(64, (void *)igorMenuID, (void *)actualItemNumber);
}


x86 assembly (clang, -O0):
<ActualToResourceItem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xecb(%rip),%rdi
call   1030 <CheckRunningInMainThread@plt>
cmp    $0x0,%eax
jne    114f <ActualToResourceItem+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1164 <ActualToResourceItem+0x44>
movslq -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rdx
mov    $0x40,%edi
call   1040 <CallBack2@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ActualToResourceItem>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rdi
call   1030 <CheckRunningInMainThread@plt>
test   %eax,%eax
je     1149 <ActualToResourceItem+0x29>
movslq %ebp,%rsi
movslq %ebx,%rdx
mov    $0x40,%edi
call   1040 <CallBack2@plt>
jmp    114b <ActualToResourceItem+0x2b>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"ActualToResourceItem\00"
define i32 @ActualToResourceItem(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %2
store i32 0, i32* %3
br label %18
9: ; preds = %2
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
%16 = call i64 @CallBack2(i32 64, i8* %12, i8* %15)
%17 = trunc i64 %16 to i32
store i32 %17, i32* %3
br label %18
18: ; preds = %9, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [21 x i8] c"ActualToResourceItem\00"
define i32 @ActualToResourceItem(i32 %0, i32 %1) {
%3 = tail call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = sext i32 %0 to i64
%7 = inttoptr i64 %6 to i8*
%8 = sext i32 %1 to i64
%9 = inttoptr i64 %8 to i8*
%10 = tail call i64 @CallBack2(i32 64, i8* %7, i8* %9)
%11 = trunc i64 %10 to i32
br label %12
12: ; preds = %2, %5
%13 = phi i32 [ %11, %5 ], [ 0, %2 ]
ret i32 %13
}
void drawCooker(char campo[25][50], int lin, int col) {
  campo[lin][col + 3] = '0';
  campo[lin][col + 4] = '0';
  campo[lin + 1][col + 4] = '^';
}


x86 assembly (clang, -O0):
<drawCooker>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x32,%rcx,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movb   $0x30,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x32,%rcx,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
movb   $0x30,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
imul   $0x32,%rcx,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
movb   $0x5e,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawCooker>:
movslq %esi,%rax
imul   $0x32,%rax,%rcx
add    %rdi,%rcx
movslq %edx,%rdx
movw   $0x3030,0x3(%rdx,%rcx,1)
add    $0x1,%eax
cltq
imul   $0x32,%rax,%rax
add    %rdi,%rax
movb   $0x5e,0x4(%rdx,%rax,1)
ret

LLVM IR (-O0):
define void @drawCooker([50 x i8]* %0, i32 %1, i32 %2) {
%4 = alloca [50 x i8]*
%5 = alloca i32
%6 = alloca i32
store [50 x i8]* %0, [50 x i8]** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load [50 x i8]*, [50 x i8]** %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 %9
%11 = load i32, i32* %6
%12 = add nsw i32 %11, 3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [50 x i8], [50 x i8]* %10, i64 0, i64 %13
store i8 48, i8* %14
%15 = load [50 x i8]*, [50 x i8]** %4
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [50 x i8], [50 x i8]* %15, i64 %17
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [50 x i8], [50 x i8]* %18, i64 0, i64 %21
store i8 48, i8* %22
%23 = load [50 x i8]*, [50 x i8]** %4
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [50 x i8], [50 x i8]* %23, i64 %26
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 4
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [50 x i8], [50 x i8]* %27, i64 0, i64 %30
store i8 94, i8* %31
ret void
}

LLVM IR (-O2):
define void @drawCooker([50 x i8]* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = add nsw i32 %2, 3
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %0, i64 %4, i64 %6
store i8 48, i8* %7
%8 = add nsw i32 %2, 4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [50 x i8], [50 x i8]* %0, i64 %4, i64 %9
store i8 48, i8* %10
%11 = add nsw i32 %1, 1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [50 x i8], [50 x i8]* %0, i64 %12, i64 %9
store i8 94, i8* %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void runtime_exit(void) { exit(0); }


x86 assembly (clang, -O0):
<runtime_exit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<runtime_exit>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @runtime_exit() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @runtime_exit() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
void enable_key_interrupts(int keys) {
  (*(unsigned short *)0x4000132) |= (1 << 14) | keys;
}


x86 assembly (clang, -O0):
<enable_key_interrupts>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
or     $0x4000,%ecx
mov    $0x4000132,%eax
movzwl (%rax),%eax
or     %ecx,%eax
mov    %ax,%cx
mov    $0x4000132,%eax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_key_interrupts>:
or     0x4000132,%di
04
or     $0x4000,%edi
mov    %di,0x4000132
04
ret

LLVM IR (-O0):
define void @enable_key_interrupts(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = or i32 16384, %3
%5 = load i16, i16* inttoptr (i64 67109170 to i16*)
%6 = zext i16 %5 to i32
%7 = or i32 %6, %4
%8 = trunc i32 %7 to i16
store i16 %8, i16* inttoptr (i64 67109170 to i16*)
ret void
}

LLVM IR (-O2):
define void @enable_key_interrupts(i32 %0) {
%2 = load i16, i16* inttoptr (i64 67109170 to i16*)
%3 = trunc i32 %0 to i16
%4 = or i16 %2, %3
%5 = or i16 %4, 16384
store i16 %5, i16* inttoptr (i64 67109170 to i16*)
ret void
}
void v2s(vec) short vec[2];
{
  float v[2];
  v[0] = vec[0];
  v[1] = vec[1];
  vcall(v, 2);
}


x86 assembly (clang, -O0):
<v2s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movswl 0x2(%rax),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <vcall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v2s>:
push   %rax
movswl (%rdi),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,(%rsp)
movswl 0x2(%rdi),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x4(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <vcall@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @v2s(i16* %0) {
%2 = alloca i16*
%3 = alloca [2 x float]
store i16* %0, i16** %2
%4 = load i16*, i16** %2
%5 = getelementptr inbounds i16, i16* %4, i64 0
%6 = load i16, i16* %5
%7 = sitofp i16 %6 to float
%8 = getelementptr inbounds [2 x float], [2 x float]* %3, i64 0, i64 0
store float %7, float* %8
%9 = load i16*, i16** %2
%10 = getelementptr inbounds i16, i16* %9, i64 1
%11 = load i16, i16* %10
%12 = sitofp i16 %11 to float
%13 = getelementptr inbounds [2 x float], [2 x float]* %3, i64 0, i64 1
store float %12, float* %13
%14 = getelementptr inbounds [2 x float], [2 x float]* %3, i64 0, i64 0
%15 = call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %14, i32 2)
ret void
}

LLVM IR (-O2):
define void @v2s(i16* nocapture %0) {
%2 = alloca [2 x float]
%3 = bitcast [2 x float]* %2 to i8*
%4 = load i16, i16* %0
%5 = sitofp i16 %4 to float
%6 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 0
store float %5, float* %6
%7 = getelementptr inbounds i16, i16* %0, i64 1
%8 = load i16, i16* %7
%9 = sitofp i16 %8 to float
%10 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 1
store float %9, float* %10
%11 = call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %6, i32 2)
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int charCmpFunction(const void *pointer1, const void *pointer2) {
  return strcmp((char *)pointer1, (char *)pointer2);
}


x86 assembly (clang, -O0):
<charCmpFunction>:
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 <strcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<charCmpFunction>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @charCmpFunction(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
int clear_lsb(int number, int i) { return number & ~((1 << i) - 1); }


x86 assembly (clang, -O0):
<clear_lsb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_lsb>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @clear_lsb(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 = shl i32 1, %6
%8 = sub nsw i32 %7, 1
%9 = xor i32 %8, -1
%10 = and i32 %5, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @clear_lsb(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %1
%4 = and i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ NRF24_CE_Disable();
int /*<<< orphan*/ NRF24_CE_Enable();
int /*<<< orphan*/ NRF24_Instruction(int);
int /*<<< orphan*/ NRF24_Reg_SetBit(int, int);
void NRF24_ReceiveStart(void) {
  NRF24_CE_Disable();
  NRF24_Instruction(0xE2);
  NRF24_Reg_SetBit(0x00, 0x01);
  NRF24_CE_Enable();
}


x86 assembly (clang, -O0):
<NRF24_ReceiveStart>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <NRF24_CE_Disable@plt>
mov    $0xe2,%edi
call   1030 <NRF24_Instruction@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1060 <NRF24_Reg_SetBit@plt>
mov    $0x0,%al
call   1040 <NRF24_CE_Enable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<NRF24_ReceiveStart>:
push   %rax
xor    %eax,%eax
call   1050 <NRF24_CE_Disable@plt>
mov    $0xe2,%edi
call   1030 <NRF24_Instruction@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1060 <NRF24_Reg_SetBit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <NRF24_CE_Enable@plt>

LLVM IR (-O0):
define void @NRF24_ReceiveStart() {
%1 = call i32 (...) @NRF24_CE_Disable()
%2 = call i32 @NRF24_Instruction(i32 226)
%3 = call i32 @NRF24_Reg_SetBit(i32 0, i32 1)
%4 = call i32 (...) @NRF24_CE_Enable()
ret void
}

LLVM IR (-O2):
define void @NRF24_ReceiveStart() {
%1 = tail call i32 (...) @NRF24_CE_Disable()
%2 = tail call i32 @NRF24_Instruction(i32 226)
%3 = tail call i32 @NRF24_Reg_SetBit(i32 0, i32 1)
%4 = tail call i32 (...) @NRF24_CE_Enable()
ret void
}
/* Variables and functions */
#define SIGHUP 130
#define SIGINT 129
#define SIGTERM 128
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ kill_daemon();
void signal_handler(int signal) {
  switch (signal) {
  case SIGHUP:
    break;
  case SIGINT:
    break;
  case SIGTERM:
    kill_daemon();
    exit(0);
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x80,%eax
je     1171 <signal_handler+0x51>
jmp    1141 <signal_handler+0x21>
mov    -0x8(%rbp),%eax
sub    $0x81,%eax
je     116c <signal_handler+0x4c>
jmp    1154 <signal_handler+0x34>
mov    -0x8(%rbp),%eax
sub    $0x82,%eax
jne    117f <signal_handler+0x5f>
jmp    1167 <signal_handler+0x47>
jmp    1184 <signal_handler+0x64>
jmp    1184 <signal_handler+0x64>
mov    $0x0,%al
call   1030 <kill_daemon@plt>
xor    %edi,%edi
call   1040 <exit@plt>
jmp    1184 <signal_handler+0x64>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_handler>:
cmp    $0x80,%edi
je     1129 <signal_handler+0x9>
ret
push   %rax
xor    %eax,%eax
call   1030 <kill_daemon@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %9 [
i32 130, label %4
i32 129, label %5
i32 128, label %6
]
4: ; preds = %1
br label %10
5: ; preds = %1
br label %10
6: ; preds = %1
%7 = call i32 (...) @kill_daemon()
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %1
br label %10
10: ; preds = %9, %5, %4
ret void
}

LLVM IR (-O2):
define void @signal_handler(i32 %0) {
%2 = icmp eq i32 %0, 128
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 (...) @kill_daemon()
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %1
ret void
}