xunge/DecIR huggingface dataset:
/* Variables and functions */
char *next_cmd(int);
int /*<<< orphan*/ printf(char *, char *);
void print_history() {
  char *cmd = next_cmd(1);
  if (cmd == NULL)
    return;
  printf("%s\n", cmd);
  while ((cmd = next_cmd(0)) != NULL) {
    printf("%s\n", cmd);
  }
}


x86 assembly (clang, -O0):
<print_history>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1040 <next_cmd@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1146 <print_history+0x26>
jmp    1180 <print_history+0x60>
mov    -0x8(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <next_cmd@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1180 <print_history+0x60>
mov    -0x8(%rbp),%rsi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
jmp    1156 <print_history+0x36>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_history>:
push   %rbx
mov    $0x1,%edi
call   1040 <next_cmd@plt>
test   %rax,%rax
je     1177 <print_history+0x57>
lea    0xec9(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <next_cmd@plt>
test   %rax,%rax
je     1177 <print_history+0x57>
lea    0xeae(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <next_cmd@plt>
test   %rax,%rax
jne    1160 <print_history+0x40>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @print_history() {
%1 = alloca i8*
%2 = call i8* @next_cmd(i32 1)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %0
br label %15
6: ; preds = %0
%7 = load i8*, i8** %1
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %12, %6
%10 = call i8* @next_cmd(i32 0)
store i8* %10, i8** %1
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i8*, i8** %1
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %9
15: ; preds = %5, %9
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print_history() {
%1 = tail call i8* @next_cmd(i32 1)
%2 = icmp eq i8* %1, null
br i1 %2, label %12, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = tail call i8* @next_cmd(i32 0)
%6 = icmp eq i8* %5, null
br i1 %6, label %12, label %7
7: ; preds = %3, %7
%8 = phi i8* [ %10, %7 ], [ %5, %3 ]
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = tail call i8* @next_cmd(i32 0)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %7
12: ; preds = %7, %3, %0
ret void
}
void gdk_draw_layout_line() {}


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

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

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

LLVM IR (-O2):
define void @gdk_draw_layout_line() {
ret void
}
void gtk_clipboard_wait_for_image() {}


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

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

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

LLVM IR (-O2):
define void @gtk_clipboard_wait_for_image() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, ...);
int main() {
  int a = 0;
  int b = 0;
  printf("%d %d %d \n", b = a++ + (a++ + 2), b, a = b++);
  printf("%d %d \n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
add    $0x2,%eax
add    %eax,%esi
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %ecx,-0x8(%rbp)
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x3,%esi
mov    $0x3,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    $0x3,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%d %d %d \0A\00"
@.str.1 = [8 x i8] c"%d %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
%8 = add nsw i32 %6, 2
%9 = add nsw i32 %4, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
store i32 %11, i32* %2
%13 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%d %d %d \0A\00"
@.str.1 = [8 x i8] c"%d %d \0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 3, i32 3, i32 3)
%2 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 4)
ret i32 0
}
int default_interrupt_cb(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @default_interrupt_cb() {
ret i32 0
}
/* Type definitions */
struct path_node {
  int dummy;
};
struct inter {
  int dummy;
};
struct dlist_root {
  int dummy;
};

/* Variables and functions */
scalar_t__ dlist_root_pop(struct dlist_root *);
int /*<<< orphan*/ path_node_free(struct path_node *, struct inter *);
void path_pop(struct dlist_root *self, struct inter *inter) {
  struct path_node *front = (struct path_node *)dlist_root_pop(self);
  path_node_free(front, inter);
}


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

x86 assembly (clang, -O2):
<path_pop>:
push   %rbx
mov    %rsi,%rbx
call   1040 <dlist_root_pop@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <path_node_free@plt>

LLVM IR (-O0):
%struct.dlist_root = type { i32 }
%struct.inter = type { i32 }
%struct.path_node = type { i32 }
define void @path_pop(%struct.dlist_root* %0, %struct.inter* %1) {
%3 = alloca %struct.dlist_root*
%4 = alloca %struct.inter*
%5 = alloca %struct.path_node*
store %struct.dlist_root* %0, %struct.dlist_root** %3
store %struct.inter* %1, %struct.inter** %4
%6 = load %struct.dlist_root*, %struct.dlist_root** %3
%7 = call i64 @dlist_root_pop(%struct.dlist_root* %6)
%8 = inttoptr i64 %7 to %struct.path_node*
store %struct.path_node* %8, %struct.path_node** %5
%9 = load %struct.path_node*, %struct.path_node** %5
%10 = load %struct.inter*, %struct.inter** %4
%11 = call i32 @path_node_free(%struct.path_node* %9, %struct.inter* %10)
ret void
}

LLVM IR (-O2):
%struct.dlist_root = type { i32 }
%struct.inter = type { i32 }
%struct.path_node = type { i32 }
define void @path_pop(%struct.dlist_root* %0, %struct.inter* %1) {
%3 = tail call i64 @dlist_root_pop(%struct.dlist_root* %0)
%4 = inttoptr i64 %3 to %struct.path_node*
%5 = tail call i32 @path_node_free(%struct.path_node* %4, %struct.inter* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_fsharp_comment_entities();
int /*<<< orphan*/ test_fsharp_comments();
void all_fsharp_tests() {
  test_fsharp_comments();
  test_fsharp_comment_entities();
}


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

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

LLVM IR (-O0):
define void @all_fsharp_tests() {
%1 = call i32 (...) @test_fsharp_comments()
%2 = call i32 (...) @test_fsharp_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_fsharp_tests() {
%1 = tail call i32 (...) @test_fsharp_comments()
%2 = tail call i32 (...) @test_fsharp_comment_entities()
ret void
}
/* Type definitions */
struct szl_obj {
  int dummy;
};
struct szl_interp {
  int dummy;
};

/* Variables and functions */
scalar_t__ szl_str_to_int(struct szl_interp *, struct szl_obj *);
scalar_t__ szl_wstr_to_str(struct szl_interp *, struct szl_obj *);
int szl_wstr_to_int(struct szl_interp *interp, struct szl_obj *obj) {
  return szl_wstr_to_str(interp, obj) && szl_str_to_int(interp, obj);
}


x86 assembly (clang, -O0):
<szl_wstr_to_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <szl_wstr_to_str@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     1166 <szl_wstr_to_int+0x46>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <szl_str_to_int@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<szl_wstr_to_int>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <szl_wstr_to_str@plt>
test   %rax,%rax
je     114c <szl_wstr_to_int+0x2c>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <szl_str_to_int@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
jmp    114e <szl_wstr_to_int+0x2e>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.szl_interp = type { i32 }
%struct.szl_obj = type { i32 }
define i32 @szl_wstr_to_int(%struct.szl_interp* %0, %struct.szl_obj* %1) {
%3 = alloca %struct.szl_interp*
%4 = alloca %struct.szl_obj*
store %struct.szl_interp* %0, %struct.szl_interp** %3
store %struct.szl_obj* %1, %struct.szl_obj** %4
%5 = load %struct.szl_interp*, %struct.szl_interp** %3
%6 = load %struct.szl_obj*, %struct.szl_obj** %4
%7 = call i64 @szl_wstr_to_str(%struct.szl_interp* %5, %struct.szl_obj* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load %struct.szl_interp*, %struct.szl_interp** %3
%11 = load %struct.szl_obj*, %struct.szl_obj** %4
%12 = call i64 @szl_str_to_int(%struct.szl_interp* %10, %struct.szl_obj* %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %9, %2
%15 = phi i1 [ false, %2 ], [ %13, %9 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
%struct.szl_interp = type { i32 }
%struct.szl_obj = type { i32 }
define i32 @szl_wstr_to_int(%struct.szl_interp* %0, %struct.szl_obj* %1) {
%3 = tail call i64 @szl_wstr_to_str(%struct.szl_interp* %0, %struct.szl_obj* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @szl_str_to_int(%struct.szl_interp* %0, %struct.szl_obj* %1)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ curs_set(int);
int /*<<< orphan*/ endwin();
void destroy_screen() {
  curs_set(1);
  endwin();
}


x86 assembly (clang, -O0):
<destroy_screen>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <curs_set@plt>
mov    $0x0,%al
call   1030 <endwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_screen>:
push   %rax
mov    $0x1,%edi
call   1040 <curs_set@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <endwin@plt>

LLVM IR (-O0):
define void @destroy_screen() {
%1 = call i32 @curs_set(i32 1)
%2 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @destroy_screen() {
%1 = tail call i32 @curs_set(i32 1)
%2 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ count64bits(long long);
long long mask_value(int /*<<< orphan*/);
long long int intNumBits(long long int x) { return mask_value(count64bits(x)); }


x86 assembly (clang, -O0):
<intNumBits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <count64bits@plt>
mov    %eax,%edi
call   1030 <mask_value@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @intNumBits(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @count64bits(i64 %3)
%5 = call i64 @mask_value(i32 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @intNumBits(i64 %0) {
%2 = tail call i32 @count64bits(i64 %0)
%3 = tail call i64 @mask_value(i32 %2)
ret i64 %3
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ select(int /*<<< orphan*/, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          struct timeval *);
void doSleep(int iSeconds, const int iuSeconds) {
  struct timeval tvSelectTimeout;
  tvSelectTimeout.tv_sec = iSeconds;
  tvSelectTimeout.tv_usec = iuSeconds;
  select(0, NULL, NULL, NULL, &tvSelectTimeout);
}


x86 assembly (clang, -O0):
<doSleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x10(%rbp),%r8
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <select@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doSleep>:
push   %rax
mov    %edi,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%r8
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <select@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @doSleep(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.timeval
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
store i32 %6, i32* %7
%8 = load i32, i32* %4
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
store i32 %8, i32* %9
%10 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %5)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @doSleep(i32 %0, i32 %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
store i32 %0, i32* %5
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
store i32 %1, i32* %6
%7 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
size_t _getNameIndex(int /*<<< orphan*/ *, size_t);
size_t _getNameLength(int /*<<< orphan*/ *, size_t);
size_t _getContentHashIndex(uint8_t *buffer, size_t length) {
  return _getNameIndex(buffer, length) + _getNameLength(buffer, length) + 4;
}


x86 assembly (clang, -O0):
<_getContentHashIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <_getNameIndex@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <_getNameLength@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
add    $0x4,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_getContentHashIndex>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <_getNameIndex@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <_getNameLength@plt>
add    %r15,%rax
add    $0x4,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @_getContentHashIndex(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i64, i64* %4
%7 = call i64 @_getNameIndex(i32* %5, i64 %6)
%8 = load i32*, i32** %3
%9 = load i64, i64* %4
%10 = call i64 @_getNameLength(i32* %8, i64 %9)
%11 = add i64 %7, %10
%12 = add i64 %11, 4
ret i64 %12
}

LLVM IR (-O2):
define i64 @_getContentHashIndex(i32* %0, i64 %1) {
%3 = tail call i64 @_getNameIndex(i32* %0, i64 %1)
%4 = tail call i64 @_getNameLength(i32* %0, i64 %1)
%5 = add i64 %3, 4
%6 = add i64 %5, %4
ret i64 %6
}
void mark_as_page_table_mfn() {}


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

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

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

LLVM IR (-O2):
define void @mark_as_page_table_mfn() {
ret void
}
/* Variables and functions */
char *epr_create_string(int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(char *, char const *);
int /*<<< orphan*/ strlen(char const *);
char *epr_clone_string(const char *str) {
  char *str_clone = NULL;
  if (str != NULL) {
    str_clone = epr_create_string(strlen(str));
    strcpy(str_clone, str);
  }
  return str_clone;
}


x86 assembly (clang, -O0):
<epr_clone_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1170 <epr_clone_string+0x40>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%edi
call   1050 <epr_create_string@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epr_clone_string>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1158 <epr_clone_string+0x28>
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %eax,%edi
call   1050 <epr_create_string@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    115b <epr_clone_string+0x2b>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @epr_clone_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %3
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @strlen(i8* %7)
%9 = call i8* @epr_create_string(i32 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i32 @strcpy(i8* %10, i8* %11)
br label %13
13: ; preds = %6, %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @epr_clone_string(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i8* @epr_create_string(i32 %4)
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %7
7: ; preds = %3, %1
%8 = phi i8* [ %5, %3 ], [ null, %1 ]
ret i8* %8
}
/* Variables and functions */
int my_strlen(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char **);
int main() {
  char palabra[80];
  printf("Ingrese palabra:\n");
  scanf("%s", &palabra);
  int len = my_strlen(&palabra[0]);
  printf("La palabra '%s' contiene %d chars. (Contando '\\0')\n\n", palabra,
         len);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xeba(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x60(%rbp),%rdi
call   1030 <my_strlen@plt>
mov    %eax,-0x64(%rbp)
lea    -0x60(%rbp),%rsi
mov    -0x64(%rbp),%edx
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xeec(%rip),%rdi
call   1040 <puts@plt>
lea    0xea8(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1030 <my_strlen@plt>
lea    0xe91(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Ingrese palabra:\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [53 x i8] c"La palabra '%s' contiene %d chars. (Contando '\\0')\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = bitcast [80 x i8]* %2 to i8**
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %5)
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%8 = call i32 @my_strlen(i8* %7)
store i32 %8, i32* %3
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%10 = load i32, i32* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0), i8* %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [53 x i8] c"La palabra '%s' contiene %d chars. (Contando '\\0')\0A\0A\00"
@str = [17 x i8] c"Ingrese palabra:\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = bitcast [80 x i8]* %1 to i8**
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %4)
%6 = call i32 @my_strlen(i8* %2)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0), i8* %2, i32 %6)
ret i32 0
}
void foo408() {}


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

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

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

LLVM IR (-O2):
define void @foo408() {
ret void
}
/* Variables and functions */
int calculate(char *);
scalar_t__ isdigit(char);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  if (isdigit('\0')) {
    printf("fuck");
  }
  printf("%d\n", calculate("55+"));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     115e <main+0x2e>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea4(%rip),%rdi
call   1050 <calculate@plt>
mov    %eax,%esi
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     114b <main+0x1b>
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb7(%rip),%rdi
call   1050 <calculate@plt>
lea    0xea7(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fuck\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [4 x i8] c"55+\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @isdigit(i8 signext 0)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = call i32 @calculate(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"fuck\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [4 x i8] c"55+\00"
define i32 @main() {
%1 = tail call i64 @isdigit(i8 signext 0)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = tail call i32 @calculate(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[], char *envp[]) {
  printf("Hello World\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void mlt_cocoa_autorelease_close(void *p) {}


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

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

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

LLVM IR (-O2):
define void @mlt_cocoa_autorelease_close(i8* nocapture %0) {
ret void
}
/* Variables and functions */
void *my_aligned_alloc(int, int);
void *t3_variable(int alignment) { return my_aligned_alloc(320, alignment); }


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

x86 assembly (clang, -O2):
<t3_variable>:
mov    %edi,%esi
mov    $0x140,%edi
jmp    1030 <my_aligned_alloc@plt>

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

LLVM IR (-O2):
define i8* @t3_variable(i32 %0) {
%2 = tail call i8* @my_aligned_alloc(i32 320, i32 %0)
ret i8* %2
}
void cygwin_premain3(int argc, char **argv) {}


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

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

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

LLVM IR (-O2):
define void @cygwin_premain3(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(int argc, char *argv[], char *envp[]) {
  char s[1024];
  scanf("%s", s);
  printf("read from pipe: %s \n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x420(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x420(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
lea    0xed1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [21 x i8] c"read from pipe: %s \0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca [1024 x i8]
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [21 x i8] c"read from pipe: %s \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ffxmsg(int, char *);
void ffpmrk(void) {
  char *dummy = 0;
  ffxmsg(6, dummy);
  return;
}


x86 assembly (clang, -O0):
<ffpmrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x6,%edi
call   1030 <ffxmsg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffpmrk>:
mov    $0x6,%edi
xor    %esi,%esi
jmp    1030 <ffxmsg@plt>

LLVM IR (-O0):
define void @ffpmrk() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @ffxmsg(i32 6, i8* %2)
ret void
}

LLVM IR (-O2):
define void @ffpmrk() {
%1 = tail call i32 @ffxmsg(i32 6, i8* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
scalar_t__ __rdrand16(int /*<<< orphan*/ *);
uint16_t rdrand16(void) {
  uint16_t val;
  while (__rdrand16(&val) == 0)
    ;
  return val;
}


x86 assembly (clang, -O0):
<rdrand16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <__rdrand16@plt>
cmp    $0x0,%rax
jne    1130 <rdrand16+0x20>
jmp    1118 <rdrand16+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdrand16>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <__rdrand16@plt>
test   %rax,%rax
je     1120 <rdrand16+0x10>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rdrand16() {
%1 = alloca i32
br label %2
2: ; preds = %5, %0
%3 = call i64 @__rdrand16(i32* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %2
br label %2
6: ; preds = %2
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @rdrand16() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = call i64 @__rdrand16(i32* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %3, label %6
6: ; preds = %3
%7 = load i32, i32* %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_semaphore_wait() {
  printf("NOT IMPLEMENTED:"
         "pa_semaphore_wait"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"NOT IMPLEMENTED:pa_semaphore_wait\0A\00"
define i32 @pa_semaphore_wait() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_semaphore_wait\00"
define i32 @pa_semaphore_wait() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
unsigned char ds1337_read_register(int);
unsigned char ds1337_get_day() {
  unsigned char day;
  day = ds1337_read_register(0x03);
  return day;
}


x86 assembly (clang, -O0):
<ds1337_get_day>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
call   1030 <ds1337_read_register@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds1337_get_day>:
mov    $0x3,%edi
jmp    1030 <ds1337_read_register@plt>

LLVM IR (-O0):
define zeroext i8 @ds1337_get_day() {
%1 = alloca i8
%2 = call zeroext i8 @ds1337_read_register(i32 3)
store i8 %2, i8* %1
%3 = load i8, i8* %1
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @ds1337_get_day() {
%1 = tail call zeroext i8 @ds1337_read_register(i32 3)
ret i8 %1
}
int test_imm_35int64_highword_reg(long long val) {
  return ((val >> 32) & (0x35 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_35int64_highword_reg>:
movabs $0x3500000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_35int64_highword_reg(i64 %0) {
%2 = and i64 %0, 227633266688
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct evbuffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ evbuffer_drain(struct evbuffer *, int /*<<< orphan*/);
int /*<<< orphan*/ evbuffer_get_length(struct evbuffer *);
void clear_buffer(struct evbuffer *buf) {
  evbuffer_drain(buf, evbuffer_get_length(buf));
}


x86 assembly (clang, -O0):
<clear_buffer>:
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 <evbuffer_get_length@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <evbuffer_drain@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_buffer>:
push   %rbx
mov    %rdi,%rbx
call   1030 <evbuffer_get_length@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <evbuffer_drain@plt>

LLVM IR (-O0):
%struct.evbuffer = type { i32 }
define void @clear_buffer(%struct.evbuffer* %0) {
%2 = alloca %struct.evbuffer*
store %struct.evbuffer* %0, %struct.evbuffer** %2
%3 = load %struct.evbuffer*, %struct.evbuffer** %2
%4 = load %struct.evbuffer*, %struct.evbuffer** %2
%5 = call i32 @evbuffer_get_length(%struct.evbuffer* %4)
%6 = call i32 @evbuffer_drain(%struct.evbuffer* %3, i32 %5)
ret void
}

LLVM IR (-O2):
%struct.evbuffer = type { i32 }
define void @clear_buffer(%struct.evbuffer* %0) {
%2 = tail call i32 @evbuffer_get_length(%struct.evbuffer* %0)
%3 = tail call i32 @evbuffer_drain(%struct.evbuffer* %0, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void usage(char *prog, FILE *fp) {
  fprintf(fp, "Usage: %s [options] arg\n", prog);
  fprintf(fp, "Options: \n"
              "  -a       a option\n"
              "  -b       a option\n"
              "  --add    add option\n"
              "  ...\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xed1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xed8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rdx
lea    0xed2(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xeda(%rip),%rdi
mov    $0x4e,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Usage: %s [options] arg\0A\00"
@.str.1 = [79 x i8] c"Options: \0A -a a option\0A -b a option\0A --add add option\0A ...\0A\00"
define void @usage(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i8*, i8** %3
%7 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32*, i32** %4
%9 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Usage: %s [options] arg\0A\00"
@.str.1 = [79 x i8] c"Options: \0A -a a option\0A -b a option\0A --add add option\0A ...\0A\00"
define void @usage(i8* %0, i32* nocapture %1) {
%3 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.1, i64 0, i64 0), i64 78, i64 1, i32* %1)
ret void
}
int main() {
  char rev[20] = {"test"};
  reverse(rev);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1030 <reverse@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <reverse@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.rev = [20 x i8] c"test\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
store i32 0, i32* %1
%3 = bitcast [20 x i8]* %2 to i8*
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @reverse to i32 (i8*, ...)*)(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.rev = [20 x i8] c"test\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @reverse to i32 (i8*, ...)*)(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ inc_IP(int *);
void Cmp(int op1, int op2, int *ip) {
  if ((op1) == (op2))
    inc_IP(ip);
  inc_IP(ip);
}


x86 assembly (clang, -O0):
<Cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1137 <Cmp+0x27>
mov    -0x10(%rbp),%rdi
call   1030 <inc_IP@plt>
mov    -0x10(%rbp),%rdi
call   1030 <inc_IP@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cmp>:
push   %rbx
mov    %rdx,%rbx
cmp    %esi,%edi
jne    1120 <Cmp+0x10>
mov    %rbx,%rdi
call   1030 <inc_IP@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <inc_IP@plt>

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

LLVM IR (-O2):
define void @Cmp(i32 %0, i32 %1, i32* %2) {
%4 = icmp eq i32 %0, %1
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @inc_IP(i32* %2)
br label %7
7: ; preds = %5, %3
%8 = tail call i32 @inc_IP(i32* %2)
ret void
}
int hdr_dd_progress() { return 1; }


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

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

LLVM IR (-O0):
define i32 @hdr_dd_progress() {
ret i32 1
}

LLVM IR (-O2):
define i32 @hdr_dd_progress() {
ret i32 1
}
void sig_hup(int sig) { return; }


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

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

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

LLVM IR (-O2):
define void @sig_hup(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_mutex_free() {
  printf("NOT IMPLEMENTED:"
         "pa_mutex_free"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"NOT IMPLEMENTED:pa_mutex_free\0A\00"
define i32 @pa_mutex_free() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [30 x i8] c"NOT IMPLEMENTED:pa_mutex_free\00"
define i32 @pa_mutex_free() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int test_imm_99int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x99 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_99int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 657129996288
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ read(int, void *, size_t);
ssize_t ReadFromNet(int sock, void *buf, size_t count) {
  return read(sock, buf, count);
}


x86 assembly (clang, -O0):
<ReadFromNet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadFromNet>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @ReadFromNet(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ M_E;
double pow(int /*<<< orphan*/, double);
double unif_dist();
int pois_dist(double mean) {
  double L = pow(M_E, -mean);
  int k = 0;
  double p = 1;
  do {
    k++;
    p *= unif_dist();
  } while (p > L);
  return k - 1;
}


x86 assembly (clang, -O0):
<pois_dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1040 <pow@plt>
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movsd  0xe95(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <unif_dist@plt>
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
ja     1170 <pois_dist+0x50>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pois_dist>:
push   %rbx
sub    $0x10,%rsp
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
xorps  0xecb(%rip),%xmm0
call   1040 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0xec8(%rip),%xmm0
mov    $0xffffffff,%ebx
nopl   (%rax)
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <unif_dist@plt>
movsd  (%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  (%rsp),%xmm0
add    $0x1,%ebx
ucomisd 0x8(%rsp),%xmm0
ja     1150 <pois_dist+0x30>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@M_E = global i32 0
define i32 @pois_dist(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i32
%5 = alloca double
store double %0, double* %2
%6 = load i32, i32* @M_E
%7 = load double, double* %2
%8 = fneg double %7
%9 = call double @pow(i32 %6, double %8)
store double %9, double* %3
store i32 0, i32* %4
store double 1.000000e+00, double* %5
br label %10
10: ; preds = %16, %1
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
%13 = call double (...) @unif_dist()
%14 = load double, double* %5
%15 = fmul double %14, %13
store double %15, double* %5
br label %16
16: ; preds = %10
%17 = load double, double* %5
%18 = load double, double* %3
%19 = fcmp ogt double %17, %18
br i1 %19, label %10, label %20
20: ; preds = %16
%21 = load i32, i32* %4
%22 = sub nsw i32 %21, 1
ret i32 %22
}

LLVM IR (-O2):
@M_E = global i32 0
define i32 @pois_dist(double %0) {
%2 = load i32, i32* @M_E
%3 = fneg double %0
%4 = tail call double @pow(i32 %2, double %3)
br label %5
5: ; preds = %5, %1
%6 = phi i32 [ 0, %1 ], [ %8, %5 ]
%7 = phi double [ 1.000000e+00, %1 ], [ %10, %5 ]
%8 = add nuw nsw i32 %6, 1
%9 = tail call double (...) @unif_dist()
%10 = fmul double %7, %9
%11 = fcmp ogt double %10, %4
br i1 %11, label %5, label %12
12: ; preds = %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ __mp_init();
void initlibrary(void) { __mp_init(); }


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

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

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

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