xunge/DecIR huggingface dataset:
void disable_page_protection(long unsigned int value) {
  asm volatile("mov %%cr0,%0" : "=r"(value));
  if (value & 0x00010000) {
    value &= ~0x00010000;
    asm volatile("mov %0,%%cr0" : : "r"(value));
  }
}


x86 assembly (clang, -O0):
<disable_page_protection>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %cr0,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x10000,%rax
cmp    $0x0,%rax
je     1138 <disable_page_protection+0x38>
mov    -0x8(%rbp),%rax
and    $0xfffffffffffeffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%cr0
pop    %rbp
ret

x86 assembly (clang, -O2):
<disable_page_protection>:
mov    %cr0,%rax
test   $0x10000,%eax
je     1113 <disable_page_protection+0x13>
and    $0xfffffffffffeffff,%rax
mov    %rax,%cr0
ret

LLVM IR (-O0):
define void @disable_page_protection(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i64 asm sideeffect "mov %cr0,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = and i64 %4, 65536
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i64, i64* %2
%9 = and i64 %8, -65537
store i64 %9, i64* %2
%10 = load i64, i64* %2
br label %11
11: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @disable_page_protection(i64 %0) {
%2 = tail call i64 asm sideeffect "mov %cr0,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
%3 = and i64 %2, 65536
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = and i64 %2, -65537
tail call void asm sideeffect "mov $0,%cr0", "r,~{dirflag},~{fpsr},~{flags}"(i64 %6)
br label %7
7: ; preds = %5, %1
ret void
}
void dummy_close(void) { ; }


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

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

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

LLVM IR (-O2):
define void @dummy_close() {
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *def_alloc_func(void *opaque, size_t items, size_t size) {
  (void)opaque, (void)items, (void)size;
  return malloc(items * size);
}


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

x86 assembly (clang, -O2):
<def_alloc_func>:
mov    %rsi,%rdi
imul   %rdx,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @def_alloc_func(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = mul i64 %10, %11
%13 = call i8* @malloc(i64 %12)
ret i8* %13
}

LLVM IR (-O2):
define noalias i8* @def_alloc_func(i8* nocapture readnone %0, i64 %1, i64 %2) {
%4 = mul i64 %2, %1
%5 = tail call i8* @malloc(i64 %4)
ret i8* %5
}
/* Type definitions */
struct storage_info_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ storage_insert(struct storage_info_t *, void *,
                                  int /*<<< orphan*/);
void storage_push(struct storage_info_t *info, void *new_node) {
  storage_insert(info, new_node, 0);
}


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

x86 assembly (clang, -O2):
<storage_push>:
xor    %edx,%edx
jmp    1030 <storage_insert@plt>

LLVM IR (-O0):
%struct.storage_info_t = type { i32 }
define void @storage_push(%struct.storage_info_t* %0, i8* %1) {
%3 = alloca %struct.storage_info_t*
%4 = alloca i8*
store %struct.storage_info_t* %0, %struct.storage_info_t** %3
store i8* %1, i8** %4
%5 = load %struct.storage_info_t*, %struct.storage_info_t** %3
%6 = load i8*, i8** %4
%7 = call i32 @storage_insert(%struct.storage_info_t* %5, i8* %6, i32 0)
ret void
}

LLVM IR (-O2):
%struct.storage_info_t = type { i32 }
define void @storage_push(%struct.storage_info_t* %0, i8* %1) {
%3 = tail call i32 @storage_insert(%struct.storage_info_t* %0, i8* %1, i32 0)
ret void
}
/* Variables and functions */
char *gettext(char *);
int /*<<< orphan*/ printf(char *);
void showVersion() { printf(gettext("CatShell (OS homework) 0.25\n")); }


x86 assembly (clang, -O0):
<showVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<showVersion>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"CatShell (OS homework) 0.25\0A\00"
define void @showVersion() {
%1 = call i8* @gettext(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"CatShell (OS homework) 0.25\0A\00"
define void @showVersion() {
%1 = tail call i8* @gettext(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printAns(int);
void doSub(int a, int b) { printAns(a - b); }


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

x86 assembly (clang, -O2):
<doSub>:
sub    %esi,%edi
jmp    1030 <printAns@plt>

LLVM IR (-O0):
define void @doSub(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 = sub nsw i32 %5, %6
%8 = call i32 @printAns(i32 %7)
ret void
}

LLVM IR (-O2):
define void @doSub(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = tail call i32 @printAns(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void bar() {
  int x;
  x = 5;
  x *= 3;
  x += 6;
  printf("Hello! %d\n", x);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
imul   $0x3,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x6,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
lea    0xee9(%rip),%rdi
mov    $0x15,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Hello! %d\0A\00"
define void @bar() {
%1 = alloca i32
store i32 5, i32* %1
%2 = load i32, i32* %1
%3 = mul nsw i32 %2, 3
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 6
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Hello! %d\0A\00"
define void @bar() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 21)
ret void
}
void rop3_60_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = T ^ S;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_60_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_60_0_0>:
xor    %edx,%esi
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_60_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = xor i32 %9, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %7
%14 = load i8, i8* %7
%15 = load i8*, i8** %4
store i8 %14, i8* %15
ret void
}

LLVM IR (-O2):
define void @rop3_60_0_0(i8* nocapture writeonly %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, %1
store i8 %4, i8* %0
ret void
}
/* Type definitions */
struct window {
  int dummy;
};

/* Variables and functions */
int line_numbers_width(struct window *);
int vertical_tabbar_width(struct window *);
int edit_x_offset(struct window *win) {
  return line_numbers_width(win) + vertical_tabbar_width(win);
}


x86 assembly (clang, -O0):
<edit_x_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <line_numbers_width@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <vertical_tabbar_width@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<edit_x_offset>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <line_numbers_width@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <vertical_tabbar_width@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.window = type { i32 }
define i32 @edit_x_offset(%struct.window* %0) {
%2 = alloca %struct.window*
store %struct.window* %0, %struct.window** %2
%3 = load %struct.window*, %struct.window** %2
%4 = call i32 @line_numbers_width(%struct.window* %3)
%5 = load %struct.window*, %struct.window** %2
%6 = call i32 @vertical_tabbar_width(%struct.window* %5)
%7 = add nsw i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
%struct.window = type { i32 }
define i32 @edit_x_offset(%struct.window* %0) {
%2 = tail call i32 @line_numbers_width(%struct.window* %0)
%3 = tail call i32 @vertical_tabbar_width(%struct.window* %0)
%4 = add nsw i32 %3, %2
ret i32 %4
}
void gtk_selection_clear_targets() {}


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

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

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

LLVM IR (-O2):
define void @gtk_selection_clear_targets() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XtPointer;
typedef int /*<<< orphan*/ XEvent;
typedef int /*<<< orphan*/ Widget;
typedef int /*<<< orphan*/ String;
typedef int /*<<< orphan*/ Cardinal;

/* Variables and functions */
int /*<<< orphan*/ XtCallCallbacks(int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/);
int /*<<< orphan*/ XtNcallback;
void InputAction(Widget w, XEvent *event, String params[],
                 Cardinal *num_params) {
  XtCallCallbacks(w, XtNcallback, (XtPointer)event);
}


x86 assembly (clang, -O0):
<InputAction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
call   1030 <XtCallCallbacks@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InputAction>:
mov    %rsi,%rdx
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
jmp    1030 <XtCallCallbacks@plt>

LLVM IR (-O0):
@XtNcallback = global i32 0
define void @InputAction(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32, i32* %5
%10 = load i32, i32* @XtNcallback
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i32
%13 = call i32 @XtCallCallbacks(i32 %9, i32 %10, i32 %12)
ret void
}

LLVM IR (-O2):
@XtNcallback = global i32 0
define void @InputAction(i32 %0, i32* %1, i32* nocapture readnone %2, i32* nocapture readnone %3) {
%5 = load i32, i32* @XtNcallback
%6 = ptrtoint i32* %1 to i64
%7 = trunc i64 %6 to i32
%8 = tail call i32 @XtCallCallbacks(i32 %0, i32 %5, i32 %7)
ret void
}
/* Variables and functions */
int close(int);
int closesocket(int s) { return close(s); }


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

x86 assembly (clang, -O2):
<closesocket>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @closesocket(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ recv_char(char);
int /*<<< orphan*/ send_char(char);
void test_mode(int nbits) {
  unsigned mask = (1 << nbits) - 1;
  send_char(0x55);
  recv_char(0x55 & mask);
  send_char('a');
  recv_char('a' & mask);
}


x86 assembly (clang, -O0):
<test_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x55,%edi
call   1040 <send_char@plt>
mov    -0x8(%rbp),%eax
and    $0x55,%eax
movsbl %al,%edi
call   1030 <recv_char@plt>
mov    $0x61,%edi
call   1040 <send_char@plt>
mov    -0x8(%rbp),%eax
and    $0x61,%eax
movsbl %al,%edi
call   1030 <recv_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mode>:
push   %rbx
mov    %edi,%ecx
mov    $0xffffffff,%ebx
shl    %cl,%ebx
mov    $0x55,%edi
call   1040 <send_char@plt>
not    %bl
mov    %ebx,%eax
and    $0x55,%al
movzbl %al,%edi
call   1030 <recv_char@plt>
mov    $0x61,%edi
call   1040 <send_char@plt>
and    $0x61,%bl
movzbl %bl,%edi
pop    %rbx
jmp    1030 <recv_char@plt>

LLVM IR (-O0):
define void @test_mode(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = shl i32 1, %4
%6 = sub nsw i32 %5, 1
store i32 %6, i32* %3
%7 = call i32 @send_char(i8 signext 85)
%8 = load i32, i32* %3
%9 = and i32 85, %8
%10 = trunc i32 %9 to i8
%11 = call i32 @recv_char(i8 signext %10)
%12 = call i32 @send_char(i8 signext 97)
%13 = load i32, i32* %3
%14 = and i32 97, %13
%15 = trunc i32 %14 to i8
%16 = call i32 @recv_char(i8 signext %15)
ret void
}

LLVM IR (-O2):
define void @test_mode(i32 %0) {
%2 = shl nsw i32 -1, %0
%3 = tail call i32 @send_char(i8 signext 85)
%4 = trunc i32 %2 to i8
%5 = xor i8 %4, -1
%6 = and i8 %5, 85
%7 = tail call i32 @recv_char(i8 signext %6)
%8 = tail call i32 @send_char(i8 signext 97)
%9 = and i8 %5, 97
%10 = tail call i32 @recv_char(i8 signext %9)
ret void
}
int foo(int a[]) { return a[2]; }


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

x86 assembly (clang, -O2):
<foo>:
mov    0x8(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ syscall_cp(int, int /*<<< orphan*/);
void __restore() { syscall_cp(119, 0); }


x86 assembly (clang, -O0):
<__restore>:
push   %rbp
mov    %rsp,%rbp
mov    $0x77,%edi
xor    %esi,%esi
call   1030 <syscall_cp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__restore>:
mov    $0x77,%edi
xor    %esi,%esi
jmp    1030 <syscall_cp@plt>

LLVM IR (-O0):
define void @__restore() {
%1 = call i32 @syscall_cp(i32 119, i32 0)
ret void
}

LLVM IR (-O2):
define void @__restore() {
%1 = tail call i32 @syscall_cp(i32 119, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void show_help(void) {
  printf("Usage: %s [OPTION]...\n\nOptions:\n    -d, --dereference\tstat file "
         "link points to rather than link itself\n    -h, --help\t\tdisplay "
         "this help\n    -V, --version\tdisplay version information\n\nReport "
         "bugs to <bulliver@gmail.com>\n",
         "stat");
}


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

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

LLVM IR (-O0):
@.str = [221 x i8] c"Usage: %s [OPTION]...\0A\0AOptions:\0A -d, --dereference\09stat file link points to rather than link itself\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0AReport bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [5 x i8] c"stat\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([221 x i8], [221 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [221 x i8] c"Usage: %s [OPTION]...\0A\0AOptions:\0A -d, --dereference\09stat file link points to rather than link itself\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0AReport bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [5 x i8] c"stat\00"
define void @show_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([221 x i8], [221 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int sqIsAbsolutePath(const char *path) { return path && (*path == '/'); }


x86 assembly (clang, -O0):
<sqIsAbsolutePath>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1128 <sqIsAbsolutePath+0x28>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqIsAbsolutePath>:
xor    %eax,%eax
test   %rdi,%rdi
je     110d <sqIsAbsolutePath+0xd>
cmpb   $0x2f,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @sqIsAbsolutePath(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 47
br label %10
10: ; preds = %5, %1
%11 = phi i1 [ false, %1 ], [ %9, %5 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @sqIsAbsolutePath(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 47
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  printf("Hi Satyam !! \nAre you okay ?  Today is  %s another great day to "
         "start!\n",
         "Mar 16 2022");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [72 x i8] c"Hi Satyam !! \0AAre you okay ? Today is %s another great day to start!\0A\00"
@.str.1 = [12 x i8] c"Mar 16 2022\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [72 x i8] c"Hi Satyam !! \0AAre you okay ? Today is %s another great day to start!\0A\00"
@.str.1 = [12 x i8] c"Mar 16 2022\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ atrshmlog_init_events(int);
void atrshmlog_init_events_use_file() { atrshmlog_init_events(1); }


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

x86 assembly (clang, -O2):
<atrshmlog_init_events_use_file>:
mov    $0x1,%edi
jmp    1030 <atrshmlog_init_events@plt>

LLVM IR (-O0):
define void @atrshmlog_init_events_use_file() {
%1 = call i32 @atrshmlog_init_events(i32 1)
ret void
}

LLVM IR (-O2):
define void @atrshmlog_init_events_use_file() {
%1 = tail call i32 @atrshmlog_init_events(i32 1)
ret void
}
int test_imm_9Auint8_mem(unsigned char *val) {
  return ((*val) & (0x9A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_9Auint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -102
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void ExttPBXAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttPBXAuxTable() {
ret void
}
void _icache_invalidate_all(void) { ; }


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

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

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

LLVM IR (-O2):
define void @_icache_invalidate_all() {
ret void
}
_Complex float test_cprojf(_Complex float x) { return __builtin_cprojf(x); }


x86 assembly (clang, -O0):
<test_cprojf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movlpd %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  %xmm1,-0x18(%rbp)
movss  %xmm0,-0x14(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <cprojf@plt>
movlpd %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cprojf>:
jmp    1030 <cprojf@plt>

LLVM IR (-O0):
define <2 x float> @test_cprojf(<2 x float> %0) {
%2 = alloca { float, float }
%3 = alloca { float, float }
%4 = alloca { float, float }
%5 = alloca { float, float }
%6 = bitcast { float, float }* %3 to <2 x float>*
store <2 x float> %0, <2 x float>* %6
%7 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%8 = load float, float* %7
%9 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
%10 = load float, float* %9
%11 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 0
%12 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 1
store float %8, float* %11
store float %10, float* %12
%13 = bitcast { float, float }* %4 to <2 x float>*
%14 = load <2 x float>, <2 x float>* %13
%15 = call <2 x float> @cprojf(<2 x float> %14)
%16 = bitcast { float, float }* %5 to <2 x float>*
store <2 x float> %15, <2 x float>* %16
%17 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 0
%18 = load float, float* %17
%19 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 1
%20 = load float, float* %19
%21 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%22 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
store float %18, float* %21
store float %20, float* %22
%23 = bitcast { float, float }* %2 to <2 x float>*
%24 = load <2 x float>, <2 x float>* %23
ret <2 x float> %24
}

LLVM IR (-O2):
define <2 x float> @test_cprojf(<2 x float> %0) {
%2 = tail call <2 x float> @cprojf(<2 x float> %0)
ret <2 x float> %2
}
/* Type definitions */
struct S {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ non_existent(struct S *, int);
void hooray1(struct S *p) { non_existent(p, 1); }


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

x86 assembly (clang, -O2):
<hooray1>:
mov    $0x1,%esi
jmp    1030 <non_existent@plt>

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

LLVM IR (-O2):
%struct.S = type { i32 }
define void @hooray1(%struct.S* %0) {
%2 = tail call i32 @non_existent(%struct.S* %0, i32 1)
ret void
}
/* Type definitions */
struct vmfile {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/, void const *, size_t);
int /*<<< orphan*/ vmfile_resize_if_less(struct vmfile *, size_t);
int /*<<< orphan*/ vmfile_wloc(struct vmfile *);
int vmfile_wseek(struct vmfile *, size_t);
int vmfile_memcpy(struct vmfile *vmb, const void *src, size_t n) {
  vmfile_resize_if_less(vmb, n);
  memcpy(vmfile_wloc(vmb), src, n);
  return vmfile_wseek(vmb, n);
}


x86 assembly (clang, -O0):
<vmfile_memcpy>:
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    -0x18(%rbp),%rsi
call   1060 <vmfile_resize_if_less@plt>
mov    -0x8(%rbp),%rdi
call   1030 <vmfile_wloc@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <vmfile_wseek@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmfile_memcpy>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdx,%rsi
call   1060 <vmfile_resize_if_less@plt>
mov    %rbx,%rdi
call   1030 <vmfile_wloc@plt>
mov    %eax,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <vmfile_wseek@plt>

LLVM IR (-O0):
%struct.vmfile = type { i32 }
define i32 @vmfile_memcpy(%struct.vmfile* %0, i8* %1, i64 %2) {
%4 = alloca %struct.vmfile*
%5 = alloca i8*
%6 = alloca i64
store %struct.vmfile* %0, %struct.vmfile** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load %struct.vmfile*, %struct.vmfile** %4
%8 = load i64, i64* %6
%9 = call i32 @vmfile_resize_if_less(%struct.vmfile* %7, i64 %8)
%10 = load %struct.vmfile*, %struct.vmfile** %4
%11 = call i32 @vmfile_wloc(%struct.vmfile* %10)
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call i32 @memcpy(i32 %11, i8* %12, i64 %13)
%15 = load %struct.vmfile*, %struct.vmfile** %4
%16 = load i64, i64* %6
%17 = call i32 @vmfile_wseek(%struct.vmfile* %15, i64 %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.vmfile = type { i32 }
define i32 @vmfile_memcpy(%struct.vmfile* %0, i8* %1, i64 %2) {
%4 = tail call i32 @vmfile_resize_if_less(%struct.vmfile* %0, i64 %2)
%5 = tail call i32 @vmfile_wloc(%struct.vmfile* %0)
%6 = tail call i32 @memcpy(i32 %5, i8* %1, i64 %2)
%7 = tail call i32 @vmfile_wseek(%struct.vmfile* %0, i64 %2)
ret i32 %7
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ *list_find(struct list *, void *,
                              int (*)(void const *, void const *));
int list_insert(struct list *, void *);
int list_insert_unique(struct list *l, void *data,
                       int (*cmp_fn)(const void *, const void *)) {
  if (list_find(l, data, cmp_fn) != NULL)
    return -1;
  return list_insert(l, data);
}


x86 assembly (clang, -O0):
<list_insert_unique>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <list_find@plt>
cmp    $0x0,%rax
je     115b <list_insert_unique+0x3b>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <list_insert_unique+0x4b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <list_insert@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_insert_unique>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <list_find@plt>
test   %rax,%rax
je     1141 <list_insert_unique+0x21>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <list_insert@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
define i32 @list_insert_unique(%struct.list* %0, i8* %1, i32 (i8*, i8*)* %2) {
%4 = alloca i32
%5 = alloca %struct.list*
%6 = alloca i8*
%7 = alloca i32 (i8*, i8*)*
store %struct.list* %0, %struct.list** %5
store i8* %1, i8** %6
store i32 (i8*, i8*)* %2, i32 (i8*, i8*)** %7
%8 = load %struct.list*, %struct.list** %5
%9 = load i8*, i8** %6
%10 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %7
%11 = call i32* @list_find(%struct.list* %8, i8* %9, i32 (i8*, i8*)* %10)
%12 = icmp ne i32* %11, null
br i1 %12, label %13, label %14
13: ; preds = %3
store i32 -1, i32* %4
br label %18
14: ; preds = %3
%15 = load %struct.list*, %struct.list** %5
%16 = load i8*, i8** %6
%17 = call i32 @list_insert(%struct.list* %15, i8* %16)
store i32 %17, i32* %4
br label %18
18: ; preds = %14, %13
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
%struct.list = type { i32 }
define i32 @list_insert_unique(%struct.list* %0, i8* %1, i32 (i8*, i8*)* %2) {
%4 = tail call i32* @list_find(%struct.list* %0, i8* %1, i32 (i8*, i8*)* %2)
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @list_insert(%struct.list* %0, i8* %1)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ -1, %3 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ wiznetRegWriteByte(int /*<<< orphan*/, int,
                                      int /*<<< orphan*/);
void wiznetSetSocketCommand(uint8_t socket, uint8_t command) {
  wiznetRegWriteByte(socket, (0x0000 + 0x0001), command);
}


x86 assembly (clang, -O0):
<wiznetSetSocketCommand>:
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    $0x1,%esi
call   1030 <wiznetRegWriteByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wiznetSetSocketCommand>:
mov    %esi,%edx
mov    $0x1,%esi
jmp    1030 <wiznetRegWriteByte@plt>

LLVM IR (-O0):
define void @wiznetSetSocketCommand(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 @wiznetRegWriteByte(i32 %5, i32 1, i32 %6)
ret void
}

LLVM IR (-O2):
define void @wiznetSetSocketCommand(i32 %0, i32 %1) {
%3 = tail call i32 @wiznetRegWriteByte(i32 %0, i32 1, i32 %1)
ret void
}
int fun956() { return 956; }


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

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

LLVM IR (-O0):
define i32 @fun956() {
ret i32 956
}

LLVM IR (-O2):
define i32 @fun956() {
ret i32 956
}
unsigned test_rightmost_one(unsigned x) {
  int mask;
  for (mask = 1; mask; mask <<= 1)
    if (x & mask)
      return mask;
  return 0;
}


x86 assembly (clang, -O0):
<test_rightmost_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1145 <test_rightmost_one+0x45>
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
cmp    $0x0,%eax
je     1132 <test_rightmost_one+0x32>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114c <test_rightmost_one+0x4c>
jmp    1137 <test_rightmost_one+0x37>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <test_rightmost_one+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rightmost_one>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ecx,%eax
test   %ecx,%ecx
je     1121 <test_rightmost_one+0x21>
mov    %eax,%edx
and    %edi,%edx
lea    (%rax,%rax,1),%ecx
test   %edx,%edx
je     1110 <test_rightmost_one+0x10>
ret

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

LLVM IR (-O2):
define i32 @test_rightmost_one(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %8, %2 ]
%4 = icmp ne i32 %3, 0
%5 = and i32 %3, %0
%6 = icmp eq i32 %5, 0
%7 = and i1 %4, %6
%8 = shl i32 %3, 1
br i1 %7, label %2, label %9
9: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sq(int);
int main() {
  printf("%d", sq(3));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sq(i32 3)
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @sq(i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int customPrint_nolf(char *, int const);
int customProgress(const int msg, ...) {
  return customPrint_nolf("\tProgress: %d.\r", msg);
}


x86 assembly (clang, -O0):
<customProgress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <customPrint_nolf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<customProgress>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <customPrint_nolf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"\09Progress: %d.\0D\00"
define i32 @customProgress(i32 %0, ...) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @customPrint_nolf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [16 x i8] c"\09Progress: %d.\0D\00"
define i32 @customProgress(i32 %0, ...) {
%2 = tail call i32 @customPrint_nolf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr,
          "Usage: %s -m p|c [-d] [-t] [-r]\n"
          "\n"
          "m p|c - producer/consumer\n"
          "t     - duration (in seconds)\n"
          "d     - debug mode\n"
          "r     - register only (don't create the shared memory)\n",
          name);
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [164 x i8] c"Usage: %s -m p|c [-d] [-t] [-r]\0A\0Am p|c - producer/consumer\0At - duration (in seconds)\0Ad - debug mode\0Ar - register only (don't create the shared memory)\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [164 x i8] c"Usage: %s -m p|c [-d] [-t] [-r]\0A\0Am p|c - producer/consumer\0At - duration (in seconds)\0Ad - debug mode\0Ar - register only (don't create the shared memory)\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int sandbox_consume_mach_extension(const char *ext_token, char **name) {
  return -1;
}


x86 assembly (clang, -O0):
<sandbox_consume_mach_extension>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sandbox_consume_mach_extension(i8* nocapture readnone %0, i8** nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void call_reg32(unsigned long reg32) {
  put8(0xFF);
  put8(0xD0 + reg32);
}


x86 assembly (clang, -O0):
<call_reg32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xff,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rax
add    $0xd0,%rax
mov    %eax,%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_reg32>:
push   %rbx
mov    %rdi,%rbx
mov    $0xff,%edi
call   1030 <put8@plt>
add    $0xd0,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @call_reg32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @put8(i32 255)
%4 = load i64, i64* %2
%5 = add i64 208, %4
%6 = trunc i64 %5 to i32
%7 = call i32 @put8(i32 %6)
ret void
}

LLVM IR (-O2):
define void @call_reg32(i64 %0) {
%2 = tail call i32 @put8(i32 255)
%3 = trunc i64 %0 to i32
%4 = add i32 %3, 208
%5 = tail call i32 @put8(i32 %4)
ret void
}
int f() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @f() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ candycane();
void candy() { candycane(); }


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

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

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

LLVM IR (-O2):
define void @candy() {
%1 = tail call i32 (...) @candycane()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *smod_usage();
void scrub_showusage() { printf("usage : scrub %s", smod_usage()); }


x86 assembly (clang, -O0):
<scrub_showusage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <smod_usage@plt>
mov    %rax,%rsi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<scrub_showusage>:
push   %rax
xor    %eax,%eax
call   1040 <smod_usage@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"usage : scrub %s\00"
define void @scrub_showusage() {
%1 = call i8* (...) @smod_usage()
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"usage : scrub %s\00"
define void @scrub_showusage() {
%1 = tail call i8* (...) @smod_usage()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
void strnullchecks(const char *fn, const char *name, const char *routine) {
  if (fn == NULL) {
    fprintf(stderr, "routine \"%s\" was supplied with NULL variable \"%s\"\n",
            routine, name);
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<strnullchecks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1166 <strnullchecks+0x46>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xea9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnullchecks>:
test   %rdi,%rdi
je     1126 <strnullchecks+0x6>
ret
push   %rax
mov    %rsi,%rcx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [51 x i8] c"routine \22%s\22 was supplied with NULL variable \22%s\22\0A\00"
define void @strnullchecks(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %15
9: ; preds = %3
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %6
%12 = load i8*, i8** %5
%13 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12)
%14 = call i32 @exit(i32 -1)
unreachable
15: ; preds = %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [51 x i8] c"routine \22%s\22 was supplied with NULL variable \22%s\22\0A\00"
define void @strnullchecks(i8* readnone %0, i8* %1, i8* %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %1)
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ RC4_KEY;

/* Variables and functions */
int /*<<< orphan*/ RC4(int /*<<< orphan*/ *, unsigned long, unsigned char *,
                       unsigned char *);
int /*<<< orphan*/ RC4_set_key(int /*<<< orphan*/ *, long, unsigned char *);
unsigned char *calloc(int, int);
unsigned char *rc4_crypt(long message_length, unsigned char *message,
                         long key_length, unsigned char *key) {
  RC4_KEY rc4_key;
  RC4_set_key(&rc4_key, key_length, key);
  unsigned char *output = calloc(1, sizeof(char) * message_length);
  RC4(&rc4_key, (unsigned long)message_length, message, output);
  return output;
}


x86 assembly (clang, -O0):
<rc4_crypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x24(%rbp),%rdi
call   1050 <RC4_set_key@plt>
mov    -0x8(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%esi
mov    $0x1,%edi
call   1040 <calloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x30(%rbp),%rcx
lea    -0x24(%rbp),%rdi
call   1030 <RC4@plt>
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rc4_crypt>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
lea    0x4(%rsp),%r15
mov    %r15,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
call   1050 <RC4_set_key@plt>
mov    $0x1,%edi
mov    %r12d,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
mov    %rax,%rcx
call   1030 <RC4@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @rc4_crypt(i64 %0, i8* %1, i64 %2, i8* %3) {
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i64 %0, i64* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i8* %3, i8** %8
%11 = load i64, i64* %7
%12 = load i8*, i8** %8
%13 = call i32 @RC4_set_key(i32* %9, i64 %11, i8* %12)
%14 = load i64, i64* %5
%15 = mul i64 1, %14
%16 = trunc i64 %15 to i32
%17 = call i8* @calloc(i32 1, i32 %16)
store i8* %17, i8** %10
%18 = load i64, i64* %5
%19 = load i8*, i8** %6
%20 = load i8*, i8** %10
%21 = call i32 @RC4(i32* %9, i64 %18, i8* %19, i8* %20)
%22 = load i8*, i8** %10
ret i8* %22
}

LLVM IR (-O2):
define i8* @rc4_crypt(i64 %0, i8* %1, i64 %2, i8* %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
%7 = call i32 @RC4_set_key(i32* %5, i64 %2, i8* %3)
%8 = trunc i64 %0 to i32
%9 = call i8* @calloc(i32 1, i32 %8)
%10 = call i32 @RC4(i32* %5, i64 %0, i8* %1, i8* %9)
ret i8* %9
}