xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int /*<<< orphan*/ logprintf(int /*<<< orphan*/, char *);
int sqlite_delete_msa(int /*<<< orphan*/ *, char *);
int mode_delete(sqlite3 *db, int argc, char **argv) {
  if (argc != 2) {
    logprintf(0, "No user name supplied\n");
    return -1;
  }
  return sqlite_delete_msa(db, argv[1]);
}


x86 assembly (clang, -O0):
<mode_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x2,-0x14(%rbp)
je     1157 <mode_delete+0x37>
xor    %edi,%edi
lea    0xeba(%rip),%rsi
call   1040 <logprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <mode_delete+0x4b>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <sqlite_delete_msa@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mode_delete>:
push   %rax
cmp    $0x2,%esi
jne    1130 <mode_delete+0x10>
mov    0x8(%rdx),%rsi
pop    %rax
jmp    1030 <sqlite_delete_msa@plt>
lea    0xec9(%rip),%rsi
xor    %edi,%edi
call   1040 <logprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"No user name supplied\0A\00"
define i32 @mode_delete(i32* %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i8**
store i32* %0, i32** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 @logprintf(i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %4
br label %18
12: ; preds = %3
%13 = load i32*, i32** %5
%14 = load i8**, i8*** %7
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @sqlite_delete_msa(i32* %13, i8* %16)
store i32 %17, i32* %4
br label %18
18: ; preds = %12, %10
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
@.str = [23 x i8] c"No user name supplied\0A\00"
define i32 @mode_delete(i32* %0, i32 %1, i8** nocapture %2) {
%4 = icmp eq i32 %1, 2
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @logprintf(i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %11
7: ; preds = %3
%8 = getelementptr inbounds i8*, i8** %2, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @sqlite_delete_msa(i32* %0, i8* %9)
br label %11
11: ; preds = %7, %5
%12 = phi i32 [ -1, %5 ], [ %10, %7 ]
ret i32 %12
}
int puts(const char *s) {
  _Bool error;
  int ret;
__ESBMC_HIDE:
  printf("%s\n", s);
  if (error)
    ret = -1;
  else
    __ESBMC_assume(ret >= 0);
  return ret;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
testb  $0x1,-0x9(%rbp)
je     1154 <puts+0x34>
movl   $0xffffffff,-0x10(%rbp)
jmp    1167 <puts+0x47>
cmpl   $0x0,-0x10(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <__ESBMC_assume@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @puts(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i32
store i8* %0, i8** %2
br label %5
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8, i8* %3
%9 = trunc i8 %8 to i1
br i1 %9, label %10, label %11
10: ; preds = %5
store i32 -1, i32* %4
br label %16
11: ; preds = %5
%12 = load i32, i32* %4
%13 = icmp sge i32 %12, 0
%14 = zext i1 %13 to i32
%15 = call i32 (i32, ...) bitcast (i32 (...)* @__ESBMC_assume to i32 (i32, ...)*)(i32 %14)
br label %16
16: ; preds = %11, %10
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @__ESBMC_assume to i32 (i32, ...)*)(i32 0)
ret i32 -1
}
void sd_zbc_complete(struct scsi_cmnd *cmd, unsigned int good_bytes,
                     struct scsi_sense_hdr *sshdr) {}


x86 assembly (clang, -O0):
<sd_zbc_complete>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.scsi_cmnd = type opaque
%struct.scsi_sense_hdr = type opaque
define void @sd_zbc_complete(%struct.scsi_cmnd* %0, i32 %1, %struct.scsi_sense_hdr* %2) {
%4 = alloca %struct.scsi_cmnd*
%5 = alloca i32
%6 = alloca %struct.scsi_sense_hdr*
store %struct.scsi_cmnd* %0, %struct.scsi_cmnd** %4
store i32 %1, i32* %5
store %struct.scsi_sense_hdr* %2, %struct.scsi_sense_hdr** %6
ret void
}

LLVM IR (-O2):
%struct.scsi_cmnd = type opaque
%struct.scsi_sense_hdr = type opaque
define void @sd_zbc_complete(%struct.scsi_cmnd* nocapture %0, i32 %1, %struct.scsi_sense_hdr* nocapture %2) {
ret void
}
/* Variables and functions */
int EOF;
int convertUtf8ToWchar(char const **, size_t *);
int convertWcharToChar(int);
int convertUtf8ToChar(const char **utf8, size_t *utfs) {
  int wc = convertUtf8ToWchar(utf8, utfs);
  if (wc == EOF)
    return EOF;
  return convertWcharToChar(wc);
}


x86 assembly (clang, -O0):
<convertUtf8ToChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <convertUtf8ToWchar@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%eax
jne    1163 <convertUtf8ToChar+0x43>
mov    0x2e8f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    116e <convertUtf8ToChar+0x4e>
mov    -0x1c(%rbp),%edi
call   1040 <convertWcharToChar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertUtf8ToChar>:
push   %rax
call   1030 <convertUtf8ToWchar@plt>
mov    0x2ebb(%rip),%rcx
cmp    (%rcx),%eax
jne    1133 <convertUtf8ToChar+0x13>
pop    %rcx
ret
mov    %eax,%edi
pop    %rax
jmp    1040 <convertWcharToChar@plt>

LLVM IR (-O0):
@EOF = global i32 0
define i32 @convertUtf8ToChar(i8** %0, i64* %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i64*
%6 = alloca i32
store i8** %0, i8*** %4
store i64* %1, i64** %5
%7 = load i8**, i8*** %4
%8 = load i64*, i64** %5
%9 = call i32 @convertUtf8ToWchar(i8** %7, i64* %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i32, i32* @EOF
store i32 %14, i32* %3
br label %18
15: ; preds = %2
%16 = load i32, i32* %6
%17 = call i32 @convertWcharToChar(i32 %16)
store i32 %17, i32* %3
br label %18
18: ; preds = %15, %13
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @convertUtf8ToChar(i8** %0, i64* %1) {
%3 = tail call i32 @convertUtf8ToWchar(i8** %0, i64* %1)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @convertWcharToChar(i32 %3)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ %3, %2 ]
ret i32 %9
}
/* Type definitions */
struct ctx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ vdso_has_clock_gettime();
void clock_gettime_notes(struct ctx *ctx) {
  if (!vdso_has_clock_gettime())
    printf("Note: vDSO version of clock_gettime not found\n");
}


x86 assembly (clang, -O0):
<clock_gettime_notes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <vdso_has_clock_gettime@plt>
cmp    $0x0,%eax
jne    1148 <clock_gettime_notes+0x28>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock_gettime_notes>:
push   %rax
xor    %eax,%eax
call   1040 <vdso_has_clock_gettime@plt>
test   %eax,%eax
je     112e <clock_gettime_notes+0xe>
pop    %rax
ret
lea    0xecb(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
%struct.ctx = type { i32 }
@.str = [47 x i8] c"Note: vDSO version of clock_gettime not found\0A\00"
define void @clock_gettime_notes(%struct.ctx* %0) {
%2 = alloca %struct.ctx*
store %struct.ctx* %0, %struct.ctx** %2
%3 = call i32 (...) @vdso_has_clock_gettime()
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.ctx = type { i32 }
@str = [46 x i8] c"Note: vDSO version of clock_gettime not found\00"
define void @clock_gettime_notes(%struct.ctx* nocapture readnone %0) {
%2 = tail call i32 (...) @vdso_has_clock_gettime()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
int mn_socket_close() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @mn_socket_close() {
ret i32 1
}
__attribute__((always_)) int __atomic_swap(int _new, volatile int *ptr) {
  return __sync_lock_test_and_set(ptr, _new);
}


x86 assembly (clang, -O0):
<__atomic_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x4(%rbp),%eax
xchg   %eax,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atomic_swap>:
mov    %edi,%eax
xchg   %eax,(%rsi)
ret

LLVM IR (-O0):
define i32 @__atomic_swap(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 = atomicrmw xchg i32* %5, i32 %6 seq_cst
ret i32 %7
}

LLVM IR (-O2):
define i32 @__atomic_swap(i32 %0, i32* nocapture %1) {
%3 = atomicrmw xchg i32* %1, i32 %0 seq_cst
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("This is a shared library test ...");
  foo();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"This is a shared library test ...\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @foo()
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"This is a shared library test ...\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @foo()
ret i32 0
}
void __attribute__((section(".after_vectors"), weak)) PendSV_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<PendSV_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <PendSV_Handler+0x9>
jmp    1109 <PendSV_Handler+0x9>

x86 assembly (clang, -O2):
<PendSV_Handler>:
jmp    1100 <PendSV_Handler>

LLVM IR (-O0):
define weak void @PendSV_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define weak void @PendSV_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}
char ordered(int arr[], int n) {
  int i;
  for (i = 1; i < n; ++i)
    if (arr[i - 1] > arr[i])
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<ordered>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115b <ordered+0x5b>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jle    1148 <ordered+0x48>
movb   $0x0,-0x1(%rbp)
jmp    115f <ordered+0x5f>
jmp    114d <ordered+0x4d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <ordered+0x12>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ordered>:
mov    $0x1,%al
cmp    $0x2,%esi
jl     1132 <ordered+0x32>
mov    %esi,%r8d
mov    (%rdi),%edx
mov    $0x1,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
mov    (%rdi,%rsi,4),%edx
cmp    %edx,%ecx
jg     1133 <ordered+0x33>
add    $0x1,%rsi
cmp    %rsi,%r8
jne    1120 <ordered+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define signext i8 @ordered(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = load i32, i32* %0
br label %9
7: ; preds = %9
%8 = icmp eq i64 %15, %5
br i1 %8, label %16, label %9
9: ; preds = %4, %7
%10 = phi i32 [ %6, %4 ], [ %13, %7 ]
%11 = phi i64 [ 1, %4 ], [ %15, %7 ]
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = icmp sgt i32 %10, %13
%15 = add nuw nsw i64 %11, 1
br i1 %14, label %16, label %7
16: ; preds = %9, %7, %2
%17 = phi i8 [ 1, %2 ], [ 1, %7 ], [ 0, %9 ]
ret i8 %17
}
int do_477() { return 477; }


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

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

LLVM IR (-O0):
define i32 @do_477() {
ret i32 477
}

LLVM IR (-O2):
define i32 @do_477() {
ret i32 477
}
/* Variables and functions */
int /*<<< orphan*/ R_ATCM_WaitSet(int /*<<< orphan*/);
int /*<<< orphan*/ cache_init();
int /*<<< orphan*/ cpg_init();
int /*<<< orphan*/ main();
int /*<<< orphan*/ reset_check();
int /*<<< orphan*/ set_low_vec();
void loader_init2(void) {
  reset_check();
  cpg_init();
  R_ATCM_WaitSet((0));
  cache_init();
  set_low_vec();
  main();
}


x86 assembly (clang, -O0):
<loader_init2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <reset_check@plt>
mov    $0x0,%al
call   1080 <cpg_init@plt>
xor    %edi,%edi
call   1040 <R_ATCM_WaitSet@plt>
mov    $0x0,%al
call   1070 <cache_init@plt>
mov    $0x0,%al
call   1060 <set_low_vec@plt>
mov    $0x0,%al
call   1050 <main@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<loader_init2>:
push   %rax
xor    %eax,%eax
call   1030 <reset_check@plt>
xor    %eax,%eax
call   1080 <cpg_init@plt>
xor    %edi,%edi
call   1040 <R_ATCM_WaitSet@plt>
xor    %eax,%eax
call   1070 <cache_init@plt>
xor    %eax,%eax
call   1060 <set_low_vec@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <main@plt>

LLVM IR (-O0):
define void @loader_init2() {
%1 = call i32 (...) @reset_check()
%2 = call i32 (...) @cpg_init()
%3 = call i32 @R_ATCM_WaitSet(i32 0)
%4 = call i32 (...) @cache_init()
%5 = call i32 (...) @set_low_vec()
%6 = call i32 (...) @main()
ret void
}

LLVM IR (-O2):
define void @loader_init2() {
%1 = tail call i32 (...) @reset_check()
%2 = tail call i32 (...) @cpg_init()
%3 = tail call i32 @R_ATCM_WaitSet(i32 0)
%4 = tail call i32 (...) @cache_init()
%5 = tail call i32 (...) @set_low_vec()
%6 = tail call i32 (...) @main()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fail(char *);
scalar_t__ malloc(unsigned int);
float *vector(int nl, int nh) {
  float *v;
  v = (float *)malloc((unsigned)(nh - nl + 1) * sizeof(float));
  if (!v)
    fail("allocation failure in vector()");
  return v - nl;
}


x86 assembly (clang, -O0):
<vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,%eax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115f <vector+0x3f>
lea    0xea6(%rip),%rdi
call   1030 <fail@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
sub    %edi,%esi
lea    0x4(,%rsi,4),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1147 <vector+0x27>
lea    0xebe(%rip),%rdi
call   1030 <fail@plt>
movslq %ebp,%rax
shl    $0x2,%rax
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"allocation failure in vector()\00"
define float* @vector(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca float*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = zext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to float*
store float* %14, float** %5
%15 = load float*, float** %5
%16 = icmp ne float* %15, null
br i1 %16, label %19, label %17
17: ; preds = %2
%18 = call i32 @fail(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %2
%20 = load float*, float** %5
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = sub i64 0, %22
%24 = getelementptr inbounds float, float* %20, i64 %23
ret float* %24
}

LLVM IR (-O2):
@.str = [31 x i8] c"allocation failure in vector()\00"
define float* @vector(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = shl i32 %3, 2
%5 = add i32 %4, 4
%6 = tail call i64 @malloc(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @fail(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to float*
%12 = sext i32 %0 to i64
%13 = sub nsw i64 0, %12
%14 = getelementptr inbounds float, float* %11, i64 %13
ret float* %14
}
/* Variables and functions */
scalar_t__ ceil(double);
scalar_t__ floor(double);
double round_double(double input) {
  if (input < 0) {
    return (double)ceil(input - 0.5);
  } else {
    return (double)floor(input + 0.5);
  }
}


x86 assembly (clang, -O0):
<round_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1160 <round_double+0x40>
movsd  -0x10(%rbp),%xmm0
movsd  0xeb8(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <ceil@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117c <round_double+0x5c>
movsd  0xe98(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1040 <floor@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_double>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    113a <round_double+0x1a>
addsd  0xed5(%rip),%xmm0
call   1030 <ceil@plt>
jmp    1147 <round_double+0x27>
addsd  0xebe(%rip),%xmm0
call   1040 <floor@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @round_double(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load double, double* %3
%8 = fsub double %7, 5.000000e-01
%9 = call i64 @ceil(double %8)
%10 = sitofp i64 %9 to double
store double %10, double* %2
br label %16
11: ; preds = %1
%12 = load double, double* %3
%13 = fadd double %12, 5.000000e-01
%14 = call i64 @floor(double %13)
%15 = sitofp i64 %14 to double
store double %15, double* %2
br label %16
16: ; preds = %11, %6
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
define double @round_double(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fadd double %0, -5.000000e-01
%5 = tail call i64 @ceil(double %4)
br label %9
6: ; preds = %1
%7 = fadd double %0, 5.000000e-01
%8 = tail call i64 @floor(double %7)
br label %9
9: ; preds = %6, %3
%10 = phi i64 [ %5, %3 ], [ %8, %6 ]
%11 = sitofp i64 %10 to double
ret double %11
}
/* Type definitions */
struct catmc_atomic_unsigned_long {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct catmc_atomic_unsigned_long *);
void catmc_atomic_unsigned_long_destroy(
    struct catmc_atomic_unsigned_long *wrapper) {
  free(wrapper);
}


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

x86 assembly (clang, -O2):
<catmc_atomic_unsigned_long_destroy>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.catmc_atomic_unsigned_long = type { i32 }
define void @catmc_atomic_unsigned_long_destroy(%struct.catmc_atomic_unsigned_long* %0) {
%2 = alloca %struct.catmc_atomic_unsigned_long*
store %struct.catmc_atomic_unsigned_long* %0, %struct.catmc_atomic_unsigned_long** %2
%3 = load %struct.catmc_atomic_unsigned_long*, %struct.catmc_atomic_unsigned_long** %2
%4 = call i32 @free(%struct.catmc_atomic_unsigned_long* %3)
ret void
}

LLVM IR (-O2):
%struct.catmc_atomic_unsigned_long = type { i32 }
define void @catmc_atomic_unsigned_long_destroy(%struct.catmc_atomic_unsigned_long* nocapture %0) {
%2 = tail call i32 @free(%struct.catmc_atomic_unsigned_long* %0)
ret void
}
unsigned long long foo(unsigned long long addr, unsigned long long a0,
                       unsigned long long a1, unsigned long long a2,
                       unsigned long long a3, unsigned long long a4,
                       unsigned long long a5) {
  register unsigned long long result asm("rax");
  register unsigned long long b0 asm("rdi");
  register unsigned long long b1 asm("rsi");
  register unsigned long long b2 asm("rdx");
  register unsigned long long b3 asm("rcx");
  register unsigned long long b4 asm("r8");
  register unsigned long long b5 asm("r9");
  b0 = a0;
  b1 = a1;
  b2 = a2;
  b3 = a3;
  b4 = a4;
  b5 = a5;
  asm("call *%1"
      : "=r"(result)
      : "r"(addr), "r"(b0), "r"(b1), "r"(b2), "r"(b3), "r"(b4), "r"(b5));
  return result;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    0x10(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x50(%rbp),%rdx
mov    -0x58(%rbp),%rcx
mov    -0x60(%rbp),%r8
mov    -0x68(%rbp),%r9
call   *%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %r9,%r10
mov    %rdi,%rax
mov    0x8(%rsp),%r9
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8,%rcx
mov    %r10,%r8
call   *%rax
ret

LLVM IR (-O0):
define i64 @foo(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
%19 = alloca i64
%20 = alloca i64
%21 = alloca i64
store i64 %0, i64* %8
store i64 %1, i64* %9
store i64 %2, i64* %10
store i64 %3, i64* %11
store i64 %4, i64* %12
store i64 %5, i64* %13
store i64 %6, i64* %14
%22 = load i64, i64* %9
store i64 %22, i64* %16
%23 = load i64, i64* %10
store i64 %23, i64* %17
%24 = load i64, i64* %11
store i64 %24, i64* %18
%25 = load i64, i64* %12
store i64 %25, i64* %19
%26 = load i64, i64* %13
store i64 %26, i64* %20
%27 = load i64, i64* %14
store i64 %27, i64* %21
%28 = load i64, i64* %8
%29 = load i64, i64* %16
%30 = load i64, i64* %17
%31 = load i64, i64* %18
%32 = load i64, i64* %19
%33 = load i64, i64* %20
%34 = load i64, i64* %21
%35 = call i64 asm "call *$1", "={rax},r,{rdi},{rsi},{rdx},{rcx},{r8},{r9},~{dirflag},~{fpsr},~{flags}"(i64 %28, i64 %29, i64 %30, i64 %31, i64 %32, i64 %33, i64 %34)
store i64 %35, i64* %15
%36 = load i64, i64* %15
ret i64 %36
}

LLVM IR (-O2):
define i64 @foo(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = tail call i64 asm "call *$1", "={rax},r,{rdi},{rsi},{rdx},{rcx},{r8},{r9},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6)
ret i64 %8
}
/* Variables and functions */
int atoi(char *);
scalar_t__ isdigit(char);
char *skipspace(char *);
int atoi_next(char **str) {
  int retval = atoi(*str);
  while (isdigit(**str))
    ++*str;
  *str = skipspace(*str);
  return retval;
}


x86 assembly (clang, -O0):
<atoi_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1177 <atoi_next+0x47>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    114b <atoi_next+0x1b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1040 <skipspace@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi_next>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rbp
mov    %rbp,%rdi
call   1050 <atoi@plt>
mov    %eax,%r14d
movsbl 0x0(%rbp),%edi
nopl   0x0(%rax)
call   1030 <isdigit@plt>
test   %rax,%rax
je     116a <atoi_next+0x3a>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movsbl 0x1(%rax),%edi
jmp    1150 <atoi_next+0x20>
mov    (%rbx),%rdi
call   1040 <skipspace@plt>
mov    %rax,(%rbx)
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @atoi_next(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @atoi(i8* %2)
%4 = load i8, i8* %2
%5 = tail call i64 @isdigit(i8 signext %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %7
%8 = load i8*, i8** %0
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %9, i8** %0
%10 = load i8, i8* %9
%11 = tail call i64 @isdigit(i8 signext %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %7
13: ; preds = %7, %1
%14 = load i8*, i8** %0
%15 = tail call i8* @skipspace(i8* %14)
store i8* %15, i8** %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ trap_R_RegisterShaderNoMip(char *);
void Login_Cache(void) {
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/cut_frame");
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"menu/art_blueish/cut_frame\00"
define void @Login_Cache() {
%1 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"menu/art_blueish/cut_frame\00"
define void @Login_Cache() {
%1 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_regmem_insns(int);
int main() {
  do_regmem_insns(0x7ffffffffffffffaul);
  do_regmem_insns(0x80000000f0000000ul);
  do_regmem_insns(0xfffffffafffffffaul);
  do_regmem_insns(0x7ffffffff0000000ul);
  do_regmem_insns(0x80000000f0000000ul);
  do_regmem_insns(0xfffffffaf0000000ul);
  do_regmem_insns(0x000000087ffffffful);
  do_regmem_insns(0x0000000480000000ul);
  do_regmem_insns(0x00000008fffffffaul);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xfffffffa,%edi
call   1030 <do_regmem_insns@plt>
mov    $0xf0000000,%edi
call   1030 <do_regmem_insns@plt>
mov    $0xfffffffa,%edi
call   1030 <do_regmem_insns@plt>
mov    $0xf0000000,%edi
call   1030 <do_regmem_insns@plt>
mov    $0xf0000000,%edi
call   1030 <do_regmem_insns@plt>
mov    $0xf0000000,%edi
call   1030 <do_regmem_insns@plt>
mov    $0x7fffffff,%edi
call   1030 <do_regmem_insns@plt>
mov    $0x80000000,%edi
call   1030 <do_regmem_insns@plt>
mov    $0xfffffffa,%edi
call   1030 <do_regmem_insns@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xfffffffa,%edi
call   1030 <do_regmem_insns@plt>
mov    $0xf0000000,%edi
call   1030 <do_regmem_insns@plt>
mov    $0xfffffffa,%edi
call   1030 <do_regmem_insns@plt>
mov    $0xf0000000,%edi
call   1030 <do_regmem_insns@plt>
mov    $0xf0000000,%edi
call   1030 <do_regmem_insns@plt>
mov    $0xf0000000,%edi
call   1030 <do_regmem_insns@plt>
mov    $0x7fffffff,%edi
call   1030 <do_regmem_insns@plt>
mov    $0x80000000,%edi
call   1030 <do_regmem_insns@plt>
mov    $0xfffffffa,%edi
call   1030 <do_regmem_insns@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @do_regmem_insns(i32 -6)
%3 = call i32 @do_regmem_insns(i32 -268435456)
%4 = call i32 @do_regmem_insns(i32 -6)
%5 = call i32 @do_regmem_insns(i32 -268435456)
%6 = call i32 @do_regmem_insns(i32 -268435456)
%7 = call i32 @do_regmem_insns(i32 -268435456)
%8 = call i32 @do_regmem_insns(i32 2147483647)
%9 = call i32 @do_regmem_insns(i32 -2147483648)
%10 = call i32 @do_regmem_insns(i32 -6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @do_regmem_insns(i32 -6)
%2 = tail call i32 @do_regmem_insns(i32 -268435456)
%3 = tail call i32 @do_regmem_insns(i32 -6)
%4 = tail call i32 @do_regmem_insns(i32 -268435456)
%5 = tail call i32 @do_regmem_insns(i32 -268435456)
%6 = tail call i32 @do_regmem_insns(i32 -268435456)
%7 = tail call i32 @do_regmem_insns(i32 2147483647)
%8 = tail call i32 @do_regmem_insns(i32 -2147483648)
%9 = tail call i32 @do_regmem_insns(i32 -6)
ret i32 0
}
int __flt_rounds(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @__flt_rounds() {
ret i32 0
}
/* Variables and functions */
int findFreeFdSlot();
int findFreeFdSlotReturnsFreeSlots() {
  int i;
  for (i = 0; i < 1; i++) {
    int freeSlot = findFreeFdSlot();
    if (i != freeSlot) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<findFreeFdSlotReturnsFreeSlots>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    115e <findFreeFdSlotReturnsFreeSlots+0x4e>
mov    $0x0,%al
call   1030 <findFreeFdSlot@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     114b <findFreeFdSlotReturnsFreeSlots+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1165 <findFreeFdSlotReturnsFreeSlots+0x55>
jmp    1150 <findFreeFdSlotReturnsFreeSlots+0x40>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111f <findFreeFdSlotReturnsFreeSlots+0xf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findFreeFdSlotReturnsFreeSlots>:
push   %rax
xor    %eax,%eax
call   1030 <findFreeFdSlot@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @findFreeFdSlotReturnsFreeSlots() {
%1 = tail call i32 (...) @findFreeFdSlot()
%2 = icmp ne i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void nvramIrqHandler(int signum) {
  system("iwpriv ra0 set WscMode=2");
  system("iwpriv ra0 set WscGetConf=1");
}


x86 assembly (clang, -O0):
<nvramIrqHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <system@plt>
lea    0xeeb(%rip),%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"iwpriv ra0 set WscMode=2\00"
@.str.1 = [28 x i8] c"iwpriv ra0 set WscGetConf=1\00"
define void @nvramIrqHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @system(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"iwpriv ra0 set WscMode=2\00"
@.str.1 = [28 x i8] c"iwpriv ra0 set WscGetConf=1\00"
define void @nvramIrqHandler(i32 %0) {
%2 = tail call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int strangeOrder(int a, int b) {
  if (a == 0 || b == 0)
    return 0;
  else
    return a % b;
}


x86 assembly (clang, -O0):
<strangeOrder>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111e <strangeOrder+0x1e>
cmpl   $0x0,-0xc(%rbp)
jne    112a <strangeOrder+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1134 <strangeOrder+0x34>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strangeOrder>:
xor    %eax,%eax
test   %edi,%edi
je     1111 <strangeOrder+0x11>
test   %esi,%esi
je     1111 <strangeOrder+0x11>
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @strangeOrder(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp eq i32 %1, 0
%5 = or i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = srem i32 %0, %1
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ 0, %2 ]
ret i32 %9
}
void f(char *p, int n) {
  for (int i = 0; i < n; ++i)
    *p = 0;
  *p = 1;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1133 <f+0x33>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <f+0x12>
mov    -0x8(%rbp),%rax
movb   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movb   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @f(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %12, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8*, i8** %3
store i8 0, i8* %11
br label %12
12: ; preds = %10
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 1
store i32 %14, i32* %5
br label %6
15: ; preds = %6
%16 = load i8*, i8** %3
store i8 1, i8* %16
ret void
}

LLVM IR (-O2):
define void @f(i8* nocapture writeonly %0, i32 %1) {
store i8 1, i8* %0
ret void
}
void myFunction(void) {
  int foo = 10, bar = 15;
  __asm__ __volatile__("addl  %%ebx,%%eax" : "=a"(foo) : "a"(foo), "b"(bar));
  printf("foo+bar=%d\n", foo);
}


x86 assembly (clang, -O0):
<myFunction>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
movl   $0xa,-0xc(%rbp)
movl   $0xf,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ebx
add    %ebx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<myFunction>:
push   %rbx
mov    $0xa,%eax
mov    $0xf,%ebx
add    %ebx,%eax
lea    0xedc(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"foo+bar=%d\0A\00"
define void @myFunction() {
%1 = alloca i32
%2 = alloca i32
store i32 10, i32* %1
store i32 15, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = call i32 asm sideeffect "addl %ebx,%eax", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 %3, i32 %4)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"foo+bar=%d\0A\00"
define void @myFunction() {
%1 = tail call i32 asm sideeffect "addl %ebx,%eax", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 10, i32 15)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
main() {
  setuid(0);
  execl("/bin/sh", " sh", NULL);
  exit(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <setuid@plt>
lea    0xeb3(%rip),%rdi
lea    0xeb4(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1050 <execl@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <setuid@plt>
lea    0xec1(%rip),%rdi
lea    0xec2(%rip),%rsi
xor    %edx,%edx
call   1050 <execl@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/sh\00"
@.str.1 = [4 x i8] c" sh\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @setuid(i32 0)
%3 = call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* null)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/sh\00"
@.str.1 = [4 x i8] c" sh\00"
define i32 @main() {
%1 = tail call i32 @setuid(i32 0)
%2 = tail call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* null)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ MyFunc_B();
int main() {
  MyFunc_B();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <MyFunc_B@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <MyFunc_B@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @MyFunc_B()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @MyFunc_B()
ret i32 0
}
/* Type definitions */
typedef unsigned long uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void I2CSlaveDataPut(uint32_t ui32Base, uint8_t ui8Data) {
  ;
  (*((volatile unsigned long *)(0x40002000 + 0x00000008))) = ui8Data;
}


x86 assembly (clang, -O0):
<I2CSlaveDataPut>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x40002008,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveDataPut>:
mov    %rsi,0x40002008
40
ret

LLVM IR (-O0):
define void @I2CSlaveDataPut(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
store volatile i64 %5, i64* inttoptr (i64 1073750024 to i64*)
ret void
}

LLVM IR (-O2):
define void @I2CSlaveDataPut(i32 %0, i64 %1) {
store volatile i64 %1, i64* inttoptr (i64 1073750024 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int /*<<< orphan*/);
__attribute__((deprecated("use ut_string_match_prefix from libutils"))) int
rs_str_match_prefix(const char *str, const char *prefix) {
  if (NULL == str || NULL == prefix)
    return 0;
  return strncmp(str, prefix, strlen(prefix)) == 0;
}


x86 assembly (clang, -O0):
<rs_str_match_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
je     1148 <rs_str_match_prefix+0x28>
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
jne    1154 <rs_str_match_prefix+0x34>
movl   $0x0,-0x4(%rbp)
jmp    118b <rs_str_match_prefix+0x6b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rs_str_match_prefix>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
test   %rdi,%rdi
je     1156 <rs_str_match_prefix+0x36>
mov    %rsi,%rbx
test   %rsi,%rsi
je     1156 <rs_str_match_prefix+0x36>
mov    %rdi,%r14
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @rs_str_match_prefix(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = or i1 %3, %4
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = tail call i32 @strlen(i8* %1)
%8 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %7)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %2, %6
%12 = phi i32 [ %10, %6 ], [ 0, %2 ]
ret i32 %12
}
/* Variables and functions */
int hash(int);
void insert_l(int *HASH_MAP, int num) {
  int probe = hash(num);
  while (HASH_MAP[probe] != 0) {
    probe = (probe + 1) % 1000;
  }
  HASH_MAP[probe] = num;
}


x86 assembly (clang, -O0):
<insert_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <hash@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1152 <insert_l+0x42>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
jmp    112a <insert_l+0x1a>
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_l>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <hash@plt>
nop
movslq %eax,%rcx
cmpl   $0x0,(%rbx,%rcx,4)
je     114c <insert_l+0x3c>
add    $0x1,%eax
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
jmp    1120 <insert_l+0x10>
mov    %ebp,(%rbx,%rcx,4)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @insert_l(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @hash(i32 %1)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %2, %8
%9 = phi i32 [ %11, %8 ], [ %3, %2 ]
%10 = add nsw i32 %9, 1
%11 = srem i32 %10, 1000
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %0, i64 %12
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %8
16: ; preds = %8, %2
%17 = phi i64 [ %4, %2 ], [ %12, %8 ]
%18 = getelementptr inbounds i32, i32* %0, i64 %17
store i32 %1, i32* %18
ret void
}
int test_264() { return 264; }


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

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

LLVM IR (-O0):
define i32 @test_264() {
ret i32 264
}

LLVM IR (-O2):
define i32 @test_264() {
ret i32 264
}