xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isUgly(int);
int getNthUglyNo(int n) {
  int i = 1;
  int count = 1;
  while (n > count) {
    i++;
    if (isUgly(i))
      count++;
  }
  return i;
}


x86 assembly (clang, -O0):
<getNthUglyNo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    115e <getNthUglyNo+0x4e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isUgly@plt>
cmp    $0x0,%rax
je     1159 <getNthUglyNo+0x49>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <getNthUglyNo+0x19>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNthUglyNo>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%ebp
cmp    $0x2,%edi
jl     1146 <getNthUglyNo+0x36>
mov    %edi,%r14d
mov    $0x1,%ebx
mov    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
mov    %ebp,%edi
call   1030 <isUgly@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebx
cmp    %r14d,%ebx
jl     1130 <getNthUglyNo+0x20>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @getNthUglyNo(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %12
3: ; preds = %1, %3
%4 = phi i32 [ %10, %3 ], [ 1, %1 ]
%5 = phi i32 [ %6, %3 ], [ 1, %1 ]
%6 = add nuw nsw i32 %5, 1
%7 = tail call i64 @isUgly(i32 %6)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
%10 = add nuw nsw i32 %4, %9
%11 = icmp slt i32 %10, %0
br i1 %11, label %3, label %12
12: ; preds = %3, %1
%13 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %13
}
int getdtablesize(void) { return 255; }


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

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

LLVM IR (-O0):
define i32 @getdtablesize() {
ret i32 255
}

LLVM IR (-O2):
define i32 @getdtablesize() {
ret i32 255
}
/* Variables and functions */
scalar_t__ halt3();
scalar_t__ unknown();
int test9() { (void)(halt3() + unknown()); }


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

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

LLVM IR (-O0):
define i32 @test9() {
%1 = alloca i32
%2 = call i64 (...) @halt3()
%3 = call i64 (...) @unknown()
%4 = add nsw i64 %2, %3
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @test9() {
%1 = tail call i64 (...) @halt3()
%2 = tail call i64 (...) @unknown()
ret i32 undef
}
char *strcpy(char *dest, const char *source) {
  char *begin = dest;
  for (; (*dest = *source) != 0; ++source, ++dest)
    ;
  return begin;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     114e <strcpy+0x4e>
jmp    1131 <strcpy+0x31>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %cl,(%rdi)
test   %cl,%cl
je     111f <strcpy+0x1f>
mov    $0x1,%ecx
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %9, %5 ], [ %0, %2 ]
%7 = phi i8* [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %8
store i8 %10, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret i8* %0
}
/* Type definitions */
typedef scalar_t__ ptrdiff_t;

/* Variables and functions */
const void *size_to_objpc(size_t ptr_rep) {
  const unsigned char *ptr;
  ptrdiff_t distance;
  distance = (ptrdiff_t)ptr_rep;
  ptr = (const unsigned char *)(((const unsigned char *)NULL) +
                                ((ptrdiff_t)distance));
  return ((const void *)ptr);
}


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

x86 assembly (clang, -O2):
<size_to_objpc>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @size_to_objpc(i64 %0) {
%2 = inttoptr i64 %0 to i8*
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ sensors_cleanup();
int FiniMBinfo(void) {
  sensors_cleanup();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @FiniMBinfo() {
%1 = call i32 (...) @sensors_cleanup()
ret i32 0
}

LLVM IR (-O2):
define i32 @FiniMBinfo() {
%1 = tail call i32 (...) @sensors_cleanup()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pthread_sched_disable();
int /*<<< orphan*/ pthread_sched_enable(int);
extern int sched_yield(void) {
  pthread_sched_disable();
  pthread_sched_enable(2);
  return 0;
}


x86 assembly (clang, -O0):
<sched_yield>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <pthread_sched_disable@plt>
mov    $0x2,%edi
call   1040 <pthread_sched_enable@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sched_yield() {
%1 = call i32 (...) @pthread_sched_disable()
%2 = call i32 @pthread_sched_enable(i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @sched_yield() {
%1 = tail call i32 (...) @pthread_sched_disable()
%2 = tail call i32 @pthread_sched_enable(i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ channel_kill();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ tunnels_kill();
void bye(void) {
  channel_kill();
  tunnels_kill();
  ((void)0);
  exit(0);
}


x86 assembly (clang, -O0):
<bye>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <channel_kill@plt>
mov    $0x0,%al
call   1030 <tunnels_kill@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<bye>:
push   %rax
xor    %eax,%eax
call   1040 <channel_kill@plt>
xor    %eax,%eax
call   1030 <tunnels_kill@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @bye() {
%1 = call i32 (...) @channel_kill()
%2 = call i32 (...) @tunnels_kill()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @bye() {
%1 = tail call i32 (...) @channel_kill()
%2 = tail call i32 (...) @tunnels_kill()
%3 = tail call i32 @exit(i32 0)
unreachable
}
void complete_release(struct completion *x) {}


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

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

LLVM IR (-O0):
%struct.completion = type opaque
define void @complete_release(%struct.completion* %0) {
%2 = alloca %struct.completion*
store %struct.completion* %0, %struct.completion** %2
ret void
}

LLVM IR (-O2):
%struct.completion = type opaque
define void @complete_release(%struct.completion* nocapture %0) {
ret void
}
const char *proginfo_version(void) {
  const char *s = "v0.9.9.8";
  return s;
}


x86 assembly (clang, -O0):
<proginfo_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<proginfo_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"v0.9.9.8\00"
define i8* @proginfo_version() {
%1 = alloca i8*
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
@.str = [9 x i8] c"v0.9.9.8\00"
define i8* @proginfo_version() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int identity__extinline(int);
int foo(int x) { return identity__extinline(x); }


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

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <identity__extinline@plt>

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = tail call i32 @identity__extinline(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
int run();
int shellDebugFlags();
int main(int argc, char **argv) {
  int status;
  do {
    if (shellDebugFlags() & 1 << 0)
      printf("starting %s\n", argv[0]);
  } while (0);
  status = run();
  exit(status);
}


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    $0x0,%al
call   1050 <shellDebugFlags@plt>
and    $0x1,%eax
cmp    $0x0,%eax
je     117c <main+0x3c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
jmp    1181 <main+0x41>
mov    $0x0,%al
call   1030 <run@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1050 <shellDebugFlags@plt>
test   $0x1,%al
je     115e <main+0x1e>
mov    (%rbx),%rsi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <run@plt>
mov    %eax,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"starting %s\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
br label %7
7: ; preds = %2
%8 = call i32 (...) @shellDebugFlags()
%9 = and i32 %8, 1
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %11, %7
br label %17
17: ; preds = %16
%18 = call i32 (...) @run()
store i32 %18, i32* %6
%19 = load i32, i32* %6
%20 = call i32 @exit(i32 %19)
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c"starting %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @shellDebugFlags()
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i8*, i8** %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %6, %2
%10 = tail call i32 (...) @run()
%11 = tail call i32 @exit(i32 %10)
unreachable
}
void bu_compile_atomp(args) struct conscell *args;
{
  int n = bu_compile_arg_list(args);
  if (n != 1)
    goto er;
  EMIT1ATM("ATOM");
  EMITEND();
  return;
er:
  cerror("atom: wrong # of args", args);
}


x86 assembly (clang, -O0):
<bu_compile_atomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <bu_compile_arg_list@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     1169 <bu_compile_atomp+0x29>
jmp    1183 <bu_compile_atomp+0x43>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1050 <EMIT1ATM@plt>
mov    $0x0,%al
call   1030 <EMITEND@plt>
jmp    1195 <bu_compile_atomp+0x55>
mov    -0x8(%rbp),%rsi
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1060 <cerror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bu_compile_atomp>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <bu_compile_arg_list@plt>
cmp    $0x1,%eax
jne    1166 <bu_compile_atomp+0x26>
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1050 <EMIT1ATM@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <EMITEND@plt>
lea    0xe98(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1060 <cerror@plt>

LLVM IR (-O0):
%struct.conscell = type opaque
@.str = [5 x i8] c"ATOM\00"
@.str.1 = [22 x i8] c"atom: wrong # of args\00"
define void @bu_compile_atomp(%struct.conscell* %0) {
%2 = alloca %struct.conscell*
%3 = alloca i32
store %struct.conscell* %0, %struct.conscell** %2
%4 = load %struct.conscell*, %struct.conscell** %2
%5 = call i32 (%struct.conscell*, ...) bitcast (i32 (...)* @bu_compile_arg_list to i32 (%struct.conscell*, ...)*)(%struct.conscell* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %1
br label %12
9: ; preds = %1
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @EMIT1ATM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (...) @EMITEND()
br label %15
12: ; preds = %8
%13 = load %struct.conscell*, %struct.conscell** %2
%14 = call i32 (i8*, %struct.conscell*, ...) bitcast (i32 (...)* @cerror to i32 (i8*, %struct.conscell*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), %struct.conscell* %13)
br label %15
15: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
%struct.conscell = type opaque
@.str = [5 x i8] c"ATOM\00"
@.str.1 = [22 x i8] c"atom: wrong # of args\00"
define void @bu_compile_atomp(%struct.conscell* %0) {
%2 = tail call i32 (%struct.conscell*, ...) bitcast (i32 (...)* @bu_compile_arg_list to i32 (%struct.conscell*, ...)*)(%struct.conscell* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @EMIT1ATM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @EMITEND()
br label %9
7: ; preds = %1
%8 = tail call i32 (i8*, %struct.conscell*, ...) bitcast (i32 (...)* @cerror to i32 (i8*, %struct.conscell*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), %struct.conscell* %0)
br label %9
9: ; preds = %7, %4
ret void
}
/* Variables and functions */
int hexval(char);
int hexbyte(char *s) {
  int i, j;
  i = hexval(s[0]);
  j = hexval(s[1]);
  if ((i < 0) || (j < 0))
    return (-1);
  return ((i << 4) + j);
}


x86 assembly (clang, -O0):
<hexbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <hexval@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <hexval@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     114f <hexbyte+0x3f>
cmpl   $0x0,-0x18(%rbp)
jge    115b <hexbyte+0x4b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <hexbyte+0x57>
mov    -0x14(%rbp),%eax
shl    $0x4,%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexbyte>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <hexval@plt>
mov    %eax,%ebp
movsbl 0x1(%rbx),%edi
call   1030 <hexval@plt>
mov    %ebp,%ecx
shl    $0x4,%ecx
add    %eax,%ecx
or     %eax,%ebp
mov    $0xffffffff,%eax
cmovns %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @hexbyte(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @hexval(i8 signext %2)
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = tail call i32 @hexval(i8 signext %5)
%7 = icmp slt i32 %3, 0
%8 = icmp slt i32 %6, 0
%9 = select i1 %7, i1 true, i1 %8
%10 = shl i32 %3, 4
%11 = add nsw i32 %6, %10
%12 = select i1 %9, i32 -1, i32 %11
ret i32 %12
}
int dbg_is_tst_rcvry(const struct ubifs_info *c) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ubifs_info = type opaque
define i32 @dbg_is_tst_rcvry(%struct.ubifs_info* nocapture readnone %0) {
ret i32 0
}
int test_func_02(int a) {
  return (((a >> 0) & 0xFF) << 24) | (((a >> 8) & 0xFF) << 16) |
         (((a >> 16) & 0xFF) << 8) | (((a >> 24) & 0xFF) << 0);
}


x86 assembly (clang, -O0):
<test_func_02>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_func_02(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 0
%5 = and i32 %4, 255
%6 = shl i32 %5, 24
%7 = load i32, i32* %2
%8 = ashr i32 %7, 8
%9 = and i32 %8, 255
%10 = shl i32 %9, 16
%11 = or i32 %6, %10
%12 = load i32, i32* %2
%13 = ashr i32 %12, 16
%14 = and i32 %13, 255
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32, i32* %2
%18 = ashr i32 %17, 24
%19 = and i32 %18, 255
%20 = shl i32 %19, 0
%21 = or i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @test_func_02(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void badusage(void) {
  fprintf(stderr, "Usage: gpmigenmult [-op d/s] [-silent] [-v] [-l/-h] [-c] "
                  "[-mwd maxwdiffs]\n");
  fprintf(stderr, "		 [-m maxeqns] [-ns] groupname [cosname].\n");
  exit(1);
}


x86 assembly (clang, -O0):
<badusage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xf02(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<badusage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf0c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [75 x i8] c"Usage: gpmigenmult [-op d/s] [-silent] [-v] [-l/-h] [-c] [-mwd maxwdiffs]\0A\00"
@.str.1 = [44 x i8] c"\09\09 [-m maxeqns] [-ns] groupname [cosname].\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [75 x i8] c"Usage: gpmigenmult [-op d/s] [-silent] [-v] [-l/-h] [-c] [-mwd maxwdiffs]\0A\00"
@.str.1 = [44 x i8] c"\09\09 [-m maxeqns] [-ns] groupname [cosname].\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct cpu {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cpu_set_r8(struct cpu *, int /*<<< orphan*/, unsigned char);
void cpu_or_flags(struct cpu *cpu, unsigned char a, unsigned char b,
                  unsigned char t) {
  unsigned char z = t ? 0 : ((unsigned char)(0x80));
  unsigned char n = 0;
  unsigned char h = 0;
  unsigned char c = 0;
  cpu_set_r8(cpu, (0), z | n | h | c);
}


x86 assembly (clang, -O0):
<cpu_or_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %rdi,-0x8(%rbp)
mov    %dl,-0x9(%rbp)
mov    %cl,-0xa(%rbp)
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%edx
mov    $0x80,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,-0xc(%rbp)
movb   $0x0,-0xd(%rbp)
movb   $0x0,-0xe(%rbp)
movb   $0x0,-0xf(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0xc(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
movzbl -0xe(%rbp),%ecx
or     %ecx,%eax
movzbl -0xf(%rbp),%ecx
or     %ecx,%eax
xor    %esi,%esi
movzbl %al,%edx
call   1030 <cpu_set_r8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_or_flags>:
xor    %edx,%edx
test   %ecx,%ecx
sete   %dl
shl    $0x7,%edx
xor    %esi,%esi
jmp    1030 <cpu_set_r8@plt>

LLVM IR (-O0):
%struct.cpu = type { i32 }
define void @cpu_or_flags(%struct.cpu* %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca %struct.cpu*
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8
store %struct.cpu* %0, %struct.cpu** %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%13 = load i8, i8* %8
%14 = zext i8 %13 to i32
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 0, i32 128
%18 = trunc i32 %17 to i8
store i8 %18, i8* %9
store i8 0, i8* %10
store i8 0, i8* %11
store i8 0, i8* %12
%19 = load %struct.cpu*, %struct.cpu** %5
%20 = load i8, i8* %9
%21 = zext i8 %20 to i32
%22 = load i8, i8* %10
%23 = zext i8 %22 to i32
%24 = or i32 %21, %23
%25 = load i8, i8* %11
%26 = zext i8 %25 to i32
%27 = or i32 %24, %26
%28 = load i8, i8* %12
%29 = zext i8 %28 to i32
%30 = or i32 %27, %29
%31 = trunc i32 %30 to i8
%32 = call i32 @cpu_set_r8(%struct.cpu* %19, i32 0, i8 zeroext %31)
ret void
}

LLVM IR (-O2):
%struct.cpu = type { i32 }
define void @cpu_or_flags(%struct.cpu* %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = icmp eq i8 %3, 0
%6 = select i1 %5, i8 -128, i8 0
%7 = tail call i32 @cpu_set_r8(%struct.cpu* %0, i32 0, i8 zeroext %6)
ret void
}
void mem_put_be32_as_int(void *vmem, int val) {
  unsigned char *mem = (unsigned char *)vmem;
  mem[0] = (val >> 24) & 0xff;
  mem[1] = (val >> 16) & 0xff;
  mem[2] = (val >> 8) & 0xff;
  mem[3] = (val >> 0) & 0xff;
}


x86 assembly (clang, -O0):
<mem_put_be32_as_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_put_be32_as_int>:
bswap  %esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @mem_put_be32_as_int(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 i32, i32* %4
%8 = ashr i32 %7, 24
%9 = and i32 %8, 255
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 %10, i8* %12
%13 = load i32, i32* %4
%14 = ashr i32 %13, 16
%15 = and i32 %14, 255
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i64 1
store i8 %16, i8* %18
%19 = load i32, i32* %4
%20 = ashr i32 %19, 8
%21 = and i32 %20, 255
%22 = trunc i32 %21 to i8
%23 = load i8*, i8** %5
%24 = getelementptr inbounds i8, i8* %23, i64 2
store i8 %22, i8* %24
%25 = load i32, i32* %4
%26 = ashr i32 %25, 0
%27 = and i32 %26, 255
%28 = trunc i32 %27 to i8
%29 = load i8*, i8** %5
%30 = getelementptr inbounds i8, i8* %29, i64 3
store i8 %28, i8* %30
ret void
}

LLVM IR (-O2):
define void @mem_put_be32_as_int(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %1, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int acc_func();
int /*<<< orphan*/ printf(char *);
int main() {
  int r = acc_func();
  if (r == 0) {
    printf("PASS\n");
  }
  return r;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <acc_func@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    114f <main+0x2f>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <acc_func@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    113a <main+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [5 x i8] c"PASS\00"
define i32 @main() {
%1 = tail call i32 (...) @acc_func()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 %1
}
/* Variables and functions */
double pow(double, int);
double sqrt(double);
double calculate_c(int a, int b) {
  double c_sq;
  c_sq = pow((double)a, 2) + pow((double)b, 2);
  return sqrt(c_sq);
}


x86 assembly (clang, -O0):
<calculate_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_c>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
cvtsi2sd %edi,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  %xmm0,0x8(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
addsd  0x8(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1166 <calculate_c+0x46>
sqrtsd %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbx
ret
add    $0x10,%rsp
pop    %rbx
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @calculate_c(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
%8 = call double @pow(double %7, i32 2)
%9 = load i32, i32* %4
%10 = sitofp i32 %9 to double
%11 = call double @pow(double %10, i32 2)
%12 = fadd double %8, %11
store double %12, double* %5
%13 = load double, double* %5
%14 = call double @sqrt(double %13)
ret double %14
}

LLVM IR (-O2):
define double @calculate_c(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = tail call double @pow(double %3, i32 2)
%5 = sitofp i32 %1 to double
%6 = tail call double @pow(double %5, i32 2)
%7 = fadd double %4, %6
%8 = tail call double @sqrt(double %7)
ret double %8
}
/* Variables and functions */
int CSPL_Stats_IQR(double *, long);
int pow(long, int);
double CSPL_Stats_FDrule(double *inval, long n) {
  return (2. * CSPL_Stats_IQR(inval, n) / pow(n, (1. / 3.)));
}


x86 assembly (clang, -O0):
<CSPL_Stats_FDrule>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <CSPL_Stats_IQR@plt>
cvtsi2sd %eax,%xmm1
movsd  0xeb7(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1040 <pow@plt>
movsd  -0x18(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CSPL_Stats_FDrule>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <CSPL_Stats_IQR@plt>
cvtsi2sd %eax,%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <pow@plt>
cvtsi2sd %eax,%xmm1
movsd  0x8(%rsp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @CSPL_Stats_FDrule(double* %0, i64 %1) {
%3 = alloca double*
%4 = alloca i64
store double* %0, double** %3
store i64 %1, i64* %4
%5 = load double*, double** %3
%6 = load i64, i64* %4
%7 = call i32 @CSPL_Stats_IQR(double* %5, i64 %6)
%8 = sitofp i32 %7 to double
%9 = fmul double 2.000000e+00, %8
%10 = load i64, i64* %4
%11 = call i32 @pow(i64 %10, i32 0)
%12 = sitofp i32 %11 to double
%13 = fdiv double %9, %12
ret double %13
}

LLVM IR (-O2):
define double @CSPL_Stats_FDrule(double* %0, i64 %1) {
%3 = tail call i32 @CSPL_Stats_IQR(double* %0, i64 %1)
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 2.000000e+00
%6 = tail call i32 @pow(i64 %1, i32 0)
%7 = sitofp i32 %6 to double
%8 = fdiv double %5, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ search(int /*<<< orphan*/, size_t);
int main() {
  size_t size = 128e16;
  printf("%zu\n", search(0, size));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movabs $0x11c37937e0800000,%rax
79 c3 11
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
xor    %edi,%edi
call   1040 <search@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x11c37937e0800000,%rsi
79 c3 11
xor    %edi,%edi
call   1040 <search@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%zu\0A\00"
define i32 @main() {
%1 = tail call i32 @search(i32 0, i64 1280000000000000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
main() {
  __typeof(0 ? (void *)0 : (int (*)())0) x;
  x();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   *-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32 (...)*
%2 = load i32 (...)*, i32 (...)** %1
%3 = call i32 (...) %2()
ret i32 0
}

LLVM IR (-O2):
/* Type definitions */
struct mloop_socket {
  int dummy;
};

/* Variables and functions */
int mloop__unref_any(struct mloop_socket *);
__attribute__((visibility("default"))) int
mloop_socket_unref(struct mloop_socket *self) {
  return mloop__unref_any(self);
}


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

x86 assembly (clang, -O2):
<mloop_socket_unref>:
jmp    1030 <mloop__unref_any@plt>

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

LLVM IR (-O2):
%struct.mloop_socket = type { i32 }
define i32 @mloop_socket_unref(%struct.mloop_socket* %0) {
%2 = tail call i32 @mloop__unref_any(%struct.mloop_socket* %0)
ret i32 %2
}
OP(fd, af) {
  illegal_1();
  op_af();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_af@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_af()
ret i32 undef
}
int rep_tab(int location) { return 4 - (location % 4); }


x86 assembly (clang, -O0):
<rep_tab>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    $0x4,%eax
sub    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rep_tab>:
lea    0x3(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
and    $0xfffffffc,%eax
sub    %edi,%eax
add    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @rep_tab(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = sub nsw i32 4, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @rep_tab(i32 %0) {
%2 = srem i32 %0, 4
%3 = sub nsw i32 4, %2
ret i32 %3
}
/* Type definitions */
struct log {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct log *);
void log_stdio_free(struct log *l) { free(l); }


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

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

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

LLVM IR (-O2):
%struct.log = type { i32 }
define void @log_stdio_free(%struct.log* nocapture %0) {
%2 = tail call i32 @free(%struct.log* %0)
ret void
}
/* Variables and functions */
double fmod(double, double);
double squ(double x) {
  return 2.0 * (fmod(x, 6.28318530717958647693) < 3.14159265358979323846) - 1.0;
}


x86 assembly (clang, -O0):
<squ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee6(%rip),%xmm1
call   1030 <fmod@plt>
movaps %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
addsd  %xmm0,%xmm0
movsd  0xeaa(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<squ>:
push   %rax
movsd  0xee7(%rip),%xmm1
call   1030 <fmod@plt>
cmpltsd 0xee1(%rip),%xmm0
movsd  0xee1(%rip),%xmm1
andpd  %xmm1,%xmm0
addsd  %xmm0,%xmm0
addsd  0xed9(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @squ(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @fmod(double %3, double 0x401921FB54442D18)
%5 = fcmp olt double %4, 0x400921FB54442D18
%6 = zext i1 %5 to i32
%7 = sitofp i32 %6 to double
%8 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %7, double -1.000000e+00)
ret double %8
}

LLVM IR (-O2):
define double @squ(double %0) {
%2 = tail call double @fmod(double %0, double 0x401921FB54442D18)
%3 = fcmp olt double %2, 0x400921FB54442D18
%4 = uitofp i1 %3 to double
%5 = tail call double @llvm.fmuladd.f64(double %4, double 2.000000e+00, double -1.000000e+00)
ret double %5
}
/* Variables and functions */
int __add_to_environ(char const *, char const *, int /*<<< orphan*/ *, int);
int setenv(const char *name, const char *value, int replace) {
  return __add_to_environ(name, value, NULL, replace);
}


x86 assembly (clang, -O0):
<setenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%edx
call   1030 <__add_to_environ@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setenv>:
mov    %edx,%ecx
xor    %edx,%edx
jmp    1030 <__add_to_environ@plt>

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

LLVM IR (-O2):
define i32 @setenv(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @__add_to_environ(i8* %0, i8* %1, i32* null, i32 %2)
ret i32 %4
}
void print_chap(char ***chap) {
  int i;
  for (i = 0; *(chap + i) != '\0'; i++) {
    print_para(*(chap + i));
  }
}


x86 assembly (clang, -O0):
<print_chap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1157 <print_chap+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x0,%al
call   1030 <print_para@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print_chap+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_chap>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1133 <print_chap+0x23>
add    $0x8,%rbx
xor    %eax,%eax
call   1030 <print_para@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1120 <print_chap+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @print_chap(i8*** nocapture %0) {
%2 = load i8**, i8*** %0
%3 = icmp eq i8** %2, null
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8** [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 (i8**, ...) bitcast (i32 (...)* @print_para to i32 (i8**, ...)*)(i8** %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8**, i8*** %0, i64 %8
%10 = load i8**, i8*** %9
%11 = icmp eq i8** %10, null
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int readInt(char **pptr) {
  char *ptr = *pptr;
  int len = 256 * ((unsigned char)(*ptr)) + (unsigned char)(*(ptr + 1));
  *pptr += 2;
  return len;
}


x86 assembly (clang, -O0):
<readInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readInt>:
mov    (%rdi),%rcx
movzwl (%rcx),%eax
shl    $0x10,%eax
bswap  %eax
add    $0x2,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define i32 @readInt(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
%4 = alloca i32
store i8** %0, i8*** %2
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = mul nsw i32 256, %9
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = add nsw i32 %10, %14
store i32 %15, i32* %4
%16 = load i8**, i8*** %2
%17 = load i8*, i8** %16
%18 = getelementptr inbounds i8, i8* %17, i64 2
store i8* %18, i8** %16
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @readInt(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw nsw i32 %4, 8
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = or i32 %5, %8
%10 = getelementptr inbounds i8, i8* %2, i64 2
store i8* %10, i8** %0
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, unsigned long long *);
int solve(unsigned long long);
int main() {
  unsigned long long n = 0;
  int res = 0;
  res = scanf("%llu", &n);
  printf("%d", solve(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xeab(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <solve@plt>
mov    %eax,%esi
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
lea    0xec0(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
mov    (%rsp),%rdi
call   1030 <solve@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%llu\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 0, i64* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = call i32 @solve(i64 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint64_t;

/* Variables and functions */
uint64_t load64(const void *src) { return *(const uint64_t *)(src); }


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

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

LLVM IR (-O0):
define i32 @load64(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @load64(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}