xunge/DecIR huggingface dataset:
unsigned int LookupUser(unsigned char *username, unsigned char *password) {
  return 0xffff;
}


x86 assembly (clang, -O0):
<LookupUser>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @LookupUser(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 65535
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *prog) {
  printf("Usage: %s [<option> <id>]\n"
         "  Where <option> is one of:\n"
         "    N - new item\n"
         "    E - edit item\n"
         "    V - view item\n"
         "    D - delete item\n"
         "    L - list all items\n"
         "  <id> is a product ID -- always enter one, even for L\n",
         prog);
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [206 x i8] c"Usage: %s [<option> <id>]\0A Where <option> is one of:\0A N - new item\0A E - edit item\0A V - view item\0A D - delete item\0A L - list all items\0A <id> is a product ID -- always enter one, even for L\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([206 x i8], [206 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [206 x i8] c"Usage: %s [<option> <id>]\0A Where <option> is one of:\0A N - new item\0A E - edit item\0A V - view item\0A D - delete item\0A L - list all items\0A <id> is a product ID -- always enter one, even for L\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([206 x i8], [206 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(void *, int /*<<< orphan*/ *, int);
void set_uint32(void *buf, uint32_t val) {
  uint32_t u = htonl(val);
  memcpy(buf, &u, 4);
}


x86 assembly (clang, -O0):
<set_uint32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_uint32>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htonl@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @set_uint32(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @htonl(i32 %1)
store i32 %5, i32* %3
%6 = call i32 @memcpy(i8* %0, i32* %3, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __gmp_get_memory_functions(int /*<<< orphan*/ *,
                                              int /*<<< orphan*/ *,
                                              void (*)(void *, size_t));
scalar_t__ strlen(char *);
void stub1(void *, size_t);
void mpc_free_str(char *str) {
  void (*freefunc)(void *, size_t);
  __gmp_get_memory_functions(NULL, NULL, &freefunc);
  (*freefunc)(str, strlen(str) + 1);
}


x86 assembly (clang, -O0):
<mpc_free_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1030 <__gmp_get_memory_functions@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rsi
mov    -0x18(%rbp),%rax
add    $0x1,%rsi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpc_free_str>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsp,%rdx
xor    %edi,%edi
xor    %esi,%esi
call   1030 <__gmp_get_memory_functions@plt>
mov    (%rsp),%r14
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rsi
mov    %rbx,%rdi
call   *%r14
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @mpc_free_str(i8* %0) {
%2 = alloca i8*
%3 = alloca void (i8*, i64)*
store i8* %0, i8** %2
%4 = bitcast void (i8*, i64)** %3 to void (i8*, i64)*
%5 = call i32 @__gmp_get_memory_functions(i32* null, i32* null, void (i8*, i64)* %4)
%6 = load void (i8*, i64)*, void (i8*, i64)** %3
%7 = load i8*, i8** %2
%8 = load i8*, i8** %2
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %9, 1
ret void
}

LLVM IR (-O2):
define void @mpc_free_str(i8* %0) {
%2 = alloca void (i8*, i64)*
%3 = bitcast void (i8*, i64)** %2 to i8*
%4 = bitcast void (i8*, i64)** %2 to void (i8*, i64)*
%5 = call i32 @__gmp_get_memory_functions(i32* null, i32* null, void (i8*, i64)* %4)
%6 = load void (i8*, i64)*, void (i8*, i64)** %2
%7 = call i64 @strlen(i8* dereferenceable(1) %0)
%8 = add nsw i64 %7, 1
ret void
}
int console_record_avail(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @console_record_avail() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TSI0_DriverIRQHandler();
__attribute__((weak, section(".after_vectors"))) void TSI0_IRQHandler(void) {
  TSI0_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @TSI0_IRQHandler() section ".after_vectors" {
%1 = call i32 (...) @TSI0_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @TSI0_IRQHandler() section ".after_vectors" {
%1 = tail call i32 (...) @TSI0_DriverIRQHandler()
ret void
}
/* Variables and functions */
long double lgamma(double);
long double lgammal(long double x) { return lgamma((double)x); }


x86 assembly (clang, -O0):
<lgammal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <lgamma@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lgammal>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <lgamma@plt>

LLVM IR (-O0):
define x86_fp80 @lgammal(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @lgamma(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @lgammal(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @lgamma(double %2)
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ c2_addr_write(int);
int /*<<< orphan*/ c2_data_write(int, int);
int /*<<< orphan*/ usleep(int);
void flash_init(void) {
  c2_addr_write(0x02);
  c2_data_write(0x02, 1);
  c2_data_write(0x01, 1);
  usleep(20000);
}


x86 assembly (clang, -O0):
<flash_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <c2_addr_write@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1040 <c2_data_write@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1040 <c2_data_write@plt>
mov    $0x4e20,%edi
call   1050 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flash_init>:
push   %rax
mov    $0x2,%edi
call   1030 <c2_addr_write@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1040 <c2_data_write@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1040 <c2_data_write@plt>
mov    $0x4e20,%edi
pop    %rax
jmp    1050 <usleep@plt>

LLVM IR (-O0):
define void @flash_init() {
%1 = call i32 @c2_addr_write(i32 2)
%2 = call i32 @c2_data_write(i32 2, i32 1)
%3 = call i32 @c2_data_write(i32 1, i32 1)
%4 = call i32 @usleep(i32 20000)
ret void
}

LLVM IR (-O2):
define void @flash_init() {
%1 = tail call i32 @c2_addr_write(i32 2)
%2 = tail call i32 @c2_data_write(i32 2, i32 1)
%3 = tail call i32 @c2_data_write(i32 1, i32 1)
%4 = tail call i32 @usleep(i32 20000)
ret void
}
void logd(const char *cmd, const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @logd(i8* nocapture %0, i8* nocapture %1, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ curve_setup();
int /*<<< orphan*/ drawnumber_setup();
int /*<<< orphan*/ gtemplate_setup();
int /*<<< orphan*/ plot_setup();
int /*<<< orphan*/ template_setup();
void g_template_setup(void) {
  template_setup();
  gtemplate_setup();
  curve_setup();
  plot_setup();
  drawnumber_setup();
}


x86 assembly (clang, -O0):
<g_template_setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <template_setup@plt>
mov    $0x0,%al
call   1060 <gtemplate_setup@plt>
mov    $0x0,%al
call   1040 <curve_setup@plt>
mov    $0x0,%al
call   1050 <plot_setup@plt>
mov    $0x0,%al
call   1070 <drawnumber_setup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_template_setup>:
push   %rax
xor    %eax,%eax
call   1030 <template_setup@plt>
xor    %eax,%eax
call   1060 <gtemplate_setup@plt>
xor    %eax,%eax
call   1040 <curve_setup@plt>
xor    %eax,%eax
call   1050 <plot_setup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <drawnumber_setup@plt>

LLVM IR (-O0):
define void @g_template_setup() {
%1 = call i32 (...) @template_setup()
%2 = call i32 (...) @gtemplate_setup()
%3 = call i32 (...) @curve_setup()
%4 = call i32 (...) @plot_setup()
%5 = call i32 (...) @drawnumber_setup()
ret void
}

LLVM IR (-O2):
define void @g_template_setup() {
%1 = tail call i32 (...) @template_setup()
%2 = tail call i32 (...) @gtemplate_setup()
%3 = tail call i32 (...) @curve_setup()
%4 = tail call i32 (...) @plot_setup()
%5 = tail call i32 (...) @drawnumber_setup()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lookNarray(char *, unsigned int);
void lookreal16array_(char *x, unsigned int *n) { lookNarray(x, (*n * 16)); }


x86 assembly (clang, -O0):
<lookreal16array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
shl    $0x4,%esi
call   1030 <lookNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookreal16array_>:
mov    (%rsi),%esi
shl    $0x4,%esi
jmp    1030 <lookNarray@plt>

LLVM IR (-O0):
define void @lookreal16array_(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = mul i32 %7, 16
%9 = call i32 @lookNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @lookreal16array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 4
%5 = tail call i32 @lookNarray(i8* %0, i32 %4)
ret void
}
/* Type definitions */
struct frame {
  int dummy;
};
struct fcgi {
  int dummy;
};

/* Variables and functions */
int process_abort_request(struct frame *f, struct fcgi *fcgi, const char *str,
                          size_t num) {
  return 1;
}


x86 assembly (clang, -O0):
<process_abort_request>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.frame = type { i32 }
%struct.fcgi = type { i32 }
define i32 @process_abort_request(%struct.frame* %0, %struct.fcgi* %1, i8* %2, i64 %3) {
%5 = alloca %struct.frame*
%6 = alloca %struct.fcgi*
%7 = alloca i8*
%8 = alloca i64
store %struct.frame* %0, %struct.frame** %5
store %struct.fcgi* %1, %struct.fcgi** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
ret i32 1
}

LLVM IR (-O2):
%struct.frame = type { i32 }
%struct.fcgi = type { i32 }
define i32 @process_abort_request(%struct.frame* nocapture readnone %0, %struct.fcgi* nocapture readnone %1, i8* nocapture readnone %2, i64 %3) {
ret i32 1
}
void begin() {}


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

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

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

LLVM IR (-O2):
define void @begin() {
ret void
}
char *skip_char_match_replace(char ch, char *str, char replace) {
  while (*str != '\0' && *str == ch) {
    *str = replace;
    str++;
  }
  return str;
}


x86 assembly (clang, -O0):
<skip_char_match_replace>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x12(%rbp)
je     113b <skip_char_match_replace+0x3b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
test   $0x1,%al
jne    114b <skip_char_match_replace+0x4b>
jmp    1165 <skip_char_match_replace+0x65>
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1113 <skip_char_match_replace+0x13>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_char_match_replace>:
mov    %rsi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1123 <skip_char_match_replace+0x23>
nopl   0x0(%rax)
cmp    %dil,%cl
jne    1123 <skip_char_match_replace+0x23>
mov    %dl,(%rax)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <skip_char_match_replace+0x10>
ret

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

LLVM IR (-O2):
define i8* @skip_char_match_replace(i8 signext %0, i8* %1, i8 signext %2) {
%4 = load i8, i8* %1
%5 = icmp ne i8 %4, 0
%6 = icmp eq i8 %4, %0
%7 = and i1 %5, %6
br i1 %7, label %8, label %15
8: ; preds = %3, %8
%9 = phi i8* [ %10, %8 ], [ %1, %3 ]
store i8 %2, i8* %9
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
%13 = icmp eq i8 %11, %0
%14 = and i1 %12, %13
br i1 %14, label %8, label %15
15: ; preds = %8, %3
%16 = phi i8* [ %1, %3 ], [ %10, %8 ]
ret i8* %16
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/);
void iodelay(void) {
  struct timespec t;
  t.tv_sec = 0;
  t.tv_nsec = 1000;
  nanosleep(&t, 0);
}


x86 assembly (clang, -O0):
<iodelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movl   $0x3e8,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iodelay>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movl   $0x3e8,0x8(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define void @iodelay() {
%1 = alloca %struct.timespec
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
store i64 0, i64* %2
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
store i32 1000, i32* %3
%4 = call i32 @nanosleep(%struct.timespec* %1, i32 0)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define void @iodelay() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
store i64 0, i64* %3
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
store i32 1000, i32* %4
%5 = call i32 @nanosleep(%struct.timespec* %1, i32 0)
ret void
}
/* Variables and functions */
void *Cyc_Absyn_bounds_one();
void *Cyc_Absyn_compress(void *);
int /*<<< orphan*/ Cyc_Unify_unify(void *, void *);
void *Cyc_Tcutil_force_bounds_one(void *t) {
  void *_T0;
  void *_T1;
  void *_T2;
  _T0 = t;
  _T1 = Cyc_Absyn_bounds_one();
  Cyc_Unify_unify(_T0, _T1);
  _T2 = Cyc_Absyn_compress(t);
  return _T2;
}


x86 assembly (clang, -O0):
<Cyc_Tcutil_force_bounds_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <Cyc_Absyn_bounds_one@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <Cyc_Unify_unify@plt>
mov    -0x8(%rbp),%rdi
call   1040 <Cyc_Absyn_compress@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Tcutil_force_bounds_one>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <Cyc_Absyn_bounds_one@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <Cyc_Unify_unify@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <Cyc_Absyn_compress@plt>

LLVM IR (-O0):
define i8* @Cyc_Tcutil_force_bounds_one(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %2
%6 = load i8*, i8** %2
store i8* %6, i8** %3
%7 = call i8* (...) @Cyc_Absyn_bounds_one()
store i8* %7, i8** %4
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @Cyc_Unify_unify(i8* %8, i8* %9)
%11 = load i8*, i8** %2
%12 = call i8* @Cyc_Absyn_compress(i8* %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
define i8* @Cyc_Tcutil_force_bounds_one(i8* %0) {
%2 = tail call i8* (...) @Cyc_Absyn_bounds_one()
%3 = tail call i32 @Cyc_Unify_unify(i8* %0, i8* %2)
%4 = tail call i8* @Cyc_Absyn_compress(i8* %0)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void fprint_rr(FILE *stream) {
  fprintf(stream, "RR    A                         ");
}


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

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

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

LLVM IR (-O2):
@.str = [33 x i8] c"RR A \00"
define void @fprint_rr(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 32, i64 1, i32* %0)
ret void
}
/* Variables and functions */
char *escape_string(char *);
int /*<<< orphan*/ s_internal(char *, char *, char *, int);
char *s_escape_string(char *str) {
  char *r = escape_string(str);
  (s_internal(str, "str",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/Rudolph-Miller/roswell/refs/heads/"
              "master/src/util_string.c",
              190));
  return r;
}


x86 assembly (clang, -O0):
<s_escape_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <escape_string@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebc(%rip),%rsi
lea    0xeb9(%rip),%rdx
mov    $0xbe,%ecx
call   1030 <s_internal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_escape_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <escape_string@plt>
mov    %rax,%r14
lea    0xeca(%rip),%rsi
lea    0xec7(%rip),%rdx
mov    %rbx,%rdi
mov    $0xbe,%ecx
call   1030 <s_internal@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"str\00"
@.str.1 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Rudolph-Miller/roswell/refs/heads/master/src/util_string.c\00"
define i8* @s_escape_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @escape_string(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %2
%7 = call i32 @s_internal(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 190)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"str\00"
@.str.1 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Rudolph-Miller/roswell/refs/heads/master/src/util_string.c\00"
define i8* @s_escape_string(i8* %0) {
%2 = tail call i8* @escape_string(i8* %0)
%3 = tail call i32 @s_internal(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 190)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ some_f(int, int, int);
void fun_ifthenelse3() { some_f(0 ? 1 : 1, 0 ? 2 : 2, 0 ? 3 : 3); }


x86 assembly (clang, -O0):
<fun_ifthenelse3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <some_f@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_ifthenelse3>:
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
jmp    1030 <some_f@plt>

LLVM IR (-O0):
define void @fun_ifthenelse3() {
%1 = call i32 @some_f(i32 1, i32 2, i32 3)
ret void
}

LLVM IR (-O2):
define void @fun_ifthenelse3() {
%1 = tail call i32 @some_f(i32 1, i32 2, i32 3)
ret void
}
void evict_line_from_cache(volatile void *ptr) {
  asm volatile("clflush (%0)" ::"r"(ptr));
}


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

x86 assembly (clang, -O2):
<evict_line_from_cache>:
clflush (%rdi)
ret

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

LLVM IR (-O2):
define void @evict_line_from_cache(i8* %0) {
tail call void asm sideeffect "clflush ($0)", "r,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
char *ATLAS_GET_KEY_NAME(int keyId) {
  if (keyId <= 0)
    return "";
  if (keyId == 1)
    return "RACE_TIME";
  return "";
}


x86 assembly (clang, -O0):
<ATLAS_GET_KEY_NAME>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1121 <ATLAS_GET_KEY_NAME+0x21>
lea    0xef1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <ATLAS_GET_KEY_NAME+0x46>
cmpl   $0x1,-0xc(%rbp)
jne    113b <ATLAS_GET_KEY_NAME+0x3b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <ATLAS_GET_KEY_NAME+0x46>
lea    0xec7(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ATLAS_GET_KEY_NAME>:
cmp    $0x1,%edi
lea    0xef6(%rip),%rax
lea    0xef8(%rip),%rcx
cmovne %rcx,%rax
cmovl  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [10 x i8] c"RACE_TIME\00"
define i8* @ATLAS_GET_KEY_NAME(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %7
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %12
11: ; preds = %7
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [10 x i8] c"RACE_TIME\00"
define i8* @ATLAS_GET_KEY_NAME(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = icmp eq i32 %0, 1
%4 = select i1 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
%5 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %4
ret i8* %5
}
int call_callback(int (*fn)(int), int a) { return fn(a); }


x86 assembly (clang, -O0):
<call_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_callback>:
mov    %rdi,%rax
mov    %esi,%edi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @call_callback(i32 (i32)* nocapture %0, i32 %1) {
%3 = tail call i32 %0(i32 %1)
ret i32 %3
}
int c_isspace(int c) {
  switch (c) {
  case ' ':
  case '\t':
  case '\n':
  case '\v':
  case '\f':
  case '\r':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<c_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffff7,%eax
sub    $0x5,%eax
jb     112f <c_isspace+0x2f>
jmp    111e <c_isspace+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
jne    113b <c_isspace+0x3b>
jmp    112f <c_isspace+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1142 <c_isspace+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_isspace>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x5,%ecx
jae    110e <c_isspace+0xe>
ret
cmp    $0x20,%edi
je     110d <c_isspace+0xd>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @c_isspace(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 32, label %5
i32 9, label %5
i32 10, label %5
i32 11, label %5
i32 12, label %5
i32 13, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @c_isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %3
i32 9, label %3
i32 10, label %3
i32 11, label %3
i32 12, label %3
i32 13, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
int intlen(int n, int base) {
  int len;
  for (len = 0; n != 0; n /= base, len++) {
  }
  return len;
}


x86 assembly (clang, -O0):
<intlen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113a <intlen+0x3a>
jmp    1120 <intlen+0x20>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <intlen+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intlen>:
test   %edi,%edi
je     111d <intlen+0x1d>
mov    %edi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cltd
idiv   %esi
add    $0x1,%ecx
test   %eax,%eax
jne    1110 <intlen+0x10>
mov    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @intlen(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ 0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = sdiv i32 %6, %1
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %2
%11 = phi i32 [ 0, %2 ], [ %8, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ send_freq_to_FT817(double);
void plugin_set_downlink_frequency(double frequency) {
  send_freq_to_FT817(frequency);
}


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

x86 assembly (clang, -O2):
<plugin_set_downlink_frequency>:
jmp    1030 <send_freq_to_FT817@plt>

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

LLVM IR (-O2):
define void @plugin_set_downlink_frequency(double %0) {
%2 = tail call i32 @send_freq_to_FT817(double %0)
ret void
}
/* Variables and functions */
bool is_leap_year(int y) { return !(y % 4) && ((y % 100) || !(y % 400)); }


x86 assembly (clang, -O0):
<is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1155 <is_leap_year+0x55>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114f <is_leap_year+0x4f>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
xor    $0xff,%al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap_year>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <is_leap_year+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <is_leap_year+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @is_leap_year(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = icmp ne i32 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 400
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br label %15
15: ; preds = %10, %6
%16 = phi i1 [ true, %6 ], [ %14, %10 ]
br label %17
17: ; preds = %15, %1
%18 = phi i1 [ false, %1 ], [ %16, %15 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @is_leap_year(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ logf(int);
float log1pf(float x) { logf(1 + x); }


x86 assembly (clang, -O0):
<log1pf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  0xedb(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <logf@plt>
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log1pf>:
addss  0xee8(%rip),%xmm0
cvttss2si %xmm0,%edi
jmp    1030 <logf@plt>

LLVM IR (-O0):
define float @log1pf(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fadd float 1.000000e+00, %4
%6 = fptosi float %5 to i32
%7 = call i32 @logf(i32 %6)
%8 = load float, float* %2
ret float %8
}

LLVM IR (-O2):
define float @log1pf(float %0) {
%2 = fadd float %0, 1.000000e+00
%3 = fptosi float %2 to i32
%4 = tail call i32 @logf(i32 %3)
ret float undef
}
void Con_Close(void) {}


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

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

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

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

/* Variables and functions */
scalar_t__ cg_read(char const *, char const *, char *, int);
scalar_t__ strstr(char *, char const *);
int cg_read_strstr(const char *cgroup, const char *control,
                   const char *needle) {
  char buf[4096];
  if (cg_read(cgroup, control, buf, sizeof(buf)))
    return -1;
  return strstr(buf, needle) ? 0 : -1;
}


x86 assembly (clang, -O0):
<cg_read_strstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1020,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x1020(%rbp),%rdx
mov    $0x1000,%ecx
call   1030 <cg_read@plt>
cmp    $0x0,%rax
je     1166 <cg_read_strstr+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    118a <cg_read_strstr+0x6a>
lea    -0x1020(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <strstr@plt>
mov    %rax,%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cg_read_strstr>:
push   %rbx
sub    $0x1000,%rsp
mov    %rdx,%rbx
mov    %rsp,%rdx
mov    $0x1000,%ecx
call   1030 <cg_read@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    1156 <cg_read_strstr+0x36>
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1040 <strstr@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
add    $0x1000,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @cg_read_strstr(i8* %0, i8* %1, i8* %2) {
%4 = alloca [4096 x i8]
%5 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%6 = call i64 @cg_read(i8* %0, i8* %1, i8* %5, i32 4096)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %3
%9 = call i64 @strstr(i8* %5, i8* %2)
%10 = icmp eq i64 %9, 0
%11 = sext i1 %10 to i32
br label %12
12: ; preds = %3, %8
%13 = phi i32 [ %11, %8 ], [ -1, %3 ]
ret i32 %13
}
void iounmap(void *addr) {}


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

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

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

LLVM IR (-O2):
define void @iounmap(i8* nocapture %0) {
ret void
}
void g(int *x) { ((*x) = 20); }


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

x86 assembly (clang, -O2):
<g>:
movl   $0x14,(%rdi)
ret

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

LLVM IR (-O2):
define void @g(i32* nocapture writeonly %0) {
store i32 20, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putPT(char);
void putPTstring(char *p) {
  char c;
  do {
    c = *(p++);
    putPT(c);
  } while (c != '\0');
}


x86 assembly (clang, -O0):
<putPTstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edi
call   1030 <putPT@plt>
movsbl -0x9(%rbp),%eax
cmp    $0x0,%eax
jne    111c <putPTstring+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putPTstring>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
movsbl (%rbx),%ebp
add    $0x1,%rbx
mov    %ebp,%edi
call   1030 <putPT@plt>
test   %ebp,%ebp
jne    1120 <putPTstring+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @putPTstring(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
br label %4
4: ; preds = %10, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
store i8 %7, i8* %3
%8 = load i8, i8* %3
%9 = call i32 @putPT(i8 signext %8)
br label %10
10: ; preds = %4
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %4, label %14
14: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @putPTstring(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = tail call i32 @putPT(i8 signext %5)
%7 = icmp eq i8 %5, 0
br i1 %7, label %8, label %2
8: ; preds = %2
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t ComplementBaseBWA(uint8_t base) {
  if (base < 4)
    return (3 - base);
  return 4;
}


x86 assembly (clang, -O0):
<ComplementBaseBWA>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1121 <ComplementBaseBWA+0x21>
mov    $0x3,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1128 <ComplementBaseBWA+0x28>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ComplementBaseBWA>:
mov    $0x3,%ecx
sub    %edi,%ecx
cmp    $0x4,%edi
mov    $0x4,%eax
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ComplementBaseBWA(i32 %0) {
%2 = icmp slt i32 %0, 4
%3 = sub nsw i32 3, %0
%4 = select i1 %2, i32 %3, i32 4
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cgdeclw(int a) { ngen("%s\t%d(%%ebp)", "decl", a); }


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

x86 assembly (clang, -O2):
<cgdeclw>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xeed(%rip),%rsi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%s\09%d(%%ebp)\00"
@.str.1 = [5 x i8] c"decl\00"
define void @cgdeclw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s\09%d(%%ebp)\00"
@.str.1 = [5 x i8] c"decl\00"
define void @cgdeclw(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
struct in6_addr {
  int dummy;
};
typedef int /*<<< orphan*/ str;

/* Variables and functions */
int /*<<< orphan*/ AF_INET6;
char const *inet_ntop(int /*<<< orphan*/, struct in6_addr *, char *, int);
const char *ipv6tostr(struct in6_addr *ip) {
  static char str[64];
  return inet_ntop(AF_INET6, ip, str, sizeof(str));
}


x86 assembly (clang, -O0):
<ipv6tostr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
lea    0x2f10(%rip),%rdx
mov    $0x40,%ecx
call   1030 <inet_ntop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv6tostr>:
mov    %rdi,%rsi
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
lea    0x2f1d(%rip),%rdx
mov    $0x40,%ecx
jmp    1030 <inet_ntop@plt>

LLVM IR (-O0):
%struct.in6_addr = type { i32 }
@ipv6tostr.str = internal global [64 x i8] zeroinitializer
@AF_INET6 = global i32 0
define i8* @ipv6tostr(%struct.in6_addr* %0) {
%2 = alloca %struct.in6_addr*
store %struct.in6_addr* %0, %struct.in6_addr** %2
%3 = load i32, i32* @AF_INET6
%4 = load %struct.in6_addr*, %struct.in6_addr** %2
%5 = call i8* @inet_ntop(i32 %3, %struct.in6_addr* %4, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @ipv6tostr.str, i64 0, i64 0), i32 64)
ret i8* %5
}

LLVM IR (-O2):
%struct.in6_addr = type { i32 }
@ipv6tostr.str = internal global [64 x i8] zeroinitializer
@AF_INET6 = global i32 0
define i8* @ipv6tostr(%struct.in6_addr* %0) {
%2 = load i32, i32* @AF_INET6
%3 = tail call i8* @inet_ntop(i32 %2, %struct.in6_addr* %0, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @ipv6tostr.str, i64 0, i64 0), i32 64)
ret i8* %3
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, long);
int main(void) {
  long nc;
  nc = 0;
  while (getchar() != EOF)
    ++nc;
  printf("%ld\n", nc);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%rax
je     115f <main+0x3f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <main+0x17>
mov    -0x10(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffffffffffff,%rbx
mov    0x2eb6(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%rbx
cmp    (%r14),%rax
jne    1140 <main+0x20>
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %2
br label %3
3: ; preds = %7, %0
%4 = call i64 (...) @getchar()
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i64, i64* %2
%9 = add nsw i64 %8, 1
store i64 %9, i64* %2
br label %3
10: ; preds = %3
%11 = load i64, i64* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %11)
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i64 (...) @getchar()
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
%6 = add nuw nsw i64 %2, 1
br i1 %5, label %7, label %1
7: ; preds = %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fb_exec(int);
void fb_exit(void) { fb_exec(0x2B); }


x86 assembly (clang, -O0):
<fb_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2b,%edi
call   1030 <fb_exec@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_exit>:
mov    $0x2b,%edi
jmp    1030 <fb_exec@plt>

LLVM IR (-O0):
define void @fb_exit() {
%1 = call i32 @fb_exec(i32 43)
ret void
}

LLVM IR (-O2):
define void @fb_exit() {
%1 = tail call i32 @fb_exec(i32 43)
ret void
}
void *test_pointer_xor(void *a, void *b) { return (long)a ^ (long)b; }


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

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

LLVM IR (-O0):
define i8* @test_pointer_xor(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = xor i64 %6, %8
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @test_pointer_xor(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = xor i64 %4, %3
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
/* Variables and functions */
int is_prime(int);
int solution() {
  int number, counter;
  number = 1;
  counter = 2;
  while (counter <= 10001) {
    number = number + 2;
    if (is_prime(number) == 1) {
      counter = counter + 1;
    }
  }
  return number;
}


x86 assembly (clang, -O0):
<solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x2711,-0x8(%rbp)
jg     115b <solution+0x4b>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <is_prime@plt>
cmp    $0x1,%eax
jne    1156 <solution+0x46>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <solution+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solution>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebx
mov    $0x2,%ebp
nopl   (%rax)
add    $0x2,%ebx
mov    %ebx,%edi
call   1030 <is_prime@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
add    %ecx,%ebp
cmp    $0x2712,%ebp
jb     1120 <solution+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @solution() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 2, %0 ], [ %8, %1 ]
%3 = phi i32 [ 1, %0 ], [ %4, %1 ]
%4 = add nuw nsw i32 %3, 2
%5 = tail call i32 @is_prime(i32 %4)
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = add nuw nsw i32 %2, %7
%9 = icmp ult i32 %8, 10002
br i1 %9, label %1, label %10
10: ; preds = %1
ret i32 %4
}