xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ abort();
void *acc_create(int /*<<< orphan*/, int const);
int /*<<< orphan*/ acc_delete(unsigned char *, int const);
int /*<<< orphan*/ free(unsigned char *);
scalar_t__ malloc(int const);
int main(int argc, char **argv) {
  const int N = 256;
  unsigned char *h;
  void *d;
  h = (unsigned char *)malloc(N);
  d = acc_create(0, N);
  if (!d)
    abort();
  acc_delete(h, N);
  free(h);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x100,-0x14(%rbp)
mov    $0x100,%edi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
xor    %edi,%edi
mov    $0x100,%esi
call   1050 <acc_create@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    119d <main+0x4d>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x20(%rbp),%rdi
mov    $0x100,%esi
call   1070 <acc_delete@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x100,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
mov    $0x100,%esi
call   1050 <acc_create@plt>
test   %rax,%rax
je     1188 <main+0x38>
mov    %rbx,%rdi
mov    $0x100,%esi
call   1070 <acc_delete@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 256, i32* %6
%9 = call i64 @malloc(i32 256)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %7
%11 = call i8* @acc_create(i32 0, i32 256)
store i8* %11, i8** %8
%12 = load i8*, i8** %8
%13 = icmp ne i8* %12, null
br i1 %13, label %16, label %14
14: ; preds = %2
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %2
%17 = load i8*, i8** %7
%18 = call i32 @acc_delete(i8* %17, i32 256)
%19 = load i8*, i8** %7
%20 = call i32 @free(i8* %19)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 256)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i8* @acc_create(i32 0, i32 256)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %2
%10 = tail call i32 @acc_delete(i8* %4, i32 256)
%11 = tail call i32 @free(i8* %4)
ret i32 0
}
int lux_sync(int fd, int tries) { return 0; }


x86 assembly (clang, -O0):
<lux_sync>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @lux_sync(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIGSEGV;
int /*<<< orphan*/ raise(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  raise(SIGSEGV);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@SIGSEGV = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @SIGSEGV
%4 = tail call i32 @raise(i32 %3)
ret i32 0
}
void gnttab_grant_copy() {}


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

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

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

LLVM IR (-O2):
define void @gnttab_grant_copy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HoTTSettingsHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void HoTTSettingsUpdated() { UAVObjUpdated(HoTTSettingsHandle()); }


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

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

LLVM IR (-O0):
define void @HoTTSettingsUpdated() {
%1 = call i32 (...) @HoTTSettingsHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @HoTTSettingsUpdated() {
%1 = tail call i32 (...) @HoTTSettingsHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void check_malloc(void *p, char *erstring) {
  if (p != NULL)
    return;
  fprintf(stderr, "Memory allocation failed: %s\nBailing out\n", erstring);
  exit(-1);
}


x86 assembly (clang, -O0):
<check_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1141 <check_malloc+0x21>
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeab(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<check_malloc>:
test   %rdi,%rdi
je     1126 <check_malloc+0x6>
ret
push   %rax
mov    %rsi,%rdx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"Memory allocation failed: %s\0ABailing out\0A\00"
define void @check_malloc(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %2
ret void
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %4
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"Memory allocation failed: %s\0ABailing out\0A\00"
define void @check_malloc(i8* readnone %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %5, label %4
4: ; preds = %2
ret void
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %1)
%8 = tail call i32 @exit(i32 -1)
unreachable
}
void smisk_crash_dump_init(void) {}


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

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

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

LLVM IR (-O2):
define void @smisk_crash_dump_init() {
ret void
}
int getlargestnum(int a, int b, int c) {
  int large;
  large = a;
  if (b > large)
    large = b;
  if (c > large)
    large = c;
  return large;
}


x86 assembly (clang, -O0):
<getlargestnum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1125 <getlargestnum+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1137 <getlargestnum+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @getlargestnum(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %0
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp slt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
/* Variables and functions */
int fcntl(int, int, void *);
extern int _swift_Glibc_fcntlPtr(int fd, int cmd, void *ptr) {
  return fcntl(fd, cmd, ptr);
}


x86 assembly (clang, -O0):
<_swift_Glibc_fcntlPtr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_swift_Glibc_fcntlPtr>:
jmp    1030 <fcntl@plt>

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

LLVM IR (-O2):
define i32 @_swift_Glibc_fcntlPtr(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @fcntl(i32 %0, i32 %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ entab(int, char **);
int main(int argc, char *argv[]) { entab(argc, argv); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @entab(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
unsigned int even(unsigned int);
unsigned int odd(unsigned int);
int calc(int target) {
  unsigned int temp = target;
  int count = 1;
  while (temp > 1) {
    if (temp % 2 == 0)
      temp = even(temp);
    else
      temp = odd(temp);
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<calc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jbe    117a <calc+0x5a>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1161 <calc+0x41>
mov    -0x8(%rbp),%edi
call   1030 <even@plt>
mov    %eax,-0x8(%rbp)
jmp    116c <calc+0x4c>
mov    -0x8(%rbp),%edi
call   1040 <odd@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1138 <calc+0x18>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc>:
push   %rbx
mov    $0x1,%ebx
cmp    $0x2,%edi
jb     115c <calc+0x3c>
mov    $0x1,%ebx
jmp    114f <calc+0x2f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
call   1040 <odd@plt>
mov    %eax,%edi
add    $0x1,%ebx
cmp    $0x1,%eax
jbe    115c <calc+0x3c>
test   $0x1,%dil
jne    1140 <calc+0x20>
call   1030 <even@plt>
jmp    1145 <calc+0x25>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @calc(i32 %0) {
%2 = icmp ugt i32 %0, 1
br i1 %2, label %3, label %16
3: ; preds = %1, %12
%4 = phi i32 [ %14, %12 ], [ 1, %1 ]
%5 = phi i32 [ %13, %12 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = tail call i32 @even(i32 %5)
br label %12
10: ; preds = %3
%11 = tail call i32 @odd(i32 %5)
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
%14 = add nuw nsw i32 %4, 1
%15 = icmp ugt i32 %13, 1
br i1 %15, label %3, label %16
16: ; preds = %12, %1
%17 = phi i32 [ 1, %1 ], [ %14, %12 ]
ret i32 %17
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ mem_copy_qword2qword_little(int /*<<< orphan*/ *,
                                               int /*<<< orphan*/ const);
uint64_t arch_mem_copy_qword2qword_little(uint64_t *qword_d,
                                          const uint64_t qword_s) {
  return mem_copy_qword2qword_little(qword_d, qword_s);
}


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

x86 assembly (clang, -O2):
<arch_mem_copy_qword2qword_little>:
jmp    1030 <mem_copy_qword2qword_little@plt>

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

LLVM IR (-O2):
define i32 @arch_mem_copy_qword2qword_little(i32* %0, i32 %1) {
%3 = tail call i32 @mem_copy_qword2qword_little(i32* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
struct packed_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pd_radd_lstr(struct packed_data *, char const *,
                                int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void pd_radd_str(struct packed_data *pd, const char *s) {
  pd_radd_lstr(pd, s, strlen(s));
}


x86 assembly (clang, -O0):
<pd_radd_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <pd_radd_lstr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pd_radd_str>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <pd_radd_lstr@plt>

LLVM IR (-O0):
%struct.packed_data = type { i32 }
define void @pd_radd_str(%struct.packed_data* %0, i8* %1) {
%3 = alloca %struct.packed_data*
%4 = alloca i8*
store %struct.packed_data* %0, %struct.packed_data** %3
store i8* %1, i8** %4
%5 = load %struct.packed_data*, %struct.packed_data** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @pd_radd_lstr(%struct.packed_data* %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.packed_data = type { i32 }
define void @pd_radd_str(%struct.packed_data* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @pd_radd_lstr(%struct.packed_data* %0, i8* %1, i32 %3)
ret void
}
void nabi_session_close(void) {}


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

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

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

LLVM IR (-O2):
define void @nabi_session_close() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ NFuseDecode(char *, int /*<<< orphan*/, unsigned char *);
int /*<<< orphan*/ printf(char *, unsigned char *);
int /*<<< orphan*/ strlen(char *);
int main(int argc, char **argv) {
  unsigned char buffer[256];
  NFuseDecode(argv[1], strlen(argv[1]), buffer);
  printf("%s\n", buffer);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x118(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <strlen@plt>
mov    -0x118(%rbp),%rdi
mov    %eax,%esi
lea    -0x110(%rbp),%rdx
call   1050 <NFuseDecode@plt>
lea    -0x110(%rbp),%rsi
lea    0xe78(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    0x8(%rsi),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
call   1050 <NFuseDecode@plt>
lea    0xea3(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @strlen(i8* %12)
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%15 = call i32 @NFuseDecode(i8* %9, i32 %13, i8* %14)
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
ret i32 1
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strlen(i8* %6)
%8 = call i32 @NFuseDecode(i8* %6, i32 %7, i8* %4)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 1
}
int main() {
  if (0) {
    return 1;
  } else {
    if (1) {
      if (1)
        return 0;
    } else {
      return 1;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct arena_block {
  int dummy;
};

/* Variables and functions */
struct arena_block *buddy_of(void *base, struct arena_block *b, int order) {
  const size_t offset = ((char *)b) - ((char *)base);
  const size_t boff = offset ^ (1 << order);
  return (struct arena_block *)(((char *)base) + boff);
}


x86 assembly (clang, -O0):
<buddy_of>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
xor    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
add    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<buddy_of>:
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    %rdi,%rsi
cltq
xor    %rsi,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
%struct.arena_block = type { i32 }
define %struct.arena_block* @buddy_of(i8* %0, %struct.arena_block* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca %struct.arena_block*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %4
store %struct.arena_block* %1, %struct.arena_block** %5
store i32 %2, i32* %6
%9 = load %struct.arena_block*, %struct.arena_block** %5
%10 = bitcast %struct.arena_block* %9 to i8*
%11 = load i8*, i8** %4
%12 = ptrtoint i8* %10 to i64
%13 = ptrtoint i8* %11 to i64
%14 = sub i64 %12, %13
store i64 %14, i64* %7
%15 = load i64, i64* %7
%16 = load i32, i32* %6
%17 = shl i32 1, %16
%18 = sext i32 %17 to i64
%19 = xor i64 %15, %18
store i64 %19, i64* %8
%20 = load i8*, i8** %4
%21 = load i64, i64* %8
%22 = getelementptr inbounds i8, i8* %20, i64 %21
%23 = bitcast i8* %22 to %struct.arena_block*
ret %struct.arena_block* %23
}

LLVM IR (-O2):
%struct.arena_block = type { i32 }
define %struct.arena_block* @buddy_of(i8* %0, %struct.arena_block* %1, i32 %2) {
%4 = ptrtoint %struct.arena_block* %1 to i64
%5 = ptrtoint i8* %0 to i64
%6 = sub i64 %4, %5
%7 = shl nuw i32 1, %2
%8 = sext i32 %7 to i64
%9 = xor i64 %6, %8
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = bitcast i8* %10 to %struct.arena_block*
ret %struct.arena_block* %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Testing...\n ..1\n...2\n....3\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
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 = [28 x i8] c"Testing...\0A ..1\0A...2\0A....3\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [27 x i8] c"Testing...\0A ..1\0A...2\0A....3\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void amsynth_lash_poll_events() {}


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

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

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

LLVM IR (-O2):
define void @amsynth_lash_poll_events() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main(void) {
  printf("Welcome to C!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
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"Welcome to C!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = 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"Welcome to C!\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
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ FUTEX_WAIT;
int futex(void volatile *, int /*<<< orphan*/, int, void *,
          int /*<<< orphan*/ *, int /*<<< orphan*/);
int __futex_wait(volatile void *ftx, int val, const struct timespec *timeout) {
  return futex(ftx, FUTEX_WAIT, val, (void *)timeout, NULL, 0);
}


x86 assembly (clang, -O0):
<__futex_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
call   1030 <futex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__futex_wait>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    0x2ecc(%rip),%rax
mov    (%rax),%esi
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <futex@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@FUTEX_WAIT = global i32 0
define i32 @__futex_wait(i8* %0, i32 %1, %struct.timespec* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca %struct.timespec*
store i8* %0, i8** %4
store i32 %1, i32* %5
store %struct.timespec* %2, %struct.timespec** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* @FUTEX_WAIT
%9 = load i32, i32* %5
%10 = load %struct.timespec*, %struct.timespec** %6
%11 = bitcast %struct.timespec* %10 to i8*
%12 = call i32 @futex(i8* %7, i32 %8, i32 %9, i8* %11, i32* null, i32 0)
ret i32 %12
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@FUTEX_WAIT = global i32 0
define i32 @__futex_wait(i8* %0, i32 %1, %struct.timespec* %2) {
%4 = load i32, i32* @FUTEX_WAIT
%5 = bitcast %struct.timespec* %2 to i8*
%6 = tail call i32 @futex(i8* %0, i32 %4, i32 %1, i8* %5, i32* null, i32 0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ SIGHUP;
int /*<<< orphan*/ sig_block(int /*<<< orphan*/);
void sig_hangupblock() { sig_block(SIGHUP); }


x86 assembly (clang, -O0):
<sig_hangupblock>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
call   1030 <sig_block@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_hangupblock>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sig_block@plt>

LLVM IR (-O0):
@SIGHUP = global i32 0
define void @sig_hangupblock() {
%1 = load i32, i32* @SIGHUP
%2 = call i32 @sig_block(i32 %1)
ret void
}

LLVM IR (-O2):
@SIGHUP = global i32 0
define void @sig_hangupblock() {
%1 = load i32, i32* @SIGHUP
%2 = tail call i32 @sig_block(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void looser(char *name) { printf("Sorry %s. Try harder!\n", name); }


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

x86 assembly (clang, -O2):
<looser>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Sorry %s. Try harder!\0A\00"
define void @looser(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Sorry %s. Try harder!\0A\00"
define void @looser(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ hash_keccak(int, int /*<<< orphan*/ const *,
                               int /*<<< orphan*/, int, int /*<<< orphan*/ *,
                               int, int /*<<< orphan*/);
int hash_shake128(uint8_t *h, uint64_t l, const uint8_t *m, uint64_t n) {
  hash_keccak(21 * 8, m, n, 0x1f, h, 168, l);
  return 1;
}


x86 assembly (clang, -O0):
<hash_shake128>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x8(%rbp),%r8
mov    -0xc(%rbp),%eax
mov    $0xa8,%r9d
mov    $0x1f,%ecx
mov    %r9d,%edi
mov    %eax,(%rsp)
call   1030 <hash_keccak@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_shake128>:
push   %rax
mov    %rdi,%r8
mov    %esi,(%rsp)
mov    $0xa8,%edi
mov    %rdx,%rsi
mov    %ecx,%edx
mov    $0x1f,%ecx
mov    $0xa8,%r9d
call   1030 <hash_keccak@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hash_shake128(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %7
%10 = load i32, i32* %8
%11 = load i32*, i32** %5
%12 = load i32, i32* %6
%13 = call i32 @hash_keccak(i32 168, i32* %9, i32 %10, i32 31, i32* %11, i32 168, i32 %12)
ret i32 1
}

LLVM IR (-O2):
define i32 @hash_shake128(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call i32 @hash_keccak(i32 168, i32* %2, i32 %3, i32 31, i32* %0, i32 168, i32 %1)
ret i32 1
}
void fn1(b) {}


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

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

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

LLVM IR (-O2):
define void @fn1(i32 %0) {
ret void
}
/* Variables and functions */
int htoi(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
main() {
  char s[20];
  scanf("%s", s);
  printf("the number is %d\n", htoi(s));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <htoi@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <htoi@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [18 x i8] c"the number is %d\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = call i32 @htoi(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [18 x i8] c"the number is %d\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @htoi(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
int test_imm_27int8_mem(signed char *val) {
  return ((*val) & (0x27 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_27int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 39
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ CleanupExtensions();
int /*<<< orphan*/ EmitStackTrace(int);
int /*<<< orphan*/ ResetBacktraceSignalHandlersToDefault();
int /*<<< orphan*/ TruncateAndClosePidPortFile();
void CatchFatal(int signo) {
  ResetBacktraceSignalHandlersToDefault();
  EmitStackTrace(signo);
  CleanupExtensions();
  TruncateAndClosePidPortFile();
}


x86 assembly (clang, -O0):
<CatchFatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <ResetBacktraceSignalHandlersToDefault@plt>
mov    -0x4(%rbp),%edi
call   1060 <EmitStackTrace@plt>
mov    $0x0,%al
call   1050 <CleanupExtensions@plt>
mov    $0x0,%al
call   1040 <TruncateAndClosePidPortFile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CatchFatal>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <ResetBacktraceSignalHandlersToDefault@plt>
mov    %ebx,%edi
call   1060 <EmitStackTrace@plt>
xor    %eax,%eax
call   1050 <CleanupExtensions@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <TruncateAndClosePidPortFile@plt>

LLVM IR (-O0):
define void @CatchFatal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @ResetBacktraceSignalHandlersToDefault()
%4 = load i32, i32* %2
%5 = call i32 @EmitStackTrace(i32 %4)
%6 = call i32 (...) @CleanupExtensions()
%7 = call i32 (...) @TruncateAndClosePidPortFile()
ret void
}

LLVM IR (-O2):
define void @CatchFatal(i32 %0) {
%2 = tail call i32 (...) @ResetBacktraceSignalHandlersToDefault()
%3 = tail call i32 @EmitStackTrace(i32 %0)
%4 = tail call i32 (...) @CleanupExtensions()
%5 = tail call i32 (...) @TruncateAndClosePidPortFile()
ret void
}
/* Variables and functions */
void *dlink_get_first();
void *front() { return dlink_get_first(); }


x86 assembly (clang, -O0):
<front>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dlink_get_first@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<front>:
xor    %eax,%eax
jmp    1030 <dlink_get_first@plt>

LLVM IR (-O0):
define i8* @front() {
%1 = call i8* (...) @dlink_get_first()
ret i8* %1
}

LLVM IR (-O2):
define i8* @front() {
%1 = tail call i8* (...) @dlink_get_first()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ s_len(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void w(char *s) { write(1, s, s_len(s)); }


x86 assembly (clang, -O0):
<w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <s_len@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w>:
push   %rbx
mov    %rdi,%rbx
call   1040 <s_len@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @w(i8* %0) {
%2 = tail call i32 @s_len(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
ret void
}
int fun309() { return 309; }


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

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

LLVM IR (-O0):
define i32 @fun309() {
ret i32 309
}

LLVM IR (-O2):
define i32 @fun309() {
ret i32 309
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t l = 0;
  while (*str++ != 0)
    l++;
  return l;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113c <strlen+0x3c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Type definitions */
struct wcfxs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fx_write_SPI2UART(struct wcfxs *, int, int);
void Codec_reg_data_latch(struct wcfxs *wc, int port) {
  fx_write_SPI2UART(wc, port, 0x5821);
  fx_write_SPI2UART(wc, port, 0x5825);
}


x86 assembly (clang, -O0):
<Codec_reg_data_latch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x5821,%edx
call   1030 <fx_write_SPI2UART@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x5825,%edx
call   1030 <fx_write_SPI2UART@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Codec_reg_data_latch>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x5821,%edx
call   1030 <fx_write_SPI2UART@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x5825,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fx_write_SPI2UART@plt>

LLVM IR (-O0):
%struct.wcfxs = type { i32 }
define void @Codec_reg_data_latch(%struct.wcfxs* %0, i32 %1) {
%3 = alloca %struct.wcfxs*
%4 = alloca i32
store %struct.wcfxs* %0, %struct.wcfxs** %3
store i32 %1, i32* %4
%5 = load %struct.wcfxs*, %struct.wcfxs** %3
%6 = load i32, i32* %4
%7 = call i32 @fx_write_SPI2UART(%struct.wcfxs* %5, i32 %6, i32 22561)
%8 = load %struct.wcfxs*, %struct.wcfxs** %3
%9 = load i32, i32* %4
%10 = call i32 @fx_write_SPI2UART(%struct.wcfxs* %8, i32 %9, i32 22565)
ret void
}

LLVM IR (-O2):
%struct.wcfxs = type { i32 }
define void @Codec_reg_data_latch(%struct.wcfxs* %0, i32 %1) {
%3 = tail call i32 @fx_write_SPI2UART(%struct.wcfxs* %0, i32 %1, i32 22561)
%4 = tail call i32 @fx_write_SPI2UART(%struct.wcfxs* %0, i32 %1, i32 22565)
ret void
}
/* Type definitions */
struct flashrom_flashctx {
  int dummy;
};

/* Variables and functions */
int unlock_regspace2_uniform(struct flashrom_flashctx *, int);
int unlock_regspace2_uniform_32k(struct flashrom_flashctx *flash) {
  return unlock_regspace2_uniform(flash, 32 * 1024);
}


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

x86 assembly (clang, -O2):
<unlock_regspace2_uniform_32k>:
mov    $0x8000,%esi
jmp    1030 <unlock_regspace2_uniform@plt>

LLVM IR (-O0):
%struct.flashrom_flashctx = type { i32 }
define i32 @unlock_regspace2_uniform_32k(%struct.flashrom_flashctx* %0) {
%2 = alloca %struct.flashrom_flashctx*
store %struct.flashrom_flashctx* %0, %struct.flashrom_flashctx** %2
%3 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %2
%4 = call i32 @unlock_regspace2_uniform(%struct.flashrom_flashctx* %3, i32 32768)
ret i32 %4
}

LLVM IR (-O2):
%struct.flashrom_flashctx = type { i32 }
define i32 @unlock_regspace2_uniform_32k(%struct.flashrom_flashctx* %0) {
%2 = tail call i32 @unlock_regspace2_uniform(%struct.flashrom_flashctx* %0, i32 32768)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ localfn();
int /*<<< orphan*/ stubfn();
void bar(int arg) {
  stubfn();
  localfn();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <stubfn@plt>
mov    $0x0,%al
call   1040 <localfn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
xor    %eax,%eax
call   1030 <stubfn@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <localfn@plt>

LLVM IR (-O0):
define void @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @stubfn()
%4 = call i32 (...) @localfn()
ret void
}

LLVM IR (-O2):
define void @bar(i32 %0) {
%2 = tail call i32 (...) @stubfn()
%3 = tail call i32 (...) @localfn()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRA5_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRA5_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRA5_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
int Sub(int a, int b) {
  __asm__ __volatile__("subl %1, %0;" : "=m"(a) : "r"(b), "m"(a));
  return a;
}


x86 assembly (clang, -O0):
<Sub>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sub>:
mov    %edi,-0x4(%rsp)
sub    %esi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @Sub(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
ret i32 %6
}

LLVM IR (-O2):
define i32 @Sub(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
ret i32 %4
}
/* Variables and functions */
bool isInsedeRectangle(double x, double y) {
  bool isInside = (x >= -1 && x <= 5) && (y >= -1 && y <= 1);
  return (isInside ? true : false);
}


x86 assembly (clang, -O0):
<isInsedeRectangle>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
movsd  0xee3(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x15(%rbp)
jb     1177 <isInsedeRectangle+0x77>
xor    %eax,%eax
movsd  0xed4(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
mov    %al,-0x15(%rbp)
jb     1177 <isInsedeRectangle+0x77>
movsd  -0x10(%rbp),%xmm0
xor    %eax,%eax
movsd  0xeaf(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x16(%rbp)
jb     1171 <isInsedeRectangle+0x71>
movsd  0xeaa(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
mov    %al,-0x16(%rbp)
mov    -0x16(%rbp),%al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isInsedeRectangle>:
movsd  0xef8(%rip),%xmm2
ucomisd %xmm2,%xmm0
setae  %al
movsd  0xef1(%rip),%xmm3
ucomisd %xmm0,%xmm3
setae  %cl
and    %al,%cl
ucomisd %xmm2,%xmm1
setae  %al
movsd  0xee1(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %dl
and    %al,%dl
and    %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @isInsedeRectangle(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = fcmp oge double %6, -1.000000e+00
br i1 %7, label %8, label %19
8: ; preds = %2
%9 = load double, double* %3
%10 = fcmp ole double %9, 5.000000e+00
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load double, double* %4
%13 = fcmp oge double %12, -1.000000e+00
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load double, double* %4
%16 = fcmp ole double %15, 1.000000e+00
br label %17
17: ; preds = %14, %11
%18 = phi i1 [ false, %11 ], [ %16, %14 ]
br label %19
19: ; preds = %17, %8, %2
%20 = phi i1 [ false, %8 ], [ false, %2 ], [ %18, %17 ]
%21 = zext i1 %20 to i32
store i32 %21, i32* %5
%22 = load i32, i32* %5
%23 = icmp ne i32 %22, 0
%24 = zext i1 %23 to i64
%25 = select i1 %23, i32 1, i32 0
ret i32 %25
}

LLVM IR (-O2):
define i32 @isInsedeRectangle(double %0, double %1) {
%3 = fcmp oge double %0, -1.000000e+00
%4 = fcmp ole double %0, 5.000000e+00
%5 = and i1 %3, %4
%6 = fcmp oge double %1, -1.000000e+00
%7 = fcmp ole double %1, 1.000000e+00
%8 = and i1 %6, %7
%9 = and i1 %5, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ test_MatrixPinv();
int main() {
  test_MatrixPinv();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_MatrixPinv()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void version(void) {
  fprintf(stderr, "ewfexport version: %s\n", "20060505-1");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xedc(%rip),%rdx
call   1030 <fprintf@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xedf(%rip),%rdx
call   1030 <fprintf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"ewfexport version: %s\0A\00"
@.str.1 = [11 x i8] c"20060505-1\00"
@EXIT_SUCCESS = global i32 0
define void @version() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"ewfexport version: %s\0A\00"
@.str.1 = [11 x i8] c"20060505-1\00"
@EXIT_SUCCESS = global i32 0
define void @version() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}