xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ test_lisp_char_string();
int /*<<< orphan*/ test_lisp_comment();
int /*<<< orphan*/ test_lisp_comment_entities();
int /*<<< orphan*/ test_lisp_doc_string();
int /*<<< orphan*/ test_lisp_doc_string_blank();
int /*<<< orphan*/ test_lisp_empty_string();
void all_lisp_tests() {
  test_lisp_comment();
  test_lisp_doc_string();
  test_lisp_doc_string_blank();
  test_lisp_empty_string();
  test_lisp_char_string();
  test_lisp_comment_entities();
}


x86 assembly (clang, -O0):
<all_lisp_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <test_lisp_comment@plt>
mov    $0x0,%al
call   1060 <test_lisp_doc_string@plt>
mov    $0x0,%al
call   1030 <test_lisp_doc_string_blank@plt>
mov    $0x0,%al
call   1050 <test_lisp_empty_string@plt>
mov    $0x0,%al
call   1080 <test_lisp_char_string@plt>
mov    $0x0,%al
call   1040 <test_lisp_comment_entities@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_lisp_tests>:
push   %rax
xor    %eax,%eax
call   1070 <test_lisp_comment@plt>
xor    %eax,%eax
call   1060 <test_lisp_doc_string@plt>
xor    %eax,%eax
call   1030 <test_lisp_doc_string_blank@plt>
xor    %eax,%eax
call   1050 <test_lisp_empty_string@plt>
xor    %eax,%eax
call   1080 <test_lisp_char_string@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_lisp_comment_entities@plt>

LLVM IR (-O0):
define void @all_lisp_tests() {
%1 = call i32 (...) @test_lisp_comment()
%2 = call i32 (...) @test_lisp_doc_string()
%3 = call i32 (...) @test_lisp_doc_string_blank()
%4 = call i32 (...) @test_lisp_empty_string()
%5 = call i32 (...) @test_lisp_char_string()
%6 = call i32 (...) @test_lisp_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_lisp_tests() {
%1 = tail call i32 (...) @test_lisp_comment()
%2 = tail call i32 (...) @test_lisp_doc_string()
%3 = tail call i32 (...) @test_lisp_doc_string_blank()
%4 = tail call i32 (...) @test_lisp_empty_string()
%5 = tail call i32 (...) @test_lisp_char_string()
%6 = tail call i32 (...) @test_lisp_comment_entities()
ret void
}
int numJewelsInStones(char *J, char *S) {
  char *ps = S;
  char *pj = J;
  int count = 0;
  while (ps != '\0') {
    while (pj != '\0') {
      if (*ps == *pj) {
        count++;
      }
      pj++;
    }
    ps++;
  }
  return count;
}


x86 assembly (clang, -O0):
<numJewelsInStones>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117f <numJewelsInStones+0x7f>
jmp    1133 <numJewelsInStones+0x33>
cmpq   $0x0,-0x20(%rbp)
je     116e <numJewelsInStones+0x6e>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    -0x20(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    115d <numJewelsInStones+0x5d>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1133 <numJewelsInStones+0x33>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1123 <numJewelsInStones+0x23>
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numJewelsInStones>:
test   %rsi,%rsi
je     1112 <numJewelsInStones+0x12>
cs nopw 0x0(%rax,%rax,1)
nop
jmp    1110 <numJewelsInStones+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @numJewelsInStones(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = icmp eq i8* %0, null
br label %6
6: ; preds = %4, %6
br label %6
7: ; preds = %2
ret i32 0
}
void f_d(int i) {}


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

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

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

LLVM IR (-O2):
define void @f_d(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;
typedef int /*<<< orphan*/ mp_bitcnt_t;
typedef int /*<<< orphan*/ gmp_randstate_t;

/* Variables and functions */
int /*<<< orphan*/ mpz_nextprime(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_setbit(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_urandomb(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/);
void internal_naive_random_prime(mpz_t rop, gmp_randstate_t rstate,
                                 mp_bitcnt_t bitcnt) {
  mpz_urandomb(rop, rstate, bitcnt);
  mpz_setbit(rop, bitcnt);
  mpz_nextprime(rop, rop);
}


x86 assembly (clang, -O0):
<internal_naive_random_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <mpz_urandomb@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <mpz_setbit@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1050 <mpz_nextprime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_naive_random_prime>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %edi,%ebp
call   1040 <mpz_urandomb@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <mpz_setbit@plt>
mov    %ebp,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <mpz_nextprime@plt>

LLVM IR (-O0):
define void @internal_naive_random_prime(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @mpz_urandomb(i32 %7, i32 %8, i32 %9)
%11 = load i32, i32* %4
%12 = load i32, i32* %6
%13 = call i32 @mpz_setbit(i32 %11, i32 %12)
%14 = load i32, i32* %4
%15 = load i32, i32* %4
%16 = call i32 @mpz_nextprime(i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
define void @internal_naive_random_prime(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @mpz_urandomb(i32 %0, i32 %1, i32 %2)
%5 = tail call i32 @mpz_setbit(i32 %0, i32 %2)
%6 = tail call i32 @mpz_nextprime(i32 %0, i32 %0)
ret void
}
void sync_core_before_usermode(void) {}


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

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

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

LLVM IR (-O2):
define void @sync_core_before_usermode() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ radio_get_snc();
int /*<<< orphan*/ rom_write(int, int /*<<< orphan*/);
void radio_write_rom_snc(void) { rom_write(57, radio_get_snc()); }


x86 assembly (clang, -O0):
<radio_write_rom_snc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <radio_get_snc@plt>
mov    %eax,%esi
mov    $0x39,%edi
call   1040 <rom_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<radio_write_rom_snc>:
push   %rax
xor    %eax,%eax
call   1030 <radio_get_snc@plt>
mov    $0x39,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <rom_write@plt>

LLVM IR (-O0):
define void @radio_write_rom_snc() {
%1 = call i32 (...) @radio_get_snc()
%2 = call i32 @rom_write(i32 57, i32 %1)
ret void
}

LLVM IR (-O2):
define void @radio_write_rom_snc() {
%1 = tail call i32 (...) @radio_get_snc()
%2 = tail call i32 @rom_write(i32 57, i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ INT_MAX;
__attribute__((weak)) void _exit(int status) {
  int x = status / (int)INT_MAX;
  x = 4 / x;
  while (1) {
  }
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed7(%rip),%rcx
mov    (%rcx),%rcx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    $0x4,%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x8(%rbp)
jmp    1126 <_exit+0x26>

x86 assembly (clang, -O2):
<_exit>:
jmp    1100 <_exit>

LLVM IR (-O0):
@INT_MAX = global i64 0
define weak void @_exit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i64, i64* @INT_MAX
%6 = trunc i64 %5 to i32
%7 = sdiv i32 %4, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = sdiv i32 4, %8
store i32 %9, i32* %3
br label %10
10: ; preds = %1, %10
br label %10
}

LLVM IR (-O2):
@INT_MAX = global i64 0
define weak void @_exit(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
cbranch(tree, lbl, cond) struct tnode *tree;
{ rcexpr(block(1, 103, tree, lbl, cond)); }


x86 assembly (clang, -O0):
<cbranch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    $0x1,%edi
mov    $0x67,%esi
mov    $0x0,%al
call   1040 <block@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1030 <rcexpr@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbranch>:
push   %rax
mov    %edx,%r8d
mov    %esi,%ecx
mov    %rdi,%rdx
mov    $0x1,%edi
mov    $0x67,%esi
xor    %eax,%eax
call   1040 <block@plt>
mov    %eax,%edi
xor    %eax,%eax
pop    %rcx
jmp    1030 <rcexpr@plt>

LLVM IR (-O0):
%struct.tnode = type opaque
define i32 @cbranch(%struct.tnode* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.tnode*
%6 = alloca i32
%7 = alloca i32
store %struct.tnode* %0, %struct.tnode** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load %struct.tnode*, %struct.tnode** %5
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = call i32 (i32, i32, %struct.tnode*, i32, i32, ...) bitcast (i32 (...)* @block to i32 (i32, i32, %struct.tnode*, i32, i32, ...)*)(i32 1, i32 103, %struct.tnode* %8, i32 %9, i32 %10)
%12 = call i32 (i32, ...) bitcast (i32 (...)* @rcexpr to i32 (i32, ...)*)(i32 %11)
%13 = load i32, i32* %4
ret i32 %13
}

LLVM IR (-O2):
%struct.tnode = type opaque
define i32 @cbranch(%struct.tnode* %0, i32 %1, i32 %2) {
%4 = tail call i32 (i32, i32, %struct.tnode*, i32, i32, ...) bitcast (i32 (...)* @block to i32 (i32, i32, %struct.tnode*, i32, i32, ...)*)(i32 1, i32 103, %struct.tnode* %0, i32 %1, i32 %2)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @rcexpr to i32 (i32, ...)*)(i32 %4)
ret i32 undef
}
/* Variables and functions */
scalar_t__ strstr(char const *, char *);
int get_action_code(const char *str) { return strstr(str, "<=") ? 2 : 1; }


x86 assembly (clang, -O0):
<get_action_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rdx
mov    $0x1,%eax
mov    $0x2,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_action_code>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x1,%rax
mov    $0x2,%eax
sbb    $0x0,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"<=\00"
define i32 @get_action_code(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strstr(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 2, i32 1
ret i32 %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"<=\00"
define i32 @get_action_code(i8* %0) {
%2 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 1, i32 2
ret i32 %4
}
int bool_digit(char c) {
  return c == '0' ? 0 : c == '1' ? 1 : c == '8' ? -1 : 2;
}


x86 assembly (clang, -O0):
<bool_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jne    1121 <bool_digit+0x21>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1158 <bool_digit+0x58>
movsbl -0x1(%rbp),%eax
cmp    $0x31,%eax
jne    113b <bool_digit+0x3b>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1152 <bool_digit+0x52>
movsbl -0x1(%rbp),%edx
mov    $0x2,%eax
mov    $0xffffffff,%ecx
cmp    $0x38,%edx
cmove  %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bool_digit>:
cmp    $0x30,%dil
je     1112 <bool_digit+0x12>
cmp    $0x31,%dil
jne    1115 <bool_digit+0x15>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret
xor    %eax,%eax
cmp    $0x38,%dil
setne  %al
lea    (%rax,%rax,2),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @bool_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 48
br i1 %5, label %6, label %7
6: ; preds = %1
br label %20
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 49
br i1 %10, label %11, label %12
11: ; preds = %7
br label %18
12: ; preds = %7
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 56
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 -1, i32 2
br label %18
18: ; preds = %12, %11
%19 = phi i32 [ 1, %11 ], [ %17, %12 ]
br label %20
20: ; preds = %18, %6
%21 = phi i32 [ 0, %6 ], [ %19, %18 ]
ret i32 %21
}

LLVM IR (-O2):
define i32 @bool_digit(i8 signext %0) {
switch i8 %0, label %2 [
i8 48, label %6
i8 49, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 56
%4 = select i1 %3, i32 -1, i32 2
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %2
%7 = phi i32 [ 0, %1 ], [ %4, %2 ], [ 1, %5 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ _sys_exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *const, int);
int /*<<< orphan*/ stdout;
void Q_onAssert(char const *const file, int line) {
  printf("Assertion failed in %s, line %d", file, line);
  fflush(stdout);
  _sys_exit(-1);
}


x86 assembly (clang, -O0):
<Q_onAssert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0xffffffff,%edi
call   1030 <_sys_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_onAssert>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0xffffffff,%edi
pop    %rax
jmp    1030 <_sys_exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Assertion failed in %s, line %d\00"
@stdout = global i32 0
define void @Q_onAssert(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
%10 = call i32 @_sys_exit(i32 -1)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Assertion failed in %s, line %d\00"
@stdout = global i32 0
define void @Q_onAssert(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @_sys_exit(i32 -1)
ret void
}
dma(int addr, int len, int write) {
  volatile unsigned int *dm = (unsigned int *)0xa0000000;
  dm[0] = addr;
  dm[1] = (write << 13) + 0x1000 + len;
}


x86 assembly (clang, -O0):
<dma>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0xa0000000,%eax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%ecx
shl    $0xd,%ecx
add    $0x1000,%ecx
add    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dma>:
mov    $0xa0000000,%eax
mov    %edi,(%rax)
shl    $0xd,%edx
lea    (%rsi,%rdx,1),%ecx
add    $0x1000,%ecx
mov    %ecx,0x4(%rax)
ret

LLVM IR (-O0):
define i32 @dma(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* inttoptr (i64 2684354560 to i32*), i32** %8
%9 = load i32, i32* %5
%10 = load i32*, i32** %8
%11 = getelementptr inbounds i32, i32* %10, i64 0
store volatile i32 %9, i32* %11
%12 = load i32, i32* %7
%13 = shl i32 %12, 13
%14 = add nsw i32 %13, 4096
%15 = load i32, i32* %6
%16 = add nsw i32 %14, %15
%17 = load i32*, i32** %8
%18 = getelementptr inbounds i32, i32* %17, i64 1
store volatile i32 %16, i32* %18
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @dma(i32 %0, i32 %1, i32 %2) {
store volatile i32 %0, i32* inttoptr (i64 2684354560 to i32*)
%4 = shl i32 %2, 13
%5 = add i32 %1, 4096
%6 = add i32 %5, %4
store volatile i32 %6, i32* inttoptr (i64 2684354564 to i32*)
ret i32 undef
}
/* Variables and functions */
int strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t const);
char *tcc_malloc(size_t const);
char *tcc_strdup(const char *str) {
  char *ptr;
  const size_t size = strlen(str) + 1;
  ptr = tcc_malloc(size);
  strncpy(ptr, str, size);
  return ptr;
}


x86 assembly (clang, -O0):
<tcc_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <tcc_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcc_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <tcc_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @tcc_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %4
%9 = load i64, i64* %4
%10 = call i8* @tcc_malloc(i64 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = load i64, i64* %4
%14 = call i32 @strncpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @tcc_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @tcc_malloc(i64 %4)
%6 = tail call i32 @strncpy(i8* %5, i8* %0, i64 %4)
ret i8* %5
}
/* Variables and functions */
char *memcpy(char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
char *strcpy(char *restrict s1, const char *restrict s2) {
  return memcpy(s1, s2, strlen(s1));
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memcpy@plt>

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

LLVM IR (-O2):
define i8* @strcpy(i8* noalias %0, i8* noalias %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i8* @memcpy(i8* %0, i8* %1, i32 %3)
ret i8* %4
}
void ff_hevc_put_hevc_qpel_h64_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_h64_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(char *, int /*<<< orphan*/, int);
void nullpointerMemcmp(char *p) { memcmp(p, 0, 123); }


x86 assembly (clang, -O0):
<nullpointerMemcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x7b,%edx
call   1030 <memcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nullpointerMemcmp>:
xor    %esi,%esi
mov    $0x7b,%edx
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
define void @nullpointerMemcmp(i8* %0) {
%2 = tail call i32 @memcmp(i8* %0, i32 0, i32 123)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ createChild(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sleep(int);
int main(int argc, char **argv) {
  char *usage = "Usage: %s program_name\n";
  if (argc != 2) {
    printf(usage, argv[0]);
    return 1;
  }
  while (1) {
    createChild(argv[1]);
    sleep(30);
  }
  return 0;
}


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),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1176 <main+0x46>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    117b <main+0x4b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <createChild@plt>
mov    $0x1e,%edi
call   1050 <sleep@plt>
jmp    117b <main+0x4b>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    1155 <main+0x25>
nopl   0x0(%rax)
mov    0x8(%rbx),%rdi
call   1040 <createChild@plt>
mov    $0x1e,%edi
call   1050 <sleep@plt>
jmp    1140 <main+0x10>
mov    (%rbx),%rsi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [24 x i8] c"Usage: %s program_name\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
br label %9
6: ; preds = %2
%7 = load i8*, i8** %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 1
9: ; preds = %4, %9
%10 = load i8*, i8** %5
%11 = tail call i32 @createChild(i8* %10)
%12 = tail call i32 @sleep(i32 30)
br label %9
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_ftpinbound(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_ftpinbound>:
jmp    1030 <mock@plt>

LLVM IR (-O0):
define i8* @cf_s_ftpinbound(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mock(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cf_s_ftpinbound(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ umount(char *);
int main(int argc, char *argv[]) {
  int counter = 1;
  while (counter < argc)
    umount(argv[counter++]);
  return 0;
}


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)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1159 <main+0x49>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <umount@plt>
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1142 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
add    $0x1,%rbx
call   1030 <umount@plt>
cmp    %rbx,%r15
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
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
store i32 1, i32* %6
br label %7
7: ; preds = %11, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %19
11: ; preds = %7
%12 = load i8**, i8*** %5
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
store i32 %14, i32* %6
%15 = sext i32 %13 to i64
%16 = getelementptr inbounds i8*, i8** %12, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @umount(i8* %17)
br label %7
19: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %8, %6 ]
%8 = add nuw nsw i64 %7, 1
%9 = getelementptr inbounds i8*, i8** %1, i64 %7
%10 = load i8*, i8** %9
%11 = tail call i32 @umount(i8* %10)
%12 = icmp eq i64 %8, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
int gt(int a, int b) { return a > b; }


x86 assembly (clang, -O0):
<gt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt>:
xor    %eax,%eax
cmp    %esi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @gt(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 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @gt(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int __builtin_arc_ffs(int);
int bar(void) { return __builtin_arc_ffs(0x10); }


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

x86 assembly (clang, -O2):
<bar>:
mov    $0x10,%edi
jmp    1030 <__builtin_arc_ffs@plt>

LLVM IR (-O0):
define i32 @bar() {
%1 = call i32 @__builtin_arc_ffs(i32 16)
ret i32 %1
}

LLVM IR (-O2):
define i32 @bar() {
%1 = tail call i32 @__builtin_arc_ffs(i32 16)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_gr_sound() { exit(1); }


x86 assembly (clang, -O0):
<caml_gr_sound>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<caml_gr_sound>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_gr_sound() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_gr_sound() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
void INT_Excep_ICU_GROUP4(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_ICU_GROUP4() {
ret void
}
double d_abs(double d) { return ((d > 0) ? d : -d); }


x86 assembly (clang, -O0):
<d_abs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112a <d_abs+0x2a>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    114b <d_abs+0x4b>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_abs>:
movapd 0xef8(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @d_abs(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %0, double %3
ret double %4
}
void foo() {
  int l = 0;
  int p = 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func11();
void func1() {
  char var_1[8];
  var_1[7] = 0x1;
  func11();
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x1,-0x1(%rbp)
mov    $0x0,%al
call   1030 <func11@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @func1() {
%1 = alloca [8 x i8]
%2 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 7
store i8 1, i8* %2
%3 = call i32 (...) @func11()
ret void
}

LLVM IR (-O2):
define void @func1() {
%1 = tail call i32 (...) @func11()
ret void
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRCC_get(void) { return U_WMRCORENONE_get("U_WMRCC"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRCC\00"
define i32 @U_WMRCC_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ load_xmm(int, void *);
int /*<<< orphan*/ print_vec_uint32_hex(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
void print_xmm_uint32_hex(int i) {
  static uint32_t v[4];
  load_xmm(i, (void *)v);
  printf("xmm%d = ", i);
  print_vec_uint32_hex(v);
}


x86 assembly (clang, -O0):
<print_xmm_uint32_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0x2f0b(%rip),%rsi
call   1050 <load_xmm@plt>
mov    -0x4(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
lea    0x2ef0(%rip),%rdi
call   1040 <print_vec_uint32_hex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_xmm_uint32_hex>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x2f13(%rip),%r14
mov    %r14,%rsi
call   1050 <load_xmm@plt>
lea    0xeb4(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <print_vec_uint32_hex@plt>

LLVM IR (-O0):
@print_xmm_uint32_hex.v = internal global [4 x i32] zeroinitializer
@.str = [9 x i8] c"xmm%d = \00"
define void @print_xmm_uint32_hex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @load_xmm(i32 %3, i8* bitcast ([4 x i32]* @print_xmm_uint32_hex.v to i8*))
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @print_vec_uint32_hex(i32* getelementptr inbounds ([4 x i32], [4 x i32]* @print_xmm_uint32_hex.v, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@print_xmm_uint32_hex.v = internal global [4 x i32] zeroinitializer
@.str = [9 x i8] c"xmm%d = \00"
define void @print_xmm_uint32_hex(i32 %0) {
%2 = tail call i32 @load_xmm(i32 %0, i8* bitcast ([4 x i32]* @print_xmm_uint32_hex.v to i8*))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @print_vec_uint32_hex(i32* getelementptr inbounds ([4 x i32], [4 x i32]* @print_xmm_uint32_hex.v, i64 0, i64 0))
ret void
}
void test_cbw(int x) {
  volatile int a, newa;
  a = x;
  __asm__ __volatile__("mov %1, %%eax\n\t"
                       "cbtw\n\t"
                       "mov %%eax, %0\n\t"
                       : "=m"(newa)
                       : "m"(a)
                       : "eax");
  do {
    if (!((short)newa == (short)(signed char)a))
      asm volatile(".byte 0xd6" : : "a"(1));
  } while (0);
}


x86 assembly (clang, -O0):
<test_cbw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cbtw
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cwtl
mov    -0x8(%rbp),%ecx
movsbl %cl,%ecx
movswl %cx,%ecx
cmp    %ecx,%eax
je     1130 <test_cbw+0x30>
mov    $0x1,%eax
(bad)
jmp    1135 <test_cbw+0x35>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cbw>:
mov    %edi,-0x8(%rsp)
mov    -0x8(%rsp),%eax
cbtw
mov    %eax,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cwtl
mov    -0x8(%rsp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
je     1124 <test_cbw+0x24>
mov    $0x1,%eax
(bad)
ret

LLVM IR (-O0):
define void @test_cbw(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
store volatile i32 %5, i32* %3
br label %6
6: ; preds = %1
%7 = load volatile i32, i32* %4
%8 = trunc i32 %7 to i16
%9 = sext i16 %8 to i32
%10 = load volatile i32, i32* %3
%11 = trunc i32 %10 to i8
%12 = sext i8 %11 to i16
%13 = sext i16 %12 to i32
%14 = icmp eq i32 %9, %13
br i1 %14, label %16, label %15
15: ; preds = %6
br label %16
16: ; preds = %15, %6
br label %17
17: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @test_cbw(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
store volatile i32 %0, i32* %2
%6 = load volatile i32, i32* %3
%7 = shl i32 %6, 16
%8 = ashr exact i32 %7, 16
%9 = load volatile i32, i32* %2
%10 = shl i32 %9, 24
%11 = ashr exact i32 %10, 24
%12 = icmp eq i32 %8, %11
br i1 %12, label %14, label %13
13: ; preds = %1
br label %14
14: ; preds = %13, %1
ret void
}
/* Type definitions */
struct sigaction {
  int /*<<< orphan*/ sa_handler;
};
typedef int /*<<< orphan*/ action;

/* Variables and functions */
int /*<<< orphan*/ SIGQUIT;
int /*<<< orphan*/ SIGSEGV;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ memset(struct sigaction *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sigaction(int /*<<< orphan*/, struct sigaction *,
                             int /*<<< orphan*/ *);
void fault_restore(void) {
  struct sigaction action;
  memset(&action, 0, sizeof(action));
  action.sa_handler = SIG_DFL;
  sigaction(SIGSEGV, &action, NULL);
  sigaction(SIGQUIT, &action, NULL);
}


x86 assembly (clang, -O0):
<fault_restore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fault_restore>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sigaction = type { i32 }
@SIG_DFL = global i32 0
@SIGSEGV = global i32 0
@SIGQUIT = global i32 0
define void @fault_restore() {
%1 = alloca %struct.sigaction
%2 = call i32 @memset(%struct.sigaction* %1, i32 0, i32 4)
%3 = load i32, i32* @SIG_DFL
%4 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 0
store i32 %3, i32* %4
%5 = load i32, i32* @SIGSEGV
%6 = call i32 @sigaction(i32 %5, %struct.sigaction* %1, i32* null)
%7 = load i32, i32* @SIGQUIT
%8 = call i32 @sigaction(i32 %7, %struct.sigaction* %1, i32* null)
ret void
}

LLVM IR (-O2):
%struct.sigaction = type { i32 }
@SIG_DFL = global i32 0
@SIGSEGV = global i32 0
@SIGQUIT = global i32 0
define void @fault_restore() {
%1 = alloca %struct.sigaction
%2 = bitcast %struct.sigaction* %1 to i8*
%3 = call i32 @memset(%struct.sigaction* %1, i32 0, i32 4)
%4 = load i32, i32* @SIG_DFL
%5 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 0
store i32 %4, i32* %5
%6 = load i32, i32* @SIGSEGV
%7 = call i32 @sigaction(i32 %6, %struct.sigaction* %1, i32* null)
%8 = load i32, i32* @SIGQUIT
%9 = call i32 @sigaction(i32 %8, %struct.sigaction* %1, i32* null)
ret void
}
/* Type definitions */
struct IODriver {
  int dummy;
};

/* Variables and functions */
int close(int);
int /*<<< orphan*/ printf(char *, int);
int FileIo_Close(struct IODriver *driver, int fd) {
  do {
    printf("FileIo: close(%d)\n", fd);
  } while (0);
  return close(fd);
}


x86 assembly (clang, -O0):
<FileIo_Close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FileIo_Close>:
push   %rbx
mov    %esi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

LLVM IR (-O0):
%struct.IODriver = type { i32 }
@.str = [19 x i8] c"FileIo: close(%d)\0A\00"
define i32 @FileIo_Close(%struct.IODriver* %0, i32 %1) {
%3 = alloca %struct.IODriver*
%4 = alloca i32
store %struct.IODriver* %0, %struct.IODriver** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %2
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %4
%10 = call i32 @close(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.IODriver = type { i32 }
@.str = [19 x i8] c"FileIo: close(%d)\0A\00"
define i32 @FileIo_Close(%struct.IODriver* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @close(i32 %1)
ret i32 %4
}
/* Variables and functions */
int ENODEV;
int null_read(int fd, char *c_out, void *unused) { return -ENODEV; }


x86 assembly (clang, -O0):
<null_read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
mov    0x2ec8(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<null_read>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENODEV = global i32 0
define i32 @null_read(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* @ENODEV
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@ENODEV = global i32 0
define i32 @null_read(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @ENODEV
%5 = sub nsw i32 0, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int ufree(char *m) {
  free(m);
  return (0);
}


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

x86 assembly (clang, -O2):
<ufree>:
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ufree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
int test_imm_FBuint16_mem(unsigned short *val) {
  return ((*val) & (-0xFB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FBuint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffff05,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FBuint16_mem>:
movzwl (%rdi),%eax
test   $0xff05,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_FBuint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -251
%7 = icmp ne i32 %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_FBuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -251
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fun5ab1();
int /*<<< orphan*/ printf(char *);
void funa04e() {
  printf("funca04e is called!\n");
  fun5ab1();
  printf("***");
}


x86 assembly (clang, -O0):
<funa04e>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <fun5ab1@plt>
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<funa04e>:
push   %rax
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <fun5ab1@plt>
lea    0xeb5(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"funca04e is called!\0A\00"
@.str.1 = [4 x i8] c"***\00"
define void @funa04e() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @fun5ab1()
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"***\00"
@str = [20 x i8] c"funca04e is called!\00"
define void @funa04e() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @fun5ab1()
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double runge(double x) { return (1 / (1 + 25 * x * x)); }


x86 assembly (clang, -O0):
<runge>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xed9(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xecd(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<runge>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xef0(%rip),%xmm0
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @runge(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 2.500000e+01, %3
%5 = load double, double* %2
%6 = call double @llvm.fmuladd.f64(double %4, double %5, double 1.000000e+00)
%7 = fdiv double 1.000000e+00, %6
ret double %7
}

LLVM IR (-O2):
define double @runge(double %0) {
%2 = fmul double %0, 2.500000e+01
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double 1.000000e+00)
%4 = fdiv double 1.000000e+00, %3
ret double %4
}
long VMM_IS_ERR_OR_NULL(const void *ptr) {
  return !ptr || (((unsigned long)ptr) &&
                  ((unsigned long)((unsigned long)ptr) <= (unsigned long)4095));
}


x86 assembly (clang, -O0):
<VMM_IS_ERR_OR_NULL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1141 <VMM_IS_ERR_OR_NULL+0x41>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0xa(%rbp)
je     113b <VMM_IS_ERR_OR_NULL+0x3b>
mov    -0x8(%rbp),%rax
cmp    $0xfff,%rax
setbe  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<VMM_IS_ERR_OR_NULL>:
xor    %eax,%eax
cmp    $0x1000,%rdi
setb   %al
ret

LLVM IR (-O0):
define i64 @VMM_IS_ERR_OR_NULL(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %15
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = ptrtoint i8* %6 to i64
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = load i8*, i8** %2
%11 = ptrtoint i8* %10 to i64
%12 = icmp ule i64 %11, 4095
br label %13
13: ; preds = %9, %5
%14 = phi i1 [ false, %5 ], [ %12, %9 ]
br label %15
15: ; preds = %13, %1
%16 = phi i1 [ true, %1 ], [ %14, %13 ]
%17 = zext i1 %16 to i32
%18 = sext i32 %17 to i64
ret i64 %18
}

LLVM IR (-O2):
define i64 @VMM_IS_ERR_OR_NULL(i8* readnone %0) {
%2 = icmp ult i8* %0, inttoptr (i64 4096 to i8*)
%3 = zext i1 %2 to i64
ret i64 %3
}
/* Type definitions */
struct item {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ slab_put_item(struct item *);
void item_free(struct item *it) {
  ;
  slab_put_item(it);
}


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

x86 assembly (clang, -O2):
<item_free>:
jmp    1030 <slab_put_item@plt>

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

LLVM IR (-O2):
%struct.item = type { i32 }
define void @item_free(%struct.item* %0) {
%2 = tail call i32 @slab_put_item(%struct.item* %0)
ret void
}