xunge/DecIR huggingface dataset:
/* Variables and functions */
int asprintf(char **, char *, char const *, int);
char *make_version_name(const char *file, int version) {
  char *backup_name;
  if (asprintf(&backup_name, "%s.~%d~", file, version) == -1)
    return NULL;
  return backup_name;
}


x86 assembly (clang, -O0):
<make_version_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    -0x20(%rbp),%rdi
lea    0xecf(%rip),%rsi
call   1030 <asprintf@plt>
cmp    $0xffffffff,%eax
jne    114c <make_version_name+0x3c>
movq   $0x0,-0x8(%rbp)
jmp    1154 <make_version_name+0x44>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_version_name>:
push   %rax
mov    %esi,%ecx
mov    %rdi,%rdx
lea    0xee3(%rip),%rsi
mov    %rsp,%rdi
call   1030 <asprintf@plt>
cmp    $0xffffffff,%eax
je     1130 <make_version_name+0x20>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%s.~%d~\00"
define i8* @make_version_name(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 i32 @asprintf(i8** %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %12
11: ; preds = %2
store i8* null, i8** %3
br label %14
12: ; preds = %2
%13 = load i8*, i8** %6
store i8* %13, i8** %3
br label %14
14: ; preds = %12, %11
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s.~%d~\00"
define i8* @make_version_name(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%6 = icmp eq i32 %5, -1
%7 = load i8*, i8** %3
%8 = select i1 %6, i8* null, i8* %7
ret i8* %8
}
int test03(unsigned int a, unsigned int b) { return b << (a & 31); }


x86 assembly (clang, -O0):
<test03>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
shl    %cl,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test03(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = and i32 %6, 31
%8 = shl i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @test03(i32 %0, i32 %1) {
%3 = and i32 %0, 31
%4 = shl i32 %1, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x3e() {
  Assert_real((iscntrl(62) == 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_iscntrl.c",
              315, ("iscntrl should be 0 for >"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x3e>:
push   %rax
mov    $0x3e,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x13b,%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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for >\00"
define void @t_iscntrl_0x3e() {
%1 = call i64 @iscntrl(i32 62)
%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 315, i8* getelementptr inbounds ([26 x i8], [26 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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for >\00"
define void @t_iscntrl_0x3e() {
%1 = tail call i64 @iscntrl(i32 62)
%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 315, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct item {
  int dummy;
};

/* Variables and functions */
int Hash_index(char *);
int /*<<< orphan*/ PrintTable(struct item *, int);
struct item *initialize(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int index, tableSize = 10;
  struct item *HashTable = initialize(tableSize);
  index = Hash_index("Dave");
  printf("Your index is: %d\n", index);
  PrintTable(HashTable, tableSize);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <initialize@plt>
mov    %rax,-0x20(%rbp)
lea    0xe90(%rip),%rdi
call   1050 <Hash_index@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1060 <PrintTable@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1040 <initialize@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rdi
call   1050 <Hash_index@plt>
lea    0xea4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1060 <PrintTable@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.item = type { i32 }
@.str = [5 x i8] c"Dave\00"
@.str.1 = [19 x i8] c"Your index is: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.item*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %7
%9 = load i32, i32* %7
%10 = call %struct.item* @initialize(i32 %9)
store %struct.item* %10, %struct.item** %8
%11 = call i32 @Hash_index(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load %struct.item*, %struct.item** %8
%15 = load i32, i32* %7
%16 = call i32 @PrintTable(%struct.item* %14, i32 %15)
ret i32 0
}

LLVM IR (-O2):
%struct.item = type { i32 }
@.str = [5 x i8] c"Dave\00"
@.str.1 = [19 x i8] c"Your index is: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call %struct.item* @initialize(i32 10)
%4 = tail call i32 @Hash_index(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = tail call i32 @PrintTable(%struct.item* %3, i32 10)
ret i32 0
}
indirect(typeobj) char typeobj;
{
  ol("mov.l\t%d0,%a0");
  if (typeobj == (1 << 2))
    ol("mov.b\t(%a0),%d0");
  else
    ol("mov.l\t(%a0),%d0");
}


x86 assembly (clang, -O0):
<indirect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <ol@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x4,%eax
jne    114c <indirect+0x3c>
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <ol@plt>
jmp    115a <indirect+0x4a>
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indirect>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
xor    %eax,%eax
call   1030 <ol@plt>
cmp    $0x4,%bl
lea    0xee3(%rip),%rax
lea    0xeec(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <ol@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"mov.l\09%d0,%a0\00"
@.str.1 = [16 x i8] c"mov.b\09(%a0),%d0\00"
@.str.2 = [16 x i8] c"mov.l\09(%a0),%d0\00"
define i32 @indirect(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 4
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %13
11: ; preds = %1
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [14 x i8] c"mov.l\09%d0,%a0\00"
@.str.1 = [16 x i8] c"mov.b\09(%a0),%d0\00"
@.str.2 = [16 x i8] c"mov.l\09(%a0),%d0\00"
define i32 @indirect(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = and i32 %0, 255
%4 = icmp eq i32 %3, 4
%5 = select i1 %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0)
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* %5)
ret i32 undef
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int *malloc(int);
int64_t *arr_new(unsigned int *len) {
  int64_t *arr;
  arr = malloc(sizeof(int64_t));
  arr[0] = -1;
  *len = 0;
  return arr;
}


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

x86 assembly (clang, -O2):
<arr_new>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
movl   $0xffffffff,(%rax)
movl   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define i32* @arr_new(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = call i32* @malloc(i32 4)
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 0
store i32 -1, i32* %6
%7 = load i32*, i32** %2
store i32 0, i32* %7
%8 = load i32*, i32** %3
ret i32* %8
}

LLVM IR (-O2):
define noalias i32* @arr_new(i32* nocapture writeonly %0) {
%2 = tail call i32* @malloc(i32 4)
store i32 -1, i32* %2
store i32 0, i32* %0
ret i32* %2
}
/* Type definitions */
typedef union wait {
  int dummy;
} wait;
struct rusage {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
scalar_t__ wait3(union wait *, int /*<<< orphan*/, struct rusage *);
void reap() {
  while (wait3((union wait *)NULL, WNOHANG, (struct rusage *)NULL) > 0)
    ;
}


x86 assembly (clang, -O0):
<reap>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <reap+0x9>
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rdi
call   1030 <wait3@plt>
cmp    $0x0,%rax
jle    113d <reap+0x2d>
jmp    1119 <reap+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reap>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%esi
xor    %edi,%edi
xor    %edx,%edx
call   1030 <wait3@plt>
test   %rax,%rax
jg     1120 <reap+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%union.wait = type { i32 }
%struct.rusage = type { i32 }
@WNOHANG = global i32 0
define void @reap() {
br label %1
1: ; preds = %5, %0
%2 = load i32, i32* @WNOHANG
%3 = call i64 @wait3(%union.wait* null, i32 %2, %struct.rusage* null)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
%union.wait = type { i32 }
%struct.rusage = type { i32 }
@WNOHANG = global i32 0
define void @reap() {
br label %1
1: ; preds = %1, %0
%2 = load i32, i32* @WNOHANG
%3 = tail call i64 @wait3(%union.wait* null, i32 %2, %struct.rusage* null)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t, size_t);
int /*<<< orphan*/ stderr;
void *xcalloc(size_t num, size_t len) {
  void *r = calloc(num, len);
  if (r)
    return r;
  fprintf(stderr, "Out of memory allocating %zu*%zu bytes!\n", num, len);
  exit(1);
}


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)
je     1166 <xcalloc+0x36>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe82(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<xcalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <calloc@plt>
test   %rax,%rax
je     114c <xcalloc+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"Out of memory allocating %zu*%zu bytes!\0A\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 %11, label %13
11: ; preds = %2
%12 = load i8*, i8** %5
ret i8* %12
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = load i64, i64* %3
%16 = load i64, i64* %4
%17 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i64 %15, i64 %16)
%18 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"Out of memory allocating %zu*%zu bytes!\0A\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 %6, label %5
5: ; preds = %2
ret i8* %3
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1)
%9 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t IntToFixed(int val) { return val << 16; }


x86 assembly (clang, -O0):
<IntToFixed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntToFixed>:
mov    %edi,%eax
shl    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @IntToFixed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 16
ret i32 %4
}

LLVM IR (-O2):
define i32 @IntToFixed(i32 %0) {
%2 = shl i32 %0, 16
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ __PHYSFS_setError(int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int fsync(int);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int __PHYSFS_platformFlush(void *opaque) {
  int fd = *((int *)opaque);
  if (fsync(fd) == -1) {
    __PHYSFS_setError(strerror(errno));
    return 0;
  };
  return (1);
}


x86 assembly (clang, -O0):
<__PHYSFS_platformFlush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <fsync@plt>
cmp    $0xffffffff,%eax
jne    1177 <__PHYSFS_platformFlush+0x47>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%edi
call   1030 <__PHYSFS_setError@plt>
movl   $0x0,-0x4(%rbp)
jmp    117e <__PHYSFS_platformFlush+0x4e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__PHYSFS_platformFlush>:
push   %rax
mov    (%rdi),%edi
call   1040 <fsync@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0xffffffff,%ecx
je     1146 <__PHYSFS_platformFlush+0x16>
pop    %rcx
ret
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%edi
call   1030 <__PHYSFS_setError@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @__PHYSFS_platformFlush(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 @fsync(i32 %8)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %15
11: ; preds = %1
%12 = load i32, i32* @errno
%13 = call i32 @strerror(i32 %12)
%14 = call i32 @__PHYSFS_setError(i32 %13)
store i32 0, i32* %2
br label %16
15: ; preds = %1
store i32 1, i32* %2
br label %16
16: ; preds = %15, %11
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @__PHYSFS_platformFlush(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @fsync(i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @errno
%8 = tail call i32 @strerror(i32 %7)
%9 = tail call i32 @__PHYSFS_setError(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ 0, %6 ], [ 1, %1 ]
ret i32 %11
}
int ___sl_get_nondet_int(void) {
  int i;
  return i;
}


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

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

LLVM IR (-O0):
define i32 @___sl_get_nondet_int() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @___sl_get_nondet_int() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ foo(int);
int main() {
  foo(-3);
  foo(-99);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xfffffffd,%edi
call   1030 <foo@plt>
mov    $0xffffff9d,%edi
call   1030 <foo@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xfffffffd,%edi
call   1030 <foo@plt>
mov    $0xffffff9d,%edi
call   1030 <foo@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 -3)
%3 = call i32 @foo(i32 -99)
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 -3)
%2 = tail call i32 @foo(i32 -99)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ gen_pop();
int /*<<< orphan*/ output_line(char *);
void gen_udiv(void) {
  gen_pop();
  output_line("__udiv");
}


x86 assembly (clang, -O0):
<gen_udiv>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xece(%rip),%rdi
call   1040 <output_line@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_udiv>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <output_line@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"__udiv\00"
define void @gen_udiv() {
%1 = call i32 (...) @gen_pop()
%2 = call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"__udiv\00"
define void @gen_udiv() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t hci_event_le_meta_get_subevent_code(const uint8_t *event) {
  return event[2];
}


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

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

LLVM IR (-O0):
define i32 @hci_event_le_meta_get_subevent_code(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @hci_event_le_meta_get_subevent_code(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
ret i32 %3
}
void fdmi_dtype_op_NON_float(void *a, void *b) {
  (*(float *)a = (*(float *)a));
}


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

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

LLVM IR (-O0):
define void @fdmi_dtype_op_NON_float(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 float*
%7 = load float, float* %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to float*
store float %7, float* %9
ret void
}

LLVM IR (-O2):
define void @fdmi_dtype_op_NON_float(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int f2u(float);
unsigned test_float_i2f(int x) {
  float f = (float)x;
  return f2u(f);
}


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

x86 assembly (clang, -O2):
<test_float_i2f>:
cvtsi2ss %edi,%xmm0
jmp    1030 <f2u@plt>

LLVM IR (-O0):
define i32 @test_float_i2f(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to float
store float %5, float* %3
%6 = load float, float* %3
%7 = call i32 @f2u(float %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_float_i2f(i32 %0) {
%2 = sitofp i32 %0 to float
%3 = tail call i32 @f2u(float %2)
ret i32 %3
}
void GPMCPrefetchSyncTypeSelect(unsigned int baseAddr, unsigned int syncType) {
  (*((volatile unsigned int *)(baseAddr + (0x1E0 + ((1 - 1) * (0x4)))))) &=
      ~(0x00000004u);
  (*((volatile unsigned int *)(baseAddr + (0x1E0 + ((1 - 1) * (0x4)))))) |=
      ((syncType << (0x00000002u)) & (0x00000004u));
}


x86 assembly (clang, -O0):
<GPMCPrefetchSyncTypeSelect>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1e0,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffffb,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
shl    $0x2,%edx
and    $0x4,%edx
mov    -0x4(%rbp),%eax
add    $0x1e0,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCPrefetchSyncTypeSelect>:
add    $0x1e0,%edi
andl   $0xfffffffb,(%rdi)
shl    $0x2,%esi
and    $0x4,%esi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @GPMCPrefetchSyncTypeSelect(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 = add i32 %5, 480
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -5
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = shl i32 %11, 2
%13 = and i32 %12, 4
%14 = load i32, i32* %3
%15 = add i32 %14, 480
%16 = zext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
%18 = load volatile i32, i32* %17
%19 = or i32 %18, %13
store volatile i32 %19, i32* %17
ret void
}

LLVM IR (-O2):
define void @GPMCPrefetchSyncTypeSelect(i32 %0, i32 %1) {
%3 = add i32 %0, 480
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -5
store volatile i32 %7, i32* %5
%8 = shl i32 %1, 2
%9 = and i32 %8, 4
%10 = load volatile i32, i32* %5
%11 = or i32 %10, %9
store volatile i32 %11, i32* %5
ret void
}
/* Variables and functions */
int f38(int *);
int f39(int *p) { return f38(p); }


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

x86 assembly (clang, -O2):
<f39>:
jmp    1030 <f38@plt>

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

LLVM IR (-O2):
define i32 @f39(i32* %0) {
%2 = tail call i32 @f38(i32* %0)
ret i32 %2
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double utils_timespec_to_secs(struct timespec ts) {
  return ((double)ts.tv_sec) + ((double)((double)ts.tv_nsec / 1000000000.0));
}


x86 assembly (clang, -O0):
<utils_timespec_to_secs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xee0(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<utils_timespec_to_secs>:
cvtsi2sd %rsi,%xmm1
cvtsi2sd %rdi,%xmm0
divsd  0xeee(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define double @utils_timespec_to_secs(i64 %0, i64 %1) {
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %3 to { i64, i64 }*
%5 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 0
store i64 %0, i64* %5
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 1
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%11 = load i64, i64* %10
%12 = sitofp i64 %11 to double
%13 = fdiv double %12, 1.000000e+09
%14 = fadd double %9, %13
ret double %14
}

LLVM IR (-O2):
define double @utils_timespec_to_secs(i64 %0, i64 %1) {
%3 = sitofp i64 %1 to double
%4 = sitofp i64 %0 to double
%5 = fdiv double %4, 1.000000e+09
%6 = fadd double %5, %3
ret double %6
}
int get_version_minor() { return 16; }


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

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

LLVM IR (-O0):
define i32 @get_version_minor() {
ret i32 16
}

LLVM IR (-O2):
define i32 @get_version_minor() {
ret i32 16
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ ets_delay_us(int);
int /*<<< orphan*/ ets_printf(char *);
void call_user_start(void) {
  uint8_t loop;
  for (loop = 0; loop < 50; loop++) {
    ets_printf("testload 1\r\n");
    ets_delay_us(20000);
  }
}


x86 assembly (clang, -O0):
<call_user_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x32,-0x4(%rbp)
jge    115d <call_user_start+0x3d>
lea    0xec0(%rip),%rdi
call   1030 <ets_printf@plt>
mov    $0x4e20,%edi
call   1040 <ets_delay_us@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <call_user_start+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_user_start>:
push   %rbp
push   %rbx
push   %rax
mov    $0x32,%ebp
lea    0xed1(%rip),%rbx
nop
mov    %rbx,%rdi
call   1030 <ets_printf@plt>
mov    $0x4e20,%edi
call   1040 <ets_delay_us@plt>
add    $0xffffffff,%ebp
jne    1130 <call_user_start+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"testload 1\0D\0A\00"
define void @call_user_start() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 50
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = call i32 @ets_printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @ets_delay_us(i32 20000)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"testload 1\0D\0A\00"
define void @call_user_start() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i32 @ets_printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @ets_delay_us(i32 20000)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 50
br i1 %6, label %7, label %1
7: ; preds = %1
ret void
}
void makeFileDescriptorNonBlockingAndSetupSigio(int fd) {
  int arg;
  ;
}


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

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

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

LLVM IR (-O2):
define void @makeFileDescriptorNonBlockingAndSetupSigio(i32 %0) {
ret void
}
void proc40() {}


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

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

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

LLVM IR (-O2):
define void @proc40() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *,
                           char const *, char const *);
void pce_server_version(FILE *out) {
  static const char prog_str[] = "pce server";
  static const char ver_str[] = "1.1";
  static const char author_str[] = "Paolo Rovelli";
  fprintf(out, "%s %s written by %s\n", prog_str, ver_str, author_str);
  fflush(out);
  return;
}


x86 assembly (clang, -O0):
<pce_server_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xee6(%rip),%rsi
lea    0xec2(%rip),%rdx
lea    0xec6(%rip),%rcx
lea    0xec3(%rip),%r8
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pce_server_version>:
push   %rbx
mov    %rdi,%rbx
lea    0xef2(%rip),%rsi
lea    0xece(%rip),%rdx
lea    0xed2(%rip),%rcx
lea    0xecf(%rip),%r8
call   1030 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@pce_server_version.prog_str = internal constant [11 x i8] c"pce server\00"
@pce_server_version.ver_str = internal constant [4 x i8] c"1.1\00"
@pce_server_version.author_str = internal constant [14 x i8] c"Paolo Rovelli\00"
@.str = [21 x i8] c"%s %s written by %s\0A\00"
define void @pce_server_version(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @pce_server_version.prog_str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @pce_server_version.ver_str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @pce_server_version.author_str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @fflush(i32* %5)
ret void
}

LLVM IR (-O2):
@pce_server_version.prog_str = internal constant [11 x i8] c"pce server\00"
@pce_server_version.ver_str = internal constant [4 x i8] c"1.1\00"
@pce_server_version.author_str = internal constant [14 x i8] c"Paolo Rovelli\00"
@.str = [21 x i8] c"%s %s written by %s\0A\00"
define void @pce_server_version(i32* nocapture %0) {
%2 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @pce_server_version.prog_str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @pce_server_version.ver_str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @pce_server_version.author_str, i64 0, i64 0))
%3 = tail call i32 @fflush(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int pledge(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ proxyLog(char *);
void setupRunLoopPledge() {
  if (pledge("stdio inet", NULL) == -1) {
    proxyLog("run loop pledge failed");
    abort();
  }
}


x86 assembly (clang, -O0):
<setupRunLoopPledge>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <pledge@plt>
cmp    $0xffffffff,%eax
jne    1160 <setupRunLoopPledge+0x30>
lea    0xeb7(%rip),%rdi
call   1040 <proxyLog@plt>
mov    $0x0,%al
call   1030 <abort@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setupRunLoopPledge>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %esi,%esi
call   1050 <pledge@plt>
cmp    $0xffffffff,%eax
je     1146 <setupRunLoopPledge+0x16>
pop    %rax
ret
lea    0xebe(%rip),%rdi
call   1040 <proxyLog@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"stdio inet\00"
@.str.1 = [23 x i8] c"run loop pledge failed\00"
define void @setupRunLoopPledge() {
%1 = call i32 @pledge(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32* null)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 @proxyLog(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"stdio inet\00"
@.str.1 = [23 x i8] c"run loop pledge failed\00"
define void @setupRunLoopPledge() {
%1 = tail call i32 @pledge(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32* null)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @proxyLog(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ util_prg_print_parse_error();
int /*<<< orphan*/ warnx(char *, char const *);
void misc_print_invalid_command(const char *command) {
  warnx("Invalid command '%s'", command);
  util_prg_print_parse_error();
}


x86 assembly (clang, -O0):
<misc_print_invalid_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <warnx@plt>
mov    $0x0,%al
call   1030 <util_prg_print_parse_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<misc_print_invalid_command>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1040 <warnx@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <util_prg_print_parse_error@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Invalid command '%s'\00"
define void @misc_print_invalid_command(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @warnx(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (...) @util_prg_print_parse_error()
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Invalid command '%s'\00"
define void @misc_print_invalid_command(i8* %0) {
%2 = tail call i32 @warnx(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (...) @util_prg_print_parse_error()
ret void
}
/* Variables and functions */
int findprop(int /*<<< orphan*/ *);
int preset(void) { return findprop(NULL); }


x86 assembly (clang, -O0):
<preset>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <findprop@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @preset() {
%1 = call i32 @findprop(i32* null)
ret i32 %1
}

LLVM IR (-O2):
define i32 @preset() {
%1 = tail call i32 @findprop(i32* null)
ret i32 %1
}
int g(int a, int b) {
  int avg = (a + b) / 2;
  if (a > b) {
    return a + avg;
  } else {
    return b + avg;
  }
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1135 <g+0x35>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113e <g+0x3e>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
cmp    %esi,%edi
lea    (%rsi,%rdi,1),%ecx
mov    %esi,%edx
cmovg  %edi,%edx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @g(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
%5 = add nsw i32 %1, %0
%6 = sdiv i32 %5, 2
%7 = add nsw i32 %6, %4
ret i32 %7
}
/* Variables and functions */
void *fonction(void *arg) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @fonction(i8* nocapture readnone %0) {
ret i8* null
}
/* Type definitions */
typedef char *pid_t;

/* Variables and functions */
pid_t fork(void) {
  pid_t result;
  asm("movl $2, %%eax;"
      "int $0x80;"
      : "=a"(result));
  return result;
}


x86 assembly (clang, -O0):
<fork>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%eax
int    $0x80
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork>:
mov    $0x2,%eax
int    $0x80
ret

LLVM IR (-O0):
define i8* @fork() {
%1 = alloca i8*
%2 = call i8* asm "movl $$2, %eax;int $$0x80;", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @fork() {
%1 = tail call i8* asm "movl $$2, %eax;int $$0x80;", "={ax},~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("hello\n"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"hello\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *tokenParser(char *, char *, int, char *);
char *swallParser(char *header) {
  return tokenParser(header, " \t", 1, "swallParser");
}


x86 assembly (clang, -O0):
<swallParser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x1,%edx
lea    0xed0(%rip),%rcx
call   1030 <tokenParser@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swallParser>:
lea    0xee9(%rip),%rsi
lea    0xee5(%rip),%rcx
mov    $0x1,%edx
jmp    1030 <tokenParser@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c" \09\00"
@.str.1 = [12 x i8] c"swallParser\00"
define i8* @swallParser(i8* %0) {
%2 = tail call i8* @tokenParser(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
double HUGE_VAL;
double scalanative_libc_huge_val() { return HUGE_VAL; }


x86 assembly (clang, -O0):
<scalanative_libc_huge_val>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
movsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalanative_libc_huge_val>:
mov    0x2ee1(%rip),%rax
movsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@HUGE_VAL = global double 0.000000e+00
define double @scalanative_libc_huge_val() {
%1 = load double, double* @HUGE_VAL
ret double %1
}

LLVM IR (-O2):
@HUGE_VAL = global double 0.000000e+00
define double @scalanative_libc_huge_val() {
%1 = load double, double* @HUGE_VAL
ret double %1
}
/* Variables and functions */
float M_PI;
float degrees2radians(float degrees) { return degrees * M_PI / 180; }


x86 assembly (clang, -O0):
<degrees2radians>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
mulss  (%rax),%xmm0
movss  0xedf(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<degrees2radians>:
mov    0x2ee1(%rip),%rax
mulss  (%rax),%xmm0
divss  0xeed(%rip),%xmm0
ret

LLVM IR (-O0):
@M_PI = global float 0.000000e+00
define float @degrees2radians(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* @M_PI
%5 = fmul float %3, %4
%6 = fdiv float %5, 1.800000e+02
ret float %6
}

LLVM IR (-O2):
@M_PI = global float 0.000000e+00
define float @degrees2radians(float %0) {
%2 = load float, float* @M_PI
%3 = fmul float %2, %0
%4 = fdiv float %3, 1.800000e+02
ret float %4
}
/* Variables and functions */
scalar_t__ popNumber();
int /*<<< orphan*/ pushString(int /*<<< orphan*/);
int /*<<< orphan*/ space(int);
void basSpace() {
  int n;
  n = (int)popNumber();
  pushString(space(n));
}


x86 assembly (clang, -O0):
<basSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <space@plt>
mov    %eax,%edi
call   1040 <pushString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basSpace>:
push   %rax
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%edi
call   1030 <space@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <pushString@plt>

LLVM IR (-O0):
define void @basSpace() {
%1 = alloca i32
%2 = call i64 (...) @popNumber()
%3 = trunc i64 %2 to i32
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @space(i32 %4)
%6 = call i32 @pushString(i32 %5)
ret void
}

LLVM IR (-O2):
define void @basSpace() {
%1 = tail call i64 (...) @popNumber()
%2 = trunc i64 %1 to i32
%3 = tail call i32 @space(i32 %2)
%4 = tail call i32 @pushString(i32 %3)
ret void
}
void AmiSetDword24ToBe(void *pAddr_p, unsigned long int dwDwordVal_p) {
  ((unsigned char *)pAddr_p)[0] = ((unsigned char *)&dwDwordVal_p)[2];
  ((unsigned char *)pAddr_p)[1] = ((unsigned char *)&dwDwordVal_p)[1];
  ((unsigned char *)pAddr_p)[2] = ((unsigned char *)&dwDwordVal_p)[0];
}


x86 assembly (clang, -O0):
<AmiSetDword24ToBe>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0xe(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xf(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AmiSetDword24ToBe>:
mov    %rsi,%rax
mov    %rsi,%rcx
shr    $0x10,%rcx
mov    %cl,(%rdi)
mov    %ah,0x1(%rdi)
mov    %al,0x2(%rdi)
ret

LLVM IR (-O0):
define void @AmiSetDword24ToBe(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = bitcast i64* %4 to i8*
%6 = getelementptr inbounds i8, i8* %5, i64 2
%7 = load i8, i8* %6
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = bitcast i64* %4 to i8*
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %14
%15 = bitcast i64* %4 to i8*
%16 = getelementptr inbounds i8, i8* %15, i64 0
%17 = load i8, i8* %16
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 2
store i8 %17, i8* %19
ret void
}

LLVM IR (-O2):
define void @AmiSetDword24ToBe(i8* nocapture writeonly %0, i64 %1) {
%3 = trunc i64 %1 to i8
%4 = lshr i64 %1, 8
%5 = trunc i64 %4 to i8
%6 = lshr i64 %1, 16
%7 = trunc i64 %6 to i8
store i8 %7, i8* %0
%8 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %3, i8* %9
ret void
}
int omp_get_nested(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @omp_get_nested() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clock();
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int drmaa2_random_int() {
  srand(clock());
  return rand();
}


x86 assembly (clang, -O0):
<drmaa2_random_int>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drmaa2_random_int>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <rand@plt>

LLVM IR (-O0):
define i32 @drmaa2_random_int() {
%1 = call i32 (...) @clock()
%2 = call i32 @srand(i32 %1)
%3 = call i32 (...) @rand()
ret i32 %3
}

LLVM IR (-O2):
define i32 @drmaa2_random_int() {
%1 = tail call i32 (...) @clock()
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
ret i32 %3
}
int foo(int *bar) { return *bar; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("hello, world.\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"hello, world.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}