xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ NS_INADDRSZ;
int /*<<< orphan*/ memmove(char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ memset(char *, int, int);
void _map_v4v6_address(const char *src, char *dst) {
  memmove(&dst[12], src, NS_INADDRSZ);
  memset(&dst[10], 0xff, 2);
  memset(&dst[0], 0, 10);
}


x86 assembly (clang, -O0):
<_map_v4v6_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0xc,%rdi
mov    -0x8(%rbp),%rsi
mov    0x2e95(%rip),%rax
mov    (%rax),%edx
call   1040 <memmove@plt>
mov    -0x10(%rbp),%rdi
add    $0xa,%rdi
mov    $0xff,%esi
mov    $0x2,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_map_v4v6_address>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xc(%rbx),%rdi
mov    0x2ea6(%rip),%rax
mov    (%rax),%edx
call   1040 <memmove@plt>
lea    0xa(%rbx),%rdi
mov    $0xff,%esi
mov    $0x2,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xa,%edx
pop    %rbx
jmp    1030 <memset@plt>

LLVM IR (-O0):
@NS_INADDRSZ = global i32 0
define void @_map_v4v6_address(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 12
%7 = load i8*, i8** %3
%8 = load i32, i32* @NS_INADDRSZ
%9 = call i32 @memmove(i8* %6, i8* %7, i32 %8)
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 10
%12 = call i32 @memset(i8* %11, i32 255, i32 2)
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 0
%15 = call i32 @memset(i8* %14, i32 0, i32 10)
ret void
}

LLVM IR (-O2):
@NS_INADDRSZ = global i32 0
define void @_map_v4v6_address(i8* %0, i8* %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 12
%4 = load i32, i32* @NS_INADDRSZ
%5 = tail call i32 @memmove(i8* %3, i8* %0, i32 %4)
%6 = getelementptr inbounds i8, i8* %1, i64 10
%7 = tail call i32 @memset(i8* %6, i32 255, i32 2)
%8 = tail call i32 @memset(i8* %1, i32 0, i32 10)
ret void
}
void register_wlags_sysfs(struct net_device *net) {}


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

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

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

LLVM IR (-O2):
%struct.net_device = type opaque
define void @register_wlags_sysfs(%struct.net_device* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put_byte(int, int);
int /*<<< orphan*/ put_word(int, int);
int /*<<< orphan*/ write_ndless3x_loader(int, int);
__attribute__((always_)) void patch_CAS_3_6_0_546_extra(void) {
  write_ndless3x_loader(1, 1);
  put_byte(0x1008E157, 0xEA);
  put_word(0x10136418, 0xE12FFF1E);
}


x86 assembly (clang, -O0):
<patch_CAS_3_6_0_546_extra>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
mov    %esi,%edi
call   1040 <write_ndless3x_loader@plt>
mov    $0x1008e157,%edi
mov    $0xea,%esi
call   1030 <put_byte@plt>
mov    $0x10136418,%edi
mov    $0xe12fff1e,%esi
call   1050 <put_word@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<patch_CAS_3_6_0_546_extra>:
push   %rax
mov    $0x1,%edi
mov    $0x1,%esi
call   1040 <write_ndless3x_loader@plt>
mov    $0x1008e157,%edi
mov    $0xea,%esi
call   1030 <put_byte@plt>
mov    $0x10136418,%edi
mov    $0xe12fff1e,%esi
pop    %rax
jmp    1050 <put_word@plt>

LLVM IR (-O0):
define void @patch_CAS_3_6_0_546_extra() {
%1 = call i32 @write_ndless3x_loader(i32 1, i32 1)
%2 = call i32 @put_byte(i32 269017431, i32 234)
%3 = call i32 @put_word(i32 269706264, i32 -516948194)
ret void
}

LLVM IR (-O2):
define void @patch_CAS_3_6_0_546_extra() {
%1 = tail call i32 @write_ndless3x_loader(i32 1, i32 1)
%2 = tail call i32 @put_byte(i32 269017431, i32 234)
%3 = tail call i32 @put_word(i32 269706264, i32 -516948194)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pr_crit(char *, char const *);
void mark_hardware_deprecated(const char *msg) {
  pr_crit(
      "Warning: %s - this hardware is not recommended for new deployments. It "
      "continues to be supported in this RHEL release, but it is likely to be "
      "removed in the next major release. Driver updates and fixes for this "
      "device will be limited to critical issues. Please contact Red Hat "
      "Support or your device's hardware vendor for additional information.\n",
      msg);
}


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

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

LLVM IR (-O0):
@.str = [347 x i8] c"Warning: %s - this hardware is not recommended for new deployments. It continues to be supported in this RHEL release, but it is likely to be removed in the next major release. Driver updates and fixes for this device will be limited to critical issues. Please contact Red Hat Support or your device's hardware vendor for additional information.\0A\00"
define void @mark_hardware_deprecated(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @pr_crit(i8* getelementptr inbounds ([347 x i8], [347 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [347 x i8] c"Warning: %s - this hardware is not recommended for new deployments. It continues to be supported in this RHEL release, but it is likely to be removed in the next major release. Driver updates and fixes for this device will be limited to critical issues. Please contact Red Hat Support or your device's hardware vendor for additional information.\0A\00"
define void @mark_hardware_deprecated(i8* %0) {
%2 = tail call i32 @pr_crit(i8* getelementptr inbounds ([347 x i8], [347 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int xserver_export_user_env() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xserver_export_user_env() {
ret i32 0
}
/* Type definitions */
struct inode {
  int dummy;
};
struct buffer_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buffer_insert_inode_queue(struct buffer_head *,
                                             struct inode *);
int /*<<< orphan*/ mark_buffer_dirty(struct buffer_head *);
void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode) {
  mark_buffer_dirty(bh);
  buffer_insert_inode_queue(bh, inode);
}


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

x86 assembly (clang, -O2):
<mark_buffer_dirty_inode>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <mark_buffer_dirty@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <buffer_insert_inode_queue@plt>

LLVM IR (-O0):
%struct.buffer_head = type { i32 }
%struct.inode = type { i32 }
define void @mark_buffer_dirty_inode(%struct.buffer_head* %0, %struct.inode* %1) {
%3 = alloca %struct.buffer_head*
%4 = alloca %struct.inode*
store %struct.buffer_head* %0, %struct.buffer_head** %3
store %struct.inode* %1, %struct.inode** %4
%5 = load %struct.buffer_head*, %struct.buffer_head** %3
%6 = call i32 @mark_buffer_dirty(%struct.buffer_head* %5)
%7 = load %struct.buffer_head*, %struct.buffer_head** %3
%8 = load %struct.inode*, %struct.inode** %4
%9 = call i32 @buffer_insert_inode_queue(%struct.buffer_head* %7, %struct.inode* %8)
ret void
}

LLVM IR (-O2):
%struct.buffer_head = type { i32 }
%struct.inode = type { i32 }
define void @mark_buffer_dirty_inode(%struct.buffer_head* %0, %struct.inode* %1) {
%3 = tail call i32 @mark_buffer_dirty(%struct.buffer_head* %0)
%4 = tail call i32 @buffer_insert_inode_queue(%struct.buffer_head* %0, %struct.inode* %1)
ret void
}
void gtk_tool_item_retrieve_proxy_menu_item() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tool_item_retrieve_proxy_menu_item() {
ret void
}
char *timlib_pad_spaces_to_justify_right(char *d, char *s, int size) {
  sprintf(d, "%*s", size, s);
  return d;
}


x86 assembly (clang, -O0):
<timlib_pad_spaces_to_justify_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xecb(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%*s\00"
define i8* @timlib_pad_spaces_to_justify_right(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %6
%9 = load i8*, i8** %5
%10 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %9)
%11 = load i8*, i8** %4
ret i8* %11
}

LLVM IR (-O2):
@.str = [4 x i8] c"%*s\00"
define i8* @timlib_pad_spaces_to_justify_right(i8* returned writeonly %0, i8* %1, i32 %2) {
%4 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %1)
ret i8* %0
}
/* Variables and functions */
void *init_bubble_c(int);
void *init_c(int n) { return init_bubble_c(n); }


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

x86 assembly (clang, -O2):
<init_c>:
jmp    1030 <init_bubble_c@plt>

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

LLVM IR (-O2):
define i8* @init_c(i32 %0) {
%2 = tail call i8* @init_bubble_c(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ test_queue_zip_iter_next();
void test_queue_zip_iter() { test_queue_zip_iter_next(); }


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

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

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

LLVM IR (-O2):
define void @test_queue_zip_iter() {
%1 = tail call i32 (...) @test_queue_zip_iter_next()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_char(int, unsigned char);
void print_notice_char(unsigned char byte) { __console_tx_char(5, byte); }


x86 assembly (clang, -O0):
<print_notice_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x5,%edi
movzbl -0x1(%rbp),%esi
call   1030 <__console_tx_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_notice_char>:
mov    %edi,%esi
mov    $0x5,%edi
jmp    1030 <__console_tx_char@plt>

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

LLVM IR (-O2):
define void @print_notice_char(i8 zeroext %0) {
%2 = tail call i32 @__console_tx_char(i32 5, i8 zeroext %0)
ret void
}
/* Variables and functions */
int NLMSG_ALIGN(int /*<<< orphan*/);
int /*<<< orphan*/ nlmsg_msg_size(int);
int nlmsg_total_size(int payload) {
  return NLMSG_ALIGN(nlmsg_msg_size(payload));
}


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

x86 assembly (clang, -O2):
<nlmsg_total_size>:
push   %rax
call   1040 <nlmsg_msg_size@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <NLMSG_ALIGN@plt>

LLVM IR (-O0):
define i32 @nlmsg_total_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @nlmsg_msg_size(i32 %3)
%5 = call i32 @NLMSG_ALIGN(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @nlmsg_total_size(i32 %0) {
%2 = tail call i32 @nlmsg_msg_size(i32 %0)
%3 = tail call i32 @NLMSG_ALIGN(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ log_init();
void libjudge_init() { log_init(); }


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

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

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

LLVM IR (-O2):
define void @libjudge_init() {
%1 = tail call i32 (...) @log_init()
ret void
}
/* Type definitions */
struct da_cloud_mem {
  int dummy;
};

/* Variables and functions */
char *da_cloud_mem_alloc(struct da_cloud_mem *, scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *da_cloud_mem_strdup(struct da_cloud_mem *dcm, const char *src) {
  char *p = da_cloud_mem_alloc(dcm, strlen(src) + 1);
  if (p == NULL)
    return (NULL);
  strcpy(p, src);
  return (p);
}


x86 assembly (clang, -O0):
<da_cloud_mem_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %rax,%rsi
add    $0x1,%rsi
call   1050 <da_cloud_mem_alloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    117d <da_cloud_mem_strdup+0x4d>
movq   $0x0,-0x8(%rbp)
jmp    1192 <da_cloud_mem_strdup+0x62>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<da_cloud_mem_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rsi
mov    %rbx,%rdi
call   1050 <da_cloud_mem_alloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <da_cloud_mem_strdup+0x31>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.da_cloud_mem = type { i32 }
define i8* @da_cloud_mem_strdup(%struct.da_cloud_mem* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca %struct.da_cloud_mem*
%5 = alloca i8*
%6 = alloca i8*
store %struct.da_cloud_mem* %0, %struct.da_cloud_mem** %4
store i8* %1, i8** %5
%7 = load %struct.da_cloud_mem*, %struct.da_cloud_mem** %4
%8 = load i8*, i8** %5
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %9, 1
%11 = call i8* @da_cloud_mem_alloc(%struct.da_cloud_mem* %7, i64 %10)
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %15
14: ; preds = %2
store i8* null, i8** %3
br label %20
15: ; preds = %2
%16 = load i8*, i8** %6
%17 = load i8*, i8** %5
%18 = call i32 @strcpy(i8* %16, i8* %17)
%19 = load i8*, i8** %6
store i8* %19, i8** %3
br label %20
20: ; preds = %15, %14
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
%struct.da_cloud_mem = type { i32 }
define i8* @da_cloud_mem_strdup(%struct.da_cloud_mem* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i8* @da_cloud_mem_alloc(%struct.da_cloud_mem* %0, i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @strcpy(i8* %5, i8* %1)
br label %9
9: ; preds = %2, %7
ret i8* %5
}
/* Type definitions */
struct ish_shell_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ chdir(char *);
char *getenv(char *);
void ish_builtin_cd(struct ish_shell_t *shell __attribute__((unused)),
                    char **args) {
  chdir(args[1] ? args[1] : getenv("HOME"));
}


x86 assembly (clang, -O0):
<ish_builtin_cd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1150 <ish_builtin_cd+0x30>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1160 <ish_builtin_cd+0x40>
lea    0xea9(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <chdir@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ish_builtin_cd>:
push   %rax
mov    0x8(%rsi),%rdi
test   %rdi,%rdi
je     1130 <ish_builtin_cd+0x10>
pop    %rax
jmp    1040 <chdir@plt>
lea    0xec9(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <chdir@plt>

LLVM IR (-O0):
%struct.ish_shell_t = type { i32 }
@.str = [5 x i8] c"HOME\00"
define void @ish_builtin_cd(%struct.ish_shell_t* %0, i8** %1) {
%3 = alloca %struct.ish_shell_t*
%4 = alloca i8**
store %struct.ish_shell_t* %0, %struct.ish_shell_t** %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8**, i8*** %4
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
br label %15
13: ; preds = %2
%14 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %9
%16 = phi i8* [ %12, %9 ], [ %14, %13 ]
%17 = call i32 @chdir(i8* %16)
ret void
}

LLVM IR (-O2):
%struct.ish_shell_t = type { i32 }
@.str = [5 x i8] c"HOME\00"
define void @ish_builtin_cd(%struct.ish_shell_t* nocapture readnone %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ %4, %2 ]
%10 = tail call i32 @chdir(i8* %9)
ret void
}
float sub1(float f, float g, float h) { return -((f * g) + h); }


x86 assembly (clang, -O0):
<sub1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
movss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub1>:
mulss  %xmm1,%xmm0
addss  %xmm2,%xmm0
xorps  0xef1(%rip),%xmm0
ret

LLVM IR (-O0):
define float @sub1(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* %5
%9 = load float, float* %6
%10 = call float @llvm.fmuladd.f32(float %7, float %8, float %9)
%11 = fneg float %10
ret float %11
}

LLVM IR (-O2):
define float @sub1(float %0, float %1, float %2) {
%4 = tail call float @llvm.fmuladd.f32(float %0, float %1, float %2)
%5 = fneg float %4
ret float %5
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int clock();
unsigned long get_tw_seed() {
  time_t tr;
  tr = clock();
  if ((tr % 2) == 0)
    ++tr;
  return ((unsigned long)tr);
}


x86 assembly (clang, -O0):
<get_tw_seed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113f <get_tw_seed+0x2f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
movslq -0x4(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_tw_seed>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
mov    %eax,%ecx
not    %ecx
and    $0x1,%ecx
add    %eax,%ecx
movslq %ecx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @get_tw_seed() {
%1 = alloca i32
%2 = call i32 (...) @clock()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = srem i32 %3, 2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %9
9: ; preds = %6, %0
%10 = load i32, i32* %1
%11 = sext i32 %10 to i64
ret i64 %11
}

LLVM IR (-O2):
define i64 @get_tw_seed() {
%1 = tail call i32 (...) @clock()
%2 = and i32 %1, 1
%3 = xor i32 %2, 1
%4 = add nsw i32 %3, %1
%5 = sext i32 %4 to i64
ret i64 %5
}
void svcExitProcess(void) {
  asm("movq $"
      "2"
      ", %rax; movq %rcx, %r10; syscall");
}


x86 assembly (clang, -O0):
<svcExitProcess>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%rax
mov    %rcx,%r10
syscall
pop    %rbp
ret

x86 assembly (clang, -O2):
<svcExitProcess>:
mov    $0x2,%rax
mov    %rcx,%r10
syscall
ret

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

LLVM IR (-O2):
define void @svcExitProcess() {
tail call void asm sideeffect "movq $$2, %rax; movq %rcx, %r10; syscall", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void MPI_Send() {}


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

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

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

LLVM IR (-O2):
define void @MPI_Send() {
ret void
}
int testopen(pathname)
char *pathname;
{ return access(pathname, 4) >= 0; }


x86 assembly (clang, -O0):
<testopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <access@plt>
cmp    $0x0,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testopen>:
push   %rax
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <access@plt>
not    %eax
shr    $0x1f,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @testopen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @access to i32 (i8*, i32, ...)*)(i8* %3, i32 4)
%5 = icmp sge i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @testopen(i8* %0) {
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @access to i32 (i8*, i32, ...)*)(i8* %0, i32 4)
%3 = xor i32 %2, -1
%4 = lshr i32 %3, 31
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgunscale(void) { gen("shrl\t$2,%eax"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"shrl\09$2,%eax\00"
define void @cgunscale() {
%1 = call i32 @gen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"shrl\09$2,%eax\00"
define void @cgunscale() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
int raptor_sink_iostream_write_byte(void *user_data, const int byte) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @raptor_sink_iostream_write_byte(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void option_free_path(void *p) {
  char **str = p;
  free(*str);
}


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

x86 assembly (clang, -O2):
<option_free_path>:
mov    (%rdi),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @option_free_path(i8* %0) {
%2 = alloca i8*
%3 = alloca i8**
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i8**
store i8** %5, i8*** %3
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
%8 = call i32 @free(i8* %7)
ret void
}

LLVM IR (-O2):
define void @option_free_path(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ Interpolate_2(int /*<<< orphan*/, int, int /*<<< orphan*/,
                                 int, int);
u_int32_t Interp3(u_int32_t c1, u_int32_t c2) {
  return Interpolate_2(c1, 7, c2, 1, 3);
}


x86 assembly (clang, -O0):
<Interp3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x7,%esi
mov    $0x1,%ecx
mov    $0x3,%r8d
call   1030 <Interpolate_2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interp3>:
mov    %esi,%edx
mov    $0x7,%esi
mov    $0x1,%ecx
mov    $0x3,%r8d
jmp    1030 <Interpolate_2@plt>

LLVM IR (-O0):
define i32 @Interp3(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 = call i32 @Interpolate_2(i32 %5, i32 7, i32 %6, i32 1, i32 3)
ret i32 %7
}

LLVM IR (-O2):
define i32 @Interp3(i32 %0, i32 %1) {
%3 = tail call i32 @Interpolate_2(i32 %0, i32 7, i32 %1, i32 1, i32 3)
ret i32 %3
}
/* Type definitions */
struct vec2 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec2_subtract(float *, float *, float *);
__attribute__((always_)) struct vec2 *
psvec2_subtract(struct vec2 *result, struct vec2 *a, struct vec2 *b) {
  vec2_subtract((float *)result, (float *)a, (float *)b);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec2_subtract>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec2_subtract@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec2 = type { i32 }
define %struct.vec2* @psvec2_subtract(%struct.vec2* %0, %struct.vec2* %1, %struct.vec2* %2) {
%4 = alloca %struct.vec2*
%5 = alloca %struct.vec2*
%6 = alloca %struct.vec2*
store %struct.vec2* %0, %struct.vec2** %4
store %struct.vec2* %1, %struct.vec2** %5
store %struct.vec2* %2, %struct.vec2** %6
%7 = load %struct.vec2*, %struct.vec2** %4
%8 = bitcast %struct.vec2* %7 to float*
%9 = load %struct.vec2*, %struct.vec2** %5
%10 = bitcast %struct.vec2* %9 to float*
%11 = load %struct.vec2*, %struct.vec2** %6
%12 = bitcast %struct.vec2* %11 to float*
%13 = call i32 @vec2_subtract(float* %8, float* %10, float* %12)
%14 = load %struct.vec2*, %struct.vec2** %4
ret %struct.vec2* %14
}

LLVM IR (-O2):
%struct.vec2 = type { i32 }
define %struct.vec2* @psvec2_subtract(%struct.vec2* returned %0, %struct.vec2* %1, %struct.vec2* %2) {
%4 = bitcast %struct.vec2* %0 to float*
%5 = bitcast %struct.vec2* %1 to float*
%6 = bitcast %struct.vec2* %2 to float*
%7 = tail call i32 @vec2_subtract(float* %4, float* %5, float* %6)
ret %struct.vec2* %0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
char *my_realloc(char *);
void reallocIntra() {
  char *buf = (char *)malloc(100);
  buf = my_realloc(buf);
  free(buf);
}


x86 assembly (clang, -O0):
<reallocIntra>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <my_realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reallocIntra>:
push   %rax
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1050 <my_realloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @reallocIntra() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 100)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i8* @my_realloc(i8* %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
define void @reallocIntra() {
%1 = tail call i64 @malloc(i32 100)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i8* @my_realloc(i8* %2)
%4 = tail call i32 @free(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ event_left_of_seg(void *, void *);
int event_right_of_seg(void *x, void *y) { return !event_left_of_seg(x, y); }


x86 assembly (clang, -O0):
<event_right_of_seg>:
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 <event_left_of_seg@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<event_right_of_seg>:
push   %rax
call   1030 <event_left_of_seg@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @event_right_of_seg(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @event_left_of_seg(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @event_right_of_seg(i8* %0, i8* %1) {
%3 = tail call i32 @event_left_of_seg(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef unsigned long long uint64_t;

/* Variables and functions */
uint64_t set_unsafe(uint64_t i) { return (i | (1ull << 63)); }


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

x86 assembly (clang, -O2):
<set_unsafe>:
movabs $0x8000000000000000,%rax
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @set_unsafe(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = or i64 %3, -9223372036854775808
ret i64 %4
}

LLVM IR (-O2):
define i64 @set_unsafe(i64 %0) {
%2 = or i64 %0, -9223372036854775808
ret i64 %2
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
int BUFSIZ;
char *calloc(int, int);
int /*<<< orphan*/ gmtime(scalar_t__ *);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
char *get_readable_time(time_t timestamp) {
  char *time_readable = calloc(BUFSIZ, sizeof(char));
  time_t t = 0;
  t = (time_t)timestamp;
  strftime(time_readable, sizeof(char) * BUFSIZ, "%F %T %Z%z", gmtime(&t));
  return time_readable;
}


x86 assembly (clang, -O0):
<get_readable_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    0x2e6e(%rip),%rax
movslq (%rax),%rax
shl    $0x0,%rax
mov    %eax,-0x1c(%rbp)
lea    -0x18(%rbp),%rdi
call   1050 <gmtime@plt>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    %eax,%ecx
lea    0xe6b(%rip),%rdx
call   1040 <strftime@plt>
mov    -0x10(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_readable_time>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r14
mov    0x2e9e(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
mov    %r14,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1050 <gmtime@plt>
lea    0xe97(%rip),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%ecx
call   1040 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@BUFSIZ = global i32 0
@.str = [11 x i8] c"%F %T %Z%z\00"
define i8* @get_readable_time(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i32, i32* @BUFSIZ
%6 = call i8* @calloc(i32 %5, i32 1)
store i8* %6, i8** %3
store i64 0, i64* %4
%7 = load i64, i64* %2
store i64 %7, i64* %4
%8 = load i8*, i8** %3
%9 = load i32, i32* @BUFSIZ
%10 = sext i32 %9 to i64
%11 = mul i64 1, %10
%12 = trunc i64 %11 to i32
%13 = call i32 @gmtime(i64* %4)
%14 = call i32 @strftime(i8* %8, i32 %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
@.str = [11 x i8] c"%F %T %Z%z\00"
define i8* @get_readable_time(i64 %0) {
%2 = alloca i64
%3 = load i32, i32* @BUFSIZ
%4 = tail call i8* @calloc(i32 %3, i32 1)
%5 = bitcast i64* %2 to i8*
store i64 %0, i64* %2
%6 = call i32 @gmtime(i64* %2)
%7 = call i32 @strftime(i8* %4, i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i8* %4
}
int test_imm_BBint64_lowword_reg(long long val) {
  return ((val) & (0xBB << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_BBint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 187
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int main() {
  int **p, *q, r, **z;
  int ***a;
  a = &p;
  p = &q;
  q = &r;
  while (r < 10) {
    a = *a;
  }
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0xa,-0x1c(%rbp)
jge    113d <main+0x3d>
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
jmp    1123 <main+0x23>
mov    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    -0x8(%rsp),%rax
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32**
%2 = bitcast i32*** %1 to i8*
%3 = ptrtoint i32*** %1 to i64
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int strlen(char *);
scalar_t__ tolower(int);
char *Str2Lower(char *str) {
  size_t len = strlen(str) + 1;
  do {
    str[len - 1] = (char)tolower((int)str[len - 1]);
    len--;
  } while (len);
  return str;
}


x86 assembly (clang, -O0):
<Str2Lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113e <Str2Lower+0x1e>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Str2Lower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl -0x1(%r14,%rbx,1),%edi
call   1040 <tolower@plt>
mov    %al,-0x1(%r14,%rbx,1)
add    $0xffffffffffffffff,%rbx
jne    1140 <Str2Lower+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @Str2Lower(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
br label %5
5: ; preds = %5, %1
%6 = phi i64 [ %4, %1 ], [ %7, %5 ]
%7 = add i64 %6, -1
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = tail call i64 @tolower(i32 %10)
%12 = trunc i64 %11 to i8
store i8 %12, i8* %8
%13 = icmp eq i64 %7, 0
br i1 %13, label %14, label %5
14: ; preds = %5
ret i8* %0
}
/* Variables and functions */
float ptr__fy(void const *const ptr) {
  return (
      (((uintptr_t)ptr) &
       ((uintptr_t)(~((uintptr_t)((
           uintptr_t)(((uintptr_t)((0xFULL
                                    << ((sizeof(uintptr_t) * 8ULL) - 4ULL)) |
                                   ((0x1ULL
                                     << ((sizeof(uintptr_t) * 8ULL) - 1ULL)) -
                                    1ULL)))
                      << ((sizeof(uintptr_t) * 8ULL) / 2))))))) /
      ((float)((uintptr_t)(~((uintptr_t)((
          uintptr_t)(((uintptr_t)((0xFULL
                                   << ((sizeof(uintptr_t) * 8ULL) - 4ULL)) |
                                  ((0x1ULL
                                    << ((sizeof(uintptr_t) * 8ULL) - 1ULL)) -
                                   1ULL)))
                     << ((sizeof(uintptr_t) * 8ULL) / 2))))))));
}


x86 assembly (clang, -O0):
<ptr__fy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0xee8(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptr__fy>:
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
mulss  0xef1(%rip),%xmm0
ret

LLVM IR (-O0):
define float @ptr__fy(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = and i64 %4, 4294967295
%6 = uitofp i64 %5 to float
%7 = fdiv float %6, 0x41F0000000000000
ret float %7
}

LLVM IR (-O2):
define float @ptr__fy(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = and i64 %2, 4294967295
%4 = uitofp i64 %3 to float
%5 = fmul float %4, 0x3DF0000000000000
ret float %5
}
/* Variables and functions */
long ang2pix_nest_z_phi(long, int /*<<< orphan*/, double);
int /*<<< orphan*/ cos(double);
void ang2pix_nest(long nside, double theta, double phi, long *ipix) {
  *ipix = ang2pix_nest_z_phi(nside, cos(theta), phi);
}


x86 assembly (clang, -O0):
<ang2pix_nest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
movsd  -0x18(%rbp),%xmm0
call   1030 <ang2pix_nest_z_phi@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ang2pix_nest>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
movsd  %xmm1,(%rsp)
mov    %rdi,%rbx
call   1040 <cos@plt>
mov    %rbx,%rdi
mov    %eax,%esi
movsd  (%rsp),%xmm0
call   1030 <ang2pix_nest_z_phi@plt>
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ang2pix_nest(i64 %0, double %1, double %2, i64* %3) {
%5 = alloca i64
%6 = alloca double
%7 = alloca double
%8 = alloca i64*
store i64 %0, i64* %5
store double %1, double* %6
store double %2, double* %7
store i64* %3, i64** %8
%9 = load i64, i64* %5
%10 = load double, double* %6
%11 = call i32 @cos(double %10)
%12 = load double, double* %7
%13 = call i64 @ang2pix_nest_z_phi(i64 %9, i32 %11, double %12)
%14 = load i64*, i64** %8
store i64 %13, i64* %14
ret void
}

LLVM IR (-O2):
define void @ang2pix_nest(i64 %0, double %1, double %2, i64* nocapture writeonly %3) {
%5 = tail call i32 @cos(double %1)
%6 = tail call i64 @ang2pix_nest_z_phi(i64 %0, i32 %5, double %2)
store i64 %6, i64* %3
ret void
}
int passwd_cb(char *buf, int size, int rwflag, void *userdata) {
  (void)buf;
  (void)size;
  (void)rwflag;
  (void)userdata;
  return 0;
}


x86 assembly (clang, -O0):
<passwd_cb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @passwd_cb(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i8*, i8** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @passwd_cb(i8* nocapture readnone %0, i32 %1, i32 %2, i8* nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
int partition(int *, int, int);
void quick_Sort(int arr[], int low, int high) {
  if (low < high) {
    int pi = partition(arr, low, high);
    quick_Sort(arr, low, pi - 1);
    quick_Sort(arr, pi + 1, high);
  }
}


x86 assembly (clang, -O0):
<quick_Sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quick_Sort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <quick_Sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <quick_Sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_Sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_Sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <quick_Sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_Sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quick_Sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_Sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Type definitions */
struct page {
  int dummy;
};
struct address_space {
  int dummy;
};

/* Variables and functions */
struct page *find_or_create_page(struct address_space *, unsigned long,
                                 int /*<<< orphan*/);
int /*<<< orphan*/ mapping_gfp_mask(struct address_space *);
__attribute__((always_)) struct page *
grab_cache_page(struct address_space *mapping, unsigned long index) {
  return find_or_create_page(mapping, index, mapping_gfp_mask(mapping));
}


x86 assembly (clang, -O0):
<grab_cache_page>:
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 <mapping_gfp_mask@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <find_or_create_page@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.page = type { i32 }
%struct.address_space = type { i32 }
define %struct.page* @grab_cache_page(%struct.address_space* %0, i64 %1) {
%3 = alloca %struct.address_space*
%4 = alloca i64
store %struct.address_space* %0, %struct.address_space** %3
store i64 %1, i64* %4
%5 = load %struct.address_space*, %struct.address_space** %3
%6 = load i64, i64* %4
%7 = load %struct.address_space*, %struct.address_space** %3
%8 = call i32 @mapping_gfp_mask(%struct.address_space* %7)
%9 = call %struct.page* @find_or_create_page(%struct.address_space* %5, i64 %6, i32 %8)
ret %struct.page* %9
}

LLVM IR (-O2):
%struct.page = type { i32 }
%struct.address_space = type { i32 }
define %struct.page* @grab_cache_page(%struct.address_space* %0, i64 %1) {
%3 = tail call i32 @mapping_gfp_mask(%struct.address_space* %0)
%4 = tail call %struct.page* @find_or_create_page(%struct.address_space* %0, i64 %1, i32 %3)
ret %struct.page* %4
}