xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int count_lines(FILE *file) {
  int lines = 0;
  char buffer[1024];
  while (fgets(buffer, 1024, file))
    lines++;
  rewind(file);
  return lines;
}


x86 assembly (clang, -O0):
<count_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x400,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     1163 <count_lines+0x43>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <count_lines+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0xc(%rbp),%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_lines>:
push   %r15
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%r14
mov    $0xffffffff,%ebx
mov    %rsp,%r15
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    $0x400,%esi
mov    %r14,%rdx
call   1040 <fgets@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1140 <count_lines+0x20>
mov    %r14,%rdi
call   1030 <rewind@plt>
mov    %ebx,%eax
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @count_lines(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca [1024 x i8]
store i32* %0, i32** %2
store i32 0, i32* %3
br label %5
5: ; preds = %10, %1
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%7 = load i32*, i32** %2
%8 = call i64 @fgets(i8* %6, i32 1024, i32* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %5
13: ; preds = %5
%14 = load i32*, i32** %2
%15 = call i32 @rewind(i32* %14)
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @count_lines(i32* nocapture %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %4, %1
%5 = phi i32 [ 0, %1 ], [ %8, %4 ]
%6 = call i64 @fgets(i8* %3, i32 1024, i32* %0)
%7 = icmp eq i64 %6, 0
%8 = add nuw nsw i32 %5, 1
br i1 %7, label %9, label %4
9: ; preds = %4
%10 = call i32 @rewind(i32* %0)
ret i32 %5
}
char shift_generic_char(char c, int shift, char base, char length) {
  int pos = c - base;
  int delta = (pos + shift) % length;
  if (delta < 0)
    delta += length;
  return (base + delta);
}


x86 assembly (clang, -O0):
<shift_generic_char>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x9(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
movsbl -0xa(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1148 <shift_generic_char+0x48>
movsbl -0xa(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
movsbl -0x9(%rbp),%eax
add    -0x14(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_generic_char>:
mov    %edx,%r8d
lea    (%rdi,%rsi,1),%eax
sub    %edx,%eax
cltd
idiv   %ecx
mov    %edx,%eax
sar    $0x1f,%eax
and    %ecx,%eax
add    %edx,%eax
add    %r8b,%al
ret

LLVM IR (-O0):
define signext i8 @shift_generic_char(i8 signext %0, i32 %1, i8 signext %2, i8 signext %3) {
%5 = alloca i8
%6 = alloca i32
%7 = alloca i8
%8 = alloca i8
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %5
store i32 %1, i32* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%11 = load i8, i8* %5
%12 = sext i8 %11 to i32
%13 = load i8, i8* %7
%14 = sext i8 %13 to i32
%15 = sub nsw i32 %12, %14
store i32 %15, i32* %9
%16 = load i32, i32* %9
%17 = load i32, i32* %6
%18 = add nsw i32 %16, %17
%19 = load i8, i8* %8
%20 = sext i8 %19 to i32
%21 = srem i32 %18, %20
store i32 %21, i32* %10
%22 = load i32, i32* %10
%23 = icmp slt i32 %22, 0
br i1 %23, label %24, label %29
24: ; preds = %4
%25 = load i8, i8* %8
%26 = sext i8 %25 to i32
%27 = load i32, i32* %10
%28 = add nsw i32 %27, %26
store i32 %28, i32* %10
br label %29
29: ; preds = %24, %4
%30 = load i8, i8* %7
%31 = sext i8 %30 to i32
%32 = load i32, i32* %10
%33 = add nsw i32 %31, %32
%34 = trunc i32 %33 to i8
ret i8 %34
}

LLVM IR (-O2):
define signext i8 @shift_generic_char(i8 signext %0, i32 %1, i8 signext %2, i8 signext %3) {
%5 = sext i8 %0 to i32
%6 = sext i8 %2 to i32
%7 = add i32 %5, %1
%8 = sub i32 %7, %6
%9 = sext i8 %3 to i32
%10 = srem i32 %8, %9
%11 = icmp slt i32 %10, 0
%12 = select i1 %11, i32 %9, i32 0
%13 = add nsw i32 %12, %10
%14 = trunc i32 %13 to i8
%15 = add i8 %14, %2
ret i8 %15
}
/* Variables and functions */
scalar_t__ atol(char *);
int /*<<< orphan*/ exit(int);
int main() {
  if (atol("a") != 0) {
    exit(1);
  }
  if (atol("") != 0) {
    exit(2);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <atol@plt>
cmp    $0x0,%rax
je     1144 <main+0x24>
mov    $0x1,%edi
call   1040 <exit@plt>
lea    0xeb6(%rip),%rdi
call   1030 <atol@plt>
cmp    $0x0,%rax
je     1164 <main+0x44>
mov    $0x2,%edi
call   1040 <exit@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <atol@plt>
test   %rax,%rax
jne    1136 <main+0x16>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @main() {
%1 = call i64 @atol(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @exit(i32 1)
unreachable
5: ; preds = %0
%6 = call i64 @atol(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @exit(i32 2)
unreachable
10: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
define i32 @main() {
%1 = tail call i64 @atol(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @exit(i32 1)
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __ExitInner(int, int, int);
void exit(int status) { __ExitInner(1, 1, status); }


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <__ExitInner@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rax
mov    %edi,%edx
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <__ExitInner@plt>

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__ExitInner(i32 1, i32 1, i32 %3)
unreachable
}

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = tail call i32 @__ExitInner(i32 1, i32 1, i32 %0)
unreachable
}
/* Variables and functions */
int color_eqn(int, int, int, int, int, int);
int r_cyg_cymg_yeg(int entrycyg, int entrycymg, int entryyeg, int entryyemg) {
  return color_eqn(92, entryyeg, 79, entrycymg, -149, entrycyg);
}


x86 assembly (clang, -O0):
<r_cyg_cymg_yeg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%r9d
mov    $0x5c,%edi
mov    $0x4f,%edx
mov    $0xffffff6b,%r8d
call   1030 <color_eqn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_cyg_cymg_yeg>:
mov    %esi,%ecx
mov    %edi,%r9d
mov    $0x5c,%edi
mov    %edx,%esi
mov    $0x4f,%edx
mov    $0xffffff6b,%r8d
jmp    1030 <color_eqn@plt>

LLVM IR (-O0):
define i32 @r_cyg_cymg_yeg(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = load i32, i32* %5
%12 = call i32 @color_eqn(i32 92, i32 %9, i32 79, i32 %10, i32 -149, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @r_cyg_cymg_yeg(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @color_eqn(i32 92, i32 %2, i32 79, i32 %1, i32 -149, i32 %0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ render();
void game_function() { render(); }


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

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

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

LLVM IR (-O2):
define void @game_function() {
%1 = tail call i32 (...) @render()
ret void
}
void putch(unsigned char c) {
  while (!(*(volatile unsigned *)(0xBF800000 + (0x22610)) & 0x00000100))
    continue;
again:
  *(volatile unsigned *)(0xBF800000 + (0x22620)) = c;
  while (!(*(volatile unsigned *)(0xBF800000 + (0x22610)) & 0x00000100))
    continue;
  if (c == '\n') {
    c = '\r';
    goto again;
  }
}


x86 assembly (clang, -O0):
<putch>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xbf822610,%eax
mov    (%rax),%eax
and    $0x100,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112b <putch+0x2b>
jmp    1130 <putch+0x30>
jmp    110a <putch+0xa>
jmp    1135 <putch+0x35>
movzbl -0x1(%rbp),%ecx
mov    $0xbf822620,%eax
mov    %ecx,(%rax)
mov    $0xbf822610,%eax
mov    (%rax),%eax
and    $0x100,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1161 <putch+0x61>
jmp    1166 <putch+0x66>
jmp    1140 <putch+0x40>
movzbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    117c <putch+0x7c>
movb   $0xd,-0x1(%rbp)
jmp    1135 <putch+0x35>
pop    %rbp
ret

x86 assembly (clang, -O2):
<putch>:
mov    $0xbf822610,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testl  $0x100,(%rax)
je     1110 <putch+0x10>
nopl   0x0(%rax,%rax,1)
movzbl %dil,%ecx
mov    %ecx,0x10(%rax)
nopw   0x0(%rax,%rax,1)
testl  $0x100,(%rax)
je     1130 <putch+0x30>
cmp    $0xa,%dil
mov    $0xd,%dil
je     1120 <putch+0x20>
ret

LLVM IR (-O0):
define void @putch(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %8, %1
%4 = load volatile i32, i32* inttoptr (i64 3212977680 to i32*)
%5 = and i32 %4, 256
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
br label %10
10: ; preds = %23, %9
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
store volatile i32 %12, i32* inttoptr (i64 3212977696 to i32*)
br label %13
13: ; preds = %18, %10
%14 = load volatile i32, i32* inttoptr (i64 3212977680 to i32*)
%15 = and i32 %14, 256
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
br i1 %17, label %18, label %19
18: ; preds = %13
br label %13
19: ; preds = %13
%20 = load i8, i8* %2
%21 = zext i8 %20 to i32
%22 = icmp eq i32 %21, 10
br i1 %22, label %23, label %24
23: ; preds = %19
store i8 13, i8* %2
br label %10
24: ; preds = %19
ret void
}

LLVM IR (-O2):
define void @putch(i8 zeroext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* inttoptr (i64 3212977680 to i32*)
%4 = and i32 %3, 256
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2, %13
%7 = phi i8 [ 13, %13 ], [ %0, %2 ]
%8 = zext i8 %7 to i32
store volatile i32 %8, i32* inttoptr (i64 3212977696 to i32*)
br label %9
9: ; preds = %9, %6
%10 = load volatile i32, i32* inttoptr (i64 3212977680 to i32*)
%11 = and i32 %10, 256
%12 = icmp eq i32 %11, 0
br i1 %12, label %9, label %13
13: ; preds = %9
%14 = icmp eq i8 %7, 10
br i1 %14, label %6, label %15
15: ; preds = %13
ret void
}
/* Variables and functions */
void mem_cpy(void *__restrict__ dst_, const void *__restrict__ src_, size_t n) {
  unsigned char *dst = (unsigned char *)dst_;
  const unsigned char *src = (const unsigned char *)src_;
  size_t i;
  for (i = 0; i < n; i++) {
    dst[i] = src[i];
  }
}


x86 assembly (clang, -O0):
<mem_cpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    115d <mem_cpy+0x5d>
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x20(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1128 <mem_cpy+0x28>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_cpy>:
test   %rdx,%rdx
je     111f <mem_cpy+0xf>
push   %rax
call   1030 <memcpy@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @mem_cpy(i8* noalias nocapture writeonly %0, i8* noalias nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %6, label %5
5: ; preds = %3
br label %6
6: ; preds = %5, %3
ret void
}
int XGetFontProperty() {}


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

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

LLVM IR (-O0):
define i32 @XGetFontProperty() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XGetFontProperty() {
ret i32 undef
}
int cairo_code_draw_infamousLogoTrans_get_width() { return 67; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_infamousLogoTrans_get_width() {
ret i32 67
}

LLVM IR (-O2):
define i32 @cairo_code_draw_infamousLogoTrans_get_width() {
ret i32 67
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t max_s32(int32_t a, int32_t b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<max_s32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <max_s32+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <max_s32+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_s32>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @max_s32(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 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @max_s32(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Type definitions */
struct timex {
  int freq;
  scalar_t__ modes;
};

/* Variables and functions */
scalar_t__ __adjtimex(struct timex *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int get_current_freq() {
  struct timex txc;
  txc.modes = 0;
  if (__adjtimex(&txc) < 0) {
    perror("adjtimex");
    exit(1);
  }
  return txc.freq;
}


x86 assembly (clang, -O0):
<get_current_freq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <__adjtimex@plt>
cmp    $0x0,%rax
jge    1169 <get_current_freq+0x39>
lea    0xea6(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_current_freq>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <__adjtimex@plt>
test   %rax,%rax
js     1155 <get_current_freq+0x25>
mov    0x8(%rsp),%eax
add    $0x18,%rsp
ret
lea    0xea4(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.timex = type { i32, i64 }
@.str = [9 x i8] c"adjtimex\00"
define i32 @get_current_freq() {
%1 = alloca %struct.timex
%2 = getelementptr inbounds %struct.timex, %struct.timex* %1, i32 0, i32 1
store i64 0, i64* %2
%3 = call i64 @__adjtimex(%struct.timex* %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = getelementptr inbounds %struct.timex, %struct.timex* %1, i32 0, i32 0
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timex = type { i32, i64 }
@.str = [9 x i8] c"adjtimex\00"
define i32 @get_current_freq() {
%1 = alloca %struct.timex
%2 = bitcast %struct.timex* %1 to i8*
%3 = getelementptr inbounds %struct.timex, %struct.timex* %1, i64 0, i32 1
store i64 0, i64* %3
%4 = call i64 @__adjtimex(%struct.timex* %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %0
%10 = getelementptr inbounds %struct.timex, %struct.timex* %1, i64 0, i32 0
%11 = load i32, i32* %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
#pragma omp parallel
  printf("hello, world\n");
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"hello, world\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"hello, world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int ftol(float f) { return (int)f; }


x86 assembly (clang, -O0):
<ftol>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftol>:
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @ftol(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fptosi float %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @ftol(float %0) {
%2 = fptosi float %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ getpagesize();
size_t mem_pagesize() { return (size_t)getpagesize(); }


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

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

LLVM IR (-O0):
define i64 @mem_pagesize() {
%1 = call i32 (...) @getpagesize()
%2 = sext i32 %1 to i64
ret i64 %2
}

LLVM IR (-O2):
define i64 @mem_pagesize() {
%1 = tail call i32 (...) @getpagesize()
%2 = sext i32 %1 to i64
ret i64 %2
}
/* Type definitions */
struct RNALfold_args_info {
  int dummy;
};

/* Variables and functions */
int RNALfold_cmdline_parser2(int, char **, struct RNALfold_args_info *,
                             int /*<<< orphan*/, int, int);
int RNALfold_cmdline_parser(int argc, char **argv,
                            struct RNALfold_args_info *args_info) {
  return RNALfold_cmdline_parser2(argc, argv, args_info, 0, 1, 1);
}


x86 assembly (clang, -O0):
<RNALfold_cmdline_parser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <RNALfold_cmdline_parser2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNALfold_cmdline_parser>:
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <RNALfold_cmdline_parser2@plt>

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

LLVM IR (-O2):
%struct.RNALfold_args_info = type { i32 }
define i32 @RNALfold_cmdline_parser(i32 %0, i8** %1, %struct.RNALfold_args_info* %2) {
%4 = tail call i32 @RNALfold_cmdline_parser2(i32 %0, i8** %1, %struct.RNALfold_args_info* %2, i32 0, i32 1, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ func();
main() {
  func();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @func()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @func()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ inputdata();
int /*<<< orphan*/ inputoptions();
int /*<<< orphan*/ makevalues();
int /*<<< orphan*/ makeweights();
void doinput() {
  inputoptions();
  inputdata();
  makeweights();
  makevalues();
}


x86 assembly (clang, -O0):
<doinput>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <inputoptions@plt>
mov    $0x0,%al
call   1040 <inputdata@plt>
mov    $0x0,%al
call   1030 <makeweights@plt>
mov    $0x0,%al
call   1050 <makevalues@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<doinput>:
push   %rax
xor    %eax,%eax
call   1060 <inputoptions@plt>
xor    %eax,%eax
call   1040 <inputdata@plt>
xor    %eax,%eax
call   1030 <makeweights@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <makevalues@plt>

LLVM IR (-O0):
define void @doinput() {
%1 = call i32 (...) @inputoptions()
%2 = call i32 (...) @inputdata()
%3 = call i32 (...) @makeweights()
%4 = call i32 (...) @makevalues()
ret void
}

LLVM IR (-O2):
define void @doinput() {
%1 = tail call i32 (...) @inputoptions()
%2 = tail call i32 (...) @inputdata()
%3 = tail call i32 (...) @makeweights()
%4 = tail call i32 (...) @makevalues()
ret void
}
char hasOdd(int n) {
  while (n) {
    if ((n % 10) % 2 == 0) {
      return 0;
    }
    n /= 10;
  }
  return 1;
}


x86 assembly (clang, -O0):
<hasOdd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114b <hasOdd+0x4b>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1138 <hasOdd+0x38>
movb   $0x0,-0x1(%rbp)
jmp    114f <hasOdd+0x4f>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1107 <hasOdd+0x7>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasOdd>:
mov    $0x1,%al
test   %edi,%edi
je     1137 <hasOdd+0x37>
cs nopw 0x0(%rax,%rax,1)
test   $0x1,%dil
je     1138 <hasOdd+0x38>
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    $0x9,%edi
cmp    $0x12,%edi
mov    %ecx,%edi
ja     1110 <hasOdd+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i8 @hasOdd(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %3
%9 = srem i32 %8, 10
%10 = srem i32 %9, 2
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %7
store i8 0, i8* %2
br label %17
13: ; preds = %7
%14 = load i32, i32* %3
%15 = sdiv i32 %14, 10
store i32 %15, i32* %3
br label %4
16: ; preds = %4
store i8 1, i8* %2
br label %17
17: ; preds = %16, %12
%18 = load i8, i8* %2
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @hasOdd(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %9
%4 = phi i32 [ %6, %9 ], [ %0, %1 ]
%5 = srem i32 %4, 10
%6 = sdiv i32 %4, 10
%7 = and i32 %5, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = add i32 %4, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %9, %1
%13 = phi i8 [ 1, %1 ], [ 1, %9 ], [ 0, %3 ]
ret i8 %13
}
/* Variables and functions */
int strlen(char *);
void pad_text(char str[], int width) {
  int i = 0;
  for (i = strlen(str); i < width; i++)
    str[i] = ' ';
  str[i] = 0;
}


x86 assembly (clang, -O0):
<pad_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <pad_text+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1132 <pad_text+0x22>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pad_text>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%rdx
cmp    %ebp,%eax
jge    114d <pad_text+0x2d>
lea    (%rbx,%rdx,1),%rdi
not    %edx
add    %ebp,%edx
add    $0x1,%rdx
mov    $0x20,%esi
call   1040 <memset@plt>
movslq %ebp,%rdx
movb   $0x0,(%rbx,%rdx,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @pad_text(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp slt i32 %3, %1
%5 = sext i32 %3 to i64
br i1 %4, label %6, label %13
6: ; preds = %2
%7 = getelementptr i8, i8* %0, i64 %5
%8 = xor i32 %3, -1
%9 = add i32 %8, %1
%10 = zext i32 %9 to i64
%11 = add nuw nsw i64 %10, 1
%12 = sext i32 %1 to i64
br label %13
13: ; preds = %6, %2
%14 = phi i64 [ %5, %2 ], [ %12, %6 ]
%15 = getelementptr inbounds i8, i8* %0, i64 %14
store i8 0, i8* %15
ret void
}
/* Variables and functions */
int signed_high_prod(unsigned int, unsigned int);
unsigned unsigned_high_prod(unsigned x, unsigned y) {
  int w = sizeof(int) << 3;
  return signed_high_prod(x, y) + ((int)y >> (w - 1)) &
         x + ((int)x >> (w - 1)) & y;
}


x86 assembly (clang, -O0):
<unsigned_high_prod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x20,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <signed_high_prod@plt>
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edx
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
sar    %cl,%edx
mov    -0x10(%rbp),%ecx
add    %edx,%ecx
and    %ecx,%eax
and    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsigned_high_prod>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <signed_high_prod@plt>
mov    %ebx,%ecx
sar    $0x1f,%ecx
add    %ecx,%eax
mov    %ebp,%ecx
sar    $0x1f,%ecx
add    %ebp,%ecx
and    %ebx,%ecx
and    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @unsigned_high_prod(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 32, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @signed_high_prod(i32 %6, i32 %7)
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = sub nsw i32 %10, 1
%12 = ashr i32 %9, %11
%13 = add nsw i32 %8, %12
%14 = load i32, i32* %3
%15 = load i32, i32* %3
%16 = load i32, i32* %5
%17 = sub nsw i32 %16, 1
%18 = ashr i32 %15, %17
%19 = add i32 %14, %18
%20 = and i32 %13, %19
%21 = load i32, i32* %4
%22 = and i32 %20, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @unsigned_high_prod(i32 %0, i32 %1) {
%3 = tail call i32 @signed_high_prod(i32 %0, i32 %1)
%4 = ashr i32 %1, 31
%5 = add nsw i32 %3, %4
%6 = ashr i32 %0, 31
%7 = add i32 %6, %0
%8 = and i32 %7, %1
%9 = and i32 %8, %5
ret i32 %9
}
/* Variables and functions */
double gsl_ran_dirichlet_lnpdf(long, double *, double *);
double logpdf_Dirichlet(long n, double *a, double *x) {
  return gsl_ran_dirichlet_lnpdf(n, a, x);
}


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

x86 assembly (clang, -O2):
<logpdf_Dirichlet>:
jmp    1030 <gsl_ran_dirichlet_lnpdf@plt>

LLVM IR (-O0):
define double @logpdf_Dirichlet(i64 %0, double* %1, double* %2) {
%4 = alloca i64
%5 = alloca double*
%6 = alloca double*
store i64 %0, i64* %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load i64, i64* %4
%8 = load double*, double** %5
%9 = load double*, double** %6
%10 = call double @gsl_ran_dirichlet_lnpdf(i64 %7, double* %8, double* %9)
ret double %10
}

LLVM IR (-O2):
define double @logpdf_Dirichlet(i64 %0, double* %1, double* %2) {
%4 = tail call double @gsl_ran_dirichlet_lnpdf(i64 %0, double* %1, double* %2)
ret double %4
}
void sci_adc_dump_register(void) {}


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

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

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

LLVM IR (-O2):
define void @sci_adc_dump_register() {
ret void
}
/* Type definitions */
struct dirent {
  char *d_name;
};

/* Variables and functions */
char *ext_get_d_name(struct dirent *ent) { return ent->d_name; }


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

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

LLVM IR (-O0):
%struct.dirent = type { i8* }
define i8* @ext_get_d_name(%struct.dirent* %0) {
%2 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %2
%3 = load %struct.dirent*, %struct.dirent** %2
%4 = getelementptr inbounds %struct.dirent, %struct.dirent* %3, i32 0, i32 0
%5 = load i8*, i8** %4
ret i8* %5
}

LLVM IR (-O2):
%struct.dirent = type { i8* }
define i8* @ext_get_d_name(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i8*, i8** %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ write_ble8(int /*<<< orphan*/ *, int /*<<< orphan*/);
void write_at_ble8(void *dest, uint8_t val, size_t offset) {
  uint8_t *d = dest;
  d += offset;
  write_ble8(d, val);
}


x86 assembly (clang, -O0):
<write_at_ble8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <write_ble8@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_at_ble8>:
lea    (%rdi,%rdx,4),%rdi
jmp    1030 <write_ble8@plt>

LLVM IR (-O0):
define void @write_at_ble8(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
%7 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %7
%10 = load i64, i64* %6
%11 = load i32*, i32** %7
%12 = getelementptr inbounds i32, i32* %11, i64 %10
store i32* %12, i32** %7
%13 = load i32*, i32** %7
%14 = load i32, i32* %5
%15 = call i32 @write_ble8(i32* %13, i32 %14)
ret void
}

LLVM IR (-O2):
define void @write_at_ble8(i8* %0, i32 %1, i64 %2) {
%4 = bitcast i8* %0 to i32*
%5 = getelementptr inbounds i32, i32* %4, i64 %2
%6 = tail call i32 @write_ble8(i32* %5, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int fork();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setsid();
int init_deamon() {
  int pid;
  if (pid = fork()) {
    exit(0);
  } else if (pid < 0) {
    exit(1);
  }
  setsid();
  printf("deamon process run\r\n");
}


x86 assembly (clang, -O0):
<init_deamon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <fork@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1162 <init_deamon+0x22>
xor    %edi,%edi
call   1050 <exit@plt>
cmpl   $0x0,-0x8(%rbp)
jge    1176 <init_deamon+0x36>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    117b <init_deamon+0x3b>
mov    $0x0,%al
call   1040 <setsid@plt>
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_deamon>:
push   %rax
xor    %eax,%eax
call   1060 <fork@plt>
test   %eax,%eax
jne    1160 <init_deamon+0x20>
xor    %eax,%eax
call   1040 <setsid@plt>
lea    0xea6(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"deamon process run\0D\0A\00"
define i32 @init_deamon() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @fork()
store i32 %3, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @exit(i32 0)
unreachable
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %7
br label %13
13: ; preds = %12
%14 = call i32 (...) @setsid()
%15 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@str = [20 x i8] c"deamon process run\0D\00"
define i32 @init_deamon() {
%1 = tail call i32 (...) @fork()
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @exit(i32 0)
unreachable
5: ; preds = %0
%6 = tail call i32 (...) @setsid()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
double pow(double, double);
double RPowerR(double base, double exponent) {
  if (base <= 0.0)
    return (0.0);
  return (pow(base, exponent));
}


x86 assembly (clang, -O0):
<RPowerR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     113d <RPowerR+0x2d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1151 <RPowerR+0x41>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RPowerR>:
xorpd  %xmm2,%xmm2
ucomisd %xmm0,%xmm2
jae    111f <RPowerR+0xf>
jmp    1030 <pow@plt>
xorpd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @RPowerR(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = fcmp ole double %6, 0.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %2
store double 0.000000e+00, double* %3
br label %13
9: ; preds = %2
%10 = load double, double* %4
%11 = load double, double* %5
%12 = call double @pow(double %10, double %11)
store double %12, double* %3
br label %13
13: ; preds = %9, %8
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @RPowerR(double %0, double %1) {
%3 = fcmp ugt double %0, 0.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call double @pow(double %0, double %1)
br label %6
6: ; preds = %2, %4
%7 = phi double [ %5, %4 ], [ 0.000000e+00, %2 ]
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bKash() {
  printf("This module is on development process.Please try again later.");
}


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

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

LLVM IR (-O0):
@.str = [62 x i8] c"This module is on development process.Please try again later.\00"
define void @bKash() {
%1 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [62 x i8] c"This module is on development process.Please try again later.\00"
define void @bKash() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct http_request {
  int dummy;
};

/* Variables and functions */
void native_runtime_http_body_chunk(void *addr, struct http_request *req,
                                    const void *data, size_t len) {
  void (*cb)(struct http_request *, const void *, size_t);
  *(void **)&(cb) = addr;
  cb(req, data, len);
}


x86 assembly (clang, -O0):
<native_runtime_http_body_chunk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   *%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<native_runtime_http_body_chunk>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
jmp    *%rax

LLVM IR (-O0):
%struct.http_request = type { i32 }
define void @native_runtime_http_body_chunk(i8* %0, %struct.http_request* %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca %struct.http_request*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca void (%struct.http_request*, i8*, i64)*
store i8* %0, i8** %5
store %struct.http_request* %1, %struct.http_request** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = load i8*, i8** %5
%11 = bitcast void (%struct.http_request*, i8*, i64)** %9 to i8**
store i8* %10, i8** %11
%12 = load void (%struct.http_request*, i8*, i64)*, void (%struct.http_request*, i8*, i64)** %9
%13 = load %struct.http_request*, %struct.http_request** %6
%14 = load i8*, i8** %7
%15 = load i64, i64* %8
ret void
}

LLVM IR (-O2):
%struct.http_request = type { i32 }
define void @native_runtime_http_body_chunk(i8* nocapture %0, %struct.http_request* %1, i8* %2, i64 %3) {
%5 = bitcast i8* %0 to void (%struct.http_request*, i8*, i64)*
tail call void %5(%struct.http_request* %1, i8* %2, i64 %3)
ret void
}
unsigned int bitAt(unsigned int k, unsigned int num) {
  return ((num >> (k - 1)) & 1);
}


x86 assembly (clang, -O0):
<bitAt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
shr    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitAt>:
mov    %esi,%eax
lea    -0x1(%rdi),%ecx
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @bitAt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = sub i32 %6, 1
%8 = lshr i32 %5, %7
%9 = and i32 %8, 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @bitAt(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = lshr i32 %1, %3
%5 = and i32 %4, 1
ret i32 %5
}
int produceOne(void) { return 10 - 9; }


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

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

LLVM IR (-O0):
define i32 @produceOne() {
ret i32 1
}

LLVM IR (-O2):
define i32 @produceOne() {
ret i32 1
}
/* Type definitions */
typedef unsigned int uint64_t;

/* Variables and functions */
void _wymix32(unsigned *A, unsigned *B) {
  uint64_t c = *A ^ 0x53c5ca59u;
  c *= *B ^ 0x74743c1bu;
  *A = (unsigned)c;
  *B = (unsigned)(c >> 32);
}


x86 assembly (clang, -O0):
<_wymix32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
xor    $0x53c5ca59,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
xor    $0x74743c1b,%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
mov    $0x20,%ecx
shr    %cl,%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_wymix32>:
mov    $0x53c5ca59,%eax
xor    (%rdi),%eax
mov    $0x74743c1b,%ecx
xor    (%rsi),%ecx
imul   %eax,%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define void @_wymix32(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = xor i32 %7, 1405471321
store i32 %8, i32* %5
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = xor i32 %10, 1953774619
%12 = load i32, i32* %5
%13 = mul i32 %12, %11
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = load i32*, i32** %3
store i32 %14, i32* %15
%16 = load i32, i32* %5
%17 = lshr i32 %16, 32
%18 = load i32*, i32** %4
store i32 %17, i32* %18
ret void
}

LLVM IR (-O2):
define void @_wymix32(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = xor i32 %3, 1405471321
%5 = load i32, i32* %1
%6 = xor i32 %5, 1953774619
%7 = mul i32 %6, %4
store i32 %7, i32* %0
ret void
}
void event_finger(p) char *p;
{}


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

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

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

LLVM IR (-O2):
define void @event_finger(i8* nocapture %0) {
ret void
}
int bitmap_size(int nr_bits) { return (nr_bits + 7) / 8; }


x86 assembly (clang, -O0):
<bitmap_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x7,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_size>:
lea    0x7(%rdi),%ecx
lea    0xe(%rdi),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @bitmap_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 7
%5 = sdiv i32 %4, 8
ret i32 %5
}

LLVM IR (-O2):
define i32 @bitmap_size(i32 %0) {
%2 = add nsw i32 %0, 7
%3 = sdiv i32 %2, 8
ret i32 %3
}
unsigned hashlevel(unsigned l) { return 1u << (l & 31); }


x86 assembly (clang, -O0):
<hashlevel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%eax
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashlevel>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @hashlevel(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 31
%5 = shl i32 1, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @hashlevel(i32 %0) {
%2 = and i32 %0, 31
%3 = shl nuw i32 1, %2
ret i32 %3
}
int egsy_gcm_mult_lena_msb_csr_debug_set(
    unsigned int dev_id, union egsy_gcm_mult_lena_msb_csr_debug_u *value) {
  return 1;
}


x86 assembly (clang, -O0):
<egsy_gcm_mult_lena_msb_csr_debug_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.egsy_gcm_mult_lena_msb_csr_debug_u = type opaque
define i32 @egsy_gcm_mult_lena_msb_csr_debug_set(i32 %0, %union.egsy_gcm_mult_lena_msb_csr_debug_u* %1) {
%3 = alloca i32
%4 = alloca %union.egsy_gcm_mult_lena_msb_csr_debug_u*
store i32 %0, i32* %3
store %union.egsy_gcm_mult_lena_msb_csr_debug_u* %1, %union.egsy_gcm_mult_lena_msb_csr_debug_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.egsy_gcm_mult_lena_msb_csr_debug_u = type opaque
define i32 @egsy_gcm_mult_lena_msb_csr_debug_set(i32 %0, %union.egsy_gcm_mult_lena_msb_csr_debug_u* nocapture readnone %1) {
ret i32 1
}
int __ltdouble(double a, double b) { return a < b; }


x86 assembly (clang, -O0):
<__ltdouble>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ltdouble>:
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @__ltdouble(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @__ltdouble(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int factorial_foo(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int fact;
  fact = factorial_foo(4);
  printf("fact = %d\n", fact);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"fact = %d\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
%7 = call i32 @factorial_foo(i32 4)
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"fact = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @factorial_foo(i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}