xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strrchr(char const *, char);
char *skippathname(char const *name) {
  char const *p;
  p = strrchr(name, '/');
  return (char *)(p ? p + 1 : name);
}


x86 assembly (clang, -O0):
<skippathname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <skippathname+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <skippathname+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skippathname>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skippathname(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @skippathname(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
void swap(int *array, int index1, int index2) {
  int temp = 0;
  temp = *(array + index1);
  array[index1] = array[index2];
  array[index2] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(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
store i32 0, i32* %7
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t xora64(void *ptr, size_t size64) {
  uint64_t result;
  asm volatile("cld;\n"
               "mov %1, %%rsi;\n"
               "mov %2, %%rcx;\n"
               "xor %%rdx, %%rdx\n"
               "1: lodsq;\n"
               "xor %%rax, %%rdx;\n"
               "loop 1b;\n"
               "mov %%rdx, %0;\n"
               : "=g"(result)
               : "g"(ptr), "g"(size64)
               : "rax", "rcx", "rdx", "rsi");
  return result;
}


x86 assembly (clang, -O0):
<xora64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,-0x20(%rbp)
mov    %rax,-0x28(%rbp)
cld
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rcx
xor    %rdx,%rdx
lods   %ds:(%rsi),%rax
xor    %rax,%rdx
loop   1128 <xora64+0x28>
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xora64>:
mov    %rdi,-0x10(%rsp)
mov    %rsi,-0x18(%rsp)
cld
mov    -0x10(%rsp),%rsi
mov    -0x18(%rsp),%rcx
xor    %rdx,%rdx
lods   %ds:(%rsi),%rax
xor    %rax,%rdx
loop   1118 <xora64+0x18>
mov    %rdx,-0x8(%rsp)
mov    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i8* @xora64(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = load i8*, i8** %5
ret i8* %8
}

LLVM IR (-O2):
define i8* @xora64(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = load i8*, i8** %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ cls();
int /*<<< orphan*/ kprintf(char *);
void init(void) {
  cls();
  kprintf("BADGER OS 0.1 Booting...");
  int terminate = 0;
  while (terminate == 0) {
    terminate = 1;
  }
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <cls@plt>
lea    0xeca(%rip),%rdi
call   1040 <kprintf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1158 <init+0x38>
movl   $0x1,-0x4(%rbp)
jmp    1142 <init+0x22>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"BADGER OS 0.1 Booting...\00"
define void @init() {
%1 = alloca i32
%2 = call i32 (...) @cls()
%3 = call i32 @kprintf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %4
store i32 1, i32* %1
br label %4
8: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"BADGER OS 0.1 Booting...\00"
define void @init() {
%1 = tail call i32 (...) @cls()
%2 = tail call i32 @kprintf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doStuff_variadic(int *, int *);
void f_variadic_unp_unp(void) {
  int t;
  int u;
  int *vp = &u;
  int *tp = &t;
  doStuff_variadic(tp, vp);
}


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

x86 assembly (clang, -O2):
<f_variadic_unp_unp>:
push   %rax
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <doStuff_variadic@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @f_variadic_unp_unp() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @doStuff_variadic(i32* %1, i32* %2)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void USBHostPwrFaultDisable(uint32_t ui32Base) {
  ;
  (*((volatile unsigned short *)(ui32Base + 0x00000400))) &= ~0x00000010;
}


x86 assembly (clang, -O0):
<USBHostPwrFaultDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x400(%rax),%cx
movzwl %cx,%ecx
and    $0xffffffef,%ecx
mov    %cx,0x400(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostPwrFaultDisable>:
andw   $0xffef,0x400(%rdi)
ef
ret

LLVM IR (-O0):
define void @USBHostPwrFaultDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 1024
%5 = inttoptr i64 %4 to i16*
%6 = load volatile i16, i16* %5
%7 = zext i16 %6 to i32
%8 = and i32 %7, -17
%9 = trunc i32 %8 to i16
store volatile i16 %9, i16* %5
ret void
}

LLVM IR (-O2):
define void @USBHostPwrFaultDisable(i64 %0) {
%2 = add nsw i64 %0, 1024
%3 = inttoptr i64 %2 to i16*
%4 = load volatile i16, i16* %3
%5 = and i16 %4, -17
store volatile i16 %5, i16* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int __ms_vfscanf(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int __ms_vscanf(const char *__restrict__ format, va_list arg) {
  return __ms_vfscanf(stdin, format, arg);
}


x86 assembly (clang, -O0):
<__ms_vscanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <__ms_vfscanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ms_vscanf>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ecc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <__ms_vfscanf@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @__ms_vscanf(i8* noalias %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdin
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @__ms_vfscanf(i32 %5, i8* %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @__ms_vscanf(i8* noalias %0, i32 %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @__ms_vfscanf(i32 %3, i8* %0, i32 %1)
ret i32 %4
}
void CatchAlarm(int ignored) {}


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

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

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

LLVM IR (-O2):
define void @CatchAlarm(i32 %0) {
ret void
}
int get_sta_assoc_secmode(radio) { return nvram_get_sta_secmode(radio); }


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

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

LLVM IR (-O0):
define i32 @get_sta_assoc_secmode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @nvram_get_sta_secmode to i32 (i32, ...)*)(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @get_sta_assoc_secmode(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @nvram_get_sta_secmode to i32 (i32, ...)*)(i32 %0)
ret i32 %2
}
/* Variables and functions */
size_t errno;
int /*<<< orphan*/ xstrcat(char **, char *);
void xstrerrorcat(char **buf) {
  extern char *sys_errlist[];
  char *err = sys_errlist[errno];
  xstrcat(buf, err);
}


x86 assembly (clang, -O0):
<xstrerrorcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%rcx
mov    0x2ecb(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <xstrcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrerrorcat>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%rax
mov    0x2ed7(%rip),%rcx
mov    (%rcx,%rax,8),%rsi
jmp    1030 <xstrcat@plt>

LLVM IR (-O0):
@sys_errlist = external global [0 x i8*]
@errno = global i64 0
define void @xstrerrorcat(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
store i8** %0, i8*** %2
%4 = load i64, i64* @errno
%5 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sys_errlist, i64 0, i64 %4
%6 = load i8*, i8** %5
store i8* %6, i8** %3
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %3
%9 = call i32 @xstrcat(i8** %7, i8* %8)
ret void
}

LLVM IR (-O2):
@sys_errlist = external global [0 x i8*]
@errno = global i64 0
define void @xstrerrorcat(i8** %0) {
%2 = load i64, i64* @errno
%3 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sys_errlist, i64 0, i64 %2
%4 = load i8*, i8** %3
%5 = tail call i32 @xstrcat(i8** %0, i8* %4)
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int tvtohz(struct timeval *);
int msecs_to_jiffies(int msec) {
  struct timeval tv;
  tv.tv_sec = msec / 1000;
  tv.tv_usec = (msec % 1000) * 1000;
  return (tvtohz(&tv) - 1);
}


x86 assembly (clang, -O0):
<msecs_to_jiffies>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0x3e8,%edx,%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <tvtohz@plt>
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msecs_to_jiffies>:
push   %rax
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
mov    %ecx,(%rsp)
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
imul   $0x3e8,%eax,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
call   1030 <tvtohz@plt>
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @msecs_to_jiffies(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timeval
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %2
%8 = srem i32 %7, 1000
%9 = mul nsw i32 %8, 1000
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
store i32 %9, i32* %10
%11 = call i32 @tvtohz(%struct.timeval* %3)
%12 = sub nsw i32 %11, 1
ret i32 %12
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @msecs_to_jiffies(i32 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = sdiv i32 %0, 1000
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = srem i32 %0, 1000
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i32 @tvtohz(%struct.timeval* %2)
%10 = add nsw i32 %9, -1
ret i32 %10
}
void av_dynarray_add() {}


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

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

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

LLVM IR (-O2):
define void @av_dynarray_add() {
ret void
}
/* Variables and functions */
int edit_istep(void *, int, int);
int edit_inext(void *h, int n) { return (edit_istep(h, n, +1)); }


x86 assembly (clang, -O0):
<edit_inext>:
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    $0x1,%edx
call   1030 <edit_istep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<edit_inext>:
mov    $0x1,%edx
jmp    1030 <edit_istep@plt>

LLVM IR (-O0):
define i32 @edit_inext(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 @edit_istep(i8* %5, i32 %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @edit_inext(i8* %0, i32 %1) {
%3 = tail call i32 @edit_istep(i8* %0, i32 %1, i32 1)
ret i32 %3
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_message_verify_type(void *m, char type, const char *contents) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_message_verify_type>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
mov    0x2ec5(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_message_verify_type>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_message_verify_type(i8* %0, i8 signext %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8*
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8* %2, i8** %6
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_verify_type(i8* nocapture readnone %0, i8 signext %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_list() { printf("hi list...\n"); }


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"hi list...\00"
define void @show_list() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int x;
  x = 1;
  while (x) {
    printf("x is 1\n");
    x = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     114f <main+0x3f>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%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 = [8 x i8] c"x is 1\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
br label %7
7: ; preds = %10, %2
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %6
br label %7
12: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@str = [7 x i8] c"x is 1\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_size;
};
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
scalar_t__ stat(char const *, struct stat *);
int /*<<< orphan*/ stderr;
off_t misc_device_size(const char *device) {
  struct stat st;
  if (stat(device, &st) == 0)
    return st.st_size;
  fprintf(stderr, "Stat of the device '%s' failed.", device);
  exit(8);
}


x86 assembly (clang, -O0):
<misc_device_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jne    115c <misc_device_size+0x2c>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe90(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x8,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<misc_device_size>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
call   1040 <stat@plt>
test   %rax,%rax
jne    1151 <misc_device_size+0x21>
mov    0x8(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    0xe9f(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x8,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [32 x i8] c"Stat of the device '%s' failed.\00"
define i32 @misc_device_size(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%9 = load i32, i32* %8
ret i32 %9
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %2
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 8)
unreachable
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [32 x i8] c"Stat of the device '%s' failed.\00"
define i32 @misc_device_size(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
ret i32 %8
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0)
%12 = call i32 @exit(i32 8)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x36() {
  Assert_real((isprint(54)),
              "/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_isprint.c",
              275, ("isprint should be 1 for 6"));
}


x86 assembly (clang, -O0):
<t_isprint_0x36>:
push   %rbp
mov    %rsp,%rbp
mov    $0x36,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x113,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x36>:
push   %rax
mov    $0x36,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x113,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for 6\00"
define void @t_isprint_0x36() {
%1 = call i32 @isprint(i32 54)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 275, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for 6\00"
define void @t_isprint_0x36() {
%1 = tail call i32 @isprint(i32 54)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 275, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int RAND_MAX;
int rand();
int irand(int xr, int ya) {
  int zu = ya - xr + 1;
  return xr + zu * rand() / (RAND_MAX + 1);
}


x86 assembly (clang, -O0):
<irand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   %ecx,%eax
mov    0x2e9c(%rip),%rcx
mov    (%rcx),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irand>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
sub    %edi,%esi
lea    0x1(%rsi),%ebp
xor    %eax,%eax
call   1030 <rand@plt>
imul   %ebp,%eax
mov    0x2ebd(%rip),%rcx
mov    (%rcx),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @irand(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = call i32 (...) @rand()
%13 = mul nsw i32 %11, %12
%14 = load i32, i32* @RAND_MAX
%15 = add nsw i32 %14, 1
%16 = sdiv i32 %13, %15
%17 = add nsw i32 %10, %16
ret i32 %17
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @irand(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = tail call i32 (...) @rand()
%6 = mul nsw i32 %5, %4
%7 = load i32, i32* @RAND_MAX
%8 = add nsw i32 %7, 1
%9 = sdiv i32 %6, %8
%10 = add nsw i32 %9, %0
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int main() {
  print("Hello, World!\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 <print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @print(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, World!\0A\00"
define i32 @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int main(void) {
  float a = 2.5;
  float b = 2.5;
  __VERIFIER_assert(a != b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xecc(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 2.500000e+00, float* %2
store float 2.500000e+00, float* %3
%4 = load float, float* %2
%5 = load float, float* %3
%6 = fcmp une float %4, %5
%7 = zext i1 %6 to i32
%8 = call i32 @__VERIFIER_assert(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__VERIFIER_assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ds_str_destroy(void *);
void ds_str_destructor(void *str) { ds_str_destroy(str); }


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

x86 assembly (clang, -O2):
<ds_str_destructor>:
jmp    1030 <ds_str_destroy@plt>

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

LLVM IR (-O2):
define void @ds_str_destructor(i8* %0) {
%2 = tail call i32 @ds_str_destroy(i8* %0)
ret void
}
unsigned int test_12(unsigned int a, int b) { return (a << 3) | (b & 1); }


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

x86 assembly (clang, -O2):
<test_12>:
and    $0x1,%esi
lea    (%rsi,%rdi,8),%eax
ret

LLVM IR (-O0):
define i32 @test_12(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 = shl i32 %5, 3
%7 = load i32, i32* %4
%8 = and i32 %7, 1
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_12(i32 %0, i32 %1) {
%3 = shl i32 %0, 3
%4 = and i32 %1, 1
%5 = or i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ add_Byte(void *, int, int);
int /*<<< orphan*/ keccakP400NRounds(void *, int);
void Ketje_stride(void *state, int size, unsigned char padding) {
  add_Byte(state, padding, size);
  add_Byte(state, 0x08, 4);
  keccakP400NRounds(state, 6);
}


x86 assembly (clang, -O0):
<Ketje_stride>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0xd(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <add_Byte@plt>
mov    -0x8(%rbp),%rdi
mov    $0x8,%esi
mov    $0x4,%edx
call   1040 <add_Byte@plt>
mov    -0x8(%rbp),%rdi
mov    $0x6,%esi
call   1030 <keccakP400NRounds@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ketje_stride>:
push   %rbx
mov    %esi,%eax
mov    %rdi,%rbx
mov    %edx,%esi
mov    %eax,%edx
call   1040 <add_Byte@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x4,%edx
call   1040 <add_Byte@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
pop    %rbx
jmp    1030 <keccakP400NRounds@plt>

LLVM IR (-O0):
define void @Ketje_stride(i8* %0, i32 %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i8*, i8** %4
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = load i32, i32* %5
%11 = call i32 @add_Byte(i8* %7, i32 %9, i32 %10)
%12 = load i8*, i8** %4
%13 = call i32 @add_Byte(i8* %12, i32 8, i32 4)
%14 = load i8*, i8** %4
%15 = call i32 @keccakP400NRounds(i8* %14, i32 6)
ret void
}

LLVM IR (-O2):
define void @Ketje_stride(i8* %0, i32 %1, i8 zeroext %2) {
%4 = zext i8 %2 to i32
%5 = tail call i32 @add_Byte(i8* %0, i32 %4, i32 %1)
%6 = tail call i32 @add_Byte(i8* %0, i32 8, i32 4)
%7 = tail call i32 @keccakP400NRounds(i8* %0, i32 6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CloseDisplay();
int /*<<< orphan*/ ReleaseKeyHandler();
long GPUclose() {
  ReleaseKeyHandler();
  CloseDisplay();
  return 0;
}


x86 assembly (clang, -O0):
<GPUclose>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ReleaseKeyHandler@plt>
mov    $0x0,%al
call   1030 <CloseDisplay@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPUclose>:
push   %rax
xor    %eax,%eax
call   1040 <ReleaseKeyHandler@plt>
xor    %eax,%eax
call   1030 <CloseDisplay@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @GPUclose() {
%1 = call i32 (...) @ReleaseKeyHandler()
%2 = call i32 (...) @CloseDisplay()
ret i64 0
}

LLVM IR (-O2):
define i64 @GPUclose() {
%1 = tail call i32 (...) @ReleaseKeyHandler()
%2 = tail call i32 (...) @CloseDisplay()
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ cprintf(char *);
int /*<<< orphan*/ textattr(int);
void about() {
  textattr(0x0A);
  cprintf("\n\rAbout QFSemu\n\r");
  textattr(0x0F);
  cprintf("\n\rQFSemu v1.00\n\rQuick File System emulator\n\r");
  cprintf("\n\r(c) Copyright 2005, vbmacher");
}


x86 assembly (clang, -O0):
<about>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <textattr@plt>
lea    0xecb(%rip),%rdi
call   1040 <cprintf@plt>
mov    $0xf,%edi
call   1030 <textattr@plt>
lea    0xec6(%rip),%rdi
call   1040 <cprintf@plt>
lea    0xee7(%rip),%rdi
call   1040 <cprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<about>:
push   %rax
mov    $0xa,%edi
call   1030 <textattr@plt>
lea    0xece(%rip),%rdi
call   1040 <cprintf@plt>
mov    $0xf,%edi
call   1030 <textattr@plt>
lea    0xec9(%rip),%rdi
call   1040 <cprintf@plt>
lea    0xeea(%rip),%rdi
pop    %rax
jmp    1040 <cprintf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"\0A\0DAbout QFSemu\0A\0D\00"
@.str.1 = [45 x i8] c"\0A\0DQFSemu v1.00\0A\0DQuick File System emulator\0A\0D\00"
@.str.2 = [31 x i8] c"\0A\0D(c) Copyright 2005, vbmacher\00"
define void @about() {
%1 = call i32 @textattr(i32 10)
%2 = call i32 @cprintf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @textattr(i32 15)
%4 = call i32 @cprintf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @cprintf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"\0A\0DAbout QFSemu\0A\0D\00"
@.str.1 = [45 x i8] c"\0A\0DQFSemu v1.00\0A\0DQuick File System emulator\0A\0D\00"
@.str.2 = [31 x i8] c"\0A\0D(c) Copyright 2005, vbmacher\00"
define void @about() {
%1 = tail call i32 @textattr(i32 10)
%2 = tail call i32 @cprintf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @textattr(i32 15)
%4 = tail call i32 @cprintf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @cprintf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
struct pollfd {
  int dummy;
};
typedef int /*<<< orphan*/ nfds_t;

/* Variables and functions */
int poll(struct pollfd *, int /*<<< orphan*/, int);
int polldev(struct pollfd fds[], nfds_t nfds, int timeout) {
  return poll(fds, nfds, timeout);
}


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

x86 assembly (clang, -O2):
<polldev>:
jmp    1030 <poll@plt>

LLVM IR (-O0):
%struct.pollfd = type { i32 }
define i32 @polldev(%struct.pollfd* %0, i32 %1, i32 %2) {
%4 = alloca %struct.pollfd*
%5 = alloca i32
%6 = alloca i32
store %struct.pollfd* %0, %struct.pollfd** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.pollfd*, %struct.pollfd** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @poll(%struct.pollfd* %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.pollfd = type { i32 }
define i32 @polldev(%struct.pollfd* %0, i32 %1, i32 %2) {
%4 = tail call i32 @poll(%struct.pollfd* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int timesync_timespec(struct timespec *);
int timesync(void) {
  struct timespec now;
  clock_gettime(CLOCK_REALTIME, &now);
  return timesync_timespec(&now);
}


x86 assembly (clang, -O0):
<timesync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
lea    -0x8(%rbp),%rdi
call   1040 <timesync_timespec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timesync>:
push   %rbx
sub    $0x10,%rsp
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
call   1030 <clock_gettime@plt>
mov    %rbx,%rdi
call   1040 <timesync_timespec@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @timesync() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = call i32 @timesync_timespec(%struct.timespec* %1)
ret i32 %4
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @timesync() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = call i32 @timesync_timespec(%struct.timespec* %1)
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
scalar_t__ listxattr(char const *, char *, size_t);
ssize_t xlistxattr(const char *path, char *list, size_t size) {
  ssize_t ret = listxattr(path, list, size);
  if (ret < 0)
    err(1, "listxattr() failed");
  return ret;
}


x86 assembly (clang, -O0):
<xlistxattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <listxattr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jge    1165 <xlistxattr+0x45>
mov    $0x1,%edi
lea    0xea0(%rip),%rsi
call   1040 <err@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xlistxattr>:
push   %rbx
call   1030 <listxattr@plt>
mov    %rax,%rbx
test   %rax,%rax
jns    113f <xlistxattr+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1040 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"listxattr() failed\00"
define i64 @xlistxattr(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @listxattr(i8* %0, i8* %1, i64 %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ callmealias();
c() { callmealias(); }


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

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

LLVM IR (-O0):
define i32 @c() {
%1 = alloca i32
%2 = call i32 (...) @callmealias()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @c() {
%1 = tail call i32 (...) @callmealias()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
long main() { printf("%d\n", 5); }


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

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x5,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i64 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
ret i64 undef
}
int t(int x) {
  if (x == 0)
    return 1;
  else
    return x + t(x - 1);
}


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <t+0x21>
movl   $0x1,-0x4(%rbp)
jmp    114c <t+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <t@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
test   %edi,%edi
je     111c <t+0x1c>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
imul   %eax,%eax
shr    %rcx
add    %edi,%eax
sub    %ecx,%eax
add    $0x1,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @t(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = mul i32 %4, %4
%6 = zext i32 %4 to i33
%7 = add i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %0
%13 = sub i32 %12, %11
%14 = add i32 %13, 1
br label %15
15: ; preds = %3, %1
%16 = phi i32 [ 1, %1 ], [ %14, %3 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
void gen_mult(void) {
  gen_pop();
  gen_call("__mul");
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"__mul\00"
define void @gen_mult() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ umfpack_dl_numeric(long *, long *, double *, void *, void **,
                                      double *, double *);
void umf4num_(long Ap[], long Ai[], double Ax[], void **Symbolic,
              void **Numeric, double Control[20], double Info[90]) {
  (void)umfpack_dl_numeric(Ap, Ai, Ax, *Symbolic, Numeric, Control, Info);
}


x86 assembly (clang, -O0):
<umf4num_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <umfpack_dl_numeric@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umf4num_>:
mov    (%rcx),%rcx
jmp    1030 <umfpack_dl_numeric@plt>

LLVM IR (-O0):
define void @umf4num_(i64* %0, i64* %1, double* %2, i8** %3, i8** %4, double* %5, double* %6) {
%8 = alloca i64*
%9 = alloca i64*
%10 = alloca double*
%11 = alloca i8**
%12 = alloca i8**
%13 = alloca double*
%14 = alloca double*
store i64* %0, i64** %8
store i64* %1, i64** %9
store double* %2, double** %10
store i8** %3, i8*** %11
store i8** %4, i8*** %12
store double* %5, double** %13
store double* %6, double** %14
%15 = load i64*, i64** %8
%16 = load i64*, i64** %9
%17 = load double*, double** %10
%18 = load i8**, i8*** %11
%19 = load i8*, i8** %18
%20 = load i8**, i8*** %12
%21 = load double*, double** %13
%22 = load double*, double** %14
%23 = call i32 @umfpack_dl_numeric(i64* %15, i64* %16, double* %17, i8* %19, i8** %20, double* %21, double* %22)
ret void
}

LLVM IR (-O2):
define void @umf4num_(i64* %0, i64* %1, double* %2, i8** nocapture %3, i8** %4, double* %5, double* %6) {
%8 = load i8*, i8** %3
%9 = tail call i32 @umfpack_dl_numeric(i64* %0, i64* %1, double* %2, i8* %8, i8** %4, double* %5, double* %6)
ret void
}
/* Variables and functions */
int gnt_net_connect(char *, float);
int gntc_connect(char *url, float timeout) {
  int sfd = gnt_net_connect(url, timeout);
  if (sfd < 0) {
    return -2;
  }
  return -1;
}


x86 assembly (clang, -O0):
<gntc_connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
movss  -0x14(%rbp),%xmm0
call   1030 <gnt_net_connect@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1148 <gntc_connect+0x38>
movl   $0xfffffffe,-0x4(%rbp)
jmp    114f <gntc_connect+0x3f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gntc_connect>:
push   %rax
call   1030 <gnt_net_connect@plt>
xor    %ecx,%ecx
test   %eax,%eax
setns  %cl
or     $0xfffffffe,%ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @gntc_connect(i8* %0, float %1) {
%3 = tail call i32 @gnt_net_connect(i8* %0, float %1)
%4 = icmp sgt i32 %3, -1
%5 = select i1 %4, i32 -1, i32 -2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int var1 = 69;
  printf("Character of ASCII value 69 is %c\n", var1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x45,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%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
mov    $0x45,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Character of ASCII value 69 is %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 69, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"Character of ASCII value 69 is %c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 69)
ret i32 0
}