xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fa(int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/);
int fb(int a, int b, int c, int d, int e, int f, int g) {
  fa(0, 0, 0, 0, 0, 0, 0);
  return 0;
}


x86 assembly (clang, -O0):
<fb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
xor    %r9d,%r9d
mov    %r9d,%edi
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <fa@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb>:
push   %rax
movl   $0x0,(%rsp)
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <fa@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fb(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = call i32 @fa(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @fb(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = tail call i32 @fa(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char const *);
scalar_t__ strlen(char const *);
int /*<<< orphan*/ write(int, char *, scalar_t__);
int smtp_sendFrom(int socket, const char *mailaddress) {
  char buf[1024];
  snprintf(buf, 1024, "MAIL FROM:<%s>\r\n", mailaddress);
  write(socket, buf, 14 + strlen(mailaddress));
}


x86 assembly (clang, -O0):
<smtp_sendFrom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x400,%esi
lea    0xea7(%rip),%rdx
call   1050 <snprintf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x41c(%rbp)
lea    -0x410(%rbp),%rax
mov    %rax,-0x418(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x41c(%rbp),%edi
mov    -0x418(%rbp),%rsi
mov    %rax,%rdx
add    $0xe,%rdx
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smtp_sendFrom>:
push   %rbp
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xeb9(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x400,%esi
mov    %rbx,%rcx
call   1050 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xe(%rax),%rdx
mov    %ebp,%edi
mov    %r14,%rsi
call   1030 <write@plt>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"MAIL FROM:<%s>\0D\0A\00"
define i32 @smtp_sendFrom(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca [1024 x i8]
store i32 %0, i32* %4
store i8* %1, i8** %5
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%8 = load i8*, i8** %5
%9 = call i32 @snprintf(i8* %7, i32 1024, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* %4
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%12 = load i8*, i8** %5
%13 = call i64 @strlen(i8* %12)
%14 = add nsw i64 14, %13
%15 = call i32 @write(i32 %10, i8* %11, i64 %14)
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [17 x i8] c"MAIL FROM:<%s>\0D\0A\00"
define i32 @smtp_sendFrom(i32 %0, i8* %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 1024, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = call i64 @strlen(i8* dereferenceable(1) %1)
%7 = add nsw i64 %6, 14
%8 = call i32 @write(i32 %0, i8* %4, i64 %7)
ret i32 undef
}
/* Type definitions */
struct ibv_srq_attr {
  int dummy;
};
struct ibv_srq {
  int dummy;
};

/* Variables and functions */
int _query_srq(struct ibv_srq *, struct ibv_srq_attr *);
int /*<<< orphan*/ dmtcp_plugin_disable_ckpt();
int /*<<< orphan*/ dmtcp_plugin_enable_ckpt();
int ibv_query_srq(struct ibv_srq *srq, struct ibv_srq_attr *srq_attr) {
  dmtcp_plugin_disable_ckpt();
  int rslt = _query_srq(srq, srq_attr);
  dmtcp_plugin_enable_ckpt();
  return rslt;
}


x86 assembly (clang, -O0):
<ibv_query_srq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <_query_srq@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ibv_query_srq>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <_query_srq@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.ibv_srq = type { i32 }
%struct.ibv_srq_attr = type { i32 }
define i32 @ibv_query_srq(%struct.ibv_srq* %0, %struct.ibv_srq_attr* %1) {
%3 = alloca %struct.ibv_srq*
%4 = alloca %struct.ibv_srq_attr*
%5 = alloca i32
store %struct.ibv_srq* %0, %struct.ibv_srq** %3
store %struct.ibv_srq_attr* %1, %struct.ibv_srq_attr** %4
%6 = call i32 (...) @dmtcp_plugin_disable_ckpt()
%7 = load %struct.ibv_srq*, %struct.ibv_srq** %3
%8 = load %struct.ibv_srq_attr*, %struct.ibv_srq_attr** %4
%9 = call i32 @_query_srq(%struct.ibv_srq* %7, %struct.ibv_srq_attr* %8)
store i32 %9, i32* %5
%10 = call i32 (...) @dmtcp_plugin_enable_ckpt()
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
%struct.ibv_srq = type { i32 }
%struct.ibv_srq_attr = type { i32 }
define i32 @ibv_query_srq(%struct.ibv_srq* %0, %struct.ibv_srq_attr* %1) {
%3 = tail call i32 (...) @dmtcp_plugin_disable_ckpt()
%4 = tail call i32 @_query_srq(%struct.ibv_srq* %0, %struct.ibv_srq_attr* %1)
%5 = tail call i32 (...) @dmtcp_plugin_enable_ckpt()
ret i32 %4
}
int foo(int *y) {
  int *external(int *z);
  int (*local1)() = 0;
  int (*local2[4])();
  local2[0] = local1;
  return *external(y);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <external@plt>
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
call   1030 <external@plt>
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @foo(i32* %0) {
%2 = alloca i32*
%3 = alloca i32 (...)*
%4 = alloca [4 x i32 (...)*]
store i32* %0, i32** %2
store i32 (...)* null, i32 (...)** %3
%5 = load i32 (...)*, i32 (...)** %3
%6 = getelementptr inbounds [4 x i32 (...)*], [4 x i32 (...)*]* %4, i64 0, i64 0
store i32 (...)* %5, i32 (...)** %6
%7 = load i32*, i32** %2
%8 = call i32* @external(i32* %7)
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @foo(i32* %0) {
%2 = tail call i32* @external(i32* %0)
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ randombytes_strong(unsigned char *, size_t);
void gen_key_bytes(unsigned char *area, size_t len) {
  randombytes_strong(area, len);
}


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

x86 assembly (clang, -O2):
<gen_key_bytes>:
jmp    1030 <randombytes_strong@plt>

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

LLVM IR (-O2):
define void @gen_key_bytes(i8* %0, i64 %1) {
%3 = tail call i32 @randombytes_strong(i8* %0, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void help_back() {
  puts("back\n"
       "Takes no parameter. Switches the user out of the currently selected\n"
       "hotel, and into the main shell. The '@' hotel name prompt is cleared.");
}


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

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

LLVM IR (-O0):
@.str = [143 x i8] c"back\0ATakes no parameter. Switches the user out of the currently selected\0Ahotel, and into the main shell. The '@' hotel name prompt is cleared.\00"
define void @help_back() {
%1 = call i32 @puts(i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [143 x i8] c"back\0ATakes no parameter. Switches the user out of the currently selected\0Ahotel, and into the main shell. The '@' hotel name prompt is cleared.\00"
define void @help_back() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0))
ret void
}
f(int i) {
  char buf[i];
  buf[0] = 5;
  return buf[0];
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
mov    %rcx,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x18(%rbp)
movb   $0x5,(%rax)
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i8, i64 %6
store i64 %6, i64* %4
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 5, i8* %9
%10 = getelementptr inbounds i8, i8* %8, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = load i8*, i8** %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
ret i32 5
}
void handle_sig(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_sig(i32 %0) {
ret void
}
int main(int argc, char **argv) {
  const char *files[40];
  files[0] = "/root/gsm/myidx/220.idx";
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xee0(%rip),%rax
mov    %rax,-0x150(%rbp)
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"/root/gsm/myidx/220.idx\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [40 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [40 x i8*], [40 x i8*]* %6, i64 0, i64 0
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8** %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct rbtree_node {
  int dummy;
};

/* Variables and functions */
struct rbtree_node *__rbtree_iterate(struct rbtree_node const *,
                                     int /*<<< orphan*/);
struct rbtree_node *rbtree_prev(const struct rbtree_node *node) {
  return __rbtree_iterate(node, 0);
}


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

x86 assembly (clang, -O2):
<rbtree_prev>:
xor    %esi,%esi
jmp    1030 <__rbtree_iterate@plt>

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

LLVM IR (-O2):
%struct.rbtree_node = type { i32 }
define %struct.rbtree_node* @rbtree_prev(%struct.rbtree_node* %0) {
%2 = tail call %struct.rbtree_node* @__rbtree_iterate(%struct.rbtree_node* %0, i32 0)
ret %struct.rbtree_node* %2
}
/* Variables and functions */
int /*<<< orphan*/ cdrom_sysctl_unregister();
int /*<<< orphan*/ printk(char *);
void __attribute__((__section__(".exit.text"))) __attribute__((__used__))
__attribute__((__cold__)) cdrom_exit(void) {
  printk("<6>"
         "Uniform CD-ROM driver unloaded\n");
  cdrom_sysctl_unregister();
}


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

x86 assembly (clang, -O2):
<cdrom_exit>:
push   %rax
lea    0xedc(%rip),%rdi
call   1030 <printk@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <cdrom_sysctl_unregister@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"<6>Uniform CD-ROM driver unloaded\0A\00"
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @cdrom_exit to i8*)], section "llvm.metadata"
define void @cdrom_exit() section ".exit.text" {
%1 = call i32 @printk(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @cdrom_sysctl_unregister()
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"<6>Uniform CD-ROM driver unloaded\0A\00"
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @cdrom_exit to i8*)], section "llvm.metadata"
define void @cdrom_exit() section ".exit.text" {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @cdrom_sysctl_unregister()
ret void
}
adrx0adrreg1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((((unsigned int *)10000000)[x0]) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0adrreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movslq -0x10(%rbp),%rcx
mov    $0x989680,%eax
mov    (%rax,%rcx,4),%eax
mov    -0x28(%rbp),%rcx
cmp    0x10f444(%rcx),%eax
ja     1140 <adrx0adrreg1+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <adrx0adrreg1+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0adrreg1>:
movslq %edx,%rax
mov    0x989680(,%rax,4),%ecx
xor    %eax,%eax
cmp    0x10f444(%r9),%ecx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @adrx0adrreg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* inttoptr (i64 10000000 to i32*), i64 %7
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %5, i64 277777
%11 = load i32, i32* %10
%12 = icmp ule i32 %9, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int isxdigit(char);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", isxdigit('0'));
  printf("%d\n", isxdigit('a'));
  printf("%d\n", isxdigit('A'));
  printf("%d\n", isxdigit('g'));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x30,%edi
call   1040 <isxdigit@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x61,%edi
call   1040 <isxdigit@plt>
mov    %eax,%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x41,%edi
call   1040 <isxdigit@plt>
mov    %eax,%esi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
mov    $0x67,%edi
call   1040 <isxdigit@plt>
mov    %eax,%esi
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x30,%edi
call   1040 <isxdigit@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x61,%edi
call   1040 <isxdigit@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x41,%edi
call   1040 <isxdigit@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x67,%edi
call   1040 <isxdigit@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @isxdigit(i8 signext 48)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @isxdigit(i8 signext 97)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @isxdigit(i8 signext 65)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @isxdigit(i8 signext 103)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @isxdigit(i8 signext 48)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @isxdigit(i8 signext 97)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @isxdigit(i8 signext 65)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @isxdigit(i8 signext 103)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit_msg(char *, char const *, char const *, int);
void *malloc(size_t);
void *_malloc_w(size_t size, const char *caller, const char *file, int line) {
  void *buffer;
  buffer = malloc(size);
  if (!buffer)
    exit_msg("Failed to allocate memory in %s() %s:%d", caller, file, line);
  ;
  return buffer;
}


x86 assembly (clang, -O0):
<_malloc_w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1166 <_malloc_w+0x46>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    0xe9f(%rip),%rdi
call   1040 <exit_msg@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_malloc_w>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rbx
call   1030 <malloc@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    1152 <_malloc_w+0x32>
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1040 <exit_msg@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Failed to allocate memory in %s() %s:%d\00"
define i8* @_malloc_w(i64 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
store i64 %0, i64* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i64, i64* %5
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %9
%12 = load i8*, i8** %9
%13 = icmp ne i8* %12, null
br i1 %13, label %19, label %14
14: ; preds = %4
%15 = load i8*, i8** %6
%16 = load i8*, i8** %7
%17 = load i32, i32* %8
%18 = call i32 @exit_msg(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %15, i8* %16, i32 %17)
br label %19
19: ; preds = %14, %4
%20 = load i8*, i8** %9
ret i8* %20
}

LLVM IR (-O2):
@.str = [40 x i8] c"Failed to allocate memory in %s() %s:%d\00"
define noalias i8* @_malloc_w(i64 %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i8* @malloc(i64 %0)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @exit_msg(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i32 %3)
br label %9
9: ; preds = %7, %4
ret i8* %5
}
int advance(int pointer) {
  if (pointer < 1001 - 1)
    return pointer + 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<advance>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    1122 <advance+0x22>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1129 <advance+0x29>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<advance>:
lea    0x1(%rdi),%ecx
xor    %eax,%eax
cmp    $0x3e8,%edi
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @advance(i32 %0) {
%2 = icmp slt i32 %0, 1000
%3 = add nsw i32 %0, 1
%4 = select i1 %2, i32 %3, i32 0
ret i32 %4
}
int main(int argc, char *argv[]) {
  asm("mov $512,%ecx");
  asm("rep movsq");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x200,%ecx
rep movsq %ds:(%rsi),%es:(%rdi)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x200,%ecx
rep movsq %ds:(%rsi),%es:(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
tail call void asm sideeffect "mov $$512,%ecx", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "rep movsq", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: deroff [ -w ] [ -x ] [file ...]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"Usage: deroff [ -w ] [ -x ] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"Usage: deroff [ -w ] [ -x ] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/
__softboundmpx_propagate_metadata_shadow_stack_from(int, int /*<<< orphan*/);
char *strchr(char const *, int);
__attribute__((__weak__, __always___)) char *softboundmpx_strchr(const char *s,
                                                                 int c) {
  char *ret_ptr = strchr(s, c);
  __softboundmpx_propagate_metadata_shadow_stack_from(1, 0);
  return ret_ptr;
}


x86 assembly (clang, -O0):
<softboundmpx_strchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <__softboundmpx_propagate_metadata_shadow_stack_from@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundmpx_strchr>:
push   %rbx
call   1040 <strchr@plt>
mov    %rax,%rbx
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <__softboundmpx_propagate_metadata_shadow_stack_from@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define weak i8* @softboundmpx_strchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i8* @strchr(i8* %6, i32 %7)
store i8* %8, i8** %5
%9 = call i32 @__softboundmpx_propagate_metadata_shadow_stack_from(i32 1, i32 0)
%10 = load i8*, i8** %5
ret i8* %10
}

LLVM IR (-O2):
define weak i8* @softboundmpx_strchr(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
%4 = tail call i32 @__softboundmpx_propagate_metadata_shadow_stack_from(i32 1, i32 0)
ret i8* %3
}
/* Variables and functions */
int **alloc2d_opt(int, int);
int /*<<< orphan*/ free(int **);
int test_2d_array(int **, int, int);
int test_alloc2d_opt() {
  int **ptr = alloc2d_opt(10, 10);
  int ret = test_2d_array(ptr, 10, 10);
  free(ptr);
  return ret;
}


x86 assembly (clang, -O0):
<test_alloc2d_opt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%esi
mov    %esi,%edi
call   1040 <alloc2d_opt@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%edx
mov    %edx,%esi
call   1050 <test_2d_array@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_alloc2d_opt>:
push   %rbp
push   %rbx
push   %rax
mov    $0xa,%edi
mov    $0xa,%esi
call   1040 <alloc2d_opt@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0xa,%esi
mov    $0xa,%edx
call   1050 <test_2d_array@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @test_alloc2d_opt() {
%1 = alloca i32**
%2 = alloca i32
%3 = call i32** @alloc2d_opt(i32 10, i32 10)
store i32** %3, i32*** %1
%4 = load i32**, i32*** %1
%5 = call i32 @test_2d_array(i32** %4, i32 10, i32 10)
store i32 %5, i32* %2
%6 = load i32**, i32*** %1
%7 = call i32 @free(i32** %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_alloc2d_opt() {
%1 = tail call i32** @alloc2d_opt(i32 10, i32 10)
%2 = tail call i32 @test_2d_array(i32** %1, i32 10, i32 10)
%3 = tail call i32 @free(i32** %1)
ret i32 %2
}
/* Type definitions */
struct imv_window {
  int dummy;
};

/* Variables and functions */
bool imv_window_is_fullscreen(struct imv_window *window) {
  (void)window;
  return false;
}


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

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

LLVM IR (-O0):
%struct.imv_window = type { i32 }
define i32 @imv_window_is_fullscreen(%struct.imv_window* %0) {
%2 = alloca %struct.imv_window*
store %struct.imv_window* %0, %struct.imv_window** %2
%3 = load %struct.imv_window*, %struct.imv_window** %2
ret i32 0
}

LLVM IR (-O2):
%struct.imv_window = type { i32 }
define i32 @imv_window_is_fullscreen(%struct.imv_window* nocapture readnone %0) {
ret i32 0
}
int main() {
  int i;
  int j;
  i = 1;
  while (i < 100) {
    j = 100;
    while (j > 1)
      j = j - i;
    i = i + 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1149 <main+0x49>
movl   $0x64,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    113b <main+0x3b>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <main+0x23>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ my_strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
int my_puts(const char *s) {
  write(1, s, my_strlen(s));
  return (0);
}


x86 assembly (clang, -O0):
<my_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <my_strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1040 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_puts>:
push   %rbx
mov    %rdi,%rbx
call   1030 <my_strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @my_puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @my_strlen(i8* %4)
%6 = call i32 @write(i32 1, i8* %3, i32 %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @my_puts(i8* %0) {
%2 = tail call i32 @my_strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
ret i32 0
}
void musb_exit_debugfs(struct musb *musb) {}


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

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

LLVM IR (-O0):
%struct.musb = type opaque
define void @musb_exit_debugfs(%struct.musb* %0) {
%2 = alloca %struct.musb*
store %struct.musb* %0, %struct.musb** %2
ret void
}

LLVM IR (-O2):
%struct.musb = type opaque
define void @musb_exit_debugfs(%struct.musb* nocapture %0) {
ret void
}
/* Variables and functions */
float __ocml_logb_f32(float);
float logbf(float x) { return __ocml_logb_f32(x); }


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

x86 assembly (clang, -O2):
<logbf>:
jmp    1030 <__ocml_logb_f32@plt>

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

LLVM IR (-O2):
define float @logbf(float %0) {
%2 = tail call float @__ocml_logb_f32(float %0)
ret float %2
}
/* Type definitions */
struct gsm_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void sky_gsm_endian_swap(struct gsm_t *p) {
  assert(p != NULL);
  ;
  ;
  ;
  ;
  ;
}


x86 assembly (clang, -O0):
<sky_gsm_endian_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sky_gsm_endian_swap>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
mov    %eax,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
%struct.gsm_t = type { i32 }
define void @sky_gsm_endian_swap(%struct.gsm_t* %0) {
%2 = alloca %struct.gsm_t*
store %struct.gsm_t* %0, %struct.gsm_t** %2
%3 = load %struct.gsm_t*, %struct.gsm_t** %2
%4 = icmp ne %struct.gsm_t* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret void
}

LLVM IR (-O2):
%struct.gsm_t = type { i32 }
define void @sky_gsm_endian_swap(%struct.gsm_t* readnone %0) {
%2 = icmp ne %struct.gsm_t* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ scanf(char *, int *);
void reg5(void) {
  uint32_t reg5 = 0;
  printf("\ninput reg5: ");
  if (scanf("%x", &reg5)) {
    printf("LD: %u \n", (reg5 & (0b11 << 22)) >> 22);
  }
}


x86 assembly (clang, -O0):
<reg5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x0,%rax
je     1171 <reg5+0x51>
mov    -0x4(%rbp),%esi
and    $0xc00000,%esi
sar    $0x16,%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg5>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
test   %rax,%rax
je     1165 <reg5+0x45>
mov    0x4(%rsp),%esi
shr    $0x16,%esi
and    $0x3,%esi
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"\0Ainput reg5: \00"
@.str.1 = [3 x i8] c"%x\00"
@.str.2 = [9 x i8] c"LD: %u \0A\00"
define void @reg5() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = load i32, i32* %1
%7 = and i32 %6, 12582912
%8 = ashr i32 %7, 22
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"\0Ainput reg5: \00"
@.str.1 = [3 x i8] c"%x\00"
@.str.2 = [9 x i8] c"LD: %u \0A\00"
define void @reg5() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %0
%7 = load i32, i32* %1
%8 = lshr i32 %7, 22
%9 = and i32 %8, 3
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %6, %0
ret void
}
void av_image_alloc() {}


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

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

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

LLVM IR (-O2):
define void @av_image_alloc() {
ret void
}
float n_lerp(float x, float y, float l) { return x + l * (y - x); }


x86 assembly (clang, -O0):
<n_lerp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
subss  -0x4(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<n_lerp>:
subss  %xmm0,%xmm1
mulss  %xmm2,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @n_lerp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %6
%9 = load float, float* %5
%10 = load float, float* %4
%11 = fsub float %9, %10
%12 = call float @llvm.fmuladd.f32(float %8, float %11, float %7)
ret float %12
}

LLVM IR (-O2):
define float @n_lerp(float %0, float %1, float %2) {
%4 = fsub float %1, %0
%5 = tail call float @llvm.fmuladd.f32(float %2, float %4, float %0)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ read_code_PIC24(unsigned long, unsigned char *, char, char);
void read_data_P24KA1(unsigned long address, unsigned char *data,
                      char blocksize, char lastblock) {
  read_code_PIC24(address + 0x7FFE00, data, blocksize, lastblock | 0x04);
}


x86 assembly (clang, -O0):
<read_data_P24KA1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %cl,-0x11(%rbp)
mov    %al,-0x12(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x7ffe00,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x11(%rbp),%cl
movsbl -0x12(%rbp),%eax
or     $0x4,%eax
movsbl %cl,%edx
movsbl %al,%ecx
call   1030 <read_code_PIC24@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_data_P24KA1>:
add    $0x7ffe00,%rdi
or     $0x4,%cl
movsbl %cl,%ecx
jmp    1030 <read_code_PIC24@plt>

LLVM IR (-O0):
define void @read_data_P24KA1(i64 %0, i8* %1, i8 signext %2, i8 signext %3) {
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i8
store i64 %0, i64* %5
store i8* %1, i8** %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%9 = load i64, i64* %5
%10 = add i64 %9, 8388096
%11 = load i8*, i8** %6
%12 = load i8, i8* %7
%13 = load i8, i8* %8
%14 = sext i8 %13 to i32
%15 = or i32 %14, 4
%16 = trunc i32 %15 to i8
%17 = call i32 @read_code_PIC24(i64 %10, i8* %11, i8 signext %12, i8 signext %16)
ret void
}

LLVM IR (-O2):
define void @read_data_P24KA1(i64 %0, i8* %1, i8 signext %2, i8 signext %3) {
%5 = add i64 %0, 8388096
%6 = or i8 %3, 4
%7 = tail call i32 @read_code_PIC24(i64 %5, i8* %1, i8 signext %2, i8 signext %6)
ret void
}
/* Type definitions */
struct log {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ logger_write_time(struct log *, char *);
void logger_start(struct log *log) { logger_write_time(log, "start"); }


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

x86 assembly (clang, -O2):
<logger_start>:
lea    0xee9(%rip),%rsi
jmp    1030 <logger_write_time@plt>

LLVM IR (-O0):
%struct.log = type { i32 }
@.str = [6 x i8] c"start\00"
define void @logger_start(%struct.log* %0) {
%2 = alloca %struct.log*
store %struct.log* %0, %struct.log** %2
%3 = load %struct.log*, %struct.log** %2
%4 = call i32 @logger_write_time(%struct.log* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.log = type { i32 }
@.str = [6 x i8] c"start\00"
define void @logger_start(%struct.log* %0) {
%2 = tail call i32 @logger_write_time(%struct.log* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned char VIM_HIF_GetReg8(int);
int /*<<< orphan*/ VIM_HIF_SetReg8(int, unsigned char);
void VIM_DISP_EnableVrgbMode(unsigned char bEnable) {
  unsigned char byMode;
  byMode = VIM_HIF_GetReg8((0x2800 + 0x002));
  byMode &= 0xfe;
  byMode |= (bEnable & 0x01);
  VIM_HIF_SetReg8((0x2800 + 0x002), byMode);
}


x86 assembly (clang, -O0):
<VIM_DISP_EnableVrgbMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x2802,%edi
call   1040 <VIM_HIF_GetReg8@plt>
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
and    $0xfe,%eax
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%ecx
and    $0x1,%ecx
movzbl -0x2(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x2(%rbp)
mov    $0x2802,%edi
movzbl -0x2(%rbp),%esi
call   1030 <VIM_HIF_SetReg8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_DISP_EnableVrgbMode>:
push   %rbx
mov    %edi,%ebx
mov    $0x2802,%edi
call   1040 <VIM_HIF_GetReg8@plt>
and    $0xfe,%al
and    $0x1,%bl
or     %al,%bl
movzbl %bl,%esi
mov    $0x2802,%edi
pop    %rbx
jmp    1030 <VIM_HIF_SetReg8@plt>

LLVM IR (-O0):
define void @VIM_DISP_EnableVrgbMode(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = call zeroext i8 @VIM_HIF_GetReg8(i32 10242)
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = and i32 %6, 254
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = and i32 %10, 1
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = or i32 %13, %11
%15 = trunc i32 %14 to i8
store i8 %15, i8* %3
%16 = load i8, i8* %3
%17 = call i32 @VIM_HIF_SetReg8(i32 10242, i8 zeroext %16)
ret void
}

LLVM IR (-O2):
define void @VIM_DISP_EnableVrgbMode(i8 zeroext %0) {
%2 = tail call zeroext i8 @VIM_HIF_GetReg8(i32 10242)
%3 = and i8 %2, -2
%4 = and i8 %0, 1
%5 = or i8 %3, %4
%6 = tail call i32 @VIM_HIF_SetReg8(i32 10242, i8 zeroext %5)
ret void
}
double zldexp(x, e)
double x, e;
{
  double y;
  int i;
  i = e;
  y = ldexp(x, i);
  return (y);
}


x86 assembly (clang, -O0):
<zldexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x1c(%rbp),%edi
call   1030 <ldexp@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zldexp>:
cvttsd2si %xmm1,%edi
jmp    1030 <ldexp@plt>

LLVM IR (-O0):
define double @zldexp(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca i32
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %4
%8 = fptosi double %7 to i32
store i32 %8, i32* %6
%9 = load double, double* %3
%10 = load i32, i32* %6
%11 = call double @ldexp(double %9, i32 %10)
store double %11, double* %5
%12 = load double, double* %5
ret double %12
}

LLVM IR (-O2):
define double @zldexp(double %0, double %1) {
%3 = fptosi double %1 to i32
%4 = tail call double @ldexp(double %0, i32 %3)
ret double %4
}
void out(unsigned short port, unsigned char data) {
  __asm__("out %%al, %%dx" : : "a"(data), "d"(port));
}


x86 assembly (clang, -O0):
<out>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    -0x2(%rbp),%dx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<out>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @out(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i16, i16* %3
ret void
}

LLVM IR (-O2):
define void @out(i16 zeroext %0, i8 zeroext %1) {
tail call void asm sideeffect "out %al, %dx", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i8 %1, i16 %0)
ret void
}
unsigned hash(char *s) {
  unsigned hashval;
  for (hashval = 0; *s != '\0'; s++)
    hashval = *s + 31 * hashval;
  return hashval % 600005;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <hash+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
mov    $0x927c5,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1141 <hash+0x41>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
mov    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
mov    %eax,%ecx
mov    $0xdfb1c0df,%edx
imul   %rcx,%rdx
shr    $0x33,%rdx
imul   $0x927c5,%edx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

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


x86 assembly (clang, -O0):
<pffft_aligned_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <pffft_aligned_free+0x24>
mov    -0x8(%rbp),%rax
mov    -0x8(%rax),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pffft_aligned_free>:
test   %rdi,%rdi
je     111e <pffft_aligned_free+0xe>
mov    -0x8(%rdi),%rdi
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @pffft_aligned_free(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 %11
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i8**
%8 = getelementptr inbounds i8*, i8** %7, i64 -1
%9 = load i8*, i8** %8
%10 = call i32 @free(i8* %9)
br label %11
11: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @pffft_aligned_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 -8
%5 = bitcast i8* %4 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @free(i8* %6)
br label %8
8: ; preds = %3, %1
ret void
}