xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ __hosted_from_gdb_errno(int);
int do_syscall(int, unsigned int, int, int /*<<< orphan*/, int /*<<< orphan*/,
               int *);
int /*<<< orphan*/ errno;
int strlen(char const *);
int unlink(const char *path) {
  int status;
  int error;
  int len = strlen(path) + 1;
  status = do_syscall(9, (unsigned)path, len, 0, 0, &error);
  if (status < 0)
    errno = __hosted_from_gdb_errno(error);
  return status;
}


x86 assembly (clang, -O0):
<unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%esi
mov    -0x14(%rbp),%edx
mov    $0x9,%edi
xor    %r8d,%r8d
lea    -0x10(%rbp),%r9
mov    %r8d,%ecx
call   1040 <do_syscall@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1188 <unlink+0x58>
mov    -0x10(%rbp),%edi
call   1050 <__hosted_from_gdb_errno@plt>
mov    %eax,%ecx
mov    0x2e5a(%rip),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%edx
lea    0xc(%rsp),%r9
mov    $0x9,%edi
mov    %ebx,%esi
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <do_syscall@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    116e <unlink+0x3e>
mov    0xc(%rsp),%edi
call   1050 <__hosted_from_gdb_errno@plt>
mov    0x2e74(%rip),%rcx
mov    %eax,(%rcx)
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @unlink(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 1
store i32 %8, i32* %5
%9 = load i8*, i8** %2
%10 = ptrtoint i8* %9 to i32
%11 = load i32, i32* %5
%12 = call i32 @do_syscall(i32 9, i32 %10, i32 %11, i32 0, i32 0, i32* %4)
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %1
%16 = load i32, i32* %4
%17 = call i32 @__hosted_from_gdb_errno(i32 %16)
store i32 %17, i32* @errno
br label %18
18: ; preds = %15, %1
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @unlink(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = ptrtoint i8* %0 to i64
%7 = trunc i64 %6 to i32
%8 = call i32 @do_syscall(i32 9, i32 %7, i32 %5, i32 0, i32 0, i32* %2)
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call i32 @__hosted_from_gdb_errno(i32 %11)
store i32 %12, i32* @errno
br label %13
13: ; preds = %10, %1
ret i32 %8
}
/* Variables and functions */
char *dirname(char *);
int /*<<< orphan*/ printf(char *, char *);
int _dirname(char *arg) {
  printf("%s\n", dirname(arg));
  return 0;
}


x86 assembly (clang, -O0):
<_dirname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <dirname@plt>
mov    %rax,%rsi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dirname>:
push   %rax
call   1040 <dirname@plt>
lea    0xed3(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @_dirname(i8* %0) {
%2 = tail call i8* @dirname(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int ioctl(int, int, void *);
int iioctl(int fh, int request, void *arg) {
  int r;
  do {
    r = ioctl(fh, request, arg);
  } while (r < 0 && EINTR == errno);
  return r;
}


x86 assembly (clang, -O0):
<iioctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%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 <ioctl@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x15(%rbp)
jge    115d <iioctl+0x4d>
mov    0x2e8e(%rip),%rax
mov    (%rax),%rax
mov    0x2e8c(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1122 <iioctl+0x12>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iioctl>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
mov    0x2eb2(%rip),%r15
mov    0x2eb3(%rip),%r12
nopl   (%rax)
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14,%rdx
call   1030 <ioctl@plt>
test   %eax,%eax
jns    1149 <iioctl+0x39>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <iioctl+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EINTR = global i64 0
@errno = global i64 0
define i32 @iioctl(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = call i32 @ioctl(i32 %9, i32 %10, i8* %11)
store i32 %12, i32* %7
br label %13
13: ; preds = %8
%14 = load i32, i32* %7
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i64, i64* @EINTR
%18 = load i64, i64* @errno
%19 = icmp eq i64 %17, %18
br label %20
20: ; preds = %16, %13
%21 = phi i1 [ false, %13 ], [ %19, %16 ]
br i1 %21, label %8, label %22
22: ; preds = %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
@EINTR = global i64 0
@errno = global i64 0
define i32 @iioctl(i32 %0, i32 %1, i8* %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @ioctl(i32 %0, i32 %1, i8* %2)
%6 = icmp slt i32 %5, 0
%7 = load i64, i64* @EINTR
%8 = load i64, i64* @errno
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xf6() {
  Assert_real((isbdigit(246) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              1235, ("isbdigit should be 0 for 0xf6"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xf6>:
push   %rax
mov    $0xf6,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4d3,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xf6\00"
define void @t_isbdigit_0xf6() {
%1 = call i64 @isbdigit(i32 246)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1235, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xf6\00"
define void @t_isbdigit_0xf6() {
%1 = tail call i64 @isbdigit(i32 246)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1235, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void pre_user() { write("json-task.json", "\t{", NULL); }


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

x86 assembly (clang, -O2):
<pre_user>:
lea    0xee9(%rip),%rdi
lea    0xef1(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [3 x i8] c"\09{\00"
define void @pre_user() {
%1 = call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [3 x i8] c"\09{\00"
define void @pre_user() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
void dummyinput_RomClosed(void) {}


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

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

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

LLVM IR (-O2):
define void @dummyinput_RomClosed() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OAL_OBTAIN_SEMAPHORE();
int /*<<< orphan*/ OAL_RELEASE_SEMAPHORE();
int i2c_bulkread(void *, unsigned char, unsigned short, unsigned char *, int);
int fc8300_i2c_longread(void *handle, unsigned short devid, unsigned short addr,
                        unsigned int *data) {
  int res;
  OAL_OBTAIN_SEMAPHORE();
  res = i2c_bulkread(handle, (unsigned char)(devid >> 8) & 0xff, addr,
                     (unsigned char *)data, 4);
  OAL_RELEASE_SEMAPHORE();
  return res;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dx,%ax
mov    %si,%dx
mov    %rdi,-0x8(%rbp)
mov    %dx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    $0x0,%al
call   1050 <OAL_OBTAIN_SEMAPHORE@plt>
mov    -0x8(%rbp),%rdi
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
movzbl %al,%eax
and    $0xff,%eax
mov    %al,%dl
mov    -0xc(%rbp),%ax
mov    -0x18(%rbp),%rcx
mov    $0x4,%r8d
movzbl %dl,%esi
movzwl %ax,%edx
call   1030 <i2c_bulkread@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1040 <OAL_RELEASE_SEMAPHORE@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%r15d
mov    %esi,%ebx
mov    %rdi,%rbp
xor    %eax,%eax
call   1050 <OAL_OBTAIN_SEMAPHORE@plt>
shr    $0x8,%ebx
mov    %rbp,%rdi
mov    %ebx,%esi
mov    %r15d,%edx
mov    %r14,%rcx
mov    $0x4,%r8d
call   1030 <i2c_bulkread@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <OAL_RELEASE_SEMAPHORE@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fc8300_i2c_longread(i8* %0, i16 zeroext %1, i16 zeroext %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i16
%7 = alloca i16
%8 = alloca i32*
%9 = alloca i32
store i8* %0, i8** %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i32* %3, i32** %8
%10 = call i32 (...) @OAL_OBTAIN_SEMAPHORE()
%11 = load i8*, i8** %5
%12 = load i16, i16* %6
%13 = zext i16 %12 to i32
%14 = ashr i32 %13, 8
%15 = trunc i32 %14 to i8
%16 = zext i8 %15 to i32
%17 = and i32 %16, 255
%18 = trunc i32 %17 to i8
%19 = load i16, i16* %7
%20 = load i32*, i32** %8
%21 = bitcast i32* %20 to i8*
%22 = call i32 @i2c_bulkread(i8* %11, i8 zeroext %18, i16 zeroext %19, i8* %21, i32 4)
store i32 %22, i32* %9
%23 = call i32 (...) @OAL_RELEASE_SEMAPHORE()
%24 = load i32, i32* %9
ret i32 %24
}

LLVM IR (-O2):
define i32 @fc8300_i2c_longread(i8* %0, i16 zeroext %1, i16 zeroext %2, i32* %3) {
%5 = tail call i32 (...) @OAL_OBTAIN_SEMAPHORE()
%6 = lshr i16 %1, 8
%7 = trunc i16 %6 to i8
%8 = bitcast i32* %3 to i8*
%9 = tail call i32 @i2c_bulkread(i8* %0, i8 zeroext %7, i16 zeroext %2, i8* %8, i32 4)
%10 = tail call i32 (...) @OAL_RELEASE_SEMAPHORE()
ret i32 %9
}
A0AX1(r0, r1, x0, x1, p0, p1) unsigned char r0, r1;
unsigned char *p0, *p1;
{
  if ((*((unsigned char *)10000000)) <= (((unsigned char *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<A0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0x989680,%eax
movzbl (%rax),%eax
movslq -0x10(%rbp),%rdx
mov    $0xa98ac7,%ecx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jg     1147 <A0AX1+0x47>
movl   $0x1,-0x4(%rbp)
jmp    114e <A0AX1+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<A0AX1>:
mov    0x989680,%dl
movslq %ecx,%rcx
xor    %eax,%eax
cmp    0xa98ac7(%rcx),%dl
setbe  %al
ret

LLVM IR (-O0):
define i32 @A0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i8, i8* inttoptr (i64 10000000 to i8*)
%17 = zext i8 %16 to i32
%18 = load i32, i32* %11
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* inttoptr (i64 11111111 to i8*), i64 %19
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = icmp sle i32 %17, %22
br i1 %23, label %24, label %25
24: ; preds = %6
store i32 1, i32* %7
br label %26
25: ; preds = %6
store i32 0, i32* %7
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %7
ret i32 %27
}

LLVM IR (-O2):
define i32 @A0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
%7 = load i8, i8* inttoptr (i64 10000000 to i8*)
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i8, i8* inttoptr (i64 11111111 to i8*), i64 %8
%10 = load i8, i8* %9
%11 = icmp ule i8 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
int rl_set_prompt(const char *c) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @rl_set_prompt(i8* nocapture readnone %0) {
ret i32 -1
}
unsigned long PWMGenFaultTriggerGet(unsigned long ulBase, unsigned long ulGen,
                                    unsigned long ulGroup) {
  ;
  ;
  ;
  ;
  if (ulGroup == 0) {
    return ((*((volatile unsigned long *)(((ulBase) + (ulGen)) + 0x00000034))));
  } else {
    return ((*((volatile unsigned long *)(((ulBase) + (ulGen)) + 0x00000038))));
  }
}


x86 assembly (clang, -O0):
<PWMGenFaultTriggerGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1130 <PWMGenFaultTriggerGet+0x30>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    0x34(%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1140 <PWMGenFaultTriggerGet+0x40>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    0x38(%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenFaultTriggerGet>:
xor    %eax,%eax
test   %rdx,%rdx
setne  %al
add    %rsi,%rdi
mov    0x34(%rdi,%rax,4),%rax
ret

LLVM IR (-O0):
define i64 @PWMGenFaultTriggerGet(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%8 = load i64, i64* %7
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %3
%11 = load i64, i64* %5
%12 = load i64, i64* %6
%13 = add i64 %11, %12
%14 = add i64 %13, 52
%15 = inttoptr i64 %14 to i64*
%16 = load volatile i64, i64* %15
store i64 %16, i64* %4
br label %24
17: ; preds = %3
%18 = load i64, i64* %5
%19 = load i64, i64* %6
%20 = add i64 %18, %19
%21 = add i64 %20, 56
%22 = inttoptr i64 %21 to i64*
%23 = load volatile i64, i64* %22
store i64 %23, i64* %4
br label %24
24: ; preds = %17, %10
%25 = load i64, i64* %4
ret i64 %25
}

LLVM IR (-O2):
define i64 @PWMGenFaultTriggerGet(i64 %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
%5 = add i64 %1, %0
%6 = select i1 %4, i64 52, i64 56
%7 = add i64 %5, %6
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
ret i64 %9
}
/* Type definitions */
struct user {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ *get_user(char const *, struct user *);
int user_exists(const char *username, struct user *list_start) {
  return !(get_user(username, list_start) == NULL);
}


x86 assembly (clang, -O0):
<user_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <get_user@plt>
cmp    $0x0,%rax
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.user = type { i32 }
define i32 @user_exists(i8* %0, %struct.user* %1) {
%3 = alloca i8*
%4 = alloca %struct.user*
store i8* %0, i8** %3
store %struct.user* %1, %struct.user** %4
%5 = load i8*, i8** %3
%6 = load %struct.user*, %struct.user** %4
%7 = call i32* @get_user(i8* %5, %struct.user* %6)
%8 = icmp eq i32* %7, null
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.user = type { i32 }
define i32 @user_exists(i8* %0, %struct.user* %1) {
%3 = tail call i32* @get_user(i8* %0, %struct.user* %1)
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}
int buildinfo_custom_src(int i) { return i; }


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

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

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

LLVM IR (-O2):
define i32 @buildinfo_custom_src(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ GetInterval(int *, int *, int *, int);
int /*<<< orphan*/ arithmetic_encode(int, int, int, int /*<<< orphan*/ *);
void AESym(int symbol, int *counters, int totalCount, FILE *oFp) {
  int low, high;
  GetInterval(&low, &high, counters, symbol);
  arithmetic_encode(low, high, totalCount, oFp);
}


x86 assembly (clang, -O0):
<AESym>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x4(%rbp),%ecx
lea    -0x24(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1040 <GetInterval@plt>
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1030 <arithmetic_encode@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AESym>:
push   %rbp
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %edx,%ebp
mov    %rsi,%rdx
mov    %edi,%ecx
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <GetInterval@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
mov    %ebp,%edx
mov    %rbx,%rcx
call   1030 <arithmetic_encode@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @AESym(i32 %0, i32* %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%11 = load i32*, i32** %6
%12 = load i32, i32* %5
%13 = call i32 @GetInterval(i32* %9, i32* %10, i32* %11, i32 %12)
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = load i32, i32* %7
%17 = load i32*, i32** %8
%18 = call i32 @arithmetic_encode(i32 %14, i32 %15, i32 %16, i32* %17)
ret void
}

LLVM IR (-O2):
define void @AESym(i32 %0, i32* %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %5 to i8*
%8 = bitcast i32* %6 to i8*
%9 = call i32 @GetInterval(i32* %5, i32* %6, i32* %1, i32 %0)
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @arithmetic_encode(i32 %10, i32 %11, i32 %2, i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CCF();
int /*<<< orphan*/ T_WAIT_UNTIL(int);
void op_0x3f(void) {
  CCF();
  T_WAIT_UNTIL(4);
  return;
}


x86 assembly (clang, -O0):
<op_0x3f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <CCF@plt>
mov    $0x4,%edi
call   1040 <T_WAIT_UNTIL@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_0x3f>:
push   %rax
xor    %eax,%eax
call   1030 <CCF@plt>
mov    $0x4,%edi
pop    %rax
jmp    1040 <T_WAIT_UNTIL@plt>

LLVM IR (-O0):
define void @op_0x3f() {
%1 = call i32 (...) @CCF()
%2 = call i32 @T_WAIT_UNTIL(i32 4)
ret void
}

LLVM IR (-O2):
define void @op_0x3f() {
%1 = tail call i32 (...) @CCF()
%2 = tail call i32 @T_WAIT_UNTIL(i32 4)
ret void
}
void get_feature_str(char *featurestr) {}


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

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

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

LLVM IR (-O2):
define void @get_feature_str(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check();
int /*<<< orphan*/ init();
int /*<<< orphan*/ vec_mult();
int /*<<< orphan*/ vec_mult_ref();
int main() {
  init();
  vec_mult_ref();
  vec_mult();
  check();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <init@plt>
xor    %eax,%eax
call   1040 <vec_mult_ref@plt>
xor    %eax,%eax
call   1060 <vec_mult@plt>
xor    %eax,%eax
call   1050 <check@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @init()
%3 = call i32 (...) @vec_mult_ref()
%4 = call i32 (...) @vec_mult()
%5 = call i32 (...) @check()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 (...) @vec_mult_ref()
%3 = tail call i32 (...) @vec_mult()
%4 = tail call i32 (...) @check()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ release_arrays();
void nanocalc_addons_release() { release_arrays(); }


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

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

LLVM IR (-O0):
define void @nanocalc_addons_release() {
%1 = call i32 (...) @release_arrays()
ret void
}

LLVM IR (-O2):
define void @nanocalc_addons_release() {
%1 = tail call i32 (...) @release_arrays()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int test_case;
  int T;
  scanf("%d", &T);
  for (test_case = 1; test_case <= T; test_case++) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <scanf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1155 <main+0x45>
jmp    1147 <main+0x37>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x26>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void sqliterkOSFree(void *p) { free(p); }


x86 assembly (clang, -O0):
<sqliterkOSFree>:
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):
<sqliterkOSFree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @sqliterkOSFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ f(unsigned int *, unsigned int *, int);
int main() {
  unsigned int a[] = {1, 10, 100};
  unsigned sum = 1000;
  f(a, &sum, 3);
  if (sum != 1111)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x3e8,-0x14(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x3,%edx
call   1040 <f@plt>
cmpl   $0x457,-0x14(%rbp)
je     1170 <main+0x50>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x8(%rsp)
movl   $0x3e8,0x4(%rsp)
lea    0x8(%rsp),%rdi
lea    0x4(%rsp),%rsi
mov    $0x3,%edx
call   1040 <f@plt>
cmpl   $0x457,0x4(%rsp)
jne    1167 <main+0x47>
xor    %eax,%eax
add    $0x18,%rsp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@__const.main.a = [3 x i32] [i32 1, i32 10, i32 100]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [3 x i32]* %2 to i8*
store i32 1000, i32* %3
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%6 = call i32 @f(i32* %5, i32* %3, i32 3)
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 1111
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [3 x i32] [i32 1, i32 10, i32 100]
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca i32
%3 = bitcast [3 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 1000, i32* %2
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%6 = call i32 @f(i32* %5, i32* %2, i32 3)
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 1111
br i1 %8, label %11, label %9
9: ; preds = %0
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %0
ret i32 0
}
unsigned int hash(const char *p) {
  unsigned int hash = 5381, c;
  while ((c = *p++) != '\0') {
    hash = ((hash << 5) + hash) ^ c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1141 <hash+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <hash+0x38>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <hash+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 33
%11 = xor i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %11, %4 ]
ret i32 %15
}
void SteamAPI_ISteamController_SetOverrideMode(void *self,
                                               const char *pchMode) {
  xlogf("%s(self = %p, pchMode = %s)\n", __func__, self, pchMode);
}


x86 assembly (clang, -O0):
<SteamAPI_ISteamController_SetOverrideMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xed1(%rip),%rdi
lea    0xee7(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_ISteamController_SetOverrideMode>:
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xee3(%rip),%rdi
lea    0xef9(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"%s(self = %p, pchMode = %s)\0A\00"
@__func__.SteamAPI_ISteamController_SetOverrideMode = [42 x i8] c"SteamAPI_ISteamController_SetOverrideMode\00"
define void @SteamAPI_ISteamController_SetOverrideMode(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 (i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @__func__.SteamAPI_ISteamController_SetOverrideMode, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"%s(self = %p, pchMode = %s)\0A\00"
@__func__.SteamAPI_ISteamController_SetOverrideMode = [42 x i8] c"SteamAPI_ISteamController_SetOverrideMode\00"
define void @SteamAPI_ISteamController_SetOverrideMode(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @__func__.SteamAPI_ISteamController_SetOverrideMode, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Type definitions */
struct state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ threads_wait(struct state *);
void state_run(struct state *state) { threads_wait(state); }


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

x86 assembly (clang, -O2):
<state_run>:
jmp    1030 <threads_wait@plt>

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

LLVM IR (-O2):
%struct.state = type { i32 }
define void @state_run(%struct.state* %0) {
%2 = tail call i32 @threads_wait(%struct.state* %0)
ret void
}
int rsock_tcp_optname_to_int(const char *str, long len, int *valp) {
  switch (len) {
  case 4:
    return -1;
  case 5:
    return -1;
  case 6:
    return -1;
  case 7:
    return -1;
  case 8:
    return -1;
  case 9:
    return -1;
  case 10:
    return -1;
  case 11:
    return -1;
  case 12:
    return -1;
  case 13:
    return -1;
  case 16:
    return -1;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<rsock_tcp_optname_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x28(%rbp)
sub    $0xc,%rax
ja     11be <rsock_tcp_optname_to_int+0xbe>
mov    -0x28(%rbp),%rax
lea    0xecf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xffffffff,-0x4(%rbp)
jmp    11c5 <rsock_tcp_optname_to_int+0xc5>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c5 <rsock_tcp_optname_to_int+0xc5>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c5 <rsock_tcp_optname_to_int+0xc5>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c5 <rsock_tcp_optname_to_int+0xc5>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c5 <rsock_tcp_optname_to_int+0xc5>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c5 <rsock_tcp_optname_to_int+0xc5>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c5 <rsock_tcp_optname_to_int+0xc5>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c5 <rsock_tcp_optname_to_int+0xc5>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c5 <rsock_tcp_optname_to_int+0xc5>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c5 <rsock_tcp_optname_to_int+0xc5>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c5 <rsock_tcp_optname_to_int+0xc5>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @rsock_tcp_optname_to_int(i8* nocapture readnone %0, i64 %1, i32* nocapture readnone %2) {
ret i32 -1
}
void foo_2_2_1_1_1_2_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_1_1_2_1_2_2() {
ret void
}
/* Variables and functions */
char *alloc_join_cstr(char const *, char *, char const **, size_t);
char *alloc_join(const char *glue, const char **arr, size_t n) {
  return alloc_join_cstr(glue, "%s", arr, n);
}


x86 assembly (clang, -O0):
<alloc_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xec9(%rip),%rsi
call   1030 <alloc_join_cstr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_join>:
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
jmp    1030 <alloc_join_cstr@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i8* @alloc_join(i8* %0, i8** %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i64
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i8* @alloc_join_cstr(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %8, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i8* @alloc_join(i8* %0, i8** %1, i64 %2) {
%4 = tail call i8* @alloc_join_cstr(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %1, i64 %2)
ret i8* %4
}
int cwx_pg_writer_pack(struct CWX_PG_WRITER *writer) {
  writer = 0;
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.CWX_PG_WRITER = type opaque
define i32 @cwx_pg_writer_pack(%struct.CWX_PG_WRITER* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void cplPrintCmdBegin(int convLT) {
  if (convLT)
    printf("&lt;");
  else
    printf("%c", '<');
}


x86 assembly (clang, -O0):
<cplPrintCmdBegin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1138 <cplPrintCmdBegin+0x28>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    114b <cplPrintCmdBegin+0x3b>
lea    0xec6(%rip),%rdi
mov    $0x3c,%esi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cplPrintCmdBegin>:
test   %edi,%edi
je     1132 <cplPrintCmdBegin+0x12>
lea    0xed5(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
mov    $0x3c,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"&lt;\00"
@.str.1 = [3 x i8] c"%c\00"
define void @cplPrintCmdBegin(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 60)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"&lt;\00"
define void @cplPrintCmdBegin(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @putchar(i32 60)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
double RAND_MAX;
double rand();
double rnd() { return rand() / (RAND_MAX + 1.0); }


x86 assembly (clang, -O0):
<rnd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
movsd  0xedd(%rip),%xmm1
mov    0x2ebe(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xed5(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @rnd() {
%1 = call double (...) @rand()
%2 = load double, double* @RAND_MAX
%3 = fadd double %2, 1.000000e+00
%4 = fdiv double %1, %3
ret double %4
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @rnd() {
%1 = tail call double (...) @rand()
%2 = load double, double* @RAND_MAX
%3 = fadd double %2, 1.000000e+00
%4 = fdiv double %1, %3
ret double %4
}
/* Variables and functions */
int geti();
int /*<<< orphan*/ printf(char *);
int syscall(int, int, int /*<<< orphan*/, int /*<<< orphan*/);
int casanova() {
  int exitValue;
  printf("Enter a new segment (0-7): ");
  exitValue = geti();
  return syscall(20, exitValue, 0, 0);
}


x86 assembly (clang, -O0):
<casanova>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <geti@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x14,%edi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1040 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<casanova>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <geti@plt>
mov    $0x14,%edi
mov    %eax,%esi
xor    %edx,%edx
xor    %ecx,%ecx
pop    %rax
jmp    1040 <syscall@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Enter a new segment (0-7): \00"
define i32 @casanova() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @geti()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @syscall(i32 20, i32 %4, i32 0, i32 0)
ret i32 %5
}

LLVM IR (-O2):
@.str = [28 x i8] c"Enter a new segment (0-7): \00"
define i32 @casanova() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @geti()
%3 = tail call i32 @syscall(i32 20, i32 %2, i32 0, i32 0)
ret i32 %3
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ hz_check_alloc(void *);
int /*<<< orphan*/ hz_check_size(size_t, size_t);
void *hz_calloc(size_t num, size_t size) {
  hz_check_size(num, size);
  if (num == 0) {
    return NULL;
  }
  void *ptr = calloc(num, size);
  hz_check_alloc(ptr);
  return ptr;
}


x86 assembly (clang, -O0):
<hz_calloc>:
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 <hz_check_size@plt>
cmpq   $0x0,-0x10(%rbp)
jne    1165 <hz_calloc+0x35>
movq   $0x0,-0x8(%rbp)
jmp    1187 <hz_calloc+0x57>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <hz_check_alloc@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hz_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <hz_check_size@plt>
test   %rbx,%rbx
je     115c <hz_calloc+0x2c>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <hz_check_alloc@plt>
jmp    115e <hz_calloc+0x2e>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @hz_calloc(i64 %0, i64 %1) {
%3 = tail call i32 @hz_check_size(i64 %0, i64 %1)
%4 = icmp eq i64 %0, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i8* @calloc(i64 %0, i64 %1)
%7 = tail call i32 @hz_check_alloc(i8* %6)
br label %8
8: ; preds = %2, %5
%9 = phi i8* [ %6, %5 ], [ null, %2 ]
ret i8* %9
}
/* Variables and functions */
scalar_t__ printf(char *);
int main(void) {
  if (printf("hello world")) {
  }
}


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>
cmp    $0x0,%rax
je     113a <main+0x2a>
jmp    113a <main+0x2a>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
br label %5
5: ; preds = %4, %0
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = tail call i64 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
double getBW_matchg32() {
  double intercept = 196.82;
  return intercept;
}


x86 assembly (clang, -O0):
<getBW_matchg32>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBW_matchg32>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @getBW_matchg32() {
%1 = alloca double
store double 1.968200e+02, double* %1
%2 = load double, double* %1
ret double %2
}

LLVM IR (-O2):
define double @getBW_matchg32() {
ret double 1.968200e+02
}