xunge/DecIR huggingface dataset:
void mls_type_data_bytearray_to_ushort(unsigned char *inb,
                                       unsigned short *outb) {
  *outb = (((unsigned short)(inb[0]) << 8) & (unsigned short)0xff00) |
          (((unsigned short)(inb[1])) & (unsigned short)0x00ff);
}


x86 assembly (clang, -O0):
<mls_type_data_bytearray_to_ushort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzwl %ax,%eax
shl    $0x8,%eax
and    $0xff00,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
movzwl %cx,%ecx
and    $0xff,%ecx
or     %ecx,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mls_type_data_bytearray_to_ushort>:
movzwl (%rdi),%eax
rol    $0x8,%ax
mov    %ax,(%rsi)
ret

LLVM IR (-O0):
define void @mls_type_data_bytearray_to_ushort(i8* %0, i16* %1) {
%3 = alloca i8*
%4 = alloca i16*
store i8* %0, i8** %3
store i16* %1, i16** %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i16
%9 = zext i16 %8 to i32
%10 = shl i32 %9, 8
%11 = and i32 %10, 65280
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = zext i8 %14 to i16
%16 = zext i16 %15 to i32
%17 = and i32 %16, 255
%18 = or i32 %11, %17
%19 = trunc i32 %18 to i16
%20 = load i16*, i16** %4
store i16 %19, i16* %20
ret void
}

LLVM IR (-O2):
define void @mls_type_data_bytearray_to_ushort(i8* nocapture %0, i16* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i16
%5 = shl nuw i16 %4, 8
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i16
%9 = or i16 %5, %8
store i16 %9, i16* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct tcphdr {
  int /*<<< orphan*/ ack_seq;
};

/* Variables and functions */
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
uint32_t tcphdr_ack_seq_ntohl(struct tcphdr *h) { return ntohl(h->ack_seq); }


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

x86 assembly (clang, -O2):
<tcphdr_ack_seq_ntohl>:
mov    (%rdi),%edi
jmp    1030 <ntohl@plt>

LLVM IR (-O0):
%struct.tcphdr = type { i32 }
define i32 @tcphdr_ack_seq_ntohl(%struct.tcphdr* %0) {
%2 = alloca %struct.tcphdr*
store %struct.tcphdr* %0, %struct.tcphdr** %2
%3 = load %struct.tcphdr*, %struct.tcphdr** %2
%4 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @ntohl(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.tcphdr = type { i32 }
define i32 @tcphdr_ack_seq_ntohl(%struct.tcphdr* nocapture %0) {
%2 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @ntohl(i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint8_t initializerHasRun(uint64_t *guard_object) {
  return (*((uint8_t *)guard_object) != 0);
}


x86 assembly (clang, -O0):
<initializerHasRun>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<initializerHasRun>:
xor    %eax,%eax
cmpl   $0x0,(%rdi)
setne  %al
ret

LLVM IR (-O0):
define i32 @initializerHasRun(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @initializerHasRun(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int strcmp(const char *s1, const char *s2) {
  while (*s1 != '\0' && *s1 == *s2) {
    s1++, s2++;
  }
  return (int)((unsigned char)*s1 - (unsigned char)*s2);
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <strcmp+0x47>
jmp    1164 <strcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
test   %al,%al
je     1123 <strcmp+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1125 <strcmp+0x25>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
movzbl %al,%eax
movzbl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %20, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %13, %16
br label %18
18: ; preds = %10, %5
%19 = phi i1 [ false, %5 ], [ %17, %10 ]
br i1 %19, label %20, label %25
20: ; preds = %18
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %4
br label %5
25: ; preds = %18
%26 = load i8*, i8** %3
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = load i8*, i8** %4
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = sub nsw i32 %28, %31
ret i32 %32
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = phi i8 [ 0, %2 ], [ 0, %11 ], [ %6, %5 ]
%19 = zext i8 %18 to i32
%20 = load i8, i8* %17
%21 = zext i8 %20 to i32
%22 = sub nsw i32 %19, %21
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ init_arrays();
int /*<<< orphan*/ main1(int, int, int);
int main(void) {
  init_arrays();
  main1(100, 100, 1);
  main1(0, 15, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <init_arrays@plt>
mov    $0x64,%esi
mov    $0x1,%edx
mov    %esi,%edi
call   1030 <main1@plt>
xor    %edx,%edx
mov    $0xf,%esi
mov    %edx,%edi
call   1030 <main1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <init_arrays@plt>
mov    $0x64,%edi
mov    $0x64,%esi
mov    $0x1,%edx
call   1030 <main1@plt>
xor    %edi,%edi
mov    $0xf,%esi
xor    %edx,%edx
call   1030 <main1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @init_arrays()
%3 = call i32 @main1(i32 100, i32 100, i32 1)
%4 = call i32 @main1(i32 0, i32 15, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init_arrays()
%2 = tail call i32 @main1(i32 100, i32 100, i32 1)
%3 = tail call i32 @main1(i32 0, i32 15, i32 0)
ret i32 0
}
void foo(int n) {
  volatile char arr[64 * 1024];
  arr[n] = 1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0xff90,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movb   $0x1,-0x10010(%rbp,%rax,1)
01
add    $0xff90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
sub    $0xff88,%rsp
movslq %edi,%rax
movb   $0x1,-0x80(%rsp,%rax,1)
add    $0xff88,%rsp
ret

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
%3 = alloca [65536 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [65536 x i8], [65536 x i8]* %3, i64 0, i64 %5
store volatile i8 1, i8* %6
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = alloca [65536 x i8]
%3 = getelementptr inbounds [65536 x i8], [65536 x i8]* %2, i64 0, i64 0
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [65536 x i8], [65536 x i8]* %2, i64 0, i64 %4
store volatile i8 1, i8* %5
ret void
}
void handle_URG(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_URG(i32 %0) {
ret void
}
void avcodec_get_subtitle_rect_class() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_get_subtitle_rect_class() {
ret void
}
void ux500_ci_dbg_init(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @ux500_ci_dbg_init() {
ret void
}
/* Variables and functions */
int ap_cmd_set_int(int, int, int);
int ap_set_looping(int session, int looping) {
  return (ap_cmd_set_int(session, 0xcc2c, looping));
}


x86 assembly (clang, -O0):
<ap_set_looping>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0xcc2c,%esi
call   1030 <ap_cmd_set_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_set_looping>:
mov    %esi,%edx
mov    $0xcc2c,%esi
jmp    1030 <ap_cmd_set_int@plt>

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

LLVM IR (-O2):
define i32 @ap_set_looping(i32 %0, i32 %1) {
%3 = tail call i32 @ap_cmd_set_int(i32 %0, i32 52268, i32 %1)
ret i32 %3
}
int g(int a, int b) {
  int c = a % b;
  return c != -0x7fffffff - 1;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x80000000,-0xc(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @g(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = srem i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, -2147483648
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @g(i32 %0, i32 %1) {
ret i32 1
}
int linearSearch(int A[], int s, int i, int n) {
  if (i == n)
    return -1;
  if (A[i] == s)
    return i;
  return linearSearch(A, s, ++i, n);
}


x86 assembly (clang, -O0):
<linearSearch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    113d <linearSearch+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <linearSearch+0x67>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jne    115c <linearSearch+0x4c>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <linearSearch+0x67>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
add    $0x1,%edx
mov    %edx,-0x18(%rbp)
mov    -0x1c(%rbp),%ecx
call   1030 <linearSearch@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linearSearch>:
mov    $0xffffffff,%eax
cmp    %ecx,%edx
je     111f <linearSearch+0x1f>
movslq %edx,%r8
lea    (%rdi,%r8,4),%rdi
cmp    %esi,(%rdi)
je     1120 <linearSearch+0x20>
add    $0x1,%edx
add    $0x4,%rdi
cmp    %edx,%ecx
jne    1110 <linearSearch+0x10>
ret
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @linearSearch(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %2, %3
br i1 %5, label %19, label %6
6: ; preds = %4
%7 = sext i32 %2 to i64
br label %8
8: ; preds = %6, %13
%9 = phi i64 [ %7, %6 ], [ %14, %13 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, %1
br i1 %12, label %17, label %13
13: ; preds = %8
%14 = add nsw i64 %9, 1
%15 = trunc i64 %14 to i32
%16 = icmp eq i32 %15, %3
br i1 %16, label %19, label %8
17: ; preds = %8
%18 = trunc i64 %9 to i32
br label %19
19: ; preds = %13, %17, %4
%20 = phi i32 [ -1, %4 ], [ %18, %17 ], [ -1, %13 ]
ret i32 %20
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void print_short_usage(FILE *stream) {
  (void)fputs("Usage: prng [-h] [-s SEED] [-u] [-x | -X] [-32] [algorithm]\n",
              stream);
}


x86 assembly (clang, -O0):
<print_short_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_short_usage>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x3c,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [61 x i8] c"Usage: prng [-h] [-s SEED] [-u] [-x | -X] [-32] [algorithm]\0A\00"
define void @print_short_usage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fputs(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i32* %3)
ret void
}

LLVM IR (-O2):
@.str = [61 x i8] c"Usage: prng [-h] [-s SEED] [-u] [-x | -X] [-32] [algorithm]\0A\00"
define void @print_short_usage(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i64 60, i64 1, i32* %0)
ret void
}
void post_block_hook(void) {}


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

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

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

LLVM IR (-O2):
define void @post_block_hook() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
void ft_base(unsigned int i, unsigned int base_length, char *base) {
  if (i > base_length) {
    ft_base(i / base_length, base_length, base);
    ft_base(i % base_length, base_length, base);
  } else
    ft_putchar(base[i]);
}


x86 assembly (clang, -O0):
<ft_base>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    116f <ft_base+0x4f>
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %eax,%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ft_base@plt>
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %edx,%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ft_base@plt>
jmp    117f <ft_base+0x5f>
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
movsbl (%rax,%rcx,1),%edi
call   1040 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_base>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %edi,%ebp
cmp    %esi,%edi
jbe    113e <ft_base+0x1e>
mov    %ebp,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%ebp
mov    %eax,%edi
mov    %rbx,%rdx
call   1030 <ft_base@plt>
mov    %ebp,%eax
movsbl (%rbx,%rax,1),%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_base(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp ugt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = udiv i32 %11, %12
%14 = load i32, i32* %5
%15 = load i8*, i8** %6
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = urem i32 %16, %17
%19 = load i32, i32* %5
%20 = load i8*, i8** %6
br label %28
21: ; preds = %3
%22 = load i8*, i8** %6
%23 = load i32, i32* %4
%24 = zext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i8, i8* %25
%27 = call i32 @ft_putchar(i8 signext %26)
br label %28
28: ; preds = %21, %10
ret void
}

LLVM IR (-O2):
define void @ft_base(i32 %0, i32 %1, i8* %2) {
%4 = icmp ugt i32 %0, %1
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = udiv i32 %0, %1
tail call void @ft_base(i32 %6, i32 %1, i8* %2)
%7 = urem i32 %0, %1
br label %8
8: ; preds = %5, %3
%9 = phi i32 [ %0, %3 ], [ %7, %5 ]
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %2, i64 %10
%12 = load i8, i8* %11
%13 = tail call i32 @ft_putchar(i8 signext %12)
ret void
}
int foo(void) {
  int ret, i;
  for (i = 0; i < 1; i++)
    ret = 0;
  for (i = 0; i < 1; i++)
    ret = 1;
  return ret;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    112a <foo+0x2a>
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110b <foo+0xb>
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    1150 <foo+0x50>
movl   $0x1,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1131 <foo+0x31>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 1
}
unsigned int readTime(unsigned char *buf) {
  return (buf[7] << 24) | (buf[4] << 16) | (buf[5] << 8) | buf[6];
}


x86 assembly (clang, -O0):
<readTime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x7(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x5(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x6(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readTime>:
movzbl 0x7(%rdi),%eax
shl    $0x18,%eax
movzbl 0x4(%rdi),%ecx
shl    $0x10,%ecx
or     %eax,%ecx
movzbl 0x5(%rdi),%edx
shl    $0x8,%edx
or     %ecx,%edx
movzbl 0x6(%rdi),%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @readTime(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 7
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 5
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 6
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = or i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @readTime(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 7
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw i32 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 4
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 16
%10 = or i32 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 5
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = or i32 %10, %14
%16 = getelementptr inbounds i8, i8* %0, i64 6
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = or i32 %15, %18
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void before_exit() { printf("\n\n"); }


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

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

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

LLVM IR (-O2):
@str = [2 x i8] c"\0A\00"
define void @before_exit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("What happens to this string?\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"What happens to this string?\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [29 x i8] c"What happens to this string?\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ delay_us(unsigned int);
void delayMicroseconds(unsigned int microseconds) { delay_us(microseconds); }


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

x86 assembly (clang, -O2):
<delayMicroseconds>:
jmp    1030 <delay_us@plt>

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

LLVM IR (-O2):
define void @delayMicroseconds(i32 %0) {
%2 = tail call i32 @delay_us(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ getfilelist(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  if (argc != 2) {
    printf("usage: %s  dirname\n", argv[0]);
    exit(-1);
  }
  getfilelist(argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     116d <main+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <getfilelist@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1143 <main+0x13>
mov    0x8(%rsi),%rdi
call   1040 <getfilelist@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    (%rsi),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"usage: %s dirname\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 @exit(i32 -1)
unreachable
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @getfilelist(i8* %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"usage: %s dirname\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @getfilelist(i8* %10)
ret i32 0
}
float mid_func(float f) {
  return 5.0 - (1.0 / (1.2 - 1.0 + f)) + 0.83333333333;
}


x86 assembly (clang, -O0):
<mid_func>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xefe(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  0xed6(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  0xec2(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mid_func>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
movsd  0xef4(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  0xef0(%rip),%xmm1
addsd  0xef0(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @mid_func(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fadd double 0x3FC9999999999998, %4
%6 = fdiv double 1.000000e+00, %5
%7 = fsub double 5.000000e+00, %6
%8 = fadd double %7, 0x3FEAAAAAAAAA3563
%9 = fptrunc double %8 to float
ret float %9
}

LLVM IR (-O2):
define float @mid_func(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, 0x3FC9999999999998
%4 = fdiv double 1.000000e+00, %3
%5 = fsub double 5.000000e+00, %4
%6 = fadd double %5, 0x3FEAAAAAAAAA3563
%7 = fptrunc double %6 to float
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xfree(void *mem) { free(mem); }


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

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

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

LLVM IR (-O2):
define void @xfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int get_mdterm();
void md_draw_line_gray(int x1, int y1, int x2, int y2, int width) {
  switch (get_mdterm()) {}
}


x86 assembly (clang, -O0):
<md_draw_line_gray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
xor    %eax,%eax
call   1030 <get_mdterm@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @md_draw_line_gray(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = call i32 (...) @get_mdterm()
switch i32 %11, label %12 [
]
12: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @md_draw_line_gray(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 (...) @get_mdterm()
ret void
}
/* Variables and functions */
int COLOR_PAIR(short);
int color_pair(short n) { return COLOR_PAIR(n); }


x86 assembly (clang, -O0):
<color_pair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <COLOR_PAIR@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_pair>:
jmp    1030 <COLOR_PAIR@plt>

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

LLVM IR (-O2):
define i32 @color_pair(i16 signext %0) {
%2 = tail call i32 @COLOR_PAIR(i16 signext %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_help(char *command_line) {
  printf(
      "Usage: %s (--rev) (--append [string_to_append_to_header]) (--to-fasta) "
      "(--illumina-trinity) sequences_1.fastq/a sequences_2.fastq/a ... \n",
      command_line);
}


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

x86 assembly (clang, -O2):
<print_help>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [138 x i8] c"Usage: %s (--rev) (--append [string_to_append_to_header]) (--to-fasta) (--illumina-trinity) sequences_1.fastq/a sequences_2.fastq/a ... \0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [138 x i8] c"Usage: %s (--rev) (--append [string_to_append_to_header]) (--to-fasta) (--illumina-trinity) sequences_1.fastq/a sequences_2.fastq/a ... \0A\00"
define void @print_help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int unhash_test();
int main(int argc, char **argv) { return unhash_test(); }


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @unhash_test()
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @unhash_test()
ret i32 %3
}
/* Variables and functions */
double sin(double);
double sinc(double x) { return x == 0 ? 1 : sin(x) / x; }


x86 assembly (clang, -O0):
<sinc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1147 <sinc+0x37>
jp     1147 <sinc+0x37>
movsd  0xec3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    115b <sinc+0x4b>
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinc>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1127 <sinc+0x17>
jp     1127 <sinc+0x17>
movsd  0xedb(%rip),%xmm0
pop    %rax
ret
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sinc(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oeq double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load double, double* %2
%8 = call double @sin(double %7)
%9 = load double, double* %2
%10 = fdiv double %8, %9
br label %11
11: ; preds = %6, %5
%12 = phi double [ 1.000000e+00, %5 ], [ %10, %6 ]
ret double %12
}

LLVM IR (-O2):
define double @sinc(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call double @sin(double %0)
%5 = fdiv double %4, %0
br label %6
6: ; preds = %1, %3
%7 = phi double [ %5, %3 ], [ 1.000000e+00, %1 ]
ret double %7
}
/* Variables and functions */
int get_ones_count(unsigned int);
short is_power_of_two(unsigned int number) {
  return (1 == get_ones_count(number)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_power_of_two>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_ones_count@plt>
mov    %eax,%edx
mov    $0x1,%ecx
xor    %eax,%eax
cmp    %edx,%ecx
cmove  %ecx,%eax
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_power_of_two>:
push   %rax
call   1030 <get_ones_count@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @is_power_of_two(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @get_ones_count(i32 %3)
%5 = icmp eq i32 1, %4
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
%8 = trunc i32 %7 to i16
ret i16 %8
}

LLVM IR (-O2):
define signext i16 @is_power_of_two(i32 %0) {
%2 = tail call i32 @get_ones_count(i32 %0)
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i16
ret i16 %4
}
void IPCCtoMFlagAcknowledge(unsigned long ulFlags) {
  (*((volatile unsigned long *)(0x400FB700 + 0x000000000))) |= ulFlags;
}


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

x86 assembly (clang, -O2):
<IPCCtoMFlagAcknowledge>:
or     %rdi,0x400fb700
40
ret

LLVM IR (-O0):
define void @IPCCtoMFlagAcknowledge(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074771712 to i64*)
%5 = or i64 %4, %3
store volatile i64 %5, i64* inttoptr (i64 1074771712 to i64*)
ret void
}

LLVM IR (-O2):
define void @IPCCtoMFlagAcknowledge(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074771712 to i64*)
%3 = or i64 %2, %0
store volatile i64 %3, i64* inttoptr (i64 1074771712 to i64*)
ret void
}
/* Variables and functions */
int fibbo(int);
int /*<<< orphan*/ printf(char *, int);
void main(void) {
  int a = fibbo(8);
  printf("%d\n", a);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @fibbo(i32 8)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
struct list_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct list_node *);
void list_node_cleanup(struct list_node *node) { free(node); }


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

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

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

LLVM IR (-O2):
%struct.list_node = type { i32 }
define void @list_node_cleanup(%struct.list_node* nocapture %0) {
%2 = tail call i32 @free(%struct.list_node* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void char_array() {
  char amessage[] = "nw is the time";
  char *pmessage = "now is the time";
  printf("%c\n", *(pmessage + 1));
  amessage[1] = 'e';
  printf("%c\n", amessage[1]);
}


x86 assembly (clang, -O0):
<char_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xed9(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xed1(%rip),%al
mov    %al,-0x1(%rbp)
lea    0xec8(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
lea    0xec9(%rip),%rdi
movsbl 0x1(%rax),%esi
call   1030 <printf@plt>
movb   $0x65,-0xe(%rbp)
lea    0xeb5(%rip),%rdi
movsbl -0xe(%rbp),%esi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_array>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x6f,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x65,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@__const.char_array.amessage = [15 x i8] c"nw is the time\00"
@.str = [16 x i8] c"now is the time\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define void @char_array() {
%1 = alloca [15 x i8]
%2 = alloca i8*
%3 = bitcast [15 x i8]* %1 to i8*
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %6)
%8 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 1
store i8 101, i8* %8
%9 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 1
%10 = load i8, i8* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %10)
ret void
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%c\0A\00"
define void @char_array() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext 111)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext 101)
ret void
}
void rand_close() { return; }


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

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

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

LLVM IR (-O2):
define void @rand_close() {
ret void
}
void set_bitmap(unsigned char bitmap[], unsigned char value, unsigned int nr) {
  register int i;
  for (i = 0; i < nr; i++) {
    bitmap[i] = value;
  }
}


x86 assembly (clang, -O0):
<set_bitmap>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jae    1140 <set_bitmap+0x40>
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1118 <set_bitmap+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bitmap>:
test   %edx,%edx
je     1124 <set_bitmap+0x14>
push   %rax
mov    %edx,%edx
movzbl %sil,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @set_bitmap(i8* nocapture writeonly %0, i8 zeroext %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
struct ygo_replay {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int ygo_replay_sread(struct ygo_replay *replay, const char *data, size_t size) {
  fputs("ygo_replay_sread: not implemented", stderr);
  return -1;
}


x86 assembly (clang, -O0):
<ygo_replay_sread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ygo_replay_sread>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ygo_replay = type { i32 }
@.str = [34 x i8] c"ygo_replay_sread: not implemented\00"
@stderr = global i32 0
define i32 @ygo_replay_sread(%struct.ygo_replay* %0, i8* %1, i64 %2) {
%4 = alloca %struct.ygo_replay*
%5 = alloca i8*
%6 = alloca i64
store %struct.ygo_replay* %0, %struct.ygo_replay** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* @stderr
%8 = call i32 @fputs(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 -1
}

LLVM IR (-O2):
%struct.ygo_replay = type { i32 }
@.str = [34 x i8] c"ygo_replay_sread: not implemented\00"
@stderr = global i32 0
define i32 @ygo_replay_sread(%struct.ygo_replay* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fputs(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 -1
}
/* Variables and functions */
int find_nth_int(int *, int, int);
int median_int(int *array, int n_elements) {
  return find_nth_int(array, n_elements, (n_elements - 1) / 2);
}


x86 assembly (clang, -O0):
<median_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
call   1030 <find_nth_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<median_int>:
lea    -0x1(%rsi),%eax
shr    $0x1f,%eax
lea    (%rsi,%rax,1),%edx
add    $0xffffffff,%edx
sar    %edx
jmp    1030 <find_nth_int@plt>

LLVM IR (-O0):
define i32 @median_int(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = sdiv i32 %8, 2
%10 = call i32 @find_nth_int(i32* %5, i32 %6, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @median_int(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sdiv i32 %3, 2
%5 = tail call i32 @find_nth_int(i32* %0, i32 %1, i32 %4)
ret i32 %5
}
struct bwb_line *bwb_DEFSTR(struct bwb_line *l) {
  bwx_DEBUG(__FUNCTION__);
  var_defx(l, '$');
  return bwb_zline(l);
}


x86 assembly (clang, -O0):
<bwb_DEFSTR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1040 <bwx_DEBUG@plt>
mov    -0x8(%rbp),%rdi
mov    $0x24,%esi
mov    $0x0,%al
call   1030 <var_defx@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <bwb_zline@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bwb_DEFSTR>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <bwx_DEBUG@plt>
mov    %rbx,%rdi
mov    $0x24,%esi
xor    %eax,%eax
call   1030 <var_defx@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <bwb_zline@plt>
cltq
pop    %rbx
ret

LLVM IR (-O0):
%struct.bwb_line = type opaque
@__FUNCTION__.bwb_DEFSTR = [11 x i8] c"bwb_DEFSTR\00"
define %struct.bwb_line* @bwb_DEFSTR(%struct.bwb_line* %0) {
%2 = alloca %struct.bwb_line*
store %struct.bwb_line* %0, %struct.bwb_line** %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.bwb_DEFSTR, i64 0, i64 0))
%4 = load %struct.bwb_line*, %struct.bwb_line** %2
%5 = call i32 (%struct.bwb_line*, i32, ...) bitcast (i32 (...)* @var_defx to i32 (%struct.bwb_line*, i32, ...)*)(%struct.bwb_line* %4, i32 36)
%6 = load %struct.bwb_line*, %struct.bwb_line** %2
%7 = call i32 (%struct.bwb_line*, ...) bitcast (i32 (...)* @bwb_zline to i32 (%struct.bwb_line*, ...)*)(%struct.bwb_line* %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to %struct.bwb_line*
ret %struct.bwb_line* %9
}

LLVM IR (-O2):
%struct.bwb_line = type opaque
@__FUNCTION__.bwb_DEFSTR = [11 x i8] c"bwb_DEFSTR\00"
define %struct.bwb_line* @bwb_DEFSTR(%struct.bwb_line* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.bwb_DEFSTR, i64 0, i64 0))
%3 = tail call i32 (%struct.bwb_line*, i32, ...) bitcast (i32 (...)* @var_defx to i32 (%struct.bwb_line*, i32, ...)*)(%struct.bwb_line* %0, i32 36)
%4 = tail call i32 (%struct.bwb_line*, ...) bitcast (i32 (...)* @bwb_zline to i32 (%struct.bwb_line*, ...)*)(%struct.bwb_line* %0)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to %struct.bwb_line*
ret %struct.bwb_line* %6
}