xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ vpoke(int /*<<< orphan*/, int /*<<< orphan*/);
void vpoke_block(unsigned int address, char *block, unsigned int size) {
  while (size-- > 0) {
    vpoke(address++, *(block++));
  }
}


x86 assembly (clang, -O0):
<vpoke_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
jbe    115d <vpoke_block+0x4d>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%esi
call   1030 <vpoke@plt>
jmp    1122 <vpoke_block+0x12>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vpoke_block>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
je     1147 <vpoke_block+0x37>
mov    %rsi,%r14
mov    %edx,%r15d
mov    %edi,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
lea    (%r12,%rbx,1),%edi
movsbl (%r14,%rbx,1),%esi
call   1030 <vpoke@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <vpoke_block+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @vpoke_block(i32 %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %16, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %2, %3 ]
%7 = phi i8* [ %11, %5 ], [ %1, %3 ]
%8 = phi i32 [ %10, %5 ], [ %0, %3 ]
%9 = add i32 %6, -1
%10 = add i32 %8, 1
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %7
%13 = sext i8 %12 to i32
%14 = tail call i32 @vpoke(i32 %8, i32 %13)
%15 = icmp eq i32 %9, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void GLOB_FREE(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @GLOB_FREE(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unblock_signals();
void arch_local_irq_enable(void) { unblock_signals(); }


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

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

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

LLVM IR (-O2):
define void @arch_local_irq_enable() {
%1 = tail call i32 (...) @unblock_signals()
ret void
}
void a_spin() {}


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

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

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

LLVM IR (-O2):
define void @a_spin() {
ret void
}
/* Variables and functions */
int __syscall(int, int, char const *, int);
int errno;
int _write(int fd, const char *buf, int nbytes) {
  int err;
  err = __syscall(4, fd, buf, nbytes);
  if (err < 0) {
    errno = -err;
    return -1;
  }
  return err;
}


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x4,%edi
call   1030 <__syscall@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    115d <_write+0x4d>
xor    %ecx,%ecx
sub    -0x18(%rbp),%ecx
mov    0x2e91(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <_write+0x53>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x4,%edi
call   1030 <__syscall@plt>
test   %eax,%eax
js     1128 <_write+0x18>
pop    %rcx
ret
neg    %eax
mov    0x2eaf(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @_write(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @__syscall(i32 4, i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = sub nsw i32 0, %4
store i32 %7, i32* @errno
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ -1, %6 ], [ %4, %3 ]
ret i32 %9
}
int tputs(const char *str, int affcnt, int (*putc_)(int ch)) {
  while (*str) {
    putc_(*str);
    str++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<tputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113e <tputs+0x3e>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%edi
call   *%rax
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <tputs+0x13>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tputs>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1131 <tputs+0x31>
mov    %rdx,%r14
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
call   *%r14
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <tputs+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @tputs(i8* nocapture %0, i32 %1, i32 (i32)* nocapture %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %12, %6 ], [ %4, %3 ]
%8 = phi i8* [ %11, %6 ], [ %0, %3 ]
%9 = sext i8 %7 to i32
%10 = tail call i32 %2(i32 %9)
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ raw(char *, char *);
void pong(char *trg) { raw("PONG :%s\r\n", trg); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"PONG :%s\0D\0A\00"
define void @pong(i8* %0) {
%2 = tail call i32 @raw(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int do_076() { return 76; }


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

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

LLVM IR (-O0):
define i32 @do_076() {
ret i32 76
}

LLVM IR (-O2):
define i32 @do_076() {
ret i32 76
}
/* Variables and functions */
unsigned char *sha512_buffer(unsigned char *, unsigned char const *, size_t);
unsigned char *hash_buffer_sha512(unsigned char *out, const unsigned char *in,
                                  size_t in_len) {
  return sha512_buffer(out, in, in_len);
}


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

x86 assembly (clang, -O2):
<hash_buffer_sha512>:
jmp    1030 <sha512_buffer@plt>

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

LLVM IR (-O2):
define i8* @hash_buffer_sha512(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @sha512_buffer(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
/* Type definitions */
typedef size_t uint32_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
void store_SINT8(int8_t *arr, uint32_t idx, int8_t value) { arr[idx] = value; }


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

x86 assembly (clang, -O2):
<store_SINT8>:
mov    %edx,(%rdi,%rsi,4)
ret

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

LLVM IR (-O2):
define void @store_SINT8(i32* nocapture writeonly %0, i64 %1, i32 %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 %1
store i32 %2, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unsigned_prune_gt(int /*<<< orphan*/, int);
void call_unsigned_prune_gt_Good() { unsigned_prune_gt(0, 3); }


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

x86 assembly (clang, -O2):
<call_unsigned_prune_gt_Good>:
xor    %edi,%edi
mov    $0x3,%esi
jmp    1030 <unsigned_prune_gt@plt>

LLVM IR (-O0):
define void @call_unsigned_prune_gt_Good() {
%1 = call i32 @unsigned_prune_gt(i32 0, i32 3)
ret void
}

LLVM IR (-O2):
define void @call_unsigned_prune_gt_Good() {
%1 = tail call i32 @unsigned_prune_gt(i32 0, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GetRelativeTime();
void InitTimer(void) { GetRelativeTime(); }


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

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

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

LLVM IR (-O2):
define void @InitTimer() {
%1 = tail call i32 (...) @GetRelativeTime()
ret void
}
/* Variables and functions */
unsigned long readl(unsigned long);
int /*<<< orphan*/ writel(unsigned long, unsigned long);
void hieth_set_regbit(unsigned long addr, int bit, int shift) {
  unsigned long reg;
  reg = readl(addr);
  bit = bit ? 1 : 0;
  reg &= ~(1 << shift);
  reg |= bit << shift;
  writel(reg, addr);
}


x86 assembly (clang, -O0):
<hieth_set_regbit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <readl@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
cltq
and    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    %cl,%eax
cltq
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <writel@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hieth_set_regbit>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
call   1030 <readl@plt>
xor    %edx,%edx
test   %ebp,%ebp
setne  %dl
mov    $0xfffffffe,%esi
mov    %ebx,%ecx
rol    %cl,%esi
shl    %cl,%edx
movslq %esi,%rcx
and    %rax,%rcx
movslq %edx,%rdi
or     %rcx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <writel@plt>

LLVM IR (-O0):
define void @hieth_set_regbit(i64 %0, i32 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i64, i64* %4
%9 = call i64 @readl(i64 %8)
store i64 %9, i64* %7
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
store i32 %13, i32* %5
%14 = load i32, i32* %6
%15 = shl i32 1, %14
%16 = xor i32 %15, -1
%17 = sext i32 %16 to i64
%18 = load i64, i64* %7
%19 = and i64 %18, %17
store i64 %19, i64* %7
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = shl i32 %20, %21
%23 = sext i32 %22 to i64
%24 = load i64, i64* %7
%25 = or i64 %24, %23
store i64 %25, i64* %7
%26 = load i64, i64* %7
%27 = load i64, i64* %4
%28 = call i32 @writel(i64 %26, i64 %27)
ret void
}

LLVM IR (-O2):
define void @hieth_set_regbit(i64 %0, i32 %1, i32 %2) {
%4 = tail call i64 @readl(i64 %0)
%5 = icmp ne i32 %1, 0
%6 = zext i1 %5 to i32
%7 = shl nuw i32 1, %2
%8 = xor i32 %7, -1
%9 = sext i32 %8 to i64
%10 = and i64 %4, %9
%11 = shl nuw i32 %6, %2
%12 = sext i32 %11 to i64
%13 = or i64 %10, %12
%14 = tail call i32 @writel(i64 %13, i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ngets(char *, int);
int /*<<< orphan*/ slowprintfc(char *);
char tolower(char);
int again() {
  char input[80];
  slowprintfc("\n~2bDo you want to play again?\n~7>");
  ngets(input, sizeof input);
  if (tolower(input[0]) == 'y')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<again>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    0xec1(%rip),%rdi
call   1030 <slowprintfc@plt>
lea    -0x60(%rbp),%rdi
mov    $0x50,%esi
call   1040 <ngets@plt>
movsbl -0x60(%rbp),%edi
call   1050 <tolower@plt>
movsbl %al,%eax
cmp    $0x79,%eax
jne    1173 <again+0x43>
movl   $0x1,-0x4(%rbp)
jmp    117a <again+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<again>:
sub    $0x58,%rsp
lea    0xec5(%rip),%rdi
call   1030 <slowprintfc@plt>
mov    %rsp,%rdi
mov    $0x50,%esi
call   1040 <ngets@plt>
movsbl (%rsp),%edi
call   1050 <tolower@plt>
xor    %ecx,%ecx
cmp    $0x79,%al
sete   %cl
mov    %ecx,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"\0A~2bDo you want to play again?\0A~7>\00"
define i32 @again() {
%1 = alloca i32
%2 = alloca [80 x i8]
%3 = call i32 @slowprintfc(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = call i32 @ngets(i8* %4, i32 80)
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%7 = load i8, i8* %6
%8 = call signext i8 @tolower(i8 signext %7)
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 121
br i1 %10, label %11, label %12
11: ; preds = %0
store i32 1, i32* %1
br label %13
12: ; preds = %0
store i32 0, i32* %1
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [35 x i8] c"\0A~2bDo you want to play again?\0A~7>\00"
define i32 @again() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @slowprintfc(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @ngets(i8* %2, i32 80)
%5 = load i8, i8* %2
%6 = call signext i8 @tolower(i8 signext %5)
%7 = icmp eq i8 %6, 121
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int cpu_to_le16(int);
int ieee802154_is_data(__le16 fc) {
  return (fc & cpu_to_le16(0x0003)) == cpu_to_le16(0x0001);
}


x86 assembly (clang, -O0):
<ieee802154_is_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x3,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee802154_is_data>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x3,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0x1,%edi
call   1030 <cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee802154_is_data(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cpu_to_le16(i32 3)
%5 = and i32 %3, %4
%6 = call i32 @cpu_to_le16(i32 1)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee802154_is_data(i32 %0) {
%2 = tail call i32 @cpu_to_le16(i32 3)
%3 = and i32 %2, %0
%4 = tail call i32 @cpu_to_le16(i32 1)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void BN_div_word(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_div_word() {
ret void
}
/* Variables and functions */
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ clrtobot();
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
void cmd_clrtobot(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  report_count(1);
  report_return(clrtobot());
}


x86 assembly (clang, -O0):
<cmd_clrtobot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1050 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_clrtobot+0x27>
jmp    117f <cmd_clrtobot+0x3f>
mov    $0x1,%edi
call   1060 <report_count@plt>
mov    $0x0,%al
call   1030 <clrtobot@plt>
mov    %eax,%edi
call   1040 <report_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_clrtobot>:
push   %rax
xor    %esi,%esi
call   1050 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_clrtobot+0xf>
pop    %rax
ret
mov    $0x1,%edi
call   1060 <report_count@plt>
xor    %eax,%eax
call   1030 <clrtobot@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <report_return@plt>

LLVM IR (-O0):
define void @cmd_clrtobot(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 (...) @clrtobot()
%12 = call i32 @report_return(i32 %11)
br label %13
13: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_clrtobot(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 (...) @clrtobot()
%8 = tail call i32 @report_return(i32 %7)
br label %9
9: ; preds = %2, %5
ret void
}
/* Variables and functions */
float cos(float);
float Float_cos(float x) { return cos(x); }


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

x86 assembly (clang, -O2):
<Float_cos>:
jmp    1030 <cos@plt>

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

LLVM IR (-O2):
define float @Float_cos(float %0) {
%2 = tail call float @cos(float %0)
ret float %2
}
/* Variables and functions */
int pmm_next_free();
int /*<<< orphan*/ pmm_reserve_block(int);
int pmm_reserve_next_free() {
  int free = pmm_next_free();
  if (free == -1) {
    return -1;
  }
  pmm_reserve_block(free);
  return free;
}


x86 assembly (clang, -O0):
<pmm_reserve_next_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <pmm_next_free@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1148 <pmm_reserve_next_free+0x28>
movl   $0xffffffff,-0x4(%rbp)
jmp    1156 <pmm_reserve_next_free+0x36>
mov    -0x8(%rbp),%edi
call   1030 <pmm_reserve_block@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmm_reserve_next_free>:
push   %rbx
xor    %eax,%eax
call   1040 <pmm_next_free@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     1136 <pmm_reserve_next_free+0x16>
mov    %ebx,%edi
call   1030 <pmm_reserve_block@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @pmm_reserve_next_free() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @pmm_next_free()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 -1, i32* %1
br label %11
7: ; preds = %0
%8 = load i32, i32* %2
%9 = call i32 @pmm_reserve_block(i32 %8)
%10 = load i32, i32* %2
store i32 %10, i32* %1
br label %11
11: ; preds = %7, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @pmm_reserve_next_free() {
%1 = tail call i32 (...) @pmm_next_free()
%2 = icmp eq i32 %1, -1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @pmm_reserve_block(i32 %1)
br label %5
5: ; preds = %0, %3
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ malloc(int const);
int /*<<< orphan*/ sleep(int);
int main(void) {
  const int malloc_size = 100 * 4096;
  const int chunk_size = 2048;
  int total_size;
  for (total_size = 0; total_size < malloc_size; total_size += chunk_size) {
    malloc(chunk_size);
  }
  sleep(60);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64000,-0x8(%rbp)
movl   $0x800,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x64000,-0x10(%rbp)
jge    116b <main+0x4b>
mov    $0x800,%edi
call   1030 <malloc@plt>
mov    -0x10(%rbp),%eax
add    $0x800,%eax
mov    %eax,-0x10(%rbp)
jmp    1144 <main+0x24>
mov    $0x3c,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xfffff800,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x800,%edi
call   1030 <malloc@plt>
add    $0x800,%ebx
cmp    $0x63800,%ebx
jb     1130 <main+0x10>
mov    $0x3c,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 409600, i32* %2
store i32 2048, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %10, %0
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 409600
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = call i32 @malloc(i32 2048)
br label %10
10: ; preds = %8
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 2048
store i32 %12, i32* %4
br label %5
13: ; preds = %5
%14 = call i32 @sleep(i32 60)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @malloc(i32 2048)
%4 = add nuw nsw i32 %2, 2048
%5 = icmp ult i32 %2, 407552
br i1 %5, label %1, label %6
6: ; preds = %1
%7 = tail call i32 @sleep(i32 60)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ RecursiveReturn();
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void EndLIST() {
  fputs("@end itemize\n", stdout);
  RecursiveReturn();
}


x86 assembly (clang, -O0):
<EndLIST>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x0,%al
call   1040 <RecursiveReturn@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<EndLIST>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <RecursiveReturn@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"@end itemize\0A\00"
@stdout = global i32 0
define void @EndLIST() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @RecursiveReturn()
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"@end itemize\0A\00"
@stdout = global i32 0
define void @EndLIST() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @RecursiveReturn()
ret void
}
/* Type definitions */
struct PKplex_args_info {
  int dummy;
};

/* Variables and functions */
int PKplex_cmdline_parser2(int, char **, struct PKplex_args_info *,
                           int /*<<< orphan*/, int, int);
int PKplex_cmdline_parser(int argc, char **argv,
                          struct PKplex_args_info *args_info) {
  return PKplex_cmdline_parser2(argc, argv, args_info, 0, 1, 1);
}


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

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

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

LLVM IR (-O2):
%struct.PKplex_args_info = type { i32 }
define i32 @PKplex_cmdline_parser(i32 %0, i8** %1, %struct.PKplex_args_info* %2) {
%4 = tail call i32 @PKplex_cmdline_parser2(i32 %0, i8** %1, %struct.PKplex_args_info* %2, i32 0, i32 1, i32 1)
ret i32 %4
}
/* Variables and functions */
double sin(double);
double csc(double x) { return 1.0 / sin(x); }


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

x86 assembly (clang, -O2):
<csc>:
push   %rax
call   1030 <sin@plt>
movsd  0xee2(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @csc(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @sin(double %3)
%5 = fdiv double 1.000000e+00, %4
ret double %5
}

LLVM IR (-O2):
define double @csc(double %0) {
%2 = tail call double @sin(double %0)
%3 = fdiv double 1.000000e+00, %2
ret double %3
}
void XOpenIM() {}


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

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

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

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

/* Variables and functions */
uint32_t softfloat_shiftRightJam32(uint32_t a, uint_fast16_t count) {
  return (count < 31) ? a >> count | ((uint32_t)(a << (-count & 31)) != 0)
                      : (a != 0);
}


x86 assembly (clang, -O0):
<softfloat_shiftRightJam32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1f,-0x8(%rbp)
jge    1141 <softfloat_shiftRightJam32+0x41>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0x1f,%ecx
shl    %cl,%edx
mov    %edx,%ecx
cmp    $0x0,%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1150 <softfloat_shiftRightJam32+0x50>
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<softfloat_shiftRightJam32>:
cmp    $0x1e,%esi
jg     1119 <softfloat_shiftRightJam32+0x19>
mov    %esi,%ecx
mov    %edi,%edx
sar    %cl,%edx
neg    %cl
shl    %cl,%edi
xor    %eax,%eax
test   %edi,%edi
setne  %al
or     %edx,%eax
ret
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @softfloat_shiftRightJam32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp slt i32 %5, 31
br i1 %6, label %7, label %19
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = ashr i32 %8, %9
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = sub nsw i32 0, %12
%14 = and i32 %13, 31
%15 = shl i32 %11, %14
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i32
%18 = or i32 %10, %17
br label %23
19: ; preds = %2
%20 = load i32, i32* %3
%21 = icmp ne i32 %20, 0
%22 = zext i1 %21 to i32
br label %23
23: ; preds = %19, %7
%24 = phi i32 [ %18, %7 ], [ %22, %19 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @softfloat_shiftRightJam32(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 31
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = ashr i32 %0, %1
%6 = sub nsw i32 0, %1
%7 = and i32 %6, 31
%8 = shl i32 %0, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
%11 = or i32 %5, %10
br label %15
12: ; preds = %2
%13 = icmp ne i32 %0, 0
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %12, %4
%16 = phi i32 [ %11, %4 ], [ %14, %12 ]
ret i32 %16
}
int function(int neq, double time, double *y, double *dy, void *data) {
  dy[0] = y[1];
  dy[1] = -9.8;
  dy[2] = y[3];
  dy[3] = 0;
  return 0;
}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x18(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
movsd  0x8(%rsi),%xmm0
movsd  %xmm0,(%rdx)
movabs $0xc02399999999999a,%rax
99 23 c0
mov    %rax,0x8(%rdx)
movsd  0x18(%rsi),%xmm0
movsd  %xmm0,0x10(%rdx)
movq   $0x0,0x18(%rdx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @function(i32 %0, double %1, double* %2, double* %3, i8* %4) {
%6 = alloca i32
%7 = alloca double
%8 = alloca double*
%9 = alloca double*
%10 = alloca i8*
store i32 %0, i32* %6
store double %1, double* %7
store double* %2, double** %8
store double* %3, double** %9
store i8* %4, i8** %10
%11 = load double*, double** %8
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %9
%15 = getelementptr inbounds double, double* %14, i64 0
store double %13, double* %15
%16 = load double*, double** %9
%17 = getelementptr inbounds double, double* %16, i64 1
store double -9.800000e+00, double* %17
%18 = load double*, double** %8
%19 = getelementptr inbounds double, double* %18, i64 3
%20 = load double, double* %19
%21 = load double*, double** %9
%22 = getelementptr inbounds double, double* %21, i64 2
store double %20, double* %22
%23 = load double*, double** %9
%24 = getelementptr inbounds double, double* %23, i64 3
store double 0.000000e+00, double* %24
ret i32 0
}

LLVM IR (-O2):
define i32 @function(i32 %0, double %1, double* nocapture %2, double* nocapture writeonly %3, i8* nocapture readnone %4) {
%6 = getelementptr inbounds double, double* %2, i64 1
%7 = load double, double* %6
store double %7, double* %3
%8 = getelementptr inbounds double, double* %3, i64 1
store double -9.800000e+00, double* %8
%9 = getelementptr inbounds double, double* %2, i64 3
%10 = load double, double* %9
%11 = getelementptr inbounds double, double* %3, i64 2
store double %10, double* %11
%12 = getelementptr inbounds double, double* %3, i64 3
store double 0.000000e+00, double* %12
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void libcperciva_le32enc(void *pp, uint32_t x) {
  uint8_t *p = (uint8_t *)pp;
  p[0] = x & 0xff;
  p[1] = (x >> 8) & 0xff;
  p[2] = (x >> 16) & 0xff;
  p[3] = (x >> 24) & 0xff;
}


x86 assembly (clang, -O0):
<libcperciva_le32enc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<libcperciva_le32enc>:
mov    %esi,%eax
movzbl %al,%ecx
mov    %ecx,(%rdi)
movzbl %ah,%ecx
mov    %ecx,0x4(%rdi)
mov    %esi,%ecx
shr    $0x10,%ecx
movzbl %cl,%ecx
mov    %ecx,0x8(%rdi)
shr    $0x18,%eax
mov    %eax,0xc(%rdi)
ret

LLVM IR (-O0):
define void @libcperciva_le32enc(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 i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32, i32* %4
%9 = and i32 %8, 255
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
%12 = load i32, i32* %4
%13 = ashr i32 %12, 8
%14 = and i32 %13, 255
%15 = load i32*, i32** %5
%16 = getelementptr inbounds i32, i32* %15, i64 1
store i32 %14, i32* %16
%17 = load i32, i32* %4
%18 = ashr i32 %17, 16
%19 = and i32 %18, 255
%20 = load i32*, i32** %5
%21 = getelementptr inbounds i32, i32* %20, i64 2
store i32 %19, i32* %21
%22 = load i32, i32* %4
%23 = ashr i32 %22, 24
%24 = and i32 %23, 255
%25 = load i32*, i32** %5
%26 = getelementptr inbounds i32, i32* %25, i64 3
store i32 %24, i32* %26
ret void
}

LLVM IR (-O2):
define void @libcperciva_le32enc(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = and i32 %1, 255
store i32 %4, i32* %3
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = getelementptr inbounds i8, i8* %0, i64 4
%8 = bitcast i8* %7 to i32*
store i32 %6, i32* %8
%9 = lshr i32 %1, 16
%10 = and i32 %9, 255
%11 = getelementptr inbounds i8, i8* %0, i64 8
%12 = bitcast i8* %11 to i32*
store i32 %10, i32* %12
%13 = lshr i32 %1, 24
%14 = getelementptr inbounds i8, i8* %0, i64 12
%15 = bitcast i8* %14 to i32*
store i32 %13, i32* %15
ret void
}
int esLetra(char caracter) {
  if (caracter >= 65 && caracter <= 90)
    return 1;
  else if (caracter >= 97 && caracter <= 122)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<esLetra>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1130 <esLetra+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1130 <esLetra+0x30>
movl   $0x1,-0x4(%rbp)
jmp    115d <esLetra+0x5d>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1156 <esLetra+0x56>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1156 <esLetra+0x56>
movl   $0x1,-0x4(%rbp)
jmp    115d <esLetra+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<esLetra>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @esLetra(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %22
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 97
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 122
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %2
br label %22
21: ; preds = %16, %12
store i32 0, i32* %2
br label %22
22: ; preds = %21, %20, %11
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @esLetra(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
double sqrt(double);
double get_sdev(double s1, double s2, double n) {
  double xx = n * s2 - s1 * s1;
  xx = sqrt(xx * xx);
  return sqrt(xx) / n;
}


x86 assembly (clang, -O0):
<get_sdev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <sqrt@plt>
divsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sdev>:
push   %rax
mulsd  %xmm0,%xmm0
movsd  %xmm2,(%rsp)
mulsd  %xmm2,%xmm1
subsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jb     1144 <get_sdev+0x34>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
ucomisd %xmm2,%xmm0
jae    1157 <get_sdev+0x47>
call   1030 <sqrt@plt>
jmp    115b <get_sdev+0x4b>
movapd %xmm1,%xmm0
call   1030 <sqrt@plt>
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jb     113d <get_sdev+0x2d>
sqrtsd %xmm0,%xmm0
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @get_sdev(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %6
%9 = load double, double* %5
%10 = load double, double* %4
%11 = load double, double* %4
%12 = fmul double %10, %11
%13 = fneg double %12
%14 = call double @llvm.fmuladd.f64(double %8, double %9, double %13)
store double %14, double* %7
%15 = load double, double* %7
%16 = load double, double* %7
%17 = fmul double %15, %16
%18 = call double @sqrt(double %17)
store double %18, double* %7
%19 = load double, double* %7
%20 = call double @sqrt(double %19)
%21 = load double, double* %6
%22 = fdiv double %20, %21
ret double %22
}

LLVM IR (-O2):
define double @get_sdev(double %0, double %1, double %2) {
%4 = fneg double %0
%5 = fmul double %4, %0
%6 = tail call double @llvm.fmuladd.f64(double %2, double %1, double %5)
%7 = fmul double %6, %6
%8 = tail call double @sqrt(double %7)
%9 = tail call double @sqrt(double %8)
%10 = fdiv double %9, %2
ret double %10
}
int test_imm_22int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x22 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_22int64_highword_mem>:
testb  $0x22,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_22int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 146028888064
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
float f2c(float f) { return (5.0 / 9.0) * (f - 32.0); }


x86 assembly (clang, -O0):
<f2c>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeee(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2c>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @f2c(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fsub double %4, 3.200000e+01
%6 = fmul double 0x3FE1C71C71C71C72, %5
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @f2c(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, -3.200000e+01
%4 = fmul double %3, 0x3FE1C71C71C71C72
%5 = fptrunc double %4 to float
ret float %5
}
void output_q(long n) {
  *(long *)0x100000208 = n;
  return;
}


x86 assembly (clang, -O0):
<output_q>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
movabs $0x100000208,%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_q>:
movabs $0x100000208,%rax
mov    %rdi,(%rax)
ret

LLVM IR (-O0):
define void @output_q(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store i64 %3, i64* inttoptr (i64 4294967816 to i64*)
ret void
}

LLVM IR (-O2):
define void @output_q(i64 %0) {
store i64 %0, i64* inttoptr (i64 4294967816 to i64*)
ret void
}
long long rotateR_fun_llong(long long x, int i) {
  if ((i %= 64) == 0)
    return x;
  return (x << (64 - i)) | ((0x7fffffffffffffffll >> (i - 1)) & (x >> i));
}


x86 assembly (clang, -O0):
<rotateR_fun_llong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
cmp    $0x0,%edx
jne    112f <rotateR_fun_llong+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1171 <rotateR_fun_llong+0x71>
mov    -0x10(%rbp),%rax
mov    $0x40,%ecx
sub    -0x14(%rbp),%ecx
mov    %ecx,%ecx
shl    %cl,%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
movabs $0x7fffffffffffffff,%rdx
ff ff 7f
sar    %cl,%rdx
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
sar    %cl,%rdx
mov    -0x20(%rbp),%rcx
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotateR_fun_llong>:
mov    %rdi,%rax
lea    0x3f(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
and    $0xffffffc0,%ecx
sub    %ecx,%esi
je     1137 <rotateR_fun_llong+0x37>
mov    %esi,%ecx
neg    %cl
mov    %rax,%rdx
shl    %cl,%rdx
lea    -0x1(%rsi),%ecx
movabs $0x7fffffffffffffff,%rdi
ff ff 7f
shr    %cl,%rdi
mov    %esi,%ecx
sar    %cl,%rax
and    %rdi,%rax
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @rotateR_fun_llong(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = srem i32 %6, 64
store i32 %7, i32* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i64, i64* %4
store i64 %10, i64* %3
br label %27
11: ; preds = %2
%12 = load i64, i64* %4
%13 = load i32, i32* %5
%14 = sub nsw i32 64, %13
%15 = zext i32 %14 to i64
%16 = shl i64 %12, %15
%17 = load i32, i32* %5
%18 = sub nsw i32 %17, 1
%19 = zext i32 %18 to i64
%20 = ashr i64 9223372036854775807, %19
%21 = load i64, i64* %4
%22 = load i32, i32* %5
%23 = zext i32 %22 to i64
%24 = ashr i64 %21, %23
%25 = and i64 %20, %24
%26 = or i64 %16, %25
store i64 %26, i64* %3
br label %27
27: ; preds = %11, %9
%28 = load i64, i64* %3
ret i64 %28
}

LLVM IR (-O2):
define i64 @rotateR_fun_llong(i64 %0, i32 %1) {
%3 = srem i32 %1, 64
%4 = icmp eq i32 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2
%6 = sub nsw i32 64, %3
%7 = zext i32 %6 to i64
%8 = shl i64 %0, %7
%9 = add nsw i32 %3, -1
%10 = zext i32 %9 to i64
%11 = lshr i64 9223372036854775807, %10
%12 = zext i32 %3 to i64
%13 = ashr i64 %0, %12
%14 = and i64 %11, %13
%15 = or i64 %14, %8
br label %16
16: ; preds = %2, %5
%17 = phi i64 [ %15, %5 ], [ %0, %2 ]
ret i64 %17
}
unsigned long to_uns_long(__float128 a) { return (unsigned long)a; }


x86 assembly (clang, -O0):
<to_uns_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movaps %xmm0,-0x10(%rbp)
movaps -0x10(%rbp),%xmm0
call   1120 <__fixunstfdi>
add    $0x10,%rsp
pop    %rbp
ret
nopl   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<to_uns_long>:
push   %rax
call   1110 <__fixunstfdi>
pop    %rcx
ret
nopl   0x0(%rax,%rax,1)

LLVM IR (-O0):
define i64 @to_uns_long(fp128 %0) {
%2 = alloca fp128
store fp128 %0, fp128* %2
%3 = load fp128, fp128* %2
%4 = fptoui fp128 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @to_uns_long(fp128 %0) {
%2 = fptoui fp128 %0 to i64
ret i64 %2
}
int is_multiply_precedence_op(const char *token) {
  char c;
  c = token[0];
  return c == '*' || c == '/';
}


x86 assembly (clang, -O0):
<is_multiply_precedence_op>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2a,%ecx
mov    %al,-0xa(%rbp)
je     1130 <is_multiply_precedence_op+0x30>
movsbl -0x9(%rbp),%eax
cmp    $0x2f,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_multiply_precedence_op>:
mov    (%rdi),%al
cmp    $0x2a,%al
sete   %cl
cmp    $0x2f,%al
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @is_multiply_precedence_op(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 42
br i1 %9, label %14, label %10
10: ; preds = %1
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 47
br label %14
14: ; preds = %10, %1
%15 = phi i1 [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_multiply_precedence_op(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 42
%4 = icmp eq i8 %2, 47
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}