xunge/DecIR huggingface dataset:
/* Variables and functions */
int dcloadsyscall(int, char const *, int);
int open(const char *path, int flags) {
  if (*(unsigned int *)0x8c004004 == 0xdeadbeef)
    return dcloadsyscall(2, path, flags);
  else
    return -1;
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    $0x8c004004,%eax
cmpl   $0xdeadbeef,(%rax)
jne    1149 <open+0x39>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x2,%edi
call   1030 <dcloadsyscall@plt>
mov    %eax,-0x4(%rbp)
jmp    1150 <open+0x40>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open>:
mov    $0x8c004004,%eax
cmpl   $0xdeadbeef,(%rax)
jne    112c <open+0x1c>
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x2,%edi
jmp    1030 <dcloadsyscall@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @open(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* inttoptr (i64 2348826628 to i32*)
%7 = icmp eq i32 %6, -559038737
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i32 @dcloadsyscall(i32 2, i8* %9, i32 %10)
store i32 %11, i32* %3
br label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %13
13: ; preds = %12, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @open(i8* %0, i32 %1) {
%3 = load i32, i32* inttoptr (i64 2348826628 to i32*)
%4 = icmp eq i32 %3, -559038737
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @dcloadsyscall(i32 2, i8* %0, i32 %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %8
}
void kasan_kfree_large(const void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @kasan_kfree_large(i8* nocapture %0) {
ret void
}
int isxdigit(int c) {
  if ((c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f') ||
      (c >= '0' && c <= '9')) {
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     111b <isxdigit+0x1b>
cmpl   $0x46,-0x8(%rbp)
jle    1143 <isxdigit+0x43>
cmpl   $0x61,-0x8(%rbp)
jl     112f <isxdigit+0x2f>
cmpl   $0x66,-0x8(%rbp)
jle    1143 <isxdigit+0x43>
cmpl   $0x30,-0x8(%rbp)
jl     114f <isxdigit+0x4f>
cmpl   $0x39,-0x8(%rbp)
jg     114f <isxdigit+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <isxdigit+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
mov    %edi,%eax
and    $0xffffffdf,%eax
add    $0xffffffbf,%eax
cmp    $0x6,%eax
setb   %al
add    $0xffffffd0,%edi
cmp    $0xa,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 70
br i1 %8, label %21, label %9
9: ; preds = %6, %1
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, 97
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp sle i32 %13, 102
br i1 %14, label %21, label %15
15: ; preds = %12, %9
%16 = load i32, i32* %3
%17 = icmp sge i32 %16, 48
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = icmp sle i32 %19, 57
br i1 %20, label %21, label %22
21: ; preds = %18, %12, %6
store i32 1, i32* %2
br label %23
22: ; preds = %18, %15
store i32 0, i32* %2
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 6
%5 = add i32 %0, -48
%6 = icmp ult i32 %5, 10
%7 = or i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
scalar_t__ bar(int, int /*<<< orphan*/);
scalar_t__ foo(int, int);
int main(void) {
  int i;
  if (foo(5, 5) && bar(5, 0))
    return 0;
  for (i = 0; i < 500; i++)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%esi
mov    %esi,%edi
call   1040 <foo@plt>
cmp    $0x0,%rax
je     1167 <main+0x47>
mov    $0x5,%edi
xor    %esi,%esi
call   1030 <bar@plt>
cmp    $0x0,%rax
je     1167 <main+0x47>
movl   $0x0,-0x4(%rbp)
jmp    1195 <main+0x75>
movl   $0x0,-0x8(%rbp)
cmpl   $0x1f4,-0x8(%rbp)
jge    118e <main+0x6e>
jmp    1180 <main+0x60>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    116e <main+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x5,%esi
call   1040 <foo@plt>
test   %rax,%rax
je     1141 <main+0x21>
mov    $0x5,%edi
xor    %esi,%esi
call   1030 <bar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @foo(i32 5, i32 5)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i64 @bar(i32 5, i32 0)
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dprintf(int, char *);
void http_end_headers(int fd) { dprintf(fd, "\r\n"); }


x86 assembly (clang, -O0):
<http_end_headers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
call   1030 <dprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_end_headers>:
lea    0xee9(%rip),%rsi
jmp    1030 <dprintf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define void @http_end_headers(i32 %0) {
%2 = tail call i32 @dprintf(i32 %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int u8isdigiti(int /*<<< orphan*/);
int /*<<< orphan*/ u8tointcc(char const *);
int u8isdigitcc(const char *c) { return u8isdigiti(u8tointcc(c)); }


x86 assembly (clang, -O0):
<u8isdigitcc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <u8tointcc@plt>
mov    %eax,%edi
call   1040 <u8isdigiti@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8isdigitcc>:
push   %rax
call   1030 <u8tointcc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <u8isdigiti@plt>

LLVM IR (-O0):
define i32 @u8isdigitcc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @u8tointcc(i8* %3)
%5 = call i32 @u8isdigiti(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @u8isdigitcc(i8* %0) {
%2 = tail call i32 @u8tointcc(i8* %0)
%3 = tail call i32 @u8isdigiti(i32 %2)
ret i32 %3
}
/* Variables and functions */
int __argmatch_internal(char const *, char const *const *, char const *, size_t,
                        int);
int argmatch(const char *arg, const char *const *arglist, const char *vallist,
             size_t valsize) {
  return __argmatch_internal(arg, arglist, vallist, valsize, 1);
}


x86 assembly (clang, -O0):
<argmatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1,%r8d
call   1030 <__argmatch_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argmatch>:
mov    $0x1,%r8d
jmp    1030 <__argmatch_internal@plt>

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

LLVM IR (-O2):
define i32 @argmatch(i8* %0, i8** %1, i8* %2, i64 %3) {
%5 = tail call i32 @__argmatch_internal(i8* %0, i8** %1, i8* %2, i64 %3, i32 1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned long);
char *ERR_error_string(unsigned long e, char *buf) {
  static char staticbuf[120];
  if (buf == NULL) {
    buf = staticbuf;
  }
  snprintf(buf, 120, "error:%lu:netssl:[unknown function]:[unknown error]", e);
  return buf;
}


x86 assembly (clang, -O0):
<ERR_error_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1136 <ERR_error_string+0x26>
lea    0x2f0e(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x78,%esi
lea    0xeb6(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ERR_error_string>:
push   %rbx
mov    %rdi,%rcx
test   %rsi,%rsi
lea    0x2f22(%rip),%rbx
cmovne %rsi,%rbx
lea    0xed7(%rip),%rdx
mov    %rbx,%rdi
mov    $0x78,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ERR_error_string.staticbuf = internal global [120 x i8] zeroinitializer
@.str = [52 x i8] c"error:%lu:netssl:[unknown function]:[unknown error]\00"
define i8* @ERR_error_string(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %2
store i8* getelementptr inbounds ([120 x i8], [120 x i8]* @ERR_error_string.staticbuf, i64 0, i64 0), i8** %4
br label %8
8: ; preds = %7, %2
%9 = load i8*, i8** %4
%10 = load i64, i64* %3
%11 = call i32 @snprintf(i8* %9, i32 120, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = load i8*, i8** %4
ret i8* %12
}

LLVM IR (-O2):
@ERR_error_string.staticbuf = internal global [120 x i8] zeroinitializer
@.str = [52 x i8] c"error:%lu:netssl:[unknown function]:[unknown error]\00"
define i8* @ERR_error_string(i64 %0, i8* %1) {
%3 = icmp eq i8* %1, null
%4 = select i1 %3, i8* getelementptr inbounds ([120 x i8], [120 x i8]* @ERR_error_string.staticbuf, i64 0, i64 0), i8* %1
%5 = tail call i32 @snprintf(i8* %4, i32 120, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __sched_yield(void) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__sched_yield>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sched_yield>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__sched_yield() {
%1 = load i32, i32* @ENOSYS
%2 = call i32 @__set_errno(i32 %1)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__sched_yield() {
%1 = load i32, i32* @ENOSYS
%2 = tail call i32 @__set_errno(i32 %1)
ret i32 -1
}
char __attribute__((visibility("default"))) func_c(void) { return 'c'; }


x86 assembly (clang, -O0):
<func_c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x63,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_c>:
mov    $0x63,%al
ret

LLVM IR (-O0):
define signext i8 @func_c() {
ret i8 99
}

LLVM IR (-O2):
define signext i8 @func_c() {
ret i8 99
}
/* Variables and functions */
int /*<<< orphan*/ terminal_writestring(char const *);
int printf(const char *format, ...) {
  terminal_writestring(format);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @printf(i8* %0, ...) {
%2 = tail call i32 @terminal_writestring(i8* %0)
ret i32 0
}
extern void _Z22__run_user_rf_pre_initv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @_Z22__run_user_rf_pre_initv() {
ret void
}
void PWMIntDisable(unsigned long ulBase, unsigned long ulGenFault) {
  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000014))) &= ~(ulGenFault);
}


x86 assembly (clang, -O0):
<PWMIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMIntDisable>:
not    %rsi
and    %rsi,0x14(%rdi)
ret

LLVM IR (-O0):
define void @PWMIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = xor i64 %5, -1
%7 = load i64, i64* %3
%8 = add i64 %7, 20
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @PWMIntDisable(i64 %0, i64 %1) {
%3 = xor i64 %1, -1
%4 = add i64 %0, 20
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, %3
store volatile i64 %7, i64* %5
ret void
}
/* Type definitions */
struct yaffs_dev {
  int dummy;
};

/* Variables and functions */
int yaffs_mount_common(struct yaffs_dev *, int /*<<< orphan*/,
                       int /*<<< orphan*/, int /*<<< orphan*/);
int yaffs_mount_reldev(struct yaffs_dev *dev) {
  return yaffs_mount_common(dev, (0), 0, 0);
}


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

x86 assembly (clang, -O2):
<yaffs_mount_reldev>:
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <yaffs_mount_common@plt>

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

LLVM IR (-O2):
%struct.yaffs_dev = type { i32 }
define i32 @yaffs_mount_reldev(%struct.yaffs_dev* %0) {
%2 = tail call i32 @yaffs_mount_common(%struct.yaffs_dev* %0, i32 0, i32 0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() { printf("  -N #files : create #files files every iteration\n"); }


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

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

LLVM IR (-O0):
@.str = [51 x i8] c" -N #files : create #files files every iteration\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [50 x i8] c" -N #files : create #files files every iteration\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: tc_l2_ipip_redirect [...]\n");
  printf("       -U <file>   Update an already pinned BPF array\n");
  printf("       -i <ifindex> Interface index\n");
  printf("       -h          Display this help\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefd(%rip),%rdi
call   1030 <puts@plt>
lea    0xf27(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3f(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Usage: tc_l2_ipip_redirect [...]\0A\00"
@.str.1 = [55 x i8] c" -U <file> Update an already pinned BPF array\0A\00"
@.str.2 = [37 x i8] c" -i <ifindex> Interface index\0A\00"
@.str.3 = [38 x i8] c" -h Display this help\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [33 x i8] c"Usage: tc_l2_ipip_redirect [...]\00"
@str.4 = [54 x i8] c" -U <file> Update an already pinned BPF array\00"
@str.5 = [36 x i8] c" -i <ifindex> Interface index\00"
@str.6 = [37 x i8] c" -h Display this help\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ clearerr(int /*<<< orphan*/);
int getchar();
int /*<<< orphan*/ stdin;
void clrbuff(void) {
  int ch;
  do
    ch = getchar();
  while (ch != EOF && ch != '\n');
  clearerr(stdin);
}


x86 assembly (clang, -O0):
<clrbuff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
mov    0x2ea2(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x5(%rbp)
je     1153 <clrbuff+0x33>
cmpl   $0xa,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1128 <clrbuff+0x8>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1040 <clearerr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clrbuff>:
push   %rbx
mov    0x2eb8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
je     1140 <clrbuff+0x20>
cmp    (%rbx),%eax
jne    1130 <clrbuff+0x10>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
pop    %rbx
jmp    1040 <clearerr@plt>

LLVM IR (-O0):
@EOF = global i32 0
@stdin = global i32 0
define void @clrbuff() {
%1 = alloca i32
br label %2
2: ; preds = %11, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
br label %4
4: ; preds = %2
%5 = load i32, i32* %1
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %1
%10 = icmp ne i32 %9, 10
br label %11
11: ; preds = %8, %4
%12 = phi i1 [ false, %4 ], [ %10, %8 ]
br i1 %12, label %2, label %13
13: ; preds = %11
%14 = load i32, i32* @stdin
%15 = call i32 @clearerr(i32 %14)
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
@stdin = global i32 0
define void @clrbuff() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = load i32, i32* @EOF
%4 = icmp ne i32 %2, %3
%5 = icmp ne i32 %2, 10
%6 = and i1 %5, %4
br i1 %6, label %1, label %7
7: ; preds = %1
%8 = load i32, i32* @stdin
%9 = tail call i32 @clearerr(i32 %8)
ret void
}
void ps_init_function_pointer() {}


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

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

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

LLVM IR (-O2):
define void @ps_init_function_pointer() {
ret void
}
__attribute__((used)) void _exit(int status) {
  (void)status;
  while (1)
    ;
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <_exit+0x7>

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

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void (i32)* @_exit to i8*)], section "llvm.metadata"
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
br label %4
4: ; preds = %1, %4
br label %4
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void (i32)* @_exit to i8*)], section "llvm.metadata"
define void @_exit(i32 %0) {
br label %2
2: ; preds = %1, %2
br label %2
}
/* Variables and functions */
char *strrchr(char *, int);
char *last_char_is(const char *s, int c) {
  char *sret = (char *)s;
  if (sret) {
    sret = strrchr(sret, c);
    if (sret != NULL && *(sret + 1) != 0)
      sret = NULL;
  }
  return sret;
}


x86 assembly (clang, -O0):
<last_char_is>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116b <last_char_is+0x5b>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1166 <last_char_is+0x56>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     1166 <last_char_is+0x56>
movq   $0x0,-0x18(%rbp)
jmp    116b <last_char_is+0x5b>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<last_char_is>:
push   %rax
test   %rdi,%rdi
je     112f <last_char_is+0x1f>
call   1030 <strrchr@plt>
test   %rax,%rax
je     112f <last_char_is+0x1f>
mov    %rax,%rcx
xor    %eax,%eax
cmpb   $0x0,0x1(%rcx)
cmove  %rcx,%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @last_char_is(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = tail call i8* @strrchr(i8* %0, i32 %1)
%6 = icmp eq i8* %5, null
br i1 %6, label %12, label %7
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
%11 = select i1 %10, i8* %5, i8* null
br label %12
12: ; preds = %7, %4, %2
%13 = phi i8* [ %11, %7 ], [ null, %4 ], [ null, %2 ]
ret i8* %13
}
struct param_d *dev_add_param_bool(struct device_d *dev, const char *name,
                                   int (*set)(struct param_d *p, void *priv),
                                   int (*get)(struct param_d *p, void *priv),
                                   int *value, void *priv) {
  return ((void *)0);
}


x86 assembly (clang, -O0):
<dev_add_param_bool>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.param_d = type opaque
%struct.device_d = type opaque
define %struct.param_d* @dev_add_param_bool(%struct.device_d* %0, i8* %1, i32 (%struct.param_d*, i8*)* %2, i32 (%struct.param_d*, i8*)* %3, i32* %4, i8* %5) {
%7 = alloca %struct.device_d*
%8 = alloca i8*
%9 = alloca i32 (%struct.param_d*, i8*)*
%10 = alloca i32 (%struct.param_d*, i8*)*
%11 = alloca i32*
%12 = alloca i8*
store %struct.device_d* %0, %struct.device_d** %7
store i8* %1, i8** %8
store i32 (%struct.param_d*, i8*)* %2, i32 (%struct.param_d*, i8*)** %9
store i32 (%struct.param_d*, i8*)* %3, i32 (%struct.param_d*, i8*)** %10
store i32* %4, i32** %11
store i8* %5, i8** %12
ret %struct.param_d* null
}

LLVM IR (-O2):
%struct.param_d = type opaque
%struct.device_d = type opaque
define noalias %struct.param_d* @dev_add_param_bool(%struct.device_d* nocapture readnone %0, i8* nocapture readnone %1, i32 (%struct.param_d*, i8*)* nocapture readnone %2, i32 (%struct.param_d*, i8*)* nocapture readnone %3, i32* nocapture readnone %4, i8* nocapture readnone %5) {
ret %struct.param_d* null
}
__attribute__((always_)) void writeq(unsigned long val, volatile void *addr) {
  asm volatile("mov"
               "q"
               " %0,%1"
               :
               : "r"(val), "m"(*(volatile unsigned long *)addr)
               : "memory");
}


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

x86 assembly (clang, -O2):
<writeq>:
mov    %rdi,(%rsi)
ret

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

LLVM IR (-O2):
define void @writeq(i64 %0, i8* %1) {
%3 = bitcast i8* %1 to i64*
tail call void asm sideeffect "movq $0,$1", "r,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64* elementtype(i64) %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pq_build(int *, int);
int /*<<< orphan*/ pq_downheap(int /*<<< orphan*/, int *, int);
int /*<<< orphan*/ u_swap(int *, int, int /*<<< orphan*/);
void heap_sort(int *items, int size) {
  pq_build(items, size);
  for (int i = size - 1; i > 0; i--) {
    u_swap(items, i, 0);
    pq_downheap(0, items, i);
  }
}


x86 assembly (clang, -O0):
<heap_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <pq_build@plt>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1188 <heap_sort+0x58>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
xor    %edx,%edx
call   1030 <u_swap@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%edx
xor    %edi,%edi
call   1050 <pq_downheap@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1154 <heap_sort+0x24>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_sort>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
call   1040 <pq_build@plt>
cmp    $0x2,%ebx
jl     1173 <heap_sort+0x43>
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
lea    -0x2(%rbx),%ebp
mov    %r14,%rdi
mov    %ebp,%esi
xor    %edx,%edx
call   1030 <u_swap@plt>
xor    %edi,%edi
mov    %r14,%rsi
mov    %ebp,%edx
call   1050 <pq_downheap@plt>
add    $0xffffffff,%ebx
cmp    $0x2,%ebx
ja     1150 <heap_sort+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @heap_sort(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** %3
%7 = load i32, i32* %4
%8 = call i32 @pq_build(i32* %6, i32 %7)
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
store i32 %10, i32* %5
br label %11
11: ; preds = %21, %2
%12 = load i32, i32* %5
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %24
14: ; preds = %11
%15 = load i32*, i32** %3
%16 = load i32, i32* %5
%17 = call i32 @u_swap(i32* %15, i32 %16, i32 0)
%18 = load i32*, i32** %3
%19 = load i32, i32* %5
%20 = call i32 @pq_downheap(i32 0, i32* %18, i32 %19)
br label %21
21: ; preds = %14
%22 = load i32, i32* %5
%23 = add nsw i32 %22, -1
store i32 %23, i32* %5
br label %11
24: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @heap_sort(i32* %0, i32 %1) {
%3 = tail call i32 @pq_build(i32* %0, i32 %1)
%4 = icmp sgt i32 %1, 1
br i1 %4, label %6, label %5
5: ; preds = %6, %2
ret void
6: ; preds = %2, %6
%7 = phi i32 [ %8, %6 ], [ %1, %2 ]
%8 = add nsw i32 %7, -1
%9 = tail call i32 @u_swap(i32* %0, i32 %8, i32 0)
%10 = tail call i32 @pq_downheap(i32 0, i32* %0, i32 %8)
%11 = icmp ugt i32 %7, 2
br i1 %11, label %6, label %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ mmio_writew(int /*<<< orphan*/, void *);
void mmio_le_writew(uint16_t val, void *addr) { mmio_writew((val), addr); }


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

x86 assembly (clang, -O2):
<mmio_le_writew>:
jmp    1030 <mmio_writew@plt>

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

LLVM IR (-O2):
define void @mmio_le_writew(i32 %0, i8* %1) {
%3 = tail call i32 @mmio_writew(i32 %0, i8* %1)
ret void
}
unsigned row_shift_from_symbol_count(unsigned symbol_count) {
  unsigned row_shift = 1;
  symbol_count++;
  while ((unsigned)(1 << row_shift) < symbol_count)
    row_shift++;
  return row_shift;
}


x86 assembly (clang, -O0):
<row_shift_from_symbol_count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    -0x4(%rbp),%eax
jae    1138 <row_shift_from_symbol_count+0x38>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1117 <row_shift_from_symbol_count+0x17>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<row_shift_from_symbol_count>:
add    $0x1,%edi
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    %edi,%eax
jb     1110 <row_shift_from_symbol_count+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @row_shift_from_symbol_count(i32 %0) {
%2 = add i32 %0, 1
br label %3
3: ; preds = %3, %1
%4 = phi i32 [ 1, %1 ], [ %7, %3 ]
%5 = shl nuw i32 1, %4
%6 = icmp ult i32 %5, %2
%7 = add i32 %4, 1
br i1 %6, label %3, label %8
8: ; preds = %3
ret i32 %4
}
int main(void) {
  int counter;
  {
    counter = 0;
  LOOPSTART:
    if (counter < 5) {
      counter = counter + 1;
      goto LOOPSTART;
    } else {
    }
    if (counter == 4) {
      goto ERROR;
    } else {
      goto END;
    }
  ERROR:
    goto ERROR;
  END:
    return (0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    112a <main+0x2a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
jmp    112f <main+0x2f>
cmpl   $0x4,-0x8(%rbp)
jne    113e <main+0x3e>
jmp    1143 <main+0x43>
jmp    1148 <main+0x48>
jmp    1143 <main+0x43>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
scalar_t__ fmin(double, double);
long double fminl(long double x, long double y) {
  return (long double)fmin((double)x, (double)y);
}


x86 assembly (clang, -O0):
<fminl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
fldt   -0x20(%rbp)
fstpl  -0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
call   1030 <fmin@plt>
mov    %rax,-0x28(%rbp)
fildll -0x28(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fminl>:
sub    $0x18,%rsp
fldt   0x30(%rsp)
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
fstpl  (%rsp)
movsd  (%rsp),%xmm1
call   1030 <fmin@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @fminl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = fptrunc x86_fp80 %5 to double
%7 = load x86_fp80, x86_fp80* %4
%8 = fptrunc x86_fp80 %7 to double
%9 = call i64 @fmin(double %6, double %8)
%10 = sitofp i64 %9 to x86_fp80
ret x86_fp80 %10
}

LLVM IR (-O2):
define x86_fp80 @fminl(x86_fp80 %0, x86_fp80 %1) {
%3 = fptrunc x86_fp80 %0 to double
%4 = fptrunc x86_fp80 %1 to double
%5 = tail call i64 @fmin(double %3, double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}
/* Variables and functions */
scalar_t__ errno;
double log(double);
double foo(double y) {
  double yy = 0;
  errno = 0;
  yy = log(y);
  return yy;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    0x2eb4(%rip),%rax
movq   $0x0,(%rax)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    0x2ec9(%rip),%rax
movq   $0x0,(%rax)
jmp    1030 <log@plt>

LLVM IR (-O0):
@errno = global i64 0
define double @foo(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 0.000000e+00, double* %3
store i64 0, i64* @errno
%4 = load double, double* %2
%5 = call double @log(double %4)
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
@errno = global i64 0
define double @foo(double %0) {
store i64 0, i64* @errno
%2 = tail call double @log(double %0)
ret double %2
}
int isPrime(int n) {
  int r;
  if (n)
    for (r = 2; r * r < n; r++) {
      if (n % r == 0)
        return 0;
    }
  return 1;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     115c <isPrime+0x5c>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1157 <isPrime+0x57>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1144 <isPrime+0x44>
movl   $0x0,-0x4(%rbp)
jmp    1163 <isPrime+0x63>
jmp    1149 <isPrime+0x49>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1118 <isPrime+0x18>
jmp    115c <isPrime+0x5c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
mov    $0x1,%ecx
cmp    $0x5,%edi
jl     1125 <isPrime+0x25>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1128 <isPrime+0x28>
add    $0x1,%esi
mov    %esi,%eax
imul   %esi,%eax
cmp    %edi,%eax
jl     1110 <isPrime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = icmp sgt i32 %0, 4
br i1 %2, label %6, label %11
3: ; preds = %6
%4 = mul nsw i32 %10, %10
%5 = icmp slt i32 %4, %0
br i1 %5, label %6, label %11
6: ; preds = %1, %3
%7 = phi i32 [ %10, %3 ], [ 2, %1 ]
%8 = srem i32 %0, %7
%9 = icmp eq i32 %8, 0
%10 = add nuw nsw i32 %7, 1
br i1 %9, label %11, label %3
11: ; preds = %6, %3, %1
%12 = phi i32 [ 1, %1 ], [ 0, %6 ], [ 1, %3 ]
ret i32 %12
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t reverseBits_fun_uint32_t(uint32_t x) {
  uint32_t r = x;
  int i = 31;
  while (x >>= 1) {
    r = (r << 1) | (x & 1);
    --i;
  }
  return r << i;
}


x86 assembly (clang, -O0):
<reverseBits_fun_uint32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x1f,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1145 <reverseBits_fun_uint32_t+0x45>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <reverseBits_fun_uint32_t+0x14>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseBits_fun_uint32_t>:
mov    $0x1f,%ecx
cmp    $0x2,%edi
jae    110e <reverseBits_fun_uint32_t+0xe>
mov    %edi,%eax
jmp    1134 <reverseBits_fun_uint32_t+0x34>
mov    $0x1f,%ecx
mov    %edi,%eax
mov    %edi,%edx
nopw   0x0(%rax,%rax,1)
sar    %edx
mov    %edx,%esi
and    $0x1,%esi
lea    (%rsi,%rax,2),%eax
add    $0xffffffff,%ecx
cmp    $0x3,%edi
mov    %edx,%edi
ja     1120 <reverseBits_fun_uint32_t+0x20>
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @reverseBits_fun_uint32_t(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %11, %3 ], [ 31, %1 ]
%6 = phi i32 [ %10, %3 ], [ %0, %1 ]
%7 = ashr i32 %4, 1
%8 = shl i32 %6, 1
%9 = and i32 %7, 1
%10 = or i32 %8, %9
%11 = add nsw i32 %5, -1
%12 = icmp ult i32 %4, 4
br i1 %12, label %13, label %3
13: ; preds = %3, %1
%14 = phi i32 [ %0, %1 ], [ %10, %3 ]
%15 = phi i32 [ 31, %1 ], [ %11, %3 ]
%16 = shl i32 %14, %15
ret i32 %16
}
/* Type definitions */
struct timespec {
  int tv_sec;
  long long tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int numanuma__get_time_tps();
long long numanuma__get_time_now(void) {
  struct timespec ts;
  clock_gettime(CLOCK_MONOTONIC, &ts);
  return ts.tv_sec * numanuma__get_time_tps() + ts.tv_nsec;
}


x86 assembly (clang, -O0):
<numanuma__get_time_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <numanuma__get_time_tps@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   %ecx,%eax
cltq
add    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numanuma__get_time_now>:
push   %rbx
sub    $0x10,%rsp
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
movslq (%rsp),%rbx
xor    %eax,%eax
call   1040 <numanuma__get_time_tps@plt>
cltq
imul   %rbx,%rax
add    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @numanuma__get_time_now() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 (...) @numanuma__get_time_tps()
%7 = mul nsw i32 %5, %6
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%10 = load i64, i64* %9
%11 = add nsw i64 %8, %10
ret i64 %11
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @numanuma__get_time_now() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = call i32 (...) @numanuma__get_time_tps()
%8 = mul nsw i32 %7, %6
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%11 = load i64, i64* %10
%12 = add nsw i64 %11, %9
ret i64 %12
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ type;
};
typedef TYPE_1__ XLeaveWindowEvent;

/* Variables and functions */
int get_XLeaveWindowEvent_type(void *_p) {
  return (int)((XLeaveWindowEvent *)_p)->type;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XLeaveWindowEvent_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XLeaveWindowEvent_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main_main() {
  unsigned int a = 2;
  int b = -1;
  if (b > a)
    printf("OK.\n");
  else
    printf("Fail.\n");
}


x86 assembly (clang, -O0):
<main_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jbe    1143 <main_main+0x33>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
jmp    114f <main_main+0x3f>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [4 x i8] c"OK.\00"
define void @main_main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ daemonize(char *);
char *strrchr(char *, char);
int main(int arc, char *argv[]) {
  char *cmd;
  if ((cmd = strrchr(argv[0], '/')) == NULL) {
    cmd = argv[0];
  } else {
    ++cmd;
  }
  daemonize(cmd);
  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)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1165 <main+0x45>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1171 <main+0x51>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <daemonize@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i8* @strrchr(i8* dereferenceable(1) %3, i8 signext 47)
%5 = icmp eq i8* %4, null
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = select i1 %5, i8* %3, i8* %6
%8 = tail call i32 @daemonize(i8* %7)
ret i32 0
}