xunge/DecIR huggingface dataset:
char *strcpy(char *restrict dest, const char *restrict src) {
  char *ret = dest;
  while (*dest++ = *src++)
    ;
  return ret;
}


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,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <strcpy+0x43>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
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* noalias %0, i8* noalias %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 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %4
%10 = load i8, i8* %8
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
store i8 %10, i8* %11
%13 = icmp ne i8 %10, 0
br i1 %13, label %14, label %15
14: ; preds = %7
br label %7
15: ; preds = %7
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
define i8* @strcpy(i8* noalias returned writeonly %0, i8* noalias nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void tab_post_value(unsigned int i, unsigned int size, unsigned int per_line) {
  if (i < size - 1) {
    if (i % per_line < per_line - 1) {
      printf(", ");
    } else {
      printf(",\n");
    }
  }
}


x86 assembly (clang, -O0):
<tab_post_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jae    116a <tab_post_value+0x5a>
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
cmp    %eax,%edx
jae    1159 <tab_post_value+0x49>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
jmp    1165 <tab_post_value+0x55>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
jmp    116a <tab_post_value+0x5a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tab_post_value>:
add    $0xffffffff,%esi
cmp    %edi,%esi
jbe    1142 <tab_post_value+0x22>
mov    %edx,%ecx
mov    %edi,%eax
xor    %edx,%edx
div    %ecx
add    $0xffffffff,%ecx
cmp    %ecx,%edx
jae    1143 <tab_post_value+0x23>
lea    0xec3(%rip),%rdi
jmp    1040 <printf@plt>
ret
lea    0xeb9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [3 x i8] c", \00"
@.str.1 = [3 x i8] c",\0A\00"
define void @tab_post_value(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = sub i32 %8, 1
%10 = icmp ult i32 %7, %9
br i1 %10, label %11, label %23
11: ; preds = %3
%12 = load i32, i32* %4
%13 = load i32, i32* %6
%14 = urem i32 %12, %13
%15 = load i32, i32* %6
%16 = sub i32 %15, 1
%17 = icmp ult i32 %14, %16
br i1 %17, label %18, label %20
18: ; preds = %11
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %22
20: ; preds = %11
%21 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %22
22: ; preds = %20, %18
br label %23
23: ; preds = %22, %3
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c", \00"
@str = [2 x i8] c",\00"
define void @tab_post_value(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %1, -1
%5 = icmp ugt i32 %4, %0
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = urem i32 %0, %2
%8 = add i32 %2, -1
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %14
12: ; preds = %6
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %14
14: ; preds = %10, %12, %3
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void rtp_6184_fu_set_start(uint8_t *header) { header[0] |= 0x80; }


x86 assembly (clang, -O0):
<rtp_6184_fu_set_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
or     $0x80,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp_6184_fu_set_start>:
orb    $0x80,(%rdi)
ret

LLVM IR (-O0):
define void @rtp_6184_fu_set_start(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = or i32 %5, 128
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @rtp_6184_fu_set_start(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = or i32 %2, 128
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int ERROR(const char *msg) {
  fprintf(stderr, "ERROR: %s\n", msg);
  return 1;
}


x86 assembly (clang, -O0):
<ERROR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ERROR>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
define i32 @ERROR(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int nth_prime(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int temp = nth_prime(10001);
  printf("%d\n", temp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2711,%edi
call   1040 <nth_prime@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2711,%edi
call   1040 <nth_prime@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @nth_prime(i32 10001)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int fn3(int a, int b, int m) { return (~m & a) | (m & b); }


x86 assembly (clang, -O0):
<fn3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
and    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn3>:
mov    %esi,%eax
xor    %edi,%eax
and    %edx,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @fn3(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = xor i32 %7, -1
%9 = load i32, i32* %4
%10 = and i32 %8, %9
%11 = load i32, i32* %6
%12 = load i32, i32* %5
%13 = and i32 %11, %12
%14 = or i32 %10, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @fn3(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %2, -1
%5 = and i32 %4, %0
%6 = and i32 %2, %1
%7 = or i32 %5, %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ MySAR_update_config(char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, long);
int MySAR_update_config_long(long value, char *name) {
  char buf[40];
  snprintf(buf, sizeof(buf), "%ld", value);
  MySAR_update_config(buf, name);
  return 0;
}


x86 assembly (clang, -O0):
<MySAR_update_config_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x28,%esi
lea    0xebc(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <MySAR_update_config@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MySAR_update_config_long>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %rdi,%rcx
lea    0xecc(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x28,%esi
call   1040 <snprintf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <MySAR_update_config@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
define i32 @MySAR_update_config_long(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca [40 x i8]
store i64 %0, i64* %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [40 x i8], [40 x i8]* %5, i64 0, i64 0
%7 = load i64, i64* %3
%8 = call i32 @snprintf(i8* %6, i32 40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = getelementptr inbounds [40 x i8], [40 x i8]* %5, i64 0, i64 0
%10 = load i8*, i8** %4
%11 = call i32 @MySAR_update_config(i8* %9, i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i32 @MySAR_update_config_long(i64 %0, i8* %1) {
%3 = alloca [40 x i8]
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
%6 = call i32 @MySAR_update_config(i8* %4, i8* %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t *foo(uint64_t *x) { return x; }


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

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

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

LLVM IR (-O2):
define i32* @foo(i32* readnone returned %0) {
ret i32* %0
}
unsigned char uint_log2(unsigned long x) {
  unsigned char leading_zeros = (unsigned char)__builtin_clzl(x);
  return sizeof(unsigned long) * 8 - leading_zeros - 1;
}


x86 assembly (clang, -O0):
<uint_log2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
bsr    %rax,%rax
xor    $0x3f,%rax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
mov    %eax,%ecx
mov    $0x40,%eax
sub    %rcx,%rax
sub    $0x1,%rax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint_log2>:
bsr    %rdi,%rax
ret

LLVM IR (-O0):
define zeroext i8 @uint_log2(i64 %0) {
%2 = alloca i64
%3 = alloca i8
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @llvm.ctlz.i64(i64 %4, i1 true)
%6 = trunc i64 %5 to i32
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
%8 = load i8, i8* %3
%9 = zext i8 %8 to i64
%10 = sub i64 64, %9
%11 = sub i64 %10, 1
%12 = trunc i64 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @uint_log2(i64 %0) {
%2 = tail call i64 @llvm.ctlz.i64(i64 %0, i1 true)
%3 = trunc i64 %2 to i8
%4 = xor i8 %3, 63
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
int /*<<< orphan*/ foo(int);
int main() {
  int i = 0;
  switch (i) {
  case 0:
    i = 1;
    break;
  case 1:
    i = 2;
    break;
  default:
    break;
  }
  switch (i) {
  case 0:
    i = 1;
    break;
  case 1:
    i = 2;
  default:
    break;
  }
  switch (i) {
  case 1:
  case 2:
    i = 11;
  case 3:
  case 4:
    i = 99;
  }
  foo(1);
  bar(1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     115a <main+0x3a>
jmp    1149 <main+0x29>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     1166 <main+0x46>
jmp    1172 <main+0x52>
movl   $0x1,-0x8(%rbp)
jmp    1177 <main+0x57>
movl   $0x2,-0x8(%rbp)
jmp    1177 <main+0x57>
jmp    1177 <main+0x57>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     119b <main+0x7b>
jmp    118a <main+0x6a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     11a7 <main+0x87>
jmp    11ae <main+0x8e>
movl   $0x1,-0x8(%rbp)
jmp    11b3 <main+0x93>
movl   $0x2,-0x8(%rbp)
jmp    11b3 <main+0x93>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
add    $0xffffffff,%eax
sub    $0x2,%eax
jb     11de <main+0xbe>
jmp    11ca <main+0xaa>
mov    -0x14(%rbp),%eax
add    $0xfffffffd,%eax
sub    $0x2,%eax
jb     11e5 <main+0xc5>
jmp    11ec <main+0xcc>
movl   $0xb,-0x8(%rbp)
movl   $0x63,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <foo@plt>
mov    $0x1,%edi
call   1030 <bar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <foo@plt>
mov    $0x1,%edi
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
store i32 0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %6 [
i32 0, label %4
i32 1, label %5
]
4: ; preds = %0
store i32 1, i32* %2
br label %7
5: ; preds = %0
store i32 2, i32* %2
br label %7
6: ; preds = %0
br label %7
7: ; preds = %6, %5, %4
%8 = load i32, i32* %2
switch i32 %8, label %11 [
i32 0, label %9
i32 1, label %10
]
9: ; preds = %7
store i32 1, i32* %2
br label %12
10: ; preds = %7
store i32 2, i32* %2
br label %11
11: ; preds = %7, %10
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %2
switch i32 %13, label %16 [
i32 1, label %14
i32 2, label %14
i32 3, label %15
i32 4, label %15
]
14: ; preds = %12, %12
store i32 11, i32* %2
br label %15
15: ; preds = %12, %12, %14
store i32 99, i32* %2
br label %16
16: ; preds = %15, %12
%17 = call i32 @foo(i32 1)
%18 = call i32 @bar(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1)
%2 = tail call i32 @bar(i32 1)
ret i32 0
}
int foo(void) {
  char arr[356];
  arr[0] = 1;
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movb   $0x1,-0x170(%rbp)
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca [356 x i8]
%2 = getelementptr inbounds [356 x i8], [356 x i8]* %1, i64 0, i64 0
store i8 1, i8* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 0
}
unsigned short int unsignedshortint_ignoring_longdouble(unsigned short int x,
                                                        long double y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedshortint_ignoring_longdouble>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
fldt   0x10(%rbp)
mov    %ax,-0x2(%rbp)
fstpt  -0x20(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @unsignedshortint_ignoring_longdouble(i16 zeroext %0, x86_fp80 %1) {
%3 = alloca i16
%4 = alloca x86_fp80
store i16 %0, i16* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @unsignedshortint_ignoring_longdouble(i16 returned zeroext %0, x86_fp80 %1) {
ret i16 %0
}
/* Variables and functions */
int floor(int);
int build_max_heap(int *array, int heapSize) {
  int i;
  for (i = floor(heapSize / 2); i > 0; i--)
    build_max_heap(array, i);
  return 0;
}


x86 assembly (clang, -O0):
<build_max_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <floor@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1168 <build_max_heap+0x48>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <build_max_heap@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1144 <build_max_heap+0x24>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_max_heap>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %esi,%edi
shr    $0x1f,%edi
add    %esi,%edi
sar    %edi
call   1040 <floor@plt>
test   %eax,%eax
jle    1154 <build_max_heap+0x34>
mov    %eax,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <build_max_heap@plt>
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
ja     1140 <build_max_heap+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @build_max_heap(i32* nocapture readnone %0, i32 %1) {
%3 = sdiv i32 %1, 2
%4 = tail call i32 @floor(i32 %3)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ %4, %2 ]
%8 = tail call i32 @build_max_heap(i32* %0, i32 %7)
%9 = add nsw i32 %7, -1
%10 = icmp ugt i32 %7, 1
br i1 %10, label %6, label %11
11: ; preds = %6, %2
ret i32 0
}
void test_PTHREAD_SCOPE_PROCESS(void) { int dummy = "PTHREAD_SCOPE_PROCESS"; }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"PTHREAD_SCOPE_PROCESS\00"
define void @test_PTHREAD_SCOPE_PROCESS() {
%1 = alloca i32
store i32 ptrtoint ([22 x i8]* @.str to i32), i32* %1
ret void
}

LLVM IR (-O2):
define void @test_PTHREAD_SCOPE_PROCESS() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void minipack_pack_pos_fixnum(void *ptr, uint8_t value, size_t *sz) {
  *sz = 1;
  *((uint8_t *)ptr) = value & 0x7F;
}


x86 assembly (clang, -O0):
<minipack_pack_pos_fixnum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movq   $0x1,(%rax)
mov    -0xc(%rbp),%ecx
and    $0x7f,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_pack_pos_fixnum>:
movq   $0x1,(%rdx)
and    $0x7f,%esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @minipack_pack_pos_fixnum(i8* %0, i32 %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64* %2, i64** %6
%7 = load i64*, i64** %6
store i64 1, i64* %7
%8 = load i32, i32* %5
%9 = and i32 %8, 127
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @minipack_pack_pos_fixnum(i8* nocapture writeonly %0, i32 %1, i64* nocapture writeonly %2) {
store i64 1, i64* %2
%4 = and i32 %1, 127
%5 = bitcast i8* %0 to i32*
store i32 %4, i32* %5
ret void
}
long long bit49() { return 0x0002000000000000LL; }


x86 assembly (clang, -O0):
<bit49>:
push   %rbp
mov    %rsp,%rbp
movabs $0x2000000000000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit49>:
movabs $0x2000000000000,%rax
ret

LLVM IR (-O0):
define i64 @bit49() {
ret i64 562949953421312
}

LLVM IR (-O2):
define i64 @bit49() {
ret i64 562949953421312
}
int byte_lshift(unsigned char x, unsigned char y) {
  x <<= y;
  return x;
}


x86 assembly (clang, -O0):
<byte_lshift>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%ecx
movzbl -0x1(%rbp),%eax
shl    %cl,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_lshift>:
mov    %esi,%ecx
shl    %cl,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @byte_lshift(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
%9 = shl i32 %8, %6
%10 = trunc i32 %9 to i8
store i8 %10, i8* %3
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @byte_lshift(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = zext i8 %0 to i32
%5 = shl i32 %4, %3
%6 = and i32 %5, 255
ret i32 %6
}
/* Variables and functions */
int strcspn(char *, char *);
int strlen(char *);
char *chomp(char *str) {
  int len;
  int pos;
  len = strlen(str);
  pos = strcspn(str, "\n");
  if (pos < len) {
    str[pos] = '\0';
  }
  return str;
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1040 <strcspn@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1163 <chomp+0x43>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
lea    0xecc(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcspn@plt>
cmp    %ebp,%eax
jge    1146 <chomp+0x26>
cltq
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i8* @chomp(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @strcspn(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp slt i32 %3, %2
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
br label %8
8: ; preds = %5, %1
ret i8* %0
}
int template_exit(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @template_exit() {
ret i32 0
}

LLVM IR (-O2):
define i32 @template_exit() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int console_vprintf(const char *fmt, va_list ap) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @console_vprintf(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ io_set_pgc(int);
int /*<<< orphan*/ io_set_pgd(int);
int /*<<< orphan*/ io_set_pgm(int);
int /*<<< orphan*/ io_set_vpp(int);
void pic16n_standby(void) {
  io_set_pgd((0x00));
  io_set_pgc((0x00));
  io_set_vpp((0x00));
  io_set_pgm((0x00));
}


x86 assembly (clang, -O0):
<pic16n_standby>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1050 <io_set_pgd@plt>
xor    %edi,%edi
call   1060 <io_set_pgc@plt>
xor    %edi,%edi
call   1040 <io_set_vpp@plt>
xor    %edi,%edi
call   1030 <io_set_pgm@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic16n_standby>:
push   %rax
xor    %edi,%edi
call   1050 <io_set_pgd@plt>
xor    %edi,%edi
call   1060 <io_set_pgc@plt>
xor    %edi,%edi
call   1040 <io_set_vpp@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <io_set_pgm@plt>

LLVM IR (-O0):
define void @pic16n_standby() {
%1 = call i32 @io_set_pgd(i32 0)
%2 = call i32 @io_set_pgc(i32 0)
%3 = call i32 @io_set_vpp(i32 0)
%4 = call i32 @io_set_pgm(i32 0)
ret void
}

LLVM IR (-O2):
define void @pic16n_standby() {
%1 = tail call i32 @io_set_pgd(i32 0)
%2 = tail call i32 @io_set_pgc(i32 0)
%3 = tail call i32 @io_set_vpp(i32 0)
%4 = tail call i32 @io_set_pgm(i32 0)
ret void
}
__attribute__((gnu_)) __attribute__((always_)) int func4b(int x) {
  return x < 13 ? 1 : 2;
}


x86 assembly (clang, -O0):
<func4b>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x2,%eax
mov    $0x1,%ecx
cmp    $0xd,%edx
cmovl  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func4b>:
xor    %ecx,%ecx
cmp    $0xd,%edi
setl   %cl
mov    $0x2,%eax
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @func4b(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 13
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 2
ret i32 %6
}

LLVM IR (-O2):
define i32 @func4b(i32 %0) {
%2 = icmp slt i32 %0, 13
%3 = select i1 %2, i32 1, i32 2
ret i32 %3
}
/* Variables and functions */
double log(double);
double log2(double n) { return log(n) / 0.6931471805599453; }


x86 assembly (clang, -O0):
<log2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
movsd  0xed1(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2>:
push   %rax
call   1030 <log@plt>
divsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @log2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log(double %3)
%5 = fdiv double %4, 0x3FE62E42FEFA39EF
ret double %5
}

LLVM IR (-O2):
define double @log2(double %0) {
%2 = tail call double @log(double %0)
%3 = fdiv double %2, 0x3FE62E42FEFA39EF
ret double %3
}
int printf(const char *format, ...) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @printf(i8* nocapture readnone %0, ...) {
ret i32 0
}
void hook_halt(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<hook_halt>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <hook_halt+0x9>
jmp    1109 <hook_halt+0x9>

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

LLVM IR (-O0):
define void @hook_halt() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @hook_halt() {
br label %1
1: ; preds = %0, %1
br label %1
}
void shmobile_smp_apmu_suspend_init(void) {}


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

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

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

LLVM IR (-O2):
define void @shmobile_smp_apmu_suspend_init() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *asctime(int /*<<< orphan*/);
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *get_time(void) {
  time_t result;
  result = time(NULL);
  return asctime(localtime(&result));
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1040 <asctime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1040 <asctime@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i8* @get_time() {
%1 = alloca i32
%2 = call i32 @time(i32* null)
store i32 %2, i32* %1
%3 = call i32 @localtime(i32* %1)
%4 = call i8* @asctime(i32 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @get_time() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i32 @localtime(i32* %1)
%5 = call i8* @asctime(i32 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print(int A[], int heap_size) {
  for (int i = 0; i < heap_size; i++) {
    printf("%d ", A[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
int dlclose(void *handle) {
  puts("# ");
  puts(__FUNCTION__);
  puts("()\n");
  delay(100000000);
  (void)(handle);
  return -1;
}


x86 assembly (clang, -O0):
<dlclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
mov    $0x0,%al
call   1040 <delay@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlclose>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xec7(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
xor    %eax,%eax
call   1040 <delay@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.dlclose = [8 x i8] c"dlclose\00"
@.str.1 = [4 x i8] c"()\0A\00"
define i32 @dlclose(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.dlclose, i64 0, i64 0))
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
%7 = load i8*, i8** %2
ret i32 -1
}

LLVM IR (-O2):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.dlclose = [8 x i8] c"dlclose\00"
@.str.1 = [4 x i8] c"()\0A\00"
define i32 @dlclose(i8* nocapture readnone %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.dlclose, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ jul2greg(double, int *, int *, int *, int *, int *,
                            double *);
int julian_get_year_number(double current) {
  int year, month, day, hour, minute;
  double seconds;
  jul2greg(current, &month, &day, &year, &hour, &minute, &seconds);
  return year;
}


x86 assembly (clang, -O0):
<julian_get_year_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
lea    -0x28(%rbp),%r9
call   1030 <jul2greg@plt>
mov    -0xc(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<julian_get_year_number>:
sub    $0x28,%rsp
lea    0x1c(%rsp),%rdi
lea    0x18(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x14(%rsp),%rcx
lea    0x10(%rsp),%r8
lea    0x20(%rsp),%r9
call   1030 <jul2greg@plt>
mov    0xc(%rsp),%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @julian_get_year_number(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
store double %0, double* %2
%9 = load double, double* %2
%10 = call i32 @jul2greg(double %9, i32* %4, i32* %5, i32* %3, i32* %6, i32* %7, double* %8)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @julian_get_year_number(double %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = bitcast double* %7 to i8*
%14 = call i32 @jul2greg(double %0, i32* %3, i32* %4, i32* %2, i32* %5, i32* %6, double* %7)
%15 = load i32, i32* %2
ret i32 %15
}
/* Variables and functions */
int log(int);
double link_function_inverse(double g) {
  return (-1) * log((2 * (8 * 8)) / ((8 * 8) + g) - 1);
}


x86 assembly (clang, -O0):
<link_function_inverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeeb(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
movsd  0xed6(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xec2(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
imul   $0xffffffff,%eax,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<link_function_inverse>:
push   %rax
addsd  0xee7(%rip),%xmm0
movsd  0xee7(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  0xee3(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1030 <log@plt>
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @link_function_inverse(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double 6.400000e+01, %3
%5 = fdiv double 1.280000e+02, %4
%6 = fsub double %5, 1.000000e+00
%7 = fptosi double %6 to i32
%8 = call i32 @log(i32 %7)
%9 = mul nsw i32 -1, %8
%10 = sitofp i32 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @link_function_inverse(double %0) {
%2 = fadd double %0, 6.400000e+01
%3 = fdiv double 1.280000e+02, %2
%4 = fadd double %3, -1.000000e+00
%5 = fptosi double %4 to i32
%6 = tail call i32 @log(i32 %5)
%7 = sub nsw i32 0, %6
%8 = sitofp i32 %7 to double
ret double %8
}
/* Type definitions */
typedef int __v4si;
typedef scalar_t__ __m128d;

/* Variables and functions */
__m128d __attribute__((__always___, __nodebug__))
_mm_or_pd(__m128d a, __m128d b) {
  return (__m128d)((__v4si)a | (__v4si)b);
}


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

x86 assembly (clang, -O2):
<_mm_or_pd>:
or     %edi,%esi
movslq %esi,%rax
ret

LLVM IR (-O0):
define i64 @_mm_or_pd(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = or i32 %6, %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
define i64 @_mm_or_pd(i64 %0, i64 %1) {
%3 = or i64 %1, %0
%4 = shl i64 %3, 32
%5 = ashr exact i64 %4, 32
ret i64 %5
}
void defaultHandler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<defaultHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <defaultHandler+0x9>
jmp    1109 <defaultHandler+0x9>

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

LLVM IR (-O0):
define void @defaultHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @defaultHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
unsigned long *f(p)
unsigned long *p;
{
  unsigned long a = (*p++) >> 24;
  return p + a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rax
shr    $0x18,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    (%rdi),%rax
shr    $0x18,%rax
lea    (%rdi,%rax,8),%rax
add    $0x8,%rax
ret

LLVM IR (-O0):
define i64* @f(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
store i64* %0, i64** %2
%4 = load i64*, i64** %2
%5 = getelementptr inbounds i64, i64* %4, i32 1
store i64* %5, i64** %2
%6 = load i64, i64* %4
%7 = lshr i64 %6, 24
store i64 %7, i64* %3
%8 = load i64*, i64** %2
%9 = load i64, i64* %3
%10 = getelementptr inbounds i64, i64* %8, i64 %9
ret i64* %10
}

LLVM IR (-O2):
define i64* @f(i64* %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 1
%3 = load i64, i64* %0
%4 = lshr i64 %3, 24
%5 = getelementptr inbounds i64, i64* %2, i64 %4
ret i64* %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void util_Free(void *p) {
  if (p == NULL)
    return;
  free(p);
  return;
}


x86 assembly (clang, -O0):
<util_Free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <util_Free+0x1c>
jmp    1135 <util_Free+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_Free>:
test   %rdi,%rdi
je     111a <util_Free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @util_Free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @util_Free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
int isVisible(const char *filename) {
  const char *p;
  p = strrchr(filename, '/');
  if (p != NULL) {
    ++p;
  } else {
    p = filename;
  }
  return (p[0] != '.');
}


x86 assembly (clang, -O0):
<isVisible>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <isVisible+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1152 <isVisible+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isVisible(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 46
%8 = zext i1 %7 to i32
ret i32 %8
}
void inc32word(workspace) unsigned char *workspace;
{
  workspace[3]++;
  if (!workspace[3]) {
    workspace[2]++;
    if (!workspace[2]) {
      workspace[1]++;
      if (!workspace[1]) {
        workspace[0]++;
      }
    }
  }
}


x86 assembly (clang, -O0):
<inc32word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%cl
add    $0x1,%cl
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%rax
cmpb   $0x0,0x3(%rax)
jne    116e <inc32word+0x6e>
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
add    $0x1,%cl
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
cmpb   $0x0,0x2(%rax)
jne    1169 <inc32word+0x69>
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
add    $0x1,%cl
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
cmpb   $0x0,0x1(%rax)
jne    1164 <inc32word+0x64>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
add    $0x1,%cl
mov    %cl,(%rax)
jmp    1169 <inc32word+0x69>
jmp    116e <inc32word+0x6e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc32word>:
addb   $0x1,0x3(%rdi)
jne    1115 <inc32word+0x15>
addb   $0x1,0x2(%rdi)
jne    1115 <inc32word+0x15>
addb   $0x1,0x1(%rdi)
jne    1115 <inc32word+0x15>
addb   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @inc32word(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
%5 = load i8, i8* %4
%6 = add i8 %5, 1
store i8 %6, i8* %4
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 3
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %36, label %11
11: ; preds = %1
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 2
%14 = load i8, i8* %13
%15 = add i8 %14, 1
store i8 %15, i8* %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = icmp ne i8 %18, 0
br i1 %19, label %35, label %20
20: ; preds = %11
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 1
%23 = load i8, i8* %22
%24 = add i8 %23, 1
store i8 %24, i8* %22
%25 = load i8*, i8** %2
%26 = getelementptr inbounds i8, i8* %25, i64 1
%27 = load i8, i8* %26
%28 = icmp ne i8 %27, 0
br i1 %28, label %34, label %29
29: ; preds = %20
%30 = load i8*, i8** %2
%31 = getelementptr inbounds i8, i8* %30, i64 0
%32 = load i8, i8* %31
%33 = add i8 %32, 1
store i8 %33, i8* %31
br label %34
34: ; preds = %29, %20
br label %35
35: ; preds = %34, %11
br label %36
36: ; preds = %35, %1
ret void
}

LLVM IR (-O2):
define void @inc32word(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = add i8 %3, 1
store i8 %4, i8* %2
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %19
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
%9 = add i8 %8, 1
store i8 %9, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %0, i64 1
%13 = load i8, i8* %12
%14 = add i8 %13, 1
store i8 %14, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %11
%17 = load i8, i8* %0
%18 = add i8 %17, 1
store i8 %18, i8* %0
br label %19
19: ; preds = %6, %16, %11, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, unsigned char *, int);
double load_double(unsigned char **bufferp) {
  unsigned char *buffer = *bufferp;
  double d;
  memcpy(&d, buffer, 8);
  *bufferp += 8;
  return d;
}


x86 assembly (clang, -O0):
<load_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x8,%rcx
mov    %rcx,(%rax)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_double>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    (%rdi),%rsi
lea    0x8(%rsp),%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
addq   $0x8,(%rbx)
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @load_double(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
%4 = alloca double
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 = call i32 @memcpy(double* %4, i8* %7, i32 8)
%9 = load i8**, i8*** %2
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8, i8* %10, i64 8
store i8* %11, i8** %9
%12 = load double, double* %4
ret double %12
}

LLVM IR (-O2):
define double @load_double(i8** nocapture %0) {
%2 = alloca double
%3 = load i8*, i8** %0
%4 = bitcast double* %2 to i8*
%5 = call i32 @memcpy(double* %2, i8* %3, i32 8)
%6 = load i8*, i8** %0
%7 = getelementptr inbounds i8, i8* %6, i64 8
store i8* %7, i8** %0
%8 = load double, double* %2
ret double %8
}