xunge/DecIR huggingface dataset:
/* Variables and functions */
int strlen(char *);
char *strstr(char *, char *);
char *textAfter(char *buf, char *param) {
  char *t;
  if (buf == NULL) {
    return NULL;
  }
  t = strstr(buf, param);
  if (!t) {
    return NULL;
  }
  return t + strlen(param);
}


x86 assembly (clang, -O0):
<textAfter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1148 <textAfter+0x28>
movq   $0x0,-0x8(%rbp)
jmp    1192 <textAfter+0x72>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1171 <textAfter+0x51>
movq   $0x0,-0x8(%rbp)
jmp    1192 <textAfter+0x72>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<textAfter>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1148 <textAfter+0x28>
mov    %rsi,%r14
call   1040 <strstr@plt>
test   %rax,%rax
je     1148 <textAfter+0x28>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
add    %rax,%rbx
jmp    114a <textAfter+0x2a>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @textAfter(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = tail call i8* @strstr(i8* %0, i8* dereferenceable(1) %1)
%6 = icmp eq i8* %5, null
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = tail call i32 @strlen(i8* %1)
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %5, i64 %9
br label %11
11: ; preds = %4, %2, %7
%12 = phi i8* [ %10, %7 ], [ null, %2 ], [ null, %4 ]
ret i8* %12
}
int test_imm_F7int64_highword_reg(long long val) {
  return ((val >> 32) & (0xF7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F7int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0xf7,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F7int64_highword_reg>:
movabs $0xf700000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F7int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 247
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_F7int64_highword_reg(i64 %0) {
%2 = and i64 %0, 1060856922112
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) int32_t irand(int32_t *seed) {
  *seed *= 0x343fd;
  *seed += 0x269ec3;
  return ((*seed >> 16) & 0x7fff);
}


x86 assembly (clang, -O0):
<irand>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x343fd,(%rax),%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x269ec3,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sar    $0x10,%eax
and    $0x7fff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<irand>:
imul   $0x343fd,(%rdi),%eax
add    $0x269ec3,%eax
mov    %eax,(%rdi)
shr    $0x10,%eax
and    $0x7fff,%eax
ret

LLVM IR (-O0):
define i32 @irand(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 214013
store i32 %5, i32* %3
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 2531011
store i32 %8, i32* %6
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = ashr i32 %10, 16
%12 = and i32 %11, 32767
ret i32 %12
}

LLVM IR (-O2):
define i32 @irand(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul nsw i32 %2, 214013
%4 = add nsw i32 %3, 2531011
store i32 %4, i32* %0
%5 = lshr i32 %4, 16
%6 = and i32 %5, 32767
ret i32 %6
}
void pi_init(void) {}


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

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

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

LLVM IR (-O2):
define void @pi_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foo(int);
int main() {
  int x = foo(20);
  if (x != 62)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x14,%edi
call   1040 <foo@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x3e,-0x8(%rbp)
je     114d <main+0x2d>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x14,%edi
call   1040 <foo@plt>
cmp    $0x3e,%eax
jne    1134 <main+0x14>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @foo(i32 20)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 62
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 20)
%2 = icmp eq i32 %1, 62
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
int cmp_ptr(void *l, void *k) { return ((char *)l) - (char *)k; }


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

x86 assembly (clang, -O2):
<cmp_ptr>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @cmp_ptr(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 = load i8*, i8** %4
%7 = ptrtoint i8* %5 to i64
%8 = ptrtoint i8* %6 to i64
%9 = sub i64 %7, %8
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @cmp_ptr(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
float *get_grid_data(struct grid_info *g) { return 0; }


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

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

LLVM IR (-O0):
%struct.grid_info = type opaque
define float* @get_grid_data(%struct.grid_info* %0) {
%2 = alloca %struct.grid_info*
store %struct.grid_info* %0, %struct.grid_info** %2
ret float* null
}

LLVM IR (-O2):
%struct.grid_info = type opaque
define noalias float* @get_grid_data(%struct.grid_info* nocapture readnone %0) {
ret float* null
}
float fsq(float v) { return v * v; }


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

x86 assembly (clang, -O2):
<fsq>:
mulss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @fsq(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
ret float %5
}

LLVM IR (-O2):
define float @fsq(float %0) {
%2 = fmul float %0, %0
ret float %2
}
/* Variables and functions */
int foo(int);
int bar(int i) { return foo(i) + 2; }


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

x86 assembly (clang, -O2):
<bar>:
push   %rax
call   1030 <foo@plt>
add    $0x2,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = tail call i32 @foo(i32 %0)
%3 = add nsw i32 %2, 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_MAKE_RFM_TXD_INPUT() { clear_io_bit(0x39, 3); }


x86 assembly (clang, -O0):
<TOSH_MAKE_RFM_TXD_INPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x39,%edi
mov    $0x3,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_RFM_TXD_INPUT>:
mov    $0x39,%edi
mov    $0x3,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_RFM_TXD_INPUT() {
%1 = call i32 @clear_io_bit(i32 57, i32 3)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_RFM_TXD_INPUT() {
%1 = tail call i32 @clear_io_bit(i32 57, i32 3)
ret void
}
/* Variables and functions */
int phl_sq_len_2();
int phl_sq_len() { return phl_sq_len_2() / 2; }


x86 assembly (clang, -O0):
<phl_sq_len>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <phl_sq_len_2@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<phl_sq_len>:
push   %rax
xor    %eax,%eax
call   1030 <phl_sq_len_2@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
sar    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @phl_sq_len() {
%1 = call i32 (...) @phl_sq_len_2()
%2 = sdiv i32 %1, 2
ret i32 %2
}

LLVM IR (-O2):
define i32 @phl_sq_len() {
%1 = tail call i32 (...) @phl_sq_len_2()
%2 = sdiv i32 %1, 2
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_futex;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/ *, int, int /*<<< orphan*/,
            int /*<<< orphan*/ *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int futex_attach(u_int32_t *uaddr, int opflags) {
  return syscall(SYS_futex, uaddr, 13 | opflags, 0, NULL, NULL, 0);
}


x86 assembly (clang, -O0):
<futex_attach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
or     $0xd,%edx
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
movl   $0x0,(%rsp)
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futex_attach>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
or     $0xd,%edx
movl   $0x0,(%rsp)
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SYS_futex = global i32 0
define i32 @futex_attach(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* @SYS_futex
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = or i32 13, %7
%9 = call i32 @syscall(i32 %5, i32* %6, i32 %8, i32 0, i32* null, i32* null, i32 0)
ret i32 %9
}

LLVM IR (-O2):
@SYS_futex = global i32 0
define i32 @futex_attach(i32* %0, i32 %1) {
%3 = load i32, i32* @SYS_futex
%4 = or i32 %1, 13
%5 = tail call i32 @syscall(i32 %3, i32* %0, i32 %4, i32 0, i32* null, i32* null, i32 0)
ret i32 %5
}
/* Variables and functions */
int strict_rfc1459_tolower(int);
int rfc1459_tolower(int c) {
  return c == '^' ? '~' : strict_rfc1459_tolower(c);
}


x86 assembly (clang, -O0):
<rfc1459_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x5e,-0x4(%rbp)
jne    1132 <rfc1459_tolower+0x22>
mov    $0x7e,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <rfc1459_tolower+0x2d>
mov    -0x4(%rbp),%edi
call   1030 <strict_rfc1459_tolower@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfc1459_tolower>:
cmp    $0x5e,%edi
jne    111b <rfc1459_tolower+0xb>
mov    $0x7e,%eax
ret
jmp    1030 <strict_rfc1459_tolower@plt>

LLVM IR (-O0):
define i32 @rfc1459_tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 94
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @strict_rfc1459_tolower(i32 %7)
br label %9
9: ; preds = %6, %5
%10 = phi i32 [ 126, %5 ], [ %8, %6 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @rfc1459_tolower(i32 %0) {
%2 = icmp eq i32 %0, 94
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @strict_rfc1459_tolower(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 126, %1 ]
ret i32 %6
}
/* Variables and functions */
int inet_pton(int, char const *, void *);
int grid_inet_pton(int family, const char *src, void *dst) {
  return inet_pton(family, src, dst);
}


x86 assembly (clang, -O0):
<grid_inet_pton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <inet_pton@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grid_inet_pton>:
jmp    1030 <inet_pton@plt>

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

LLVM IR (-O2):
define i32 @grid_inet_pton(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @inet_pton(i32 %0, i8* %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void so_fini1() {
  printf("so_fini1"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"so_fini1\00"
define void @so_fini1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *, int);
void easy_handle(int error_code) {
  printk("Unknown Interrupt. error:%#x.\n", error_code);
}


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

x86 assembly (clang, -O2):
<easy_handle>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printk@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Unknown Interrupt. error:%#x.\0A\00"
define void @easy_handle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printk(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Unknown Interrupt. error:%#x.\0A\00"
define void @easy_handle(i32 %0) {
%2 = tail call i32 @printk(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int ld_bgt_rr1(long double a1, long double a2) {
  return (__builtin_isgreater(a1, a2));
}


x86 assembly (clang, -O0):
<ld_bgt_rr1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_bgt_rr1>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
seta   %al
ret

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

LLVM IR (-O2):
define i32 @ld_bgt_rr1(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp ogt x86_fp80 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ reverse_factorial(long long);
int /*<<< orphan*/ scanf(char *, long long *);
int main() {
  long long int factorial;
  printf("Reverse Factorial > ");
  scanf("%lli", &factorial);
  reverse_factorial(factorial);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
mov    (%rsp),%rdi
call   1040 <reverse_factorial@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"Reverse Factorial > \00"
@.str.1 = [5 x i8] c"%lli\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%5 = load i64, i64* %1
%6 = call i32 @reverse_factorial(i64 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *);
int /*<<< orphan*/ stderr;
void assert(int boolean, char *boolstr, char *file, int line) {
  if (!boolean) {
    fprintf(stderr, "Assertion %s failed in line %d of file %s\n", boolstr,
            line, file);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    116a <assert+0x4a>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xea5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert>:
test   %edi,%edi
je     1125 <assert+0x5>
ret
push   %rax
mov    %rdx,%r8
mov    %rsi,%rdx
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"Assertion %s failed in line %d of file %s\0A\00"
define void @assert(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %4
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %6
%14 = load i32, i32* %8
%15 = load i8*, i8** %7
%16 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %14, i8* %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %4
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"Assertion %s failed in line %d of file %s\0A\00"
define void @assert(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = icmp eq i32 %0, 0
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %3, i8* %2)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %4
ret void
}
int is_path(char *str) {
  int i = 0;
  while (str[i] != '\0' && str[i] != '/') {
    i++;
  }
  if (str[i] == '\0')
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_path>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
je     113e <is_path+0x3e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    114e <is_path+0x4e>
jmp    115c <is_path+0x5c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <is_path+0xf>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    117d <is_path+0x7d>
movl   $0x0,-0x4(%rbp)
jmp    1184 <is_path+0x84>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_path>:
movzbl (%rdi),%ecx
test   %cl,%cl
je     1112 <is_path+0x12>
cmp    $0x2f,%cl
je     1112 <is_path+0x12>
add    $0x1,%rdi
jmp    1100 <is_path>
xor    %eax,%eax
test   %cl,%cl
setne  %al
ret

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

LLVM IR (-O2):
define i32 @is_path(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i64 [ %7, %6 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %8
i8 47, label %8
]
6: ; preds = %2
%7 = add nuw i64 %3, 1
br label %2
8: ; preds = %2, %2
%9 = icmp ne i8 %5, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void *cpalloc(const void *p, size_t size) {
  void *n = malloc(size);
  if (p)
    memcpy(n, p, size);
  return n;
}


x86 assembly (clang, -O0):
<cpalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1159 <cpalloc+0x39>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpalloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %r15,%r15
je     1149 <cpalloc+0x29>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @cpalloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = load i8*, i8** %3
%13 = load i64, i64* %4
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
br label %15
15: ; preds = %10, %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
define i8* @cpalloc(i8* %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = icmp eq i8* %0, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Type definitions */
struct xdr_stream {
  int dummy;
};
typedef enum reply_stat { ____Placeholder_reply_stat } reply_stat;

/* Variables and functions */
int xdr_uint(struct xdr_stream *, int *);
int xdr_reply_stat(struct xdr_stream *stream, enum reply_stat *value) {
  return xdr_uint(stream, value);
}


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

x86 assembly (clang, -O2):
<xdr_reply_stat>:
jmp    1030 <xdr_uint@plt>

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

LLVM IR (-O2):
%struct.xdr_stream = type { i32 }
define i32 @xdr_reply_stat(%struct.xdr_stream* %0, i32* %1) {
%3 = tail call i32 @xdr_uint(%struct.xdr_stream* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int XSetWindowTitle(char *);
int oz_SetWindowTitle(char *WndTitle) { return XSetWindowTitle(WndTitle); }


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

x86 assembly (clang, -O2):
<oz_SetWindowTitle>:
jmp    1030 <XSetWindowTitle@plt>

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

LLVM IR (-O2):
define i32 @oz_SetWindowTitle(i8* %0) {
%2 = tail call i32 @XSetWindowTitle(i8* %0)
ret i32 %2
}
/* Variables and functions */
int check(char *);
int CPending() { return check("NUMBER"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"NUMBER\00"
define i32 @CPending() {
%1 = call i32 @check(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [7 x i8] c"NUMBER\00"
define i32 @CPending() {
%1 = tail call i32 @check(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xdd() {
  Assert_real((isupper(221) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              1110, ("isupper should be 0 for 0xdd"));
}


x86 assembly (clang, -O0):
<t_isupper_0xdd>:
push   %rbp
mov    %rsp,%rbp
mov    $0xdd,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x456,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0xdd>:
push   %rax
mov    $0xdd,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x456,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xdd\00"
define void @t_isupper_0xdd() {
%1 = call i64 @isupper(i32 221)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1110, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xdd\00"
define void @t_isupper_0xdd() {
%1 = tail call i64 @isupper(i32 221)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1110, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, char *);
void function_desc(char *desc) {
  write("json-task.json", "\"description\":\"%s\", ", desc);
}


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

x86 assembly (clang, -O2):
<function_desc>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [21 x i8] c"\22description\22:\22%s\22, \00"
define void @function_desc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [21 x i8] c"\22description\22:\22%s\22, \00"
define void @function_desc(i8* %0) {
%2 = tail call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *);
int dump_assign(const char *name, const char *value, void *user_data) {
  printf("%s = %s\n", name, value);
  return 0;
}


x86 assembly (clang, -O0):
<dump_assign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_assign>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%s = %s\0A\00"
define i32 @dump_assign(i8* %0, i8* %1, i8* %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
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s = %s\0A\00"
define i32 @dump_assign(i8* %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ endwin();
void curses_exit() {
  clear();
  endwin();
}


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

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

LLVM IR (-O0):
define void @curses_exit() {
%1 = call i32 (...) @clear()
%2 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @curses_exit() {
%1 = tail call i32 (...) @clear()
%2 = tail call i32 (...) @endwin()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
void co_random_init(uint32_t seed) { srand(seed); }


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

x86 assembly (clang, -O2):
<co_random_init>:
jmp    1030 <srand@plt>

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

LLVM IR (-O2):
define void @co_random_init(i32 %0) {
%2 = tail call i32 @srand(i32 %0)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int int16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int16_t downcast_16(uint64_t x) {
  int16_t y = (int16_t)x;
  printf("casting down to u16 %X -> %d\n", x, y);
  return y;
}


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

x86 assembly (clang, -O2):
<downcast_16>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"casting down to u16 %X -> %d\0A\00"
define i32 @downcast_16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
@.str = [30 x i8] c"casting down to u16 %X -> %d\0A\00"
define i32 @downcast_16(i32 returned %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %0)
ret i32 %0
}
char *skip(char *p, int n) {
  for (; *p || --n > 0; p++)
    ;
  return ++p;
}


x86 assembly (clang, -O0):
<skip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
jne    1132 <skip+0x32>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
setg   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1142 <skip+0x42>
jmp    1158 <skip+0x58>
jmp    1147 <skip+0x47>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110b <skip+0xb>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rax
cmpb   $0x0,-0x1(%rax)
jne    1110 <skip+0x10>
cmp    $0x2,%esi
jl     1124 <skip+0x24>
add    $0xffffffff,%esi
jmp    1110 <skip+0x10>
ret

LLVM IR (-O0):
define i8* @skip(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %17, %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 %14, label %10
10: ; preds = %5
%11 = load i32, i32* %4
%12 = add nsw i32 %11, -1
store i32 %12, i32* %4
%13 = icmp sgt i32 %12, 0
br label %14
14: ; preds = %10, %5
%15 = phi i1 [ true, %5 ], [ %13, %10 ]
br i1 %15, label %16, label %20
16: ; preds = %14
br label %17
17: ; preds = %16
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
br label %5
20: ; preds = %14
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
ret i8* %22
}

LLVM IR (-O2):
define i8* @skip(i8* %0, i32 %1) {
br label %3
3: ; preds = %11, %2
%4 = phi i8* [ %0, %2 ], [ %13, %11 ]
%5 = phi i32 [ %1, %2 ], [ %12, %11 ]
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = add nsw i32 %5, -1
%10 = icmp sgt i32 %5, 1
br i1 %10, label %11, label %14
11: ; preds = %3, %8
%12 = phi i32 [ %5, %3 ], [ %9, %8 ]
%13 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
14: ; preds = %8
%15 = getelementptr inbounds i8, i8* %4, i64 1
ret i8* %15
}
int ht_hash(const int k, const int prime, const int m) {
  return (k * prime) % m;
}


x86 assembly (clang, -O0):
<ht_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ht_hash>:
mov    %edx,%ecx
mov    %edi,%eax
imul   %esi,%eax
cltd
idiv   %ecx
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @ht_hash(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = srem i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @ht_hash(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %0
%5 = srem i32 %4, %2
ret i32 %5
}
int stream_close(int handle) {
  handle = 0;
  return (0);
}


x86 assembly (clang, -O0):
<stream_close>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

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


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

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

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

LLVM IR (-O2):
define void @BN_to_ASN1_INTEGER() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fooA(int *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int x = 99;
  printf("%p\n", &x);
  fooA(&x);
  printf("%d\n", x);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x63,0xc(%rsp)
lea    0xecc(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <fooA@plt>
mov    0xc(%rsp),%esi
lea    0xeae(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

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

/* Variables and functions */
void _EEPROMWaitForDone(void) {
  while ((*((volatile uint32_t *)(0x400AF018))) & 0x00000001) {
  }
}


x86 assembly (clang, -O0):
<_EEPROMWaitForDone>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <_EEPROMWaitForDone+0x9>
mov    $0x400af018,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1121 <_EEPROMWaitForDone+0x21>
jmp    1109 <_EEPROMWaitForDone+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_EEPROMWaitForDone>:
mov    0x400af018,%eax
test   $0x1,%al
jne    1100 <_EEPROMWaitForDone>
ret

LLVM IR (-O0):
define void @_EEPROMWaitForDone() {
br label %1
1: ; preds = %5, %0
%2 = load volatile i32, i32* inttoptr (i64 1074458648 to i32*)
%3 = and i32 %2, 1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @_EEPROMWaitForDone() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 1074458648 to i32*)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
/* Variables and functions */
int utl_rvn_getrtn(int);
int utl_rand_vneumann(int seed) {
  seed = seed * seed;
  while (seed < 100000) {
    seed++;
    seed = seed * seed;
    seed = (seed < 0) ? -seed : seed;
  }
  return (utl_rvn_getrtn(seed));
}


x86 assembly (clang, -O0):
<utl_rand_vneumann>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x186a0,-0x4(%rbp)
jge    116d <utl_rand_vneumann+0x5d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    115c <utl_rand_vneumann+0x4c>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1162 <utl_rand_vneumann+0x52>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1125 <utl_rand_vneumann+0x15>
mov    -0x4(%rbp),%edi
call   1030 <utl_rvn_getrtn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utl_rand_vneumann>:
imul   %edi,%edi
cmp    $0x1869f,%edi
ja     112e <utl_rand_vneumann+0x1e>
nopl   0x0(%rax,%rax,1)
add    $0x1,%edi
imul   %edi,%edi
cmp    $0x186a0,%edi
jb     1120 <utl_rand_vneumann+0x10>
jmp    1030 <utl_rvn_getrtn@plt>

LLVM IR (-O0):
define i32 @utl_rand_vneumann(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
store i32 %5, i32* %2
br label %6
6: ; preds = %22, %1
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 100000
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = load i32, i32* %2
%14 = mul nsw i32 %12, %13
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %9
%18 = load i32, i32* %2
%19 = sub nsw i32 0, %18
br label %22
20: ; preds = %9
%21 = load i32, i32* %2
br label %22
22: ; preds = %20, %17
%23 = phi i32 [ %19, %17 ], [ %21, %20 ]
store i32 %23, i32* %2
br label %6
24: ; preds = %6
%25 = load i32, i32* %2
%26 = call i32 @utl_rvn_getrtn(i32 %25)
ret i32 %26
}

LLVM IR (-O2):
define i32 @utl_rand_vneumann(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = icmp ult i32 %2, 100000
br i1 %3, label %4, label %9
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ %2, %1 ]
%6 = add nuw nsw i32 %5, 1
%7 = mul nsw i32 %6, %6
%8 = icmp ult i32 %7, 100000
br i1 %8, label %4, label %9
9: ; preds = %4, %1
%10 = phi i32 [ %2, %1 ], [ %7, %4 ]
%11 = tail call i32 @utl_rvn_getrtn(i32 %10)
ret i32 %11
}
/* Variables and functions */
char *convertToTitle(int);
int /*<<< orphan*/ printf(char *, char *);
int main() { printf("%s\n", convertToTitle(1434)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x59a,%edi
call   1040 <convertToTitle@plt>
mov    %rax,%rsi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* @convertToTitle(i32 1434)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
float add1(float);
float add2(float n, float m) {
  if (n < 1)
    return 1;
  return 2 + m + add1(n - 1);
}


x86 assembly (clang, -O0):
<add2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  0xed6(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1146 <add2+0x36>
movss  0xec4(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    117f <add2+0x6f>
movss  0xeb6(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xe9b(%rip),%xmm1
subss  %xmm1,%xmm0
call   1030 <add1@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add2>:
push   %rax
movss  0xee7(%rip),%xmm2
ucomiss %xmm0,%xmm2
ja     1142 <add2+0x32>
addss  0xede(%rip),%xmm1
movss  %xmm1,0x4(%rsp)
addss  0xed4(%rip),%xmm0
call   1030 <add1@plt>
movaps %xmm0,%xmm2
addss  0x4(%rsp),%xmm2
movaps %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @add2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = fcmp olt float %6, 1.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %2
store float 1.000000e+00, float* %3
br label %16
9: ; preds = %2
%10 = load float, float* %5
%11 = fadd float 2.000000e+00, %10
%12 = load float, float* %4
%13 = fsub float %12, 1.000000e+00
%14 = call float @add1(float %13)
%15 = fadd float %11, %14
store float %15, float* %3
br label %16
16: ; preds = %9, %8
%17 = load float, float* %3
ret float %17
}

LLVM IR (-O2):
define float @add2(float %0, float %1) {
%3 = fcmp olt float %0, 1.000000e+00
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = fadd float %1, 2.000000e+00
%6 = fadd float %0, -1.000000e+00
%7 = tail call float @add1(float %6)
%8 = fadd float %5, %7
br label %9
9: ; preds = %2, %4
%10 = phi float [ %8, %4 ], [ 1.000000e+00, %2 ]
ret float %10
}
void XFontsOfFontSet() {}


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

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

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

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