xunge/DecIR huggingface dataset:
int fn_1(int flag) {
  int foo = 4, bar = 5;
  if (flag)
    foo = 3;
  bar = 2;
  return foo * bar;
}


x86 assembly (clang, -O0):
<fn_1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1126 <fn_1+0x26>
movl   $0x3,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_1>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
add    %eax,%eax
add    $0x6,%eax
ret

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

LLVM IR (-O2):
define i32 @fn_1(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 8, i32 6
ret i32 %3
}
/* Variables and functions */
unsigned short ina_read(int, int);
int ina_status(unsigned short status) {
  return (ina_read(0x80, 0x01) & status);
}


x86 assembly (clang, -O0):
<ina_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x80,%edi
mov    $0x1,%esi
call   1030 <ina_read@plt>
movzwl %ax,%eax
movzwl -0x2(%rbp),%ecx
and    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ina_status>:
push   %rbx
mov    %edi,%ebx
mov    $0x80,%edi
mov    $0x1,%esi
call   1030 <ina_read@plt>
and    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ina_status(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = call zeroext i16 @ina_read(i32 128, i32 1)
%4 = zext i16 %3 to i32
%5 = load i16, i16* %2
%6 = zext i16 %5 to i32
%7 = and i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @ina_status(i16 zeroext %0) {
%2 = tail call zeroext i16 @ina_read(i32 128, i32 1)
%3 = and i16 %2, %0
%4 = zext i16 %3 to i32
ret i32 %4
}
int isdigit(int c) { return c >= '0' || c <= '9'; }


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jge    1120 <isdigit+0x20>
cmpl   $0x39,-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):
<isdigit>:
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int, int);
void main() {
  int a = 100, *pa;
  pa = &a;
  printf("a=%d, *pa=%d\n", a, *pa);
  a = 200;
  printf("a=%d, *pa=%d\n", a, *pa);
  *pa = 300;
  printf("a=%d, *pa=%d\n", a, *pa);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x64,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
movl   $0xc8,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movl   $0x12c,(%rax)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
mov    $0x64,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xc8,%esi
mov    $0xc8,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x12c,%esi
mov    $0x12c,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <getchar@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"a=%d, *pa=%d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 100, i32 100)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 200, i32 200)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 300, i32 300)
%4 = tail call i32 (...) @getchar()
ret void
}
/* Variables and functions */
size_t strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *xmalloc(size_t);
char *dupstr(const char *string) {
  char *dup;
  size_t len;
  len = strlen(string);
  dup = xmalloc(len + 1);
  strncpy(dup, string, len);
  dup[len] = '\0';
  return dup;
}


x86 assembly (clang, -O0):
<dupstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1050 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dupstr>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @dupstr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = add i64 %7, 1
%9 = call i8* @xmalloc(i64 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = load i64, i64* %4
%13 = call i32 @strncpy(i8* %10, i8* %11, i64 %12)
%14 = load i8*, i8** %3
%15 = load i64, i64* %4
%16 = getelementptr inbounds i8, i8* %14, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
define i8* @dupstr(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @xmalloc(i64 %3)
%5 = tail call i32 @strncpy(i8* %4, i8* %0, i64 %2)
%6 = getelementptr inbounds i8, i8* %4, i64 %2
store i8 0, i8* %6
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void endl(void) { printf("\n"); }


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

x86 assembly (clang, -O2):
<endl>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @endl() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
scalar_t__ input_parser_fuzzer(int);
int main(int argc, char **argv) {
  int failure_count = 0;
  failure_count += input_parser_fuzzer(1000);
  return failure_count;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x3e8,%edi
call   1030 <input_parser_fuzzer@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x3e8,%edi
jmp    1030 <input_parser_fuzzer@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = call i64 @input_parser_fuzzer(i32 1000)
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = add nsw i64 %9, %7
%11 = trunc i64 %10 to i32
store i32 %11, i32* %6
%12 = load i32, i32* %6
ret i32 %12
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @input_parser_fuzzer(i32 1000)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Fatal(int, int, char *);
void memstat_check() { Fatal(1, 1, "memstat check on unsupported machine"); }


x86 assembly (clang, -O0):
<memstat_check>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
lea    0xee0(%rip),%rdx
mov    %esi,%edi
call   1030 <Fatal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<memstat_check>:
lea    0xee9(%rip),%rdx
mov    $0x1,%edi
mov    $0x1,%esi
jmp    1030 <Fatal@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"memstat check on unsupported machine\00"
define void @memstat_check() {
%1 = call i32 @Fatal(i32 1, i32 1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"memstat check on unsupported machine\00"
define void @memstat_check() {
%1 = tail call i32 @Fatal(i32 1, i32 1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: test_zombify <target_pid>\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Usage: test_zombify <target_pid>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [33 x i8] c"Usage: test_zombify <target_pid>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
extern unsigned char __inb_p(unsigned short port) {
  unsigned char _v;
  __asm__ __volatile__("in"
                       "b"
                       " %"
                       "w"
                       "1,%"
                       ""
                       "0"
                       : "=a"(_v)
                       : "d"(port));
  __asm__ __volatile__("outb %al,$0x80");
  return _v;
}


x86 assembly (clang, -O0):
<__inb_p>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
out    %al,$0x80
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__inb_p>:
mov    %edi,%edx
in     (%dx),%al
out    %al,$0x80
ret

LLVM IR (-O0):
define zeroext i8 @__inb_p(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb ${1:w},$0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @__inb_p(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb ${1:w},$0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
tail call void asm sideeffect "outb %al,$$0x80", "~{dirflag},~{fpsr},~{flags}"()
ret i8 %2
}
/* Variables and functions */
int grid_check(int **, int, int, int);
int square_check(int **, int, int, int);
int check_all(int **grid, int x, int y, int p) {
  int check;
  check = grid_check(grid, x, y, p);
  if (!check)
    return (0);
  return (square_check(grid, x, y, p));
}


x86 assembly (clang, -O0):
<check_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
call   1040 <grid_check@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    1160 <check_all+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1175 <check_all+0x55>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
call   1030 <square_check@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_all>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %rdi,%rbp
call   1040 <grid_check@plt>
test   %eax,%eax
je     1155 <check_all+0x35>
mov    %rbp,%rdi
mov    %ebx,%esi
mov    %r15d,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <square_check@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @check_all(i32** %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @grid_check(i32** %0, i32 %1, i32 %2, i32 %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @square_check(i32** %0, i32 %1, i32 %2, i32 %3)
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ %8, %7 ], [ 0, %4 ]
ret i32 %10
}
unsigned char C_Utils_max_byte(const unsigned char item1,
                               const unsigned char item2) {
  return item1 > item2 ? item1 : item2;
}


x86 assembly (clang, -O0):
<C_Utils_max_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jle    112c <C_Utils_max_byte+0x2c>
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <C_Utils_max_byte+0x33>
movzbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_Utils_max_byte>:
mov    %esi,%eax
cmp    %al,%dil
cmova  %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @C_Utils_max_byte(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = icmp sgt i32 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
br label %16
13: ; preds = %2
%14 = load i8, i8* %4
%15 = zext i8 %14 to i32
br label %16
16: ; preds = %13, %10
%17 = phi i32 [ %12, %10 ], [ %15, %13 ]
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @C_Utils_max_byte(i8 zeroext %0, i8 zeroext %1) {
%3 = icmp ugt i8 %0, %1
%4 = select i1 %3, i8 %0, i8 %1
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ VL_ScreenRect(int, int, int, int, int);
void VH_Bar(int x, int y, int w, int h, int colour) {
  VL_ScreenRect(x, y, w, h, colour);
}


x86 assembly (clang, -O0):
<VH_Bar>:
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    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   1030 <VL_ScreenRect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VH_Bar>:
jmp    1030 <VL_ScreenRect@plt>

LLVM IR (-O0):
define void @VH_Bar(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @VL_ScreenRect(i32 %11, i32 %12, i32 %13, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
define void @VH_Bar(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @VL_ScreenRect(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4)
ret void
}
/* Type definitions */
struct sk_buff {
  int dummy;
};

/* Variables and functions */
int skb_checksum_help(struct sk_buff *, int /*<<< orphan*/);
int skb_checksum_help_to_2_6_18(struct sk_buff *skb) {
  return skb_checksum_help(skb, 0);
}


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

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

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

LLVM IR (-O2):
%struct.sk_buff = type { i32 }
define i32 @skb_checksum_help_to_2_6_18(%struct.sk_buff* %0) {
%2 = tail call i32 @skb_checksum_help(%struct.sk_buff* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ syscall_addr_safe(void *);
int ioctl_arg_ok(void *addr, size_t sz) {
  if (syscall_addr_safe(addr) || syscall_addr_safe(addr + sz - 1))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ioctl_arg_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <syscall_addr_safe@plt>
cmp    $0x0,%rax
jne    114e <ioctl_arg_ok+0x3e>
mov    -0x10(%rbp),%rdi
add    -0x18(%rbp),%rdi
add    $0xffffffffffffffff,%rdi
call   1030 <syscall_addr_safe@plt>
cmp    $0x0,%rax
je     115a <ioctl_arg_ok+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1161 <ioctl_arg_ok+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ioctl_arg_ok>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <syscall_addr_safe@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1144 <ioctl_arg_ok+0x34>
lea    (%rbx,%r14,1),%rdi
add    $0xffffffffffffffff,%rdi
call   1030 <syscall_addr_safe@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @ioctl_arg_ok(i8* %0, i64 %1) {
%3 = tail call i64 @syscall_addr_safe(i8* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = getelementptr i8, i8* %0, i64 %1
%7 = getelementptr i8, i8* %6, i64 -1
%8 = tail call i64 @syscall_addr_safe(i8* %7)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %5, %2
%12 = phi i32 [ 1, %2 ], [ %10, %5 ]
ret i32 %12
}
/* Variables and functions */
int strcmp(char *, char *);
int compare(char *one, char *two) { return strcmp(one, two); }


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

x86 assembly (clang, -O2):
<compare>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
void CFGMR3InsertSubTree(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3InsertSubTree() {
ret void
}
int ft_isletter(char c) {
  return ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
}


x86 assembly (clang, -O0):
<ft_isletter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <ft_isletter+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    114e <ft_isletter+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <ft_isletter+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isletter>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isletter(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %20, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %6
%21 = phi i1 [ true, %6 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @ft_isletter(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef size_t uint16_t;

/* Variables and functions */
uint16_t us_bits_get_doublet(const void *base, uint16_t offset) {
  const uint8_t *data = (const uint8_t *)base;
  return ((((uint16_t)(data[offset])) << 8) |
          (((uint16_t)(data[offset + 1])) << 0));
}


x86 assembly (clang, -O0):
<us_bits_get_doublet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
shl    $0x8,%rax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rdx
mov    0x8(%rcx,%rdx,8),%rcx
shl    $0x0,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<us_bits_get_doublet>:
mov    (%rdi,%rsi,8),%rax
shl    $0x8,%rax
or     0x8(%rdi,%rsi,8),%rax
ret

LLVM IR (-O0):
define i64 @us_bits_get_doublet(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i64*
store i64* %7, i64** %5
%8 = load i64*, i64** %5
%9 = load i64, i64* %4
%10 = getelementptr inbounds i64, i64* %8, i64 %9
%11 = load i64, i64* %10
%12 = shl i64 %11, 8
%13 = load i64*, i64** %5
%14 = load i64, i64* %4
%15 = add i64 %14, 1
%16 = getelementptr inbounds i64, i64* %13, i64 %15
%17 = load i64, i64* %16
%18 = shl i64 %17, 0
%19 = or i64 %12, %18
ret i64 %19
}

LLVM IR (-O2):
define i64 @us_bits_get_doublet(i8* nocapture %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
%4 = getelementptr inbounds i64, i64* %3, i64 %1
%5 = load i64, i64* %4
%6 = shl i64 %5, 8
%7 = add i64 %1, 1
%8 = getelementptr inbounds i64, i64* %3, i64 %7
%9 = load i64, i64* %8
%10 = or i64 %6, %9
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ event_del(void *, int /*<<< orphan*/);
void event_del_all(void *data) { event_del(data, 0); }


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

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

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

LLVM IR (-O2):
define void @event_del_all(i8* %0) {
%2 = tail call i32 @event_del(i8* %0, i32 0)
ret void
}
unsigned int fixunsdfsi(double d) { return d; }


x86 assembly (clang, -O0):
<fixunsdfsi>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixunsdfsi>:
cvttsd2si %xmm0,%rax
ret

LLVM IR (-O0):
define i32 @fixunsdfsi(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptoui double %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @fixunsdfsi(double %0) {
%2 = fptoui double %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void printchr(int ch) {
  char c = ch;
  write(1, &c, 1);
}


x86 assembly (clang, -O0):
<printchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
mov    $0x1,%edx
lea    -0x5(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printchr>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @printchr(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = call i32 @write(i32 1, i8* %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Ansi2Ucs2(char *);
int AtomTypeW(int /*<<< orphan*/);
int AtomType(char *lpString) { return AtomTypeW(Ansi2Ucs2(lpString)); }


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

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

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

LLVM IR (-O2):
define i32 @AtomType(i8* %0) {
%2 = tail call i32 @Ansi2Ucs2(i8* %0)
%3 = tail call i32 @AtomTypeW(i32 %2)
ret i32 %3
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *strdup(const char *src) {
  size_t len = strlen(src) + 1;
  char *ret;
  ret = malloc(len);
  if (ret)
    memcpy(ret, src, len);
  return ret;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1177 <strdup+0x47>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <strdup+0x31>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %18
13: ; preds = %1
%14 = load i8*, i8** %4
%15 = load i8*, i8** %2
%16 = load i64, i64* %3
%17 = call i32 @memcpy(i8* %14, i8* %15, i64 %16)
br label %18
18: ; preds = %13, %1
%19 = load i8*, i8** %4
ret i8* %19
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ begin_time();
uint64_t benchmark_begin(void) { return begin_time(); }


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

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

LLVM IR (-O0):
define i32 @benchmark_begin() {
%1 = call i32 (...) @begin_time()
ret i32 %1
}

LLVM IR (-O2):
define i32 @benchmark_begin() {
%1 = tail call i32 (...) @begin_time()
ret i32 %1
}
int log2f(int value) {
  unsigned int r = 0;
  __asm__ volatile("bsfl %1, %0\n\t"
                   "jnz 1f\n\t"
                   "movl $-1, %0\n\t"
                   "1:\n\t"
                   : "=r"(r)
                   : "r"(value));
  return r;
}


x86 assembly (clang, -O0):
<log2f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
bsf    %eax,%eax
jne    111f <log2f+0x1f>
mov    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2f>:
bsf    %edi,%eax
jne    110a <log2f+0xa>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @log2f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 asm sideeffect "bsfl $1, $0\0A\09jnz 1f\0A\09movl $$-1, $0\0A\091:\0A\09", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @log2f(i32 %0) {
%2 = tail call i32 asm sideeffect "bsfl $1, $0\0A\09jnz 1f\0A\09movl $$-1, $0\0A\091:\0A\09", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ COND_GE();
int /*<<< orphan*/ EA_A7_PI_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_sge_8_pi7(void) {
  m68ki_write_8(EA_A7_PI_8(), COND_GE() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_sge_8_pi7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_A7_PI_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_GE@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sge_8_pi7>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_A7_PI_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_GE@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sge_8_pi7() {
%1 = call i32 (...) @EA_A7_PI_8()
%2 = call i64 (...) @COND_GE()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sge_8_pi7() {
%1 = tail call i32 (...) @EA_A7_PI_8()
%2 = tail call i64 (...) @COND_GE()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Type definitions */
struct fb_info {
  int dummy;
};
struct fb_copyarea {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sys_copyarea(struct fb_info *, struct fb_copyarea const *);
void wmt_ge_copyarea(struct fb_info *p, const struct fb_copyarea *area) {
  sys_copyarea(p, area);
}


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

x86 assembly (clang, -O2):
<wmt_ge_copyarea>:
jmp    1030 <sys_copyarea@plt>

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

LLVM IR (-O2):
%struct.fb_info = type { i32 }
%struct.fb_copyarea = type { i32 }
define void @wmt_ge_copyarea(%struct.fb_info* %0, %struct.fb_copyarea* %1) {
%3 = tail call i32 @sys_copyarea(%struct.fb_info* %0, %struct.fb_copyarea* %1)
ret void
}
void lgtd_jsonrpc_dispatch_request(struct lgtd_client *client, int parsed) {
  (void)client;
  (void)parsed;
}


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

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

LLVM IR (-O0):
%struct.lgtd_client = type opaque
define void @lgtd_jsonrpc_dispatch_request(%struct.lgtd_client* %0, i32 %1) {
%3 = alloca %struct.lgtd_client*
%4 = alloca i32
store %struct.lgtd_client* %0, %struct.lgtd_client** %3
store i32 %1, i32* %4
%5 = load %struct.lgtd_client*, %struct.lgtd_client** %3
%6 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
%struct.lgtd_client = type opaque
define void @lgtd_jsonrpc_dispatch_request(%struct.lgtd_client* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ somethingInFile2();
int main() {
  printf("Doing something in main...\n");
  somethingInFile2();
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [27 x i8] c"Doing something in main...\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @somethingInFile2()
ret i32 0
}
/* Type definitions */
typedef union REGS {
  int dummy;
} REGS;

/* Variables and functions */
int int86(int, union REGS *, union REGS *);
int intdos(union REGS *in, union REGS *out) { return int86(0x21, in, out); }


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

x86 assembly (clang, -O2):
<intdos>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x21,%edi
jmp    1030 <int86@plt>

LLVM IR (-O0):
%union.REGS = type { i32 }
define i32 @intdos(%union.REGS* %0, %union.REGS* %1) {
%3 = alloca %union.REGS*
%4 = alloca %union.REGS*
store %union.REGS* %0, %union.REGS** %3
store %union.REGS* %1, %union.REGS** %4
%5 = load %union.REGS*, %union.REGS** %3
%6 = load %union.REGS*, %union.REGS** %4
%7 = call i32 @int86(i32 33, %union.REGS* %5, %union.REGS* %6)
ret i32 %7
}

LLVM IR (-O2):
%union.REGS = type { i32 }
define i32 @intdos(%union.REGS* %0, %union.REGS* %1) {
%3 = tail call i32 @int86(i32 33, %union.REGS* %0, %union.REGS* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ LCDSendChar(char);
void LCDSendTxt(char *a) {
  char i = 0;
  while (a[i] != '\0') {
    LCDSendChar(a[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<LCDSendTxt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbq -0x9(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1155 <LCDSendTxt+0x45>
mov    -0x8(%rbp),%rax
movsbq -0x9(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <LCDSendChar@plt>
mov    -0x9(%rbp),%al
add    $0x1,%al
mov    %al,-0x9(%rbp)
jmp    1120 <LCDSendTxt+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDSendTxt>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1138 <LCDSendTxt+0x28>
mov    %rdi,%r14
mov    $0x1,%bl
nop
movsbl %al,%edi
call   1030 <LCDSendChar@plt>
movsbq %bl,%rbx
movzbl (%r14,%rbx,1),%eax
add    $0x1,%bl
test   %al,%al
jne    1120 <LCDSendTxt+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @LCDSendTxt(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8 [ %8, %4 ], [ 0, %1 ]
%7 = tail call i32 @LCDSendChar(i8 signext %5)
%8 = add i8 %6, 1
%9 = sext i8 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void destruye_vector(double *v) { free(v); }


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

x86 assembly (clang, -O2):
<destruye_vector>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @destruye_vector(double* nocapture %0) {
%2 = tail call i32 @free(double* %0)
ret void
}
/* Variables and functions */
scalar_t__ strcasecmp(char *, char *);
int _os_strcmp_last(char *pattern, char *str, int str_len, int size) {
  if ((str_len - size) < 0)
    return (0);
  if (strcasecmp(pattern, str + (str_len - size)) == 0)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<_os_strcmp_last>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
sub    -0x20(%rbp),%eax
cmp    $0x0,%eax
jge    1141 <_os_strcmp_last+0x31>
movl   $0x0,-0x4(%rbp)
jmp    1176 <_os_strcmp_last+0x66>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%eax
sub    -0x20(%rbp),%eax
cltq
add    %rax,%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    116f <_os_strcmp_last+0x5f>
movl   $0x1,-0x4(%rbp)
jmp    1176 <_os_strcmp_last+0x66>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_os_strcmp_last>:
sub    %ecx,%edx
js     112f <_os_strcmp_last+0x1f>
push   %rax
mov    %edx,%eax
add    %rax,%rsi
call   1030 <strcasecmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @_os_strcmp_last(i8* nocapture %0, i8* nocapture %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %2, %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %4
%8 = zext i32 %5 to i64
%9 = getelementptr inbounds i8, i8* %1, i64 %8
%10 = tail call i64 @strcasecmp(i8* %0, i8* %9)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %7, %4
%14 = phi i32 [ 0, %4 ], [ %12, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ gp2x_dualcore_pause(int);
void gp2x_940t_pause(int yes) { gp2x_dualcore_pause(yes); }


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

x86 assembly (clang, -O2):
<gp2x_940t_pause>:
jmp    1030 <gp2x_dualcore_pause@plt>

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

LLVM IR (-O2):
define void @gp2x_940t_pause(i32 %0) {
%2 = tail call i32 @gp2x_dualcore_pause(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void assert(int i, int j) {
  if (i != j) {
    printf("assert fail: %d != %d\n", i, j);
  }
}


x86 assembly (clang, -O0):
<assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     113c <assert+0x2c>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert>:
mov    %esi,%edx
cmp    %esi,%edi
jne    1117 <assert+0x7>
ret
mov    %edi,%esi
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"assert fail: %d != %d\0A\00"
define void @assert(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 = icmp ne i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
br label %12
12: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"assert fail: %d != %d\0A\00"
define void @assert(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RotShift_instr(int);
void RL(void) { RotShift_instr(2); }


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

x86 assembly (clang, -O2):
<RL>:
mov    $0x2,%edi
jmp    1030 <RotShift_instr@plt>

LLVM IR (-O0):
define void @RL() {
%1 = call i32 @RotShift_instr(i32 2)
ret void
}

LLVM IR (-O2):
define void @RL() {
%1 = tail call i32 @RotShift_instr(i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void cleanup(void) { system("rm -f /usr/local/wanrouter/wpkbd_lock"); }


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"rm -f /usr/local/wanrouter/wpkbd_lock\00"
define void @cleanup() {
%1 = call i32 @system(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"rm -f /usr/local/wanrouter/wpkbd_lock\00"
define void @cleanup() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
int /*<<< orphan*/ IntDisable(int);
int /*<<< orphan*/ IntUnregister(int);
void FanIntUnregister(unsigned long ulBase) {
  DEBUG_ASSERT(ulBase == 0x40084000);
  IntDisable(130);
  IntUnregister(130);
}


x86 assembly (clang, -O0):
<FanIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x40084000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    $0x82,%edi
call   1030 <IntDisable@plt>
mov    $0x82,%edi
call   1050 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FanIntUnregister>:
push   %rax
xor    %eax,%eax
cmp    $0x40084000,%rdi
sete   %al
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    $0x82,%edi
call   1030 <IntDisable@plt>
mov    $0x82,%edi
pop    %rax
jmp    1050 <IntUnregister@plt>

LLVM IR (-O0):
define void @FanIntUnregister(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1074282496
%5 = zext i1 %4 to i32
%6 = call i32 @DEBUG_ASSERT(i32 %5)
%7 = call i32 @IntDisable(i32 130)
%8 = call i32 @IntUnregister(i32 130)
ret void
}

LLVM IR (-O2):
define void @FanIntUnregister(i64 %0) {
%2 = icmp eq i64 %0, 1074282496
%3 = zext i1 %2 to i32
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = tail call i32 @IntDisable(i32 130)
%6 = tail call i32 @IntUnregister(i32 130)
ret void
}