xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xc7() {
  Assert_real((islower(199) == 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",
              1000, ("islower should be 0 for 0xc7"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xc7>:
push   %rax
mov    $0xc7,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3e8,%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 0xc7\00"
define void @t_islower_0xc7() {
%1 = call i64 @islower(i32 199)
%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 1000, 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 0xc7\00"
define void @t_islower_0xc7() {
%1 = tail call i64 @islower(i32 199)
%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 1000, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void encodeDmaNop(void) {}


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

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

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

LLVM IR (-O2):
define void @encodeDmaNop() {
ret void
}
int ehAntiSimetrica() { return 1; }


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

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

LLVM IR (-O0):
define i32 @ehAntiSimetrica() {
ret i32 1
}

LLVM IR (-O2):
define i32 @ehAntiSimetrica() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
void *calloc(size_t, size_t);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(int /*<<< orphan*/, int /*<<< orphan*/, char *,
                         unsigned long, unsigned long);
void *xcalloc(size_t nmemb, size_t size) {
  void *r = calloc(nmemb, size);
  if (!r)
    error(EXIT_FAILURE, errno, "calloc: allocating %lu*%lu bytes",
          (unsigned long)nmemb, (unsigned long)size);
  return r;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1172 <xcalloc+0x52>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    0x2e84(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xe93(%rip),%rdx
call   1040 <error@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115c <xcalloc+0x3c>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
lea    0xeaf(%rip),%rdx
mov    %r15,%rcx
mov    %r14,%r8
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [33 x i8] c"calloc: allocating %lu*%lu bytes\00"
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %17, label %11
11: ; preds = %2
%12 = load i32, i32* @EXIT_FAILURE
%13 = load i32, i32* @errno
%14 = load i64, i64* %3
%15 = load i64, i64* %4
%16 = call i32 @error(i32 %12, i32 %13, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 %14, i64 %15)
br label %17
17: ; preds = %11, %2
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [33 x i8] c"calloc: allocating %lu*%lu bytes\00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @EXIT_FAILURE
%7 = load i32, i32* @errno
%8 = tail call i32 @error(i32 %6, i32 %7, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1)
br label %9
9: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int main() {
  int i = 0;
  for (i = 0; i < 10; ++i) {
    printf("#### %d.\n", i);
    if (5 == i) {
      sleep(1);
      --i;
      continue;
    }
    sleep(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1194 <main+0x74>
mov    -0x8(%rbp),%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%eax
cmp    -0x8(%rbp),%eax
jne    117c <main+0x5c>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1186 <main+0x66>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
mov    $0x4,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
cmp    $0x5,%ebx
cmove  %ebp,%ebx
lea    0x1(%rbx),%eax
cmp    $0x9,%ebx
mov    %eax,%ebx
jl     1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"#### %d.\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = icmp eq i32 %2, 5
%5 = tail call i32 @sleep(i32 1)
%6 = select i1 %4, i32 4, i32 %2
%7 = add nsw i32 %6, 1
%8 = icmp slt i32 %6, 9
br i1 %8, label %1, label %9
9: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void init_device(void) { printf("Performing low level device init...\n"); }


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

x86 assembly (clang, -O2):
<init_device>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Performing low level device init...\0A\00"
define void @init_device() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [36 x i8] c"Performing low level device init...\00"
define void @init_device() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;
typedef int dev_t;

/* Variables and functions */
int syscall(int, char const *, int /*<<< orphan*/, int);
int mknod(const char *path, mode_t mode, dev_t dev) {
  return syscall(14, path, mode, dev & 0xffff);
}


x86 assembly (clang, -O0):
<mknod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
and    $0xffff,%ecx
mov    $0xe,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mknod>:
mov    %esi,%eax
mov    %rdi,%rsi
movzwl %dx,%ecx
mov    $0xe,%edi
mov    %eax,%edx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @mknod(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = and i32 %9, 65535
%11 = call i32 @syscall(i32 14, i8* %7, i32 %8, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @mknod(i8* %0, i32 %1, i32 %2) {
%4 = and i32 %2, 65535
%5 = tail call i32 @syscall(i32 14, i8* %0, i32 %1, i32 %4)
ret i32 %5
}
/* Variables and functions */
int KadaneAlgorithm(int *, int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int A[] = {-2, 1, -3, 4, -1, 2, 1, -5, 4};
  printf("Maximum subarray sum from { -2, 1, -3, 4, -1, 2, 1, -5, 4 } is %d.\n",
         KadaneAlgorithm(A, 9));
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x24,%edx
call   1060 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1030 <KadaneAlgorithm@plt>
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeaf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
call   1030 <KadaneAlgorithm@plt>
lea    0xebb(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.A = [9 x i32] [i32 -2, i32 1, i32 -3, i32 4, i32 -1, i32 2, i32 1, i32 -5, i32 4]
@.str = [68 x i8] c"Maximum subarray sum from { -2, 1, -3, 4, -1, 2, 1, -5, 4 } is %d.\0A\00"
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @KadaneAlgorithm(i32* %3, i32 9)
%5 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.A = [9 x i32] [i32 -2, i32 1, i32 -3, i32 4, i32 -1, i32 2, i32 1, i32 -5, i32 4]
@.str = [68 x i8] c"Maximum subarray sum from { -2, 1, -3, 4, -1, 2, 1, -5, 4 } is %d.\0A\00"
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @KadaneAlgorithm(i32* %3, i32 9)
%5 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
char EOF;
char getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  char c;
  (c = getchar()) != EOF ? printf("1\n") : printf("0\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
mov    0x2ea5(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     115f <main+0x3f>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
jmp    116b <main+0x4b>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rcx
cmp    (%rcx),%al
lea    0xec8(%rip),%rax
lea    0xec3(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EOF = global i8 0
@str = [2 x i8] c"0\00"
@str.2 = [2 x i8] c"1\00"
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
%4 = select i1 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str.2, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret i32 0
}
/* Variables and functions */
scalar_t__ islower(char);
char toupper(char);
void strupper(char *s) {
  while (*s) {
    {
      if (islower(*s))
        *s = toupper(*s);
      s++;
    }
  }
}


x86 assembly (clang, -O0):
<strupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1174 <strupper+0x54>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     1163 <strupper+0x43>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <strupper+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupper>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1155 <strupper+0x35>
mov    %rdi,%rbx
jmp    113c <strupper+0x1c>
nopl   0x0(%rax)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1155 <strupper+0x35>
movsbl %al,%edi
call   1030 <islower@plt>
test   %rax,%rax
je     1130 <strupper+0x10>
movsbl (%rbx),%edi
call   1040 <toupper@plt>
mov    %al,(%rbx)
jmp    1130 <strupper+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @strupper(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %12
%5 = phi i8 [ %14, %12 ], [ %2, %1 ]
%6 = phi i8* [ %13, %12 ], [ %0, %1 ]
%7 = tail call i64 @islower(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = load i8, i8* %6
%11 = tail call signext i8 @toupper(i8 signext %10)
store i8 %11, i8* %6
br label %12
12: ; preds = %9, %4
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %12, %1
ret void
}
long long ft_llongmax(long long n1, long long n2) {
  return ((n1 > n2) ? n1 : n2);
}


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

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

LLVM IR (-O0):
define i64 @ft_llongmax(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 sgt 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 @ft_llongmax(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ __ESBMC_assume(int);
int /*<<< orphan*/ f(unsigned int);
int main() {
  unsigned int x;
  __ESBMC_assume(x <= 10);
  f(x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0xa,-0x4(%rbp)
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__ESBMC_assume@plt>
mov    -0x4(%rbp),%edi
call   1040 <f@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <__ESBMC_assume@plt>
call   1040 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = icmp ule i32 %2, 10
%4 = zext i1 %3 to i32
%5 = call i32 @__ESBMC_assume(i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @f(i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__ESBMC_assume(i32 1)
%2 = tail call i32 @f(i32 undef)
ret i32 0
}
/* Type definitions */
struct _Locale_name_hint {
  int dummy;
};
struct _Locale_collate {
  int dummy;
};

/* Variables and functions */
struct _Locale_name_hint *
_Locale_get_collate_hint(struct _Locale_collate *collate) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct._Locale_name_hint = type { i32 }
%struct._Locale_collate = type { i32 }
define %struct._Locale_name_hint* @_Locale_get_collate_hint(%struct._Locale_collate* %0) {
%2 = alloca %struct._Locale_collate*
store %struct._Locale_collate* %0, %struct._Locale_collate** %2
ret %struct._Locale_name_hint* null
}

LLVM IR (-O2):
%struct._Locale_name_hint = type { i32 }
%struct._Locale_collate = type { i32 }
define noalias %struct._Locale_name_hint* @_Locale_get_collate_hint(%struct._Locale_collate* nocapture readnone %0) {
ret %struct._Locale_name_hint* null
}
/* Type definitions */
struct vec2 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec2_reflect(float *, float *, float *);
__attribute__((always_)) struct vec2 *
psvec2_reflect(struct vec2 *result, struct vec2 *a, struct vec2 *b) {
  vec2_reflect((float *)result, (float *)a, (float *)b);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec2_reflect>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec2_reflect@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec2 = type { i32 }
define %struct.vec2* @psvec2_reflect(%struct.vec2* %0, %struct.vec2* %1, %struct.vec2* %2) {
%4 = alloca %struct.vec2*
%5 = alloca %struct.vec2*
%6 = alloca %struct.vec2*
store %struct.vec2* %0, %struct.vec2** %4
store %struct.vec2* %1, %struct.vec2** %5
store %struct.vec2* %2, %struct.vec2** %6
%7 = load %struct.vec2*, %struct.vec2** %4
%8 = bitcast %struct.vec2* %7 to float*
%9 = load %struct.vec2*, %struct.vec2** %5
%10 = bitcast %struct.vec2* %9 to float*
%11 = load %struct.vec2*, %struct.vec2** %6
%12 = bitcast %struct.vec2* %11 to float*
%13 = call i32 @vec2_reflect(float* %8, float* %10, float* %12)
%14 = load %struct.vec2*, %struct.vec2** %4
ret %struct.vec2* %14
}

LLVM IR (-O2):
%struct.vec2 = type { i32 }
define %struct.vec2* @psvec2_reflect(%struct.vec2* returned %0, %struct.vec2* %1, %struct.vec2* %2) {
%4 = bitcast %struct.vec2* %0 to float*
%5 = bitcast %struct.vec2* %1 to float*
%6 = bitcast %struct.vec2* %2 to float*
%7 = tail call i32 @vec2_reflect(float* %4, float* %5, float* %6)
ret %struct.vec2* %0
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void jmp_reg64(unsigned int reg64) {
  put8(0xFF);
  put8(0xE0 + reg64);
}


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

x86 assembly (clang, -O2):
<jmp_reg64>:
push   %rbx
mov    %edi,%ebx
mov    $0xff,%edi
call   1030 <put8@plt>
add    $0xe0,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @jmp_reg64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 255)
%4 = load i32, i32* %2
%5 = add i32 224, %4
%6 = call i32 @put8(i32 %5)
ret void
}

LLVM IR (-O2):
define void @jmp_reg64(i32 %0) {
%2 = tail call i32 @put8(i32 255)
%3 = add i32 %0, 224
%4 = tail call i32 @put8(i32 %3)
ret void
}
void *providor_main(void *table_clnt) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @providor_main(i8* nocapture readnone %0) {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void testExit() { exit(10); }


x86 assembly (clang, -O0):
<testExit>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<testExit>:
push   %rax
mov    $0xa,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @testExit() {
%1 = tail call i32 @exit(i32 10)
unreachable
}
int test_imm_73uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x73 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_73uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 115
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ UpdateMallocStateFree(int);
int /*<<< orphan*/ free(void *);
void Free(void *ptr) {
  if (ptr == NULL) {
    return;
  }
  void *real_ptr = (char *)ptr - ((int)sizeof(int));
  int old_size = *((int *)real_ptr);
  UpdateMallocStateFree(old_size + ((int)sizeof(int)));
  free(real_ptr);
}


x86 assembly (clang, -O0):
<Free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <Free+0x1c>
jmp    1165 <Free+0x45>
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x4,%edi
call   1040 <UpdateMallocStateFree@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Free>:
test   %rdi,%rdi
je     1141 <Free+0x21>
push   %rbx
mov    %rdi,%rbx
mov    -0x4(%rdi),%edi
add    $0xfffffffffffffffc,%rbx
add    $0x4,%edi
call   1040 <UpdateMallocStateFree@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @Free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 -4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 4
%8 = tail call i32 @UpdateMallocStateFree(i32 %7)
%9 = tail call i32 @free(i8* %4)
br label %10
10: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int send(int, void *, int, int /*<<< orphan*/);
int sendTCP(int socket, char *buffer, int length) {
  int n;
  n = send(socket, (void *)buffer, length, 0);
  if (n < length) {
    printf("Errore durante il comando send()\n");
    exit(1);
  } else
    return n;
}


x86 assembly (clang, -O0):
<sendTCP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <send@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1178 <sendTCP+0x48>
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendTCP>:
push   %rbx
mov    %edx,%ebx
xor    %ecx,%ecx
call   1040 <send@plt>
cmp    %ebx,%eax
jl     1140 <sendTCP+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Errore durante il comando send()\0A\00"
define i32 @sendTCP(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @send(i32 %8, i8* %9, i32 %10, i32 0)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = load i32, i32* %6
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %18
15: ; preds = %3
%16 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %3
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
@str = [33 x i8] c"Errore durante il comando send()\00"
define i32 @sendTCP(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @send(i32 %0, i8* %1, i32 %2, i32 0)
%5 = icmp slt i32 %4, %2
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
size_t core_fsize(FILE *f) {
  long p = ftell(f);
  fseek(f, 0, SEEK_END);
  long rv = ftell(f);
  fseek(f, p, SEEK_SET);
  return rv;
}


x86 assembly (clang, -O0):
<core_fsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2e6d(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<core_fsize>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <ftell@plt>
mov    %rax,%r14
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %rax,%r15
mov    0x2e83(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <fseek@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @core_fsize(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i64
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i64 @ftell(i32* %5)
store i64 %6, i64* %3
%7 = load i32*, i32** %2
%8 = load i32, i32* @SEEK_END
%9 = call i32 @fseek(i32* %7, i64 0, i32 %8)
%10 = load i32*, i32** %2
%11 = call i64 @ftell(i32* %10)
store i64 %11, i64* %4
%12 = load i32*, i32** %2
%13 = load i64, i64* %3
%14 = load i32, i32* @SEEK_SET
%15 = call i32 @fseek(i32* %12, i64 %13, i32 %14)
%16 = load i64, i64* %4
ret i64 %16
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @core_fsize(i32* nocapture %0) {
%2 = tail call i64 @ftell(i32* %0)
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %0, i64 0, i32 %3)
%5 = tail call i64 @ftell(i32* %0)
%6 = load i32, i32* @SEEK_SET
%7 = tail call i32 @fseek(i32* %0, i64 %2, i32 %6)
ret i64 %5
}
int getIndexOfItem(int *values, int numVals, int itemToFind) {
  int i;
  for (i = 0; i < numVals; i++) {
    if (values[i] == itemToFind) {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<getIndexOfItem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1153 <getIndexOfItem+0x53>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1140 <getIndexOfItem+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <getIndexOfItem+0x5a>
jmp    1145 <getIndexOfItem+0x45>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <getIndexOfItem+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIndexOfItem>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <getIndexOfItem+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rdi,%rcx,4)
je     111f <getIndexOfItem+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <getIndexOfItem+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @getIndexOfItem(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
unsigned Invert(unsigned num, int p, int n) {
  unsigned mask;
  if (n == 32)
    mask = ~0;
  else
    mask = (1 << n) - 1;
  mask <<= p - n + 1;
  unsigned num_masked = num | mask;
  unsigned part_of_num = num & mask;
  unsigned inverted_part_of_num = ~part_of_num;
  unsigned result = num_masked & inverted_part_of_num;
  return result;
}


x86 assembly (clang, -O0):
<Invert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jne    1123 <Invert+0x23>
movl   $0xffffffff,-0x10(%rbp)
jmp    1133 <Invert+0x33>
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Invert>:
mov    %edx,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
mov    $0xffffffff,%edx
cmp    $0x20,%ecx
not    %eax
cmove  %edx,%eax
sub    %ecx,%esi
lea    0x1(%rsi),%ecx
shl    %cl,%eax
xor    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @Invert(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 32
%5 = shl nsw i32 -1, %2
%6 = xor i32 %5, -1
%7 = select i1 %4, i32 -1, i32 %6
%8 = add i32 %1, 1
%9 = sub i32 %8, %2
%10 = shl i32 %7, %9
%11 = xor i32 %10, %0
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int serial_data_avail();
extern int gps_avail(void) {
  int i = serial_data_avail();
  printf("the number of bytes of data avalable is %d\n", i);
  return i;
}


x86 assembly (clang, -O0):
<gps_avail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <serial_data_avail@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gps_avail>:
push   %rbx
xor    %eax,%eax
call   1040 <serial_data_avail@plt>
mov    %eax,%ebx
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"the number of bytes of data avalable is %d\0A\00"
define i32 @gps_avail() {
%1 = alloca i32
%2 = call i32 (...) @serial_data_avail()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [44 x i8] c"the number of bytes of data avalable is %d\0A\00"
define i32 @gps_avail() {
%1 = tail call i32 (...) @serial_data_avail()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int libc_perror(char *s) { perror(s); }


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

x86 assembly (clang, -O2):
<libc_perror>:
jmp    1030 <perror@plt>

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

LLVM IR (-O2):
define i32 @libc_perror(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ termina();
void ctrlHandler() {
  printf("Bye bye!\n");
  termina();
}


x86 assembly (clang, -O0):
<ctrlHandler>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <termina@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctrlHandler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <termina@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Bye bye!\0A\00"
define void @ctrlHandler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @termina()
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"Bye bye!\00"
define void @ctrlHandler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @termina()
ret void
}
/* Type definitions */
struct cell {
  int dummy;
};

/* Variables and functions */
int cell_get(struct cell *);
int /*<<< orphan*/ cell_set(struct cell *, int);
void cell_swap(struct cell *c1, struct cell *c2) {
  int tmp1 = cell_get(c1);
  int tmp2 = cell_get(c2);
  cell_set(c1, tmp2);
  cell_set(c2, tmp1);
}


x86 assembly (clang, -O0):
<cell_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <cell_get@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <cell_get@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1040 <cell_set@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <cell_set@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cell_swap>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <cell_get@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <cell_get@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <cell_set@plt>
mov    %r14,%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <cell_set@plt>

LLVM IR (-O0):
%struct.cell = type { i32 }
define void @cell_swap(%struct.cell* %0, %struct.cell* %1) {
%3 = alloca %struct.cell*
%4 = alloca %struct.cell*
%5 = alloca i32
%6 = alloca i32
store %struct.cell* %0, %struct.cell** %3
store %struct.cell* %1, %struct.cell** %4
%7 = load %struct.cell*, %struct.cell** %3
%8 = call i32 @cell_get(%struct.cell* %7)
store i32 %8, i32* %5
%9 = load %struct.cell*, %struct.cell** %4
%10 = call i32 @cell_get(%struct.cell* %9)
store i32 %10, i32* %6
%11 = load %struct.cell*, %struct.cell** %3
%12 = load i32, i32* %6
%13 = call i32 @cell_set(%struct.cell* %11, i32 %12)
%14 = load %struct.cell*, %struct.cell** %4
%15 = load i32, i32* %5
%16 = call i32 @cell_set(%struct.cell* %14, i32 %15)
ret void
}

LLVM IR (-O2):
%struct.cell = type { i32 }
define void @cell_swap(%struct.cell* %0, %struct.cell* %1) {
%3 = tail call i32 @cell_get(%struct.cell* %0)
%4 = tail call i32 @cell_get(%struct.cell* %1)
%5 = tail call i32 @cell_set(%struct.cell* %0, i32 %4)
%6 = tail call i32 @cell_set(%struct.cell* %1, i32 %3)
ret void
}
/* Variables and functions */
float floor(float const);
float pow(int, int);
float xround(const float n, int precision) {
  return floor(n * pow(10, precision) + 0.5) / pow(10, precision);
}


x86 assembly (clang, -O0):
<xround>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    $0xa,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea1(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <floor@plt>
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    $0xa,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xround>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movss  %xmm0,0xc(%rsp)
mov    $0xa,%edi
mov    %ebx,%esi
call   1040 <pow@plt>
mulss  0xc(%rsp),%xmm0
addss  0xeb9(%rip),%xmm0
call   1030 <floorf@plt>
movss  %xmm0,0xc(%rsp)
mov    $0xa,%edi
mov    %ebx,%esi
call   1040 <pow@plt>
movss  0xc(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @xround(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load float, float* %3
%6 = load i32, i32* %4
%7 = call float @pow(i32 10, i32 %6)
%8 = fmul float %5, %7
%9 = fpext float %8 to double
%10 = fadd double %9, 5.000000e-01
%11 = fptrunc double %10 to float
%12 = call float @floor(float %11)
%13 = load i32, i32* %4
%14 = call float @pow(i32 10, i32 %13)
%15 = fdiv float %12, %14
ret float %15
}

LLVM IR (-O2):
define float @xround(float %0, i32 %1) {
%3 = tail call float @pow(i32 10, i32 %1)
%4 = fmul float %3, %0
%5 = fadd float %4, 5.000000e-01
%6 = tail call float @llvm.floor.f32(float %5)
%7 = tail call float @pow(i32 10, i32 %1)
%8 = fdiv float %6, %7
ret float %8
}
int comp_zlib_init() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @comp_zlib_init() {
ret i32 0
}
void reserve_kdump_trampoline(void) { ; }


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

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

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

LLVM IR (-O2):
define void @reserve_kdump_trampoline() {
ret void
}
int main(int ac, char *argv[ac]) {
  __label__ c;
  _Bool d;
  __complex e;
  _Complex f;
  typeof(f) g;
  __typeof(f) h;
  __typeof__(f) i;
  struct tutu {
    int a;
    int b;
    int c;
  } muf;
  int a;
  int b;
  a = 12 + 4 * 42 + (int)calc(123, 348);
c:
  if (a && b) {
    printf("ok");
  } else {
    printf("ko");
  }
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x7b,%edi
mov    $0x15c,%esi
mov    $0x0,%al
call   1040 <calc@plt>
add    $0xb4,%eax
mov    %eax,-0x7c(%rbp)
cmpl   $0x0,-0x7c(%rbp)
je     1179 <main+0x59>
cmpl   $0x0,-0x80(%rbp)
je     1179 <main+0x59>
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1187 <main+0x67>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x7c(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x7b,%edi
mov    $0x15c,%esi
xor    %eax,%eax
call   1040 <calc@plt>
mov    %eax,%ebx
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xb4,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tutu = type { i32, i32, i32 }
@.str = [3 x i8] c"ok\00"
@.str.1 = [3 x i8] c"ko\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca { double, double }
%8 = alloca { double, double }
%9 = alloca { double, double }
%10 = alloca { double, double }
%11 = alloca { double, double }
%12 = alloca %struct.tutu
%13 = alloca i32
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* %4
%16 = zext i32 %15 to i64
%17 = call i32 (i32, i32, ...) bitcast (i32 (...)* @calc to i32 (i32, i32, ...)*)(i32 123, i32 348)
%18 = add nsw i32 180, %17
store i32 %18, i32* %13
br label %19
19: ; preds = %2
%20 = load i32, i32* %13
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %27
22: ; preds = %19
%23 = load i32, i32* %14
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %29
27: ; preds = %22, %19
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %29
29: ; preds = %27, %25
%30 = load i32, i32* %13
ret i32 %30
}

LLVM IR (-O2):
%struct.tutu = type { i32, i32, i32 }
@.str.1 = [3 x i8] c"ko\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @calc to i32 (i32, i32, ...)*)(i32 123, i32 348)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = add nsw i32 %3, 180
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ displaybpp();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
void basDisplayBpp() { pushNumber(displaybpp()); }


x86 assembly (clang, -O0):
<basDisplayBpp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <displaybpp@plt>
mov    %eax,%edi
call   1040 <pushNumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<basDisplayBpp>:
push   %rax
xor    %eax,%eax
call   1030 <displaybpp@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basDisplayBpp() {
%1 = call i32 (...) @displaybpp()
%2 = call i32 @pushNumber(i32 %1)
ret void
}

LLVM IR (-O2):
define void @basDisplayBpp() {
%1 = tail call i32 (...) @displaybpp()
%2 = tail call i32 @pushNumber(i32 %1)
ret void
}