xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ addch(char);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ mvprintw(int, int, char *);
int /*<<< orphan*/ stdscr;
int main() {
  int maxx, maxy;
  initscr();
  getmaxyx(stdscr, maxy, maxx);
  mvprintw(maxy / 2, (maxx - 14) / 2, "Hello World!!!");
  addch('a');
  getch();
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <initscr@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1040 <getmaxyx@plt>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x8(%rbp),%eax
sub    $0xe,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe52(%rip),%rdx
call   1080 <mvprintw@plt>
mov    $0x61,%edi
call   1050 <addch@plt>
mov    $0x0,%al
call   1060 <getch@plt>
mov    $0x0,%al
call   1070 <endwin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1040 <getmaxyx@plt>
lea    0xe83(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
call   1080 <mvprintw@plt>
mov    $0x61,%edi
call   1050 <addch@plt>
xor    %eax,%eax
call   1060 <getch@plt>
xor    %eax,%eax
call   1070 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdscr = global i32 0
@.str = [15 x i8] c"Hello World!!!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @initscr()
%5 = load i32, i32* @stdscr
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = call i32 @getmaxyx(i32 %5, i32 %6, i32 %7)
%9 = load i32, i32* %3
%10 = sdiv i32 %9, 2
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 14
%13 = sdiv i32 %12, 2
%14 = call i32 @mvprintw(i32 %10, i32 %13, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @addch(i8 signext 97)
%16 = call i32 (...) @getch()
%17 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@stdscr = global i32 0
@.str = [15 x i8] c"Hello World!!!\00"
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = load i32, i32* @stdscr
%3 = tail call i32 @getmaxyx(i32 %2, i32 undef, i32 undef)
%4 = tail call i32 @mvprintw(i32 0, i32 0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @addch(i8 signext 97)
%6 = tail call i32 (...) @getch()
%7 = tail call i32 (...) @endwin()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t big_endian_htonll(uint64_t value) { return value; }


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

x86 assembly (clang, -O2):
<big_endian_htonll>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @big_endian_htonll(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ say(char *, int);
void hit(void) { say("Eat it smelly bottles!", 1); }


x86 assembly (clang, -O0):
<hit>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <say@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"Eat it smelly bottles!\00"
define void @hit() {
%1 = call i32 @say(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Eat it smelly bottles!\00"
define void @hit() {
%1 = tail call i32 @say(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unimplemented();
void sigi(void) { unimplemented(); }


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

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

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

LLVM IR (-O2):
define void @sigi() {
%1 = tail call i32 (...) @unimplemented()
ret void
}
int fun_a_int_so(int x[], int y[]) { return 20 + x[0] + y[0]; }


x86 assembly (clang, -O0):
<fun_a_int_so>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x14,%eax
mov    -0x10(%rbp),%rcx
add    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_a_int_so>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
add    %ecx,%eax
add    $0x14,%eax
ret

LLVM IR (-O0):
define i32 @fun_a_int_so(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 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = add nsw i32 20, %7
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = add nsw i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @fun_a_int_so(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %3, 20
%5 = load i32, i32* %1
%6 = add nsw i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ CheckRunningInMainThread(char *);
int DoXOPAlert(int, char const *, char const *);
int XOPYesNoCancelAlert(const char *title, const char *message) {
  if (!CheckRunningInMainThread("XOPYesNoCancelAlert"))
    return -1;
  return DoXOPAlert(1506, title, message);
}


x86 assembly (clang, -O0):
<XOPYesNoCancelAlert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <CheckRunningInMainThread@plt>
cmp    $0x0,%eax
jne    1151 <XOPYesNoCancelAlert+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1166 <XOPYesNoCancelAlert+0x46>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x5e2,%edi
call   1040 <DoXOPAlert@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XOPYesNoCancelAlert>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1030 <CheckRunningInMainThread@plt>
test   %eax,%eax
je     1151 <XOPYesNoCancelAlert+0x31>
mov    $0x5e2,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <DoXOPAlert@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"XOPYesNoCancelAlert\00"
define i32 @XOPYesNoCancelAlert(i8* %0, i8* %1) {
%3 = tail call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @DoXOPAlert(i32 1506, i8* %0, i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void display_usage(void) {
  printf("sp-noncached reads and writes files without keeping data\n"
         "cached to avoid 'poisoning' kernel page cache.\n"
         "  sp-noncached -(r|w) <file1> [<file2>...]\n"
         "Where:\n"
         "  <options>:\n"
         "    -w (--write)  writes standard input into file <file1>.\n"
         "    -r (--read)   reads files <file1>, <file2>... into standard "
         "output.\n"
         "    -h (--help)   this help page.\n");
}


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

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

LLVM IR (-O0):
@.str = [333 x i8] c"sp-noncached reads and writes files without keeping data\0Acached to avoid 'poisoning' kernel page cache.\0A sp-noncached -(r|w) <file1> [<file2>...]\0AWhere:\0A <options>:\0A -w (--write) writes standard input into file <file1>.\0A -r (--read) reads files <file1>, <file2>... into standard output.\0A -h (--help) this help page.\0A\00"
define void @display_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([333 x i8], [333 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [332 x i8] c"sp-noncached reads and writes files without keeping data\0Acached to avoid 'poisoning' kernel page cache.\0A sp-noncached -(r|w) <file1> [<file2>...]\0AWhere:\0A <options>:\0A -w (--write) writes standard input into file <file1>.\0A -r (--read) reads files <file1>, <file2>... into standard output.\0A -h (--help) this help page.\00"
define void @display_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([332 x i8], [332 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Oscar();
int main() {
  int i;
  for (i = 0; i < 2; i++)
    Oscar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1145 <main+0x35>
mov    $0x0,%al
call   1030 <Oscar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @Oscar()
%2 = tail call i32 (...) @Oscar()
ret i32 0
}
void NETresume() {}


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

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

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

LLVM IR (-O2):
define void @NETresume() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void setclock(bool high) {
  if (high)
    (*(volatile uint8_t *)((0x500A))) |= (1 << 5);
  else
    (*(volatile uint8_t *)((0x500A))) &= ~(1 << 5);
}


x86 assembly (clang, -O0):
<setclock>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1127 <setclock+0x27>
mov    $0x500a,%eax
mov    (%rax),%ecx
or     $0x20,%ecx
mov    $0x500a,%eax
mov    %ecx,(%rax)
jmp    1138 <setclock+0x38>
mov    $0x500a,%eax
mov    (%rax),%ecx
and    $0xffffffdf,%ecx
mov    $0x500a,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setclock>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
mov    0x500a,%ecx
and    $0xffffffdf,%ecx
shl    $0x5,%eax
or     %ecx,%eax
mov    %eax,0x500a
ret

LLVM IR (-O0):
define void @setclock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 20490 to i32*)
%7 = or i32 %6, 32
store volatile i32 %7, i32* inttoptr (i64 20490 to i32*)
br label %11
8: ; preds = %1
%9 = load volatile i32, i32* inttoptr (i64 20490 to i32*)
%10 = and i32 %9, -33
store volatile i32 %10, i32* inttoptr (i64 20490 to i32*)
br label %11
11: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
define void @setclock(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = load volatile i32, i32* inttoptr (i64 20490 to i32*)
%4 = and i32 %3, -33
%5 = select i1 %2, i32 0, i32 32
%6 = or i32 %4, %5
store volatile i32 %6, i32* inttoptr (i64 20490 to i32*)
ret void
}
void freecon(char *con __attribute__((__unused__))) {}


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

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

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

LLVM IR (-O2):
define void @freecon(i8* nocapture %0) {
ret void
}
void jit_code_destroy(struct jit_code *unused) {}


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

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

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

LLVM IR (-O2):
%struct.jit_code = type opaque
define void @jit_code_destroy(%struct.jit_code* nocapture %0) {
ret void
}
void sc_submemset(unsigned char *buffer, int data, int offset, int end) {
  int walker;
  for (walker = offset; walker < offset + end; walker++)
    buffer[walker] = data;
}


x86 assembly (clang, -O0):
<sc_submemset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    -0x14(%rbp),%ecx
cmp    %ecx,%eax
jge    1146 <sc_submemset+0x46>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1117 <sc_submemset+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sc_submemset>:
test   %ecx,%ecx
jle    1136 <sc_submemset+0x26>
push   %rax
add    %edx,%ecx
movslq %edx,%rdx
add    %rdx,%rdi
lea    0x1(%rdx),%eax
cmp    %eax,%ecx
cmovle %eax,%ecx
not    %edx
add    %ecx,%edx
add    $0x1,%rdx
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @sc_submemset(i8* nocapture writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %17
6: ; preds = %4
%7 = add i32 %3, %2
%8 = trunc i32 %1 to i8
%9 = sext i32 %2 to i64
%10 = getelementptr i8, i8* %0, i64 %9
%11 = add i32 %2, 1
%12 = call i32 @llvm.smax.i32(i32 %7, i32 %11)
%13 = xor i32 %2, -1
%14 = add i32 %12, %13
%15 = zext i32 %14 to i64
%16 = add nuw nsw i64 %15, 1
br label %17
17: ; preds = %6, %4
ret void
}
/* Variables and functions */
unsigned char c2c(unsigned char);
__attribute__((__visibility__("default"))) __attribute__((used)) unsigned char
rc2c(unsigned char *x) {
  return c2c(*x);
}


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

x86 assembly (clang, -O2):
<rc2c>:
movzbl (%rdi),%edi
jmp    1030 <c2c@plt>

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i8 (i8*)* @rc2c to i8*)], section "llvm.metadata"
define zeroext i8 @rc2c(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = call zeroext i8 @c2c(i8 zeroext %4)
ret i8 %5
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i8 (i8*)* @rc2c to i8*)], section "llvm.metadata"
define zeroext i8 @rc2c(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call zeroext i8 @c2c(i8 zeroext %2)
ret i8 %3
}
/* Variables and functions */
int strlen(char *);
void getVMOutputFileName(char *string) {
  int length;
  length = strlen(string);
  string[length - 4] = 'v';
  string[length - 3] = 'm';
  string[length - 2] = '\0';
}


x86 assembly (clang, -O0):
<getVMOutputFileName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x4,%ecx
movslq %ecx,%rcx
movb   $0x76,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x3,%ecx
movslq %ecx,%rcx
movb   $0x6d,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getVMOutputFileName>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
movw   $0x6d76,-0x4(%rax,%rbx,1)
movb   $0x0,-0x2(%rax,%rbx,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @getVMOutputFileName(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
store i8 118, i8* %10
%11 = load i8*, i8** %2
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
store i8 109, i8* %15
%16 = load i8*, i8** %2
%17 = load i32, i32* %3
%18 = sub nsw i32 %17, 2
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %16, i64 %19
store i8 0, i8* %20
ret void
}

LLVM IR (-O2):
define void @getVMOutputFileName(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -4
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 118, i8* %5
%6 = add nsw i32 %2, -3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 109, i8* %8
%9 = add nsw i32 %2, -2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 0, i8* %11
ret void
}
void ReportNativeStackUsage() {}


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

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

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

LLVM IR (-O2):
define void @ReportNativeStackUsage() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
uint32_t UARTModemStatusGet(uint32_t ui32Base) {
  ASSERT(ui32Base == 0x4000D000);
  return ((*((volatile uint32_t *)(ui32Base + 0x00000018))) &
          (0x00000100 | 0x00000004 | 0x00000001 | 0x00000002));
}


x86 assembly (clang, -O0):
<UARTModemStatusGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x4000d000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x18,%eax
cltq
mov    (%rax),%eax
and    $0x107,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTModemStatusGet>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x4000d000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rcx
mov    $0x107,%eax
and    0x18(%rcx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @UARTModemStatusGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1073795072
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 24
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, 263
ret i32 %12
}

LLVM IR (-O2):
define i32 @UARTModemStatusGet(i32 %0) {
%2 = icmp eq i32 %0, 1073795072
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 24
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, 263
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ drawLine(int, int, int, int);
void drawTriangle(int x1, int y1, int x2, int y2, int x3, int y3) {
  drawLine(x1, y1, x2, y2);
  drawLine(x2, y2, x3, y3);
  drawLine(x3, y3, x1, y1);
  return;
}


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

x86 assembly (clang, -O2):
<drawTriangle>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r14d
mov    %r8d,%r15d
mov    %ecx,%ebx
mov    %edx,%ebp
mov    %esi,%r12d
mov    %edi,%r13d
call   1030 <drawLine@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r15d,%edx
mov    %r14d,%ecx
call   1030 <drawLine@plt>
mov    %r15d,%edi
mov    %r14d,%esi
mov    %r13d,%edx
mov    %r12d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <drawLine@plt>

LLVM IR (-O0):
define void @drawTriangle(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = call i32 @drawLine(i32 %13, i32 %14, i32 %15, i32 %16)
%18 = load i32, i32* %9
%19 = load i32, i32* %10
%20 = load i32, i32* %11
%21 = load i32, i32* %12
%22 = call i32 @drawLine(i32 %18, i32 %19, i32 %20, i32 %21)
%23 = load i32, i32* %11
%24 = load i32, i32* %12
%25 = load i32, i32* %7
%26 = load i32, i32* %8
%27 = call i32 @drawLine(i32 %23, i32 %24, i32 %25, i32 %26)
ret void
}

LLVM IR (-O2):
define void @drawTriangle(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @drawLine(i32 %0, i32 %1, i32 %2, i32 %3)
%8 = tail call i32 @drawLine(i32 %2, i32 %3, i32 %4, i32 %5)
%9 = tail call i32 @drawLine(i32 %4, i32 %5, i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int _sapi_inet_tcp_transmit(int, void *, int);
int sapi_inet_tcp_transmit(int sock, void *data, int datalen) {
  return _sapi_inet_tcp_transmit(sock, data, datalen);
}


x86 assembly (clang, -O0):
<sapi_inet_tcp_transmit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <_sapi_inet_tcp_transmit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sapi_inet_tcp_transmit>:
jmp    1030 <_sapi_inet_tcp_transmit@plt>

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

LLVM IR (-O2):
define i32 @sapi_inet_tcp_transmit(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @_sapi_inet_tcp_transmit(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ arm_memio_ldrsh(int /*<<< orphan*/);
int /*<<< orphan*/ arm_memio_regdh_op();
void arm_ldrsh_reg() { arm_memio_ldrsh(arm_memio_regdh_op()); }


x86 assembly (clang, -O0):
<arm_ldrsh_reg>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <arm_memio_regdh_op@plt>
mov    %eax,%edi
call   1030 <arm_memio_ldrsh@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_ldrsh_reg>:
push   %rax
xor    %eax,%eax
call   1040 <arm_memio_regdh_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <arm_memio_ldrsh@plt>

LLVM IR (-O0):
define void @arm_ldrsh_reg() {
%1 = call i32 (...) @arm_memio_regdh_op()
%2 = call i32 @arm_memio_ldrsh(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_ldrsh_reg() {
%1 = tail call i32 (...) @arm_memio_regdh_op()
%2 = tail call i32 @arm_memio_ldrsh(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
char *corta_string(char *apuntador) {
  if (*(apuntador = apuntador + 1) != '\0') {
    return apuntador;
  }
  printf("Error: Se introdujo un único caracter\n");
  return --apuntador;
}


x86 assembly (clang, -O0):
<corta_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     1145 <corta_string+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1161 <corta_string+0x51>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<corta_string>:
push   %rbx
mov    %rdi,%rbx
cmpb   $0x0,0x1(%rdi)
je     1120 <corta_string+0x10>
add    $0x1,%rbx
jmp    112c <corta_string+0x1c>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Error: Se introdujo un \C3\BAnico caracter\0A\00"
define i8* @corta_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %5, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i8*, i8** %3
store i8* %10, i8** %2
br label %15
11: ; preds = %1
%12 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 -1
store i8* %14, i8** %3
store i8* %14, i8** %2
br label %15
15: ; preds = %11, %9
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
@str = [39 x i8] c"Error: Se introdujo un \C3\BAnico caracter\00"
define i8* @corta_string(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %1, %5
%8 = phi i8* [ %0, %5 ], [ %2, %1 ]
ret i8* %8
}
void ff_hevc_put_hevc_bi_w_qpel_v32_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_v32_8_sse4() {
ret void
}
int test_double_indexed(int index_5__6_) { return index_5__6_; }


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

x86 assembly (clang, -O2):
<test_double_indexed>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @test_double_indexed(i32 returned %0) {
ret i32 %0
}
int main() {
  int x$1 = 20;
  int *xr$1 = (&x$1);
  int y$1 = 30;
  int *yr$1 = (&y$1);
  ((*xr$1) = 15);
  ((*yr$1)++);
  ((*xr$1) += 3);
  printf("%d\n", ((*xr$1) + (*yr$1)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1e,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movl   $0xf,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x3,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rax
add    (%rax),%esi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 49)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void free_tab(int tab[]) {
  if (!tab)
    free(tab);
}


x86 assembly (clang, -O0):
<free_tab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1130 <free_tab+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_tab>:
test   %rdi,%rdi
je     1116 <free_tab+0x6>
ret
xor    %edi,%edi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_tab(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32*, i32** %2
%7 = call i32 @free(i32* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @free_tab(i32* readnone %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @free(i32* null)
br label %5
5: ; preds = %3, %1
ret void
}
int psf_isprint(int ch) { return (ch >= ' ' && ch <= '~'); }


x86 assembly (clang, -O0):
<psf_isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <psf_isprint+0x20>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<psf_isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @psf_isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 126
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @psf_isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *strrchr(char const *, char);
char *basename(const char *filename) {
  char *slash = strrchr(filename, '/');
  char *backslash = strrchr(filename, '\\');
  if (slash > backslash)
    return slash + 1;
  else if (backslash != NULL)
    return backslash + 1;
  else
    return (char *)filename;
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jbe    115f <basename+0x4f>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1183 <basename+0x73>
cmpq   $0x0,-0x20(%rbp)
je     117b <basename+0x6b>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1183 <basename+0x73>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,%r14
mov    %rbx,%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
lea    0x1(%r14),%rdx
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
cmp    %rax,%r14
cmova  %rdx,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i8* @strrchr(i8* %6, i8 signext 47)
store i8* %7, i8** %4
%8 = load i8*, i8** %3
%9 = call i8* @strrchr(i8* %8, i8 signext 92)
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = icmp ugt i8* %10, %11
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8* %15, i8** %2
br label %24
16: ; preds = %1
%17 = load i8*, i8** %5
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i64 1
store i8* %21, i8** %2
br label %24
22: ; preds = %16
%23 = load i8*, i8** %3
store i8* %23, i8** %2
br label %24
24: ; preds = %22, %19, %13
%25 = load i8*, i8** %2
ret i8* %25
}

LLVM IR (-O2):
define i8* @basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 92)
%4 = icmp ugt i8* %2, %3
%5 = getelementptr inbounds i8, i8* %2, i64 1
%6 = icmp eq i8* %3, null
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = select i1 %6, i8* %0, i8* %7
%9 = select i1 %4, i8* %5, i8* %8
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_wsrp(char *, void *);
void wsrp_3(void *v) { __builtin_arm_wsrp("0:1:2", v); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"0:1:2\00"
define void @wsrp_3(i8* %0) {
%2 = tail call i32 @__builtin_arm_wsrp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_setscope(int /*<<< orphan*/ *, int);
int my_pthread_attr_setscope(pthread_attr_t *__attr, int scope) {
  pthread_attr_t *realattr = (pthread_attr_t *)*(unsigned int *)__attr;
  return pthread_attr_setscope(realattr, scope);
}


x86 assembly (clang, -O0):
<my_pthread_attr_setscope>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <pthread_attr_setscope@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pthread_attr_setscope>:
mov    (%rdi),%edi
jmp    1030 <pthread_attr_setscope@plt>

LLVM IR (-O0):
define i32 @my_pthread_attr_setscope(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %5
%10 = load i32*, i32** %5
%11 = load i32, i32* %4
%12 = call i32 @pthread_attr_setscope(i32* %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @my_pthread_attr_setscope(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 @pthread_attr_setscope(i32* %5, i32 %1)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ setAdsr(int /*<<< orphan*/, int, int, int, int);
int /*<<< orphan*/ setFrequency(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ startTriangle(int /*<<< orphan*/);
void startTone(uint8_t voice, uint8_t freqIndex) {
  setFrequency(voice, freqIndex);
  setAdsr(voice, 2, 1, 15, 1);
  startTriangle(voice);
}


x86 assembly (clang, -O0):
<startTone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <setFrequency@plt>
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
mov    $0x1,%r8d
mov    $0xf,%ecx
mov    %r8d,%edx
call   1030 <setAdsr@plt>
mov    -0x4(%rbp),%edi
call   1050 <startTriangle@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startTone>:
push   %rbx
mov    %edi,%ebx
call   1040 <setFrequency@plt>
mov    %ebx,%edi
mov    $0x2,%esi
mov    $0x1,%edx
mov    $0xf,%ecx
mov    $0x1,%r8d
call   1030 <setAdsr@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <startTriangle@plt>

LLVM IR (-O0):
define void @startTone(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 @setFrequency(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @setAdsr(i32 %8, i32 2, i32 1, i32 15, i32 1)
%10 = load i32, i32* %3
%11 = call i32 @startTriangle(i32 %10)
ret void
}

LLVM IR (-O2):
define void @startTone(i32 %0, i32 %1) {
%3 = tail call i32 @setFrequency(i32 %0, i32 %1)
%4 = tail call i32 @setAdsr(i32 %0, i32 2, i32 1, i32 15, i32 1)
%5 = tail call i32 @startTriangle(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void sig_handler(int signum) {
  printf("in handler\n");
  sleep(1);
  printf("handler return\n");
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"in handler\0A\00"
@.str.1 = [16 x i8] c"handler return\0A\00"
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @sleep(i32 1)
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [11 x i8] c"in handler\00"
@str.2 = [15 x i8] c"handler return\00"
define void @sig_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.2, i64 0, i64 0))
ret void
}
void i2d_X509_VAL(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_X509_VAL() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initialize(int, int);
void changeSize(int w, int h) {
  if (h == 0)
    h = 1;
  initialize(w, h);
}


x86 assembly (clang, -O0):
<changeSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    112f <changeSize+0x1f>
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <initialize@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<changeSize>:
test   %esi,%esi
mov    $0x1,%eax
cmove  %eax,%esi
jmp    1030 <initialize@plt>

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

LLVM IR (-O2):
define void @changeSize(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 1, i32 %1
%5 = tail call i32 @initialize(i32 %0, i32 %4)
ret void
}
/* Variables and functions */
int transl_chr(unsigned int, int);
int transl_escseq(char const *, int);
int transl_input(const unsigned char *input, int flags) {
  unsigned c = *input;
  if (c == '\033')
    return transl_escseq((const char *)input + 1, flags);
  return transl_chr(c, flags);
}


x86 assembly (clang, -O0):
<transl_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x1b,-0x18(%rbp)
jne    115b <transl_input+0x3b>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x14(%rbp),%esi
call   1040 <transl_escseq@plt>
mov    %eax,-0x4(%rbp)
jmp    1169 <transl_input+0x49>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <transl_chr@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<transl_input>:
movzbl (%rdi),%eax
cmp    $0x1b,%eax
jne    1131 <transl_input+0x11>
add    $0x1,%rdi
jmp    1040 <transl_escseq@plt>
mov    %eax,%edi
jmp    1030 <transl_chr@plt>

LLVM IR (-O0):
define i32 @transl_input(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, 27
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i32, i32* %5
%16 = call i32 @transl_escseq(i8* %14, i32 %15)
store i32 %16, i32* %3
br label %21
17: ; preds = %2
%18 = load i32, i32* %6
%19 = load i32, i32* %5
%20 = call i32 @transl_chr(i32 %18, i32 %19)
store i32 %20, i32* %3
br label %21
21: ; preds = %17, %12
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @transl_input(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 27
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = tail call i32 @transl_escseq(i8* %6, i32 %1)
br label %11
8: ; preds = %2
%9 = zext i8 %3 to i32
%10 = tail call i32 @transl_chr(i32 %9, i32 %1)
br label %11
11: ; preds = %8, %5
%12 = phi i32 [ %7, %5 ], [ %10, %8 ]
ret i32 %12
}
/* Variables and functions */
int ctz1(unsigned long long);
void f(unsigned long long x, int *p) {
  if (x != 0) {
    int a = ctz1(x);
    *p = a | p[a];
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114b <f+0x3b>
mov    -0x8(%rbp),%rdi
call   1030 <ctz1@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rdx
or     (%rax,%rdx,4),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
test   %rdi,%rdi
je     1128 <f+0x18>
push   %rbx
mov    %rsi,%rbx
call   1030 <ctz1@plt>
cltq
mov    (%rbx,%rax,4),%ecx
or     %eax,%ecx
mov    %ecx,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @f(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
%5 = alloca i32
store i64 %0, i64* %3
store i32* %1, i32** %4
%6 = load i64, i64* %3
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %2
%9 = load i64, i64* %3
%10 = call i32 @ctz1(i64 %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = or i32 %11, %16
%18 = load i32*, i32** %4
store i32 %17, i32* %18
br label %19
19: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
define void @f(i64 %0, i32* nocapture %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = tail call i32 @ctz1(i64 %0)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %1, i64 %6
%8 = load i32, i32* %7
%9 = or i32 %8, %5
store i32 %9, i32* %1
br label %10
10: ; preds = %4, %2
ret void
}