xunge/DecIR huggingface dataset:
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
main() {
  int c;
  while ((c = getchar()) != EOF)
    printf("%d ", c != EOF);
  printf("%d", c != EOF);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     116d <main+0x4d>
mov    -0x8(%rbp),%eax
mov    0x2e96(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
mov    -0x8(%rbp),%eax
mov    0x2e71(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%eax
je     1159 <main+0x39>
lea    0xec2(%rip),%rbx
xchg   %ax,%ax
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
jne    1140 <main+0x20>
lea    0xea4(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c"%d \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %9, label %4
4: ; preds = %0, %4
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%6 = tail call i32 (...) @getchar()
%7 = load i32, i32* @EOF
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %4
9: ; preds = %4, %0
%10 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret i32 0
}
int rb_isupper(int c) { return 'A' <= c && c <= 'Z'; }


x86 assembly (clang, -O0):
<rb_isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x41,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1124 <rb_isupper+0x24>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @rb_isupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 65, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @rb_isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
int xen_must_unplug_disks(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xen_must_unplug_disks() {
ret i32 0
}
FNIEMOP_DEF(iemOp_Grp7_vmcall) {
  AssertFailed();
  return IEMOP_RAISE_INVALID_OPCODE();
}


x86 assembly (clang, -O0):
<FNIEMOP_DEF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <AssertFailed@plt>
mov    $0x0,%al
call   1030 <IEMOP_RAISE_INVALID_OPCODE@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @FNIEMOP_DEF(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @AssertFailed()
%4 = call i32 (...) @IEMOP_RAISE_INVALID_OPCODE()
ret i32 %4
}

LLVM IR (-O2):
define i32 @FNIEMOP_DEF(i32 %0) {
%2 = tail call i32 (...) @AssertFailed()
%3 = tail call i32 (...) @IEMOP_RAISE_INVALID_OPCODE()
ret i32 %3
}
int __syscall4(int call, unsigned long arg0, unsigned long arg1,
               unsigned long arg2, unsigned long arg3) {
  int rc;
  __asm__ volatile("movl %[call], %%eax	\n"
                   "movl %[arg0], %%ebx	\n"
                   "movl %[arg1], %%ecx	\n"
                   "movl %[arg2], %%edx	\n"
                   "movl %[arg3], %%edi	\n"
                   "int  %[xnum]		\n"
                   "movl %%eax, %[rc]	\n"
                   : [rc] "=g"(rc)
                   : [call] "g"(call), [arg0] "g"(arg0), [arg1] "g"(arg1),
                     [arg2] "g"(arg2), [arg3] "g"(arg3), [xnum] "i"(0x80)
                   : "%eax", "%ebx", "%ecx", "%edx", "%edi", "memory");
  return rc;
}


x86 assembly (clang, -O0):
<__syscall4>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%rax
mov    %edi,-0x38(%rbp)
mov    %rsi,-0x40(%rbp)
mov    %rdx,-0x48(%rbp)
mov    %rcx,-0x50(%rbp)
mov    %rax,-0x58(%rbp)
mov    -0x38(%rbp),%eax
mov    -0x40(%rbp),%ebx
mov    -0x48(%rbp),%ecx
mov    -0x50(%rbp),%edx
mov    -0x58(%rbp),%edi
int    $0x80
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @__syscall4(i32 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i32
store i32 %0, i32* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%12 = load i32, i32* %6
%13 = load i64, i64* %7
%14 = load i64, i64* %8
%15 = load i64, i64* %9
%16 = load i64, i64* %10
%17 = load i32, i32* %11
ret i32 %17
}

LLVM IR (-O2):
/* Type definitions */
struct shm_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ shm_receive_non_blocking0(struct shm_context *);
void shm_q_recv0(struct shm_context *context) {
  while (!shm_receive_non_blocking0(context)) {
  };
}


x86 assembly (clang, -O0):
<shm_q_recv0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <shm_receive_non_blocking0@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    113a <shm_q_recv0+0x2a>
jmp    113f <shm_q_recv0+0x2f>
jmp    111c <shm_q_recv0+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shm_q_recv0>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <shm_receive_non_blocking0@plt>
test   %eax,%eax
je     1120 <shm_q_recv0+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.shm_context = type { i32 }
define void @shm_q_recv0(%struct.shm_context* %0) {
%2 = alloca %struct.shm_context*
store %struct.shm_context* %0, %struct.shm_context** %2
br label %3
3: ; preds = %8, %1
%4 = load %struct.shm_context*, %struct.shm_context** %2
%5 = call i32 @shm_receive_non_blocking0(%struct.shm_context* %4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.shm_context = type { i32 }
define void @shm_q_recv0(%struct.shm_context* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @shm_receive_non_blocking0(%struct.shm_context* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %2, label %5
5: ; preds = %2
ret void
}
/* Type definitions */
struct jx_parser {
  int dummy;
};
struct jx {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
struct jx *jx_parse_finish(struct jx_parser *);
struct jx_parser *jx_parser_create(int /*<<< orphan*/);
int /*<<< orphan*/ jx_parser_read_stream(struct jx_parser *,
                                         int /*<<< orphan*/ *);
struct jx *jx_parse_stream(FILE *file) {
  struct jx_parser *p = jx_parser_create(0);
  jx_parser_read_stream(p, file);
  return jx_parse_finish(p);
}


x86 assembly (clang, -O0):
<jx_parse_stream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1030 <jx_parser_create@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <jx_parser_read_stream@plt>
mov    -0x10(%rbp),%rdi
call   1040 <jx_parse_finish@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jx_parse_stream>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %edi,%edi
call   1030 <jx_parser_create@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <jx_parser_read_stream@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <jx_parse_finish@plt>

LLVM IR (-O0):
%struct.jx = type { i32 }
%struct.jx_parser = type { i32 }
define %struct.jx* @jx_parse_stream(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.jx_parser*
store i32* %0, i32** %2
%4 = call %struct.jx_parser* @jx_parser_create(i32 0)
store %struct.jx_parser* %4, %struct.jx_parser** %3
%5 = load %struct.jx_parser*, %struct.jx_parser** %3
%6 = load i32*, i32** %2
%7 = call i32 @jx_parser_read_stream(%struct.jx_parser* %5, i32* %6)
%8 = load %struct.jx_parser*, %struct.jx_parser** %3
%9 = call %struct.jx* @jx_parse_finish(%struct.jx_parser* %8)
ret %struct.jx* %9
}

LLVM IR (-O2):
%struct.jx = type { i32 }
%struct.jx_parser = type { i32 }
define %struct.jx* @jx_parse_stream(i32* %0) {
%2 = tail call %struct.jx_parser* @jx_parser_create(i32 0)
%3 = tail call i32 @jx_parser_read_stream(%struct.jx_parser* %2, i32* %0)
%4 = tail call %struct.jx* @jx_parse_finish(%struct.jx_parser* %2)
ret %struct.jx* %4
}
int foo(int x) { return 2 * x; }


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

x86 assembly (clang, -O2):
<foo>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
void *_Locale_numeric_create(const char *__DUMMY_PAR) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @_Locale_numeric_create(i8* nocapture readnone %0) {
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int read32_be(int /*<<< orphan*/ const *);
uint64_t read64_be(const uint8_t buf[8]) {
  uint32_t hi = read32_be(buf), lo = read32_be(buf + 4);
  return ((uint64_t)hi) << 32 | lo;
}


x86 assembly (clang, -O0):
<read64_be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <read32_be@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
call   1030 <read32_be@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read64_be>:
push   %rbx
mov    %rdi,%rbx
call   1030 <read32_be@plt>
add    $0x10,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <read32_be@plt>

LLVM IR (-O0):
define i32 @read64_be(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @read32_be(i32* %5)
store i32 %6, i32* %3
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 4
%9 = call i32 @read32_be(i32* %8)
store i32 %9, i32* %4
%10 = load i32, i32* %3
%11 = shl i32 %10, 32
%12 = load i32, i32* %4
%13 = or i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @read64_be(i32* %0) {
%2 = tail call i32 @read32_be(i32* %0)
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = tail call i32 @read32_be(i32* %3)
ret i32 poison
}
int umnozhenie(int a, int b) { return a * b; }


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

x86 assembly (clang, -O2):
<umnozhenie>:
mov    %edi,%eax
imul   %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @umnozhenie(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t h265hvcc_get_length_size_1(const uint8_t *p) { return p[21] & 0x3; }


x86 assembly (clang, -O0):
<h265hvcc_get_length_size_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x54(%rax),%eax
and    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265hvcc_get_length_size_1>:
mov    0x54(%rdi),%eax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @h265hvcc_get_length_size_1(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 21
%5 = load i32, i32* %4
%6 = and i32 %5, 3
ret i32 %6
}

LLVM IR (-O2):
define i32 @h265hvcc_get_length_size_1(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 21
%3 = load i32, i32* %2
%4 = and i32 %3, 3
ret i32 %4
}
unsigned int umul16_lo(unsigned short a, unsigned short b) {
  return (a * b) & 0xffff;
}


x86 assembly (clang, -O0):
<umul16_lo>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
imul   %ecx,%eax
and    $0xffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<umul16_lo>:
imul   %esi,%edi
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @umul16_lo(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i16, i16* %4
%8 = zext i16 %7 to i32
%9 = mul nsw i32 %6, %8
%10 = and i32 %9, 65535
ret i32 %10
}

LLVM IR (-O2):
define i32 @umul16_lo(i16 zeroext %0, i16 zeroext %1) {
%3 = zext i16 %0 to i32
%4 = zext i16 %1 to i32
%5 = mul nuw nsw i32 %4, %3
%6 = and i32 %5, 65535
ret i32 %6
}
int test_imm_20uint32_reg(unsigned int val) {
  return ((val) & (0x20 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_20uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x20,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_20uint32_reg>:
test   $0x20,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_20uint32_reg(i32 %0) {
%2 = and i32 %0, 32
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ SIGINT;
scalar_t__ WIFSIGNALED(int);
scalar_t__ WTERMSIG(int);
int system(char *);
int main(int argc, char **argv) {
  while (1) {
    int ret = system("./wrapme");
    if (WIFSIGNALED(ret) && (WTERMSIG(ret) == SIGINT))
      break;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <system@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <WIFSIGNALED@plt>
cmp    $0x0,%rax
je     1184 <main+0x54>
mov    -0x14(%rbp),%edi
call   1050 <WTERMSIG@plt>
mov    0x2e72(%rip),%rcx
cmp    (%rcx),%rax
jne    1184 <main+0x54>
jmp    1189 <main+0x59>
jmp    1146 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xec5(%rip),%rbx
mov    0x2ea6(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1040 <WIFSIGNALED@plt>
test   %rax,%rax
je     1150 <main+0x20>
mov    %ebp,%edi
call   1050 <WTERMSIG@plt>
cmp    (%r14),%rax
jne    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"./wrapme\00"
@SIGINT = global i64 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %2, %18
%8 = call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = call i64 @WIFSIGNALED(i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %7
%13 = load i32, i32* %6
%14 = call i64 @WTERMSIG(i32 %13)
%15 = load i64, i64* @SIGINT
%16 = icmp eq i64 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %12
br label %19
18: ; preds = %12, %7
br label %7
19: ; preds = %17
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [9 x i8] c"./wrapme\00"
@SIGINT = global i64 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %7, %2
%4 = tail call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = tail call i64 @WIFSIGNALED(i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3, %8
br label %3
8: ; preds = %3
%9 = tail call i64 @WTERMSIG(i32 %4)
%10 = load i64, i64* @SIGINT
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %7
12: ; preds = %8
ret i32 0
}
/* Type definitions */
typedef size_t ssize_t;

/* Variables and functions */
ssize_t len(const char *str) {
  ssize_t i;
  i = 0;
  while (str[i] != '\0')
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1136 <len+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <len+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<len>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <len+0x10>
ret

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

LLVM IR (-O2):
define i64 @len(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
int test_42_4(int *mem) { return __atomic_sub_fetch(mem + 0, 1, 4); }


x86 assembly (clang, -O0):
<test_42_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,%eax
neg    %eax
lock xadd %eax,(%rdx)
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_42_4>:
mov    $0xffffffff,%eax
lock xadd %eax,(%rdi)
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @test_42_4(i32* nocapture %0) {
%2 = atomicrmw sub i32* %0, i32 1 acq_rel
%3 = add i32 %2, -1
ret i32 %3
}
/* Variables and functions */
long grg_transform_rotations(long ***, long ***, long const, long const *,
                             long **);
long ksp_snf_transform_rotations(long (*transformed_rots)[3][3],
                                 long (*rotations)[3][3], const long num_rot,
                                 const long D_diag[3], long Q[3][3]) {
  long succeeded;
  succeeded =
      grg_transform_rotations(transformed_rots, rotations, num_rot, D_diag, Q);
  return succeeded;
}


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

x86 assembly (clang, -O2):
<ksp_snf_transform_rotations>:
jmp    1030 <grg_transform_rotations@plt>

LLVM IR (-O0):
define i64 @ksp_snf_transform_rotations([3 x [3 x i64]]* %0, [3 x [3 x i64]]* %1, i64 %2, i64* %3, [3 x i64]* %4) {
%6 = alloca [3 x [3 x i64]]*
%7 = alloca [3 x [3 x i64]]*
%8 = alloca i64
%9 = alloca i64*
%10 = alloca [3 x i64]*
%11 = alloca i64
store [3 x [3 x i64]]* %0, [3 x [3 x i64]]** %6
store [3 x [3 x i64]]* %1, [3 x [3 x i64]]** %7
store i64 %2, i64* %8
store i64* %3, i64** %9
store [3 x i64]* %4, [3 x i64]** %10
%12 = load [3 x [3 x i64]]*, [3 x [3 x i64]]** %6
%13 = bitcast [3 x [3 x i64]]* %12 to i64***
%14 = load [3 x [3 x i64]]*, [3 x [3 x i64]]** %7
%15 = bitcast [3 x [3 x i64]]* %14 to i64***
%16 = load i64, i64* %8
%17 = load i64*, i64** %9
%18 = load [3 x i64]*, [3 x i64]** %10
%19 = bitcast [3 x i64]* %18 to i64**
%20 = call i64 @grg_transform_rotations(i64*** %13, i64*** %15, i64 %16, i64* %17, i64** %19)
store i64 %20, i64* %11
%21 = load i64, i64* %11
ret i64 %21
}

LLVM IR (-O2):
define i64 @ksp_snf_transform_rotations([3 x [3 x i64]]* %0, [3 x [3 x i64]]* %1, i64 %2, i64* %3, [3 x i64]* %4) {
%6 = bitcast [3 x [3 x i64]]* %0 to i64***
%7 = bitcast [3 x [3 x i64]]* %1 to i64***
%8 = bitcast [3 x i64]* %4 to i64**
%9 = tail call i64 @grg_transform_rotations(i64*** %6, i64*** %7, i64 %2, i64* %3, i64** %8)
ret i64 %9
}
int dcmp(const void *v1, const void *v2) {
  double *s1 = (double *)v1;
  double *s2 = (double *)v2;
  if (*s1 > *s2)
    return 1;
  else if (*s1 == *s2)
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<dcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    113e <dcmp+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    116d <dcmp+0x6d>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jne    1166 <dcmp+0x66>
jp     1166 <dcmp+0x66>
movl   $0x0,-0x4(%rbp)
jmp    116d <dcmp+0x6d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcmp>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
ucomisd %xmm1,%xmm0
cmpneqsd %xmm1,%xmm0
movq   %xmm0,%rcx
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @dcmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double*
%7 = alloca double*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
store double* %9, double** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to double*
store double* %11, double** %7
%12 = load double*, double** %6
%13 = load double, double* %12
%14 = load double*, double** %7
%15 = load double, double* %14
%16 = fcmp ogt double %13, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 1, i32* %3
br label %26
18: ; preds = %2
%19 = load double*, double** %6
%20 = load double, double* %19
%21 = load double*, double** %7
%22 = load double, double* %21
%23 = fcmp oeq double %20, %22
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 0, i32* %3
br label %26
25: ; preds = %18
store i32 -1, i32* %3
br label %26
26: ; preds = %25, %24, %17
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @dcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
%8 = fcmp une double %5, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ ERR_free_strings();
int /*<<< orphan*/ EVP_cleanup();
void crypto_exit(void) {
  EVP_cleanup();
  ERR_free_strings();
}


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

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

LLVM IR (-O0):
define void @crypto_exit() {
%1 = call i32 (...) @EVP_cleanup()
%2 = call i32 (...) @ERR_free_strings()
ret void
}

LLVM IR (-O2):
define void @crypto_exit() {
%1 = tail call i32 (...) @EVP_cleanup()
%2 = tail call i32 (...) @ERR_free_strings()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("Ola Mundo\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"Ola Mundo\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_strcpy(char *, char const *);
char *ft_strcat(char *s1, const char *s2) {
  char *ptr;
  ptr = s1;
  while (*s1)
    s1++;
  ft_strcpy(s1, s2);
  return (ptr);
}


x86 assembly (clang, -O0):
<ft_strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <ft_strcat+0x36>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1128 <ft_strcat+0x18>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <ft_strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcat>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rdi
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi)
lea    0x1(%rdi),%rdi
jne    1120 <ft_strcat+0x10>
call   1030 <ft_strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ft_strcat(i8* returned %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = tail call i32 @ft_strcpy(i8* %4, i8* %1)
ret i8* %0
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void AVRCP_ResponseSink_RenderingControl_SetVolume(struct UPnPService *Service,
                                                   int ErrorCode, void *User) {
  printf(
      "AVRCP_ Invoke Response: RenderingControl/SetVolume[ErrorCode:%d]()\r\n",
      ErrorCode);
}


x86 assembly (clang, -O0):
<AVRCP_ResponseSink_RenderingControl_SetVolume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [69 x i8] c"AVRCP_ Invoke Response: RenderingControl/SetVolume[ErrorCode:%d]()\0D\0A\00"
define void @AVRCP_ResponseSink_RenderingControl_SetVolume(%struct.UPnPService* %0, i32 %1, i8* %2) {
%4 = alloca %struct.UPnPService*
%5 = alloca i32
%6 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [69 x i8] c"AVRCP_ Invoke Response: RenderingControl/SetVolume[ErrorCode:%d]()\0D\0A\00"
define void @AVRCP_ResponseSink_RenderingControl_SetVolume(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void handler(int signo) { abort(); }


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<handler>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @handler(i32 %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void error(char *msg) {
  perror("error: ");
  perror(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <perror@plt>
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <perror@plt>
mov    %rbx,%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"error: \00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @perror(i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"error: \00"
define void @error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @perror(i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ RB_AUTOBOOT;
int /*<<< orphan*/ reboot(int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
int main() {
  system("/usr/sbin/lwvmedit --from-file=/usr/lib/lwvmedit/ptmaps/dualboot.map "
         "/dev/disk0");
  system("/usr/sbin/nvram auto-boot=true");
  reboot(RB_AUTOBOOT);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <system@plt>
lea    0xf0e(%rip),%rdi
call   1030 <system@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <reboot@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <system@plt>
lea    0xf1c(%rip),%rdi
call   1030 <system@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <reboot@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [80 x i8] c"/usr/sbin/lwvmedit --from-file=/usr/lib/lwvmedit/ptmaps/dualboot.map /dev/disk0\00"
@.str.1 = [31 x i8] c"/usr/sbin/nvram auto-boot=true\00"
@RB_AUTOBOOT = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* @RB_AUTOBOOT
%5 = call i32 @reboot(i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [80 x i8] c"/usr/sbin/lwvmedit --from-file=/usr/lib/lwvmedit/ptmaps/dualboot.map /dev/disk0\00"
@.str.1 = [31 x i8] c"/usr/sbin/nvram auto-boot=true\00"
@RB_AUTOBOOT = global i32 0
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @RB_AUTOBOOT
%4 = tail call i32 @reboot(i32 %3)
ret i32 0
}
int __test() {
  int x = 3, y = 4;
  int z = 0;
  if (x < y) {
    z += 1;
  }
  if (x) {
    z += 2;
  }
  return z * x * y;
}


x86 assembly (clang, -O0):
<__test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    112e <__test+0x2e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1141 <__test+0x41>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @__test() {
ret i32 36
}
/* Variables and functions */
int strlen(char *);
int comprimento(char *s) { return strlen(s); }


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

x86 assembly (clang, -O2):
<comprimento>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @comprimento(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(int arr[], int len) {
  for (int i = 0; i < len; i++)
    printf("%d ", arr[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printArray(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
double sqrt(double x) { return x; }


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

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

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

LLVM IR (-O2):
define double @sqrt(double returned %0) {
ret double %0
}
/* Variables and functions */
float mlVectorNorm(float const *);
int /*<<< orphan*/ mlVectorScaleTo(float const *, float, float *);
void mlVectorNormalTo(const float *a, float *result) {
  mlVectorScaleTo(a, 1.0f / mlVectorNorm(a), result);
}


x86 assembly (clang, -O0):
<mlVectorNormalTo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mlVectorNorm@plt>
mov    -0x18(%rbp),%rdi
movaps %xmm0,%xmm1
movss  0xeb0(%rip),%xmm0
divss  %xmm1,%xmm0
mov    -0x10(%rbp),%rsi
call   1030 <mlVectorScaleTo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlVectorNormalTo>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <mlVectorNorm@plt>
movss  0xec9(%rip),%xmm1
divss  %xmm0,%xmm1
mov    %rbx,%rdi
movaps %xmm1,%xmm0
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <mlVectorScaleTo@plt>

LLVM IR (-O0):
define void @mlVectorNormalTo(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float*, float** %3
%7 = call float @mlVectorNorm(float* %6)
%8 = fdiv float 1.000000e+00, %7
%9 = load float*, float** %4
%10 = call i32 @mlVectorScaleTo(float* %5, float %8, float* %9)
ret void
}

LLVM IR (-O2):
define void @mlVectorNormalTo(float* %0, float* %1) {
%3 = tail call float @mlVectorNorm(float* %0)
%4 = fdiv float 1.000000e+00, %3
%5 = tail call i32 @mlVectorScaleTo(float* %0, float %4, float* %1)
ret void
}
long __VERIFIER_nondet_long() {
  long val;
  return val;
}


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

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

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

LLVM IR (-O2):
define i64 @__VERIFIER_nondet_long() {
ret i64 undef
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t read_24_le(unsigned char bytes[3]) {
  uint32_t result = 0;
  for (int i = 3 - 1; i >= 0; i--)
    result = (result << 8) | bytes[i];
  return result;
}


x86 assembly (clang, -O0):
<read_24_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1145 <read_24_le+0x45>
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <read_24_le+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_24_le>:
movzbl 0x2(%rdi),%eax
movzbl 0x1(%rdi),%ecx
shl    $0x10,%eax
shl    $0x8,%ecx
or     %eax,%ecx
movzbl (%rdi),%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @read_24_le(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %4, 16
%9 = shl nuw nsw i32 %7, 8
%10 = or i32 %8, %9
%11 = load i8, i8* %0
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void panic(char *msg) {
  fprintf(stderr, "Error: %s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<panic>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
define void @panic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
define void @panic(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void version(void *arg) { printf("No version, TMD\n"); }


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"No version, TMD\00"
define void @version(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
OP(op, c6) { ADD(ARG()); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <ARG@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <ADD@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <ARG@plt>
mov    %eax,%edi
xor    %eax,%eax
pop    %rcx
jmp    1040 <ADD@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @ARG()
%7 = call i32 (i32, ...) bitcast (i32 (...)* @ADD to i32 (i32, ...)*)(i32 %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @ARG()
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @ADD to i32 (i32, ...)*)(i32 %3)
ret i32 undef
}