xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool errata_6() {
  if (*(uint32_t *)0x00FF0130 == 0x9ul) {
    if (*(uint32_t *)0x00FF0134 == 0x01ul) {
      return true;
    }
    if (*(uint32_t *)0x00FF0134 == 0x02ul) {
      return true;
    }
  }
  return false;
}


x86 assembly (clang, -O0):
<errata_6>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff0130,%eax
movslq (%rax),%rax
cmp    $0x9,%rax
jne    1157 <errata_6+0x57>
mov    $0xff0134,%eax
movslq (%rax),%rax
cmp    $0x1,%rax
jne    1134 <errata_6+0x34>
movl   $0x1,-0x4(%rbp)
jmp    115e <errata_6+0x5e>
mov    $0xff0134,%eax
movslq (%rax),%rax
cmp    $0x2,%rax
jne    1152 <errata_6+0x52>
movl   $0x1,-0x4(%rbp)
jmp    115e <errata_6+0x5e>
jmp    1157 <errata_6+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<errata_6>:
cmpl   $0x9,0xff0130
09
jne    111e <errata_6+0x1e>
mov    0xff0134,%ecx
add    $0xffffffff,%ecx
mov    $0x1,%eax
cmp    $0x2,%ecx
jb     1120 <errata_6+0x20>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @errata_6() {
%1 = alloca i32
%2 = load i32, i32* inttoptr (i64 16711984 to i32*)
%3 = sext i32 %2 to i64
%4 = icmp eq i64 %3, 9
br i1 %4, label %5, label %16
5: ; preds = %0
%6 = load i32, i32* inttoptr (i64 16711988 to i32*)
%7 = sext i32 %6 to i64
%8 = icmp eq i64 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %5
store i32 1, i32* %1
br label %17
10: ; preds = %5
%11 = load i32, i32* inttoptr (i64 16711988 to i32*)
%12 = sext i32 %11 to i64
%13 = icmp eq i64 %12, 2
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 1, i32* %1
br label %17
15: ; preds = %10
br label %16
16: ; preds = %15, %0
store i32 0, i32* %1
br label %17
17: ; preds = %16, %14, %9
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @errata_6() {
%1 = load i32, i32* inttoptr (i64 16711984 to i32*)
%2 = icmp eq i32 %1, 9
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = load i32, i32* inttoptr (i64 16711988 to i32*)
%5 = add i32 %4, -1
%6 = icmp ult i32 %5, 2
br i1 %6, label %8, label %7
7: ; preds = %3, %0
br label %8
8: ; preds = %3, %7
%9 = phi i32 [ 0, %7 ], [ 1, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  goto mylabel;
  printf("skipped\n");
mylabel:
  printf("goto ftw!\n");
  return 0xf00d;
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"goto ftw!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 61453
}

LLVM IR (-O2):
@str = [10 x i8] c"goto ftw!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 61453
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ display;
};
typedef TYPE_1__ XExposeEvent;

/* Variables and functions */
void *get_XExposeEvent_display(void *_p) {
  return (void *)((XExposeEvent *)_p)->display;
}


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

x86 assembly (clang, -O2):
<get_XExposeEvent_display>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i8* @get_XExposeEvent_display(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @get_XExposeEvent_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
void print_stack_trace(void) {}


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

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

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

LLVM IR (-O2):
define void @print_stack_trace() {
ret void
}
const char *remove_prefix(const char *name) { return name + 3; }


x86 assembly (clang, -O0):
<remove_prefix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x3,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_prefix>:
lea    0x3(%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @remove_prefix(i8* readnone %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
ret i8* %2
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
struct list *list_new(void *, struct list *);
struct list *list_push(struct list **handle, void *value) {
  struct list *cell = list_new(value, *handle);
  *handle = cell;
  return cell;
}


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

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

LLVM IR (-O0):
%struct.list = type { i32 }
define %struct.list* @list_push(%struct.list** %0, i8* %1) {
%3 = alloca %struct.list**
%4 = alloca i8*
%5 = alloca %struct.list*
store %struct.list** %0, %struct.list*** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = load %struct.list**, %struct.list*** %3
%8 = load %struct.list*, %struct.list** %7
%9 = call %struct.list* @list_new(i8* %6, %struct.list* %8)
store %struct.list* %9, %struct.list** %5
%10 = load %struct.list*, %struct.list** %5
%11 = load %struct.list**, %struct.list*** %3
store %struct.list* %10, %struct.list** %11
%12 = load %struct.list*, %struct.list** %5
ret %struct.list* %12
}

LLVM IR (-O2):
%struct.list = type { i32 }
define %struct.list* @list_push(%struct.list** nocapture %0, i8* %1) {
%3 = load %struct.list*, %struct.list** %0
%4 = tail call %struct.list* @list_new(i8* %1, %struct.list* %3)
store %struct.list* %4, %struct.list** %0
ret %struct.list* %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void socket_close(int fd) {
  if (fd < 0)
    return;
  close(fd);
}


x86 assembly (clang, -O0):
<socket_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112a <socket_close+0x1a>
jmp    1132 <socket_close+0x22>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_close>:
test   %edi,%edi
js     1119 <socket_close+0x9>
jmp    1030 <close@plt>
ret

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

LLVM IR (-O2):
define void @socket_close(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int recv(int, void *, int, int);
int receive_socket(int socket, void *buf, int len, int flags) {
  return recv(socket, buf, len, flags);
}


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

x86 assembly (clang, -O2):
<receive_socket>:
jmp    1030 <recv@plt>

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

LLVM IR (-O2):
define i32 @receive_socket(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @recv(i32 %0, i8* %1, i32 %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
unsigned int sad_mx_n_c(unsigned char *, int, unsigned char *, int, int, int);
unsigned int vp8_sad8x8_c(unsigned char *src_ptr, int src_stride,
                          unsigned char *ref_ptr, int ref_stride, int max_sad) {
  return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 8, 8);
}


x86 assembly (clang, -O0):
<vp8_sad8x8_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x8,%r9d
mov    %r9d,%r8d
call   1030 <sad_mx_n_c@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vp8_sad8x8_c>:
mov    $0x8,%r8d
mov    $0x8,%r9d
jmp    1030 <sad_mx_n_c@plt>

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

LLVM IR (-O2):
define i32 @vp8_sad8x8_c(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = tail call i32 @sad_mx_n_c(i8* %0, i32 %1, i8* %2, i32 %3, i32 8, i32 8)
ret i32 %6
}
/* Variables and functions */
int u8isupperasciii(int /*<<< orphan*/);
int /*<<< orphan*/ u8tointcc(char const *);
int u8isupperasciicc(const char *c) { return u8isupperasciii(u8tointcc(c)); }


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

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

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

LLVM IR (-O2):
define i32 @u8isupperasciicc(i8* %0) {
%2 = tail call i32 @u8tointcc(i8* %0)
%3 = tail call i32 @u8isupperasciii(i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
void cpio_insert_num6(char *head, int num) {
  char buf[7];
  snprintf(buf, sizeof(buf), "%06x", num);
  memcpy(head, buf, 6);
}


x86 assembly (clang, -O0):
<cpio_insert_num6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x13(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x7,%esi
lea    0xebe(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x13(%rbp),%rsi
mov    $0x6,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpio_insert_num6>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ecx
mov    %rdi,%rbx
lea    0xed0(%rip),%rdx
lea    0x1(%rsp),%r14
mov    %r14,%rdi
mov    $0x7,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x6,%edx
call   1040 <memcpy@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%06x\00"
define void @cpio_insert_num6(i8* %0, i32 %1) {
%3 = alloca [7 x i8]
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i32 @memcpy(i8* %0, i8* %4, i32 6)
ret void
}
int ptrcmp(const void *a, const void *b) {
  return (a < b ? -1 : ((a == b) ? 0 : 1));
}


x86 assembly (clang, -O0):
<ptrcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <ptrcmp+0x27>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    113f <ptrcmp+0x3f>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rsi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrcmp>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
setne  %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ptrcmp(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 = icmp ult i8* %5, %6
br i1 %7, label %8, label %9
8: ; preds = %2
br label %15
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = icmp eq i8* %10, %11
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 0, i32 1
br label %15
15: ; preds = %9, %8
%16 = phi i32 [ -1, %8 ], [ %14, %9 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @ptrcmp(i8* readnone %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
%4 = icmp ne i8* %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Variables and functions */
int core7_swap(char *, int);
int U_EMRRESIZEPALETTE_swap(char *record, int torev) {
  return (core7_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRRESIZEPALETTE_swap>:
jmp    1030 <core7_swap@plt>

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

LLVM IR (-O2):
define i32 @U_EMRRESIZEPALETTE_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core7_swap(i8* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int zfile_get_size(const char *pathname) {
  struct stat st;
  if (stat(pathname, &st) == -1) {
    return -1;
  }
  return st.st_size;
}


x86 assembly (clang, -O0):
<zfile_get_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
jne    113e <zfile_get_size+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1144 <zfile_get_size+0x34>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zfile_get_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
je     1121 <zfile_get_size+0x11>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @zfile_get_size(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %12
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
store i32 %11, i32* %2
br label %12
12: ; preds = %9, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @zfile_get_size(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
char getchar();
void LimpaBuffer() {
  while (getchar() != '\n')
    ;
  return;
}


x86 assembly (clang, -O0):
<LimpaBuffer>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <LimpaBuffer+0x9>
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1131 <LimpaBuffer+0x21>
jmp    1119 <LimpaBuffer+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LimpaBuffer>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <LimpaBuffer+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @LimpaBuffer() {
br label %1
1: ; preds = %5, %0
%2 = call signext i8 (...) @getchar()
%3 = sext i8 %2 to i32
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @LimpaBuffer() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
void fc(int *y) {
  char x;
  asm(""
      : "=@cc"
        "c"(x));
  if (!x)
    *y = 0;
}


x86 assembly (clang, -O0):
<fc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
setb   %al
mov    %al,-0x9(%rbp)
cmpb   $0x0,-0x9(%rbp)
jne    1122 <fc+0x22>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc>:
jae    1103 <fc+0x3>
ret
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @fc(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
%4 = call i8 asm "", "={@ccc},~{dirflag},~{fpsr},~{flags}"()
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = icmp ne i8 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = load i32*, i32** %2
store i32 0, i32* %8
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @fc(i32* nocapture writeonly %0) {
%2 = tail call i8 asm "", "={@ccc},~{dirflag},~{fpsr},~{flags}"()
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
store i32 0, i32* %0
br label %5
5: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void revertExtSegAddr(FILE *fp) { fprintf(fp, ":020000020000FC\n"); }


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

x86 assembly (clang, -O2):
<revertExtSegAddr>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x10,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [17 x i8] c":020000020000FC\0A\00"
define void @revertExtSegAddr(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c":020000020000FC\0A\00"
define void @revertExtSegAddr(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 16, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int help(void) {
  fprintf(stderr,
          "usage: matroxset [-f fbdev] [-o output] [-m] [value]\n"
          "\n"
          "where -f fbdev  is fbdev device (default /dev/fb1)\n"
          "      -o output is output number to investigate (0=primary, "
          "1=secondary=default)\n"
          "      -m        says that CRTC->output mapping should be "
          "changed/retrieved\n"
          "      -p        print information about blanking\n"
          "      value     if present, value is set, if missing, value is "
          "retrieved\n"
          "\n"
          "For output mode, 128 means monitor, 1 = PAL TV, 2 = NTSC TV\n");
  return 98;
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x62,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x62,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [445 x i8] c"usage: matroxset [-f fbdev] [-o output] [-m] [value]\0A\0Awhere -f fbdev is fbdev device (default /dev/fb1)\0A -o output is output number to investigate (0=primary, 1=secondary=default)\0A -m says that CRTC->output mapping should be changed/retrieved\0A -p print information about blanking\0A value if present, value is set, if missing, value is retrieved\0A\0AFor output mode, 128 means monitor, 1 = PAL TV, 2 = NTSC TV\0A\00"
define i32 @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([445 x i8], [445 x i8]* @.str, i64 0, i64 0))
ret i32 98
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [445 x i8] c"usage: matroxset [-f fbdev] [-o output] [-m] [value]\0A\0Awhere -f fbdev is fbdev device (default /dev/fb1)\0A -o output is output number to investigate (0=primary, 1=secondary=default)\0A -m says that CRTC->output mapping should be changed/retrieved\0A -p print information about blanking\0A value if present, value is set, if missing, value is retrieved\0A\0AFor output mode, 128 means monitor, 1 = PAL TV, 2 = NTSC TV\0A\00"
define i32 @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([445 x i8], [445 x i8]* @.str, i64 0, i64 0))
ret i32 98
}
/* Variables and functions */
int booster_lstat(char const *, void *);
int lstat(const char *path, void *buf) { return booster_lstat(path, buf); }


x86 assembly (clang, -O0):
<lstat>:
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 <booster_lstat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lstat>:
jmp    1030 <booster_lstat@plt>

LLVM IR (-O0):
define i32 @lstat(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 @booster_lstat(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @lstat(i8* %0, i8* %1) {
%3 = tail call i32 @booster_lstat(i8* %0, i8* %1)
ret i32 %3
}
int test_imm_10int32_reg(int val) { return ((val) & (0x10 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_10int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x10,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_10int32_reg(i32 %0) {
%2 = and i32 %0, 16
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ check_keys();
char *find_keymap_file();
int /*<<< orphan*/ load_key_map(char *);
int /*<<< orphan*/ make_help();
void keys_init() {
  char *file = find_keymap_file();
  if (file) {
    load_key_map(file);
    check_keys();
  }
  make_help();
}


x86 assembly (clang, -O0):
<keys_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <find_keymap_file@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116e <keys_init+0x2e>
mov    -0x8(%rbp),%rdi
call   1040 <load_key_map@plt>
mov    $0x0,%al
call   1030 <check_keys@plt>
mov    $0x0,%al
call   1060 <make_help@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keys_init>:
push   %rax
xor    %eax,%eax
call   1050 <find_keymap_file@plt>
test   %rax,%rax
je     115c <keys_init+0x1c>
mov    %rax,%rdi
call   1040 <load_key_map@plt>
xor    %eax,%eax
call   1030 <check_keys@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <make_help@plt>

LLVM IR (-O0):
define void @keys_init() {
%1 = alloca i8*
%2 = call i8* (...) @find_keymap_file()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load i8*, i8** %1
%7 = call i32 @load_key_map(i8* %6)
%8 = call i32 (...) @check_keys()
br label %9
9: ; preds = %5, %0
%10 = call i32 (...) @make_help()
ret void
}

LLVM IR (-O2):
define void @keys_init() {
%1 = tail call i8* (...) @find_keymap_file()
%2 = icmp eq i8* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @load_key_map(i8* %1)
%5 = tail call i32 (...) @check_keys()
br label %6
6: ; preds = %3, %0
%7 = tail call i32 (...) @make_help()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
float htonf(float f) {
  union {
    float f;
    uint32_t i;
  } ret;
  ret.f = f;
  ret.i = htonl(ret.i);
  return ret.f;
}


x86 assembly (clang, -O0):
<htonf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htonf>:
push   %rax
movd   %xmm0,%edi
call   1030 <htonl@plt>
movd   %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @htonf(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.anon* %3 to float*
store float %4, float* %5
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
%8 = call i32 @htonl(i32 %7)
%9 = bitcast %union.anon* %3 to i32*
store i32 %8, i32* %9
%10 = bitcast %union.anon* %3 to float*
%11 = load float, float* %10
ret float %11
}

LLVM IR (-O2):
define float @htonf(float %0) {
%2 = bitcast float %0 to i32
%3 = tail call i32 @htonl(i32 %2)
%4 = bitcast i32 %3 to float
ret float %4
}
int rtod(double rad, double *deg) {
  static double rtrsd = 57.29577951308232;
  *deg = rad * rtrsd;
  return 0;
}


x86 assembly (clang, -O0):
<rtod>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  0x2f06(%rip),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtod>:
mulsd  0xef8(%rip),%xmm0
movsd  %xmm0,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
@rtod.rtrsd = internal global double 0x404CA5DC1A63C1F8
define i32 @rtod(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double, double* %3
%6 = load double, double* @rtod.rtrsd
%7 = fmul double %5, %6
%8 = load double*, double** %4
store double %7, double* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @rtod(double %0, double* nocapture writeonly %1) {
%3 = fmul double %0, 0x404CA5DC1A63C1F8
store double %3, double* %1
ret i32 0
}
void snd_pcm_timer_done(struct snd_pcm_substream *substream) {}


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

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

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

LLVM IR (-O2):
%struct.snd_pcm_substream = type opaque
define void @snd_pcm_timer_done(%struct.snd_pcm_substream* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ lockfile;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *, unsigned int);
int /*<<< orphan*/ unlink(char *);
void vps_unlock(unsigned int veid, char *dir) {
  char lockfile[512];
  snprintf(lockfile, sizeof(lockfile), "%s/%d.lck", dir, veid);
  unlink(lockfile);
}


x86 assembly (clang, -O0):
<vps_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x4(%rbp),%r8d
mov    $0x200,%esi
lea    0xeb3(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x210(%rbp),%rdi
call   1030 <unlink@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vps_unlock>:
push   %rbx
sub    $0x200,%rsp
mov    %rsi,%rcx
mov    %edi,%r8d
lea    0xecb(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x200,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <unlink@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%s/%d.lck\00"
define void @vps_unlock(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [512 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %4
%8 = load i32, i32* %3
%9 = call i32 @snprintf(i8* %6, i32 512, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8)
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%11 = call i32 @unlink(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s/%d.lck\00"
define void @vps_unlock(i32 %0, i8* %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 512, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %0)
%6 = call i32 @unlink(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FlightStatusHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void FlightStatusRequestUpdate() { UAVObjRequestUpdate(FlightStatusHandle()); }


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

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

LLVM IR (-O0):
define void @FlightStatusRequestUpdate() {
%1 = call i32 (...) @FlightStatusHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @FlightStatusRequestUpdate() {
%1 = tail call i32 (...) @FlightStatusHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Type definitions */
struct ybp_xid_event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ybp_xid_event *);
void ybp_dispose_safe_xe(struct ybp_xid_event *xe) { free(xe); }


x86 assembly (clang, -O0):
<ybp_dispose_safe_xe>:
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):
<ybp_dispose_safe_xe>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.ybp_xid_event = type { i32 }
define void @ybp_dispose_safe_xe(%struct.ybp_xid_event* nocapture %0) {
%2 = tail call i32 @free(%struct.ybp_xid_event* %0)
ret void
}
/* Variables and functions */
int i2c_smbus_read_word_data(int, int);
int raspberrypiI2CReadReg16(int fd, int reg) {
  return i2c_smbus_read_word_data(fd, reg);
}


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

x86 assembly (clang, -O2):
<raspberrypiI2CReadReg16>:
jmp    1030 <i2c_smbus_read_word_data@plt>

LLVM IR (-O0):
define i32 @raspberrypiI2CReadReg16(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 @i2c_smbus_read_word_data(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @raspberrypiI2CReadReg16(i32 %0, i32 %1) {
%3 = tail call i32 @i2c_smbus_read_word_data(i32 %0, i32 %1)
ret i32 %3
}
void VP8EncDspARGBInitMIPSdspR2(void) {}


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

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

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

LLVM IR (-O2):
define void @VP8EncDspARGBInitMIPSdspR2() {
ret void
}
void XGetOMValues() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ EBADF;
int /*<<< orphan*/ errno;
off_t lseek(int fd, off_t offset, int whence) {
  (void)fd;
  (void)offset;
  (void)whence;
  errno = EBADF;
  return -1;
}


x86 assembly (clang, -O0):
<lseek>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ec4(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec3(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lseek>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EBADF = global i32 0
@errno = global i32 0
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = load i32, i32* @EBADF
store i32 %10, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EBADF = global i32 0
@errno = global i32 0
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @EBADF
store i32 %4, i32* @errno
ret i32 -1
}
void test_3(unsigned char *x, unsigned int *y) { y[0] = x[1] >> 4; }


x86 assembly (clang, -O0):
<test_3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%ecx
sar    $0x4,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_3>:
movzbl 0x1(%rdi),%eax
shr    $0x4,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @test_3(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = ashr i32 %8, 4
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @test_3(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = lshr i8 %4, 4
%6 = zext i8 %5 to i32
store i32 %6, i32* %1
ret void
}
int any(int c, char *s) {
  while (*s) {
    if (c == *s++)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<any>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <any+0x46>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1141 <any+0x41>
movl   $0x1,-0x4(%rbp)
jmp    114d <any+0x4d>
jmp    110b <any+0xb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<any>:
movsbl (%rsi),%eax
test   %eax,%eax
je     1115 <any+0x15>
add    $0x1,%rsi
cmp    %edi,%eax
jne    1100 <any>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @any(i32 %0, i8* nocapture %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %1, %2 ], [ %8, %7 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = sext i8 %5 to i32
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %7
%12 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ signal(int, void (*)(int));
void catch_sigint(int s) { signal(s, catch_sigint); }


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

x86 assembly (clang, -O2):
<catch_sigint>:
mov    0x2ec9(%rip),%rsi
jmp    1030 <signal@plt>

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

LLVM IR (-O2):
define void @catch_sigint(i32 %0) {
%2 = tail call i32 @signal(i32 %0, void (i32)* @catch_sigint)
ret void
}
/* Variables and functions */
int getDirLen(char *, char *);
scalar_t__ malloc(int);
char *strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *getFullFileName(char *fileName, char *dirName) {
  int dirLen = getDirLen(fileName, dirName);
  char *name = (char *)malloc(dirLen);
  strcpy(name, fileName);
  strcat(strcat(name, "/"), dirName);
  return name;
}


x86 assembly (clang, -O0):
<getFullFileName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <getDirLen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rdi
lea    0xe7c(%rip),%rsi
call   1060 <strcat@plt>
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFullFileName>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <getDirLen@plt>
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
movw   $0x2f,(%rbx,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1070 <strcat@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define i8* @getFullFileName(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @getDirLen(i8* %7, i8* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %6
%17 = call i8* @strcat(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%18 = load i8*, i8** %4
%19 = call i8* @strcat(i8* %17, i8* %18)
%20 = load i8*, i8** %6
ret i8* %20
}

LLVM IR (-O2):
define i8* @getFullFileName(i8* %0, i8* %1) {
%3 = tail call i32 @getDirLen(i8* %0, i8* %1)
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
%7 = tail call i64 @strlen(i8* dereferenceable(1) %5)
%8 = getelementptr i8, i8* %5, i64 %7
%9 = bitcast i8* %8 to i16*
store i16 47, i16* %9
%10 = tail call i8* @strcat(i8* dereferenceable(1) %5, i8* dereferenceable(1) %1)
ret i8* %5
}
float Mult(float num3, float num4) {
  float result2 = 0.0;
  result2 = num3 * num4;
  return result2;
}


x86 assembly (clang, -O0):
<Mult>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mult>:
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @Mult(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
store float 0.000000e+00, float* %5
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fmul float %6, %7
store float %8, float* %5
%9 = load float, float* %5
ret float %9
}

LLVM IR (-O2):
define float @Mult(float %0, float %1) {
%3 = fmul float %0, %1
ret float %3
}
/* Type definitions */
struct product {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void product_ops_do_it(struct product *product, int a, int b) {
  printf("product::do_it()\n");
}


x86 assembly (clang, -O0):
<product_ops_do_it>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.product = type { i32 }
@.str = [18 x i8] c"product::do_it()\0A\00"
define void @product_ops_do_it(%struct.product* %0, i32 %1, i32 %2) {
%4 = alloca %struct.product*
%5 = alloca i32
%6 = alloca i32
store %struct.product* %0, %struct.product** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.product = type { i32 }
@str = [17 x i8] c"product::do_it()\00"
define void @product_ops_do_it(%struct.product* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ display(int *, int);
int /*<<< orphan*/ quicksort(int *, int /*<<< orphan*/, int);
int main(int argc, char *argv[]) {
  int a[] = {44, 22, 20, 15, 15, 13, 11, 10};
  quicksort(a, 0, 7);
  display(a, 7);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x7,%edx
call   1040 <quicksort@plt>
lea    -0x30(%rbp),%rdi
mov    $0x7,%esi
call   1030 <display@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x7,%edx
call   1040 <quicksort@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <display@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [8 x i32] [i32 44, i32 22, i32 20, i32 15, i32 15, i32 13, i32 11, i32 10]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [8 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [8 x i32]* %6 to i8*
%8 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 0
%9 = call i32 @quicksort(i32* %8, i32 0, i32 7)
%10 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 0
%11 = call i32 @display(i32* %10, i32 7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [8 x i32] [i32 44, i32 22, i32 20, i32 15, i32 15, i32 13, i32 11, i32 10]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [8 x i32]
%4 = bitcast [8 x i32]* %3 to i8*
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%6 = call i32 @quicksort(i32* %5, i32 0, i32 7)
%7 = call i32 @display(i32* %5, i32 7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
unsigned long long readeflags_test(int, int);
int main() {
  unsigned long long int flags;
  flags = readeflags_test(100, 100);
  if ((flags & 1) != 0)
    abort();
  flags = readeflags_test(100, 101);
  if ((flags & 1) == 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x64,%esi
mov    %esi,%edi
call   1040 <readeflags_test@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1158 <main+0x38>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x64,%edi
mov    $0x65,%esi
call   1040 <readeflags_test@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
jne    1184 <main+0x64>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x64,%edi
mov    $0x64,%esi
call   1040 <readeflags_test@plt>
test   $0x1,%al
jne    114b <main+0x2b>
mov    $0x64,%edi
mov    $0x65,%esi
call   1040 <readeflags_test@plt>
test   $0x1,%al
je     114b <main+0x2b>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i64 @readeflags_test(i32 100, i32 100)
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = and i64 %4, 1
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %0
%10 = call i64 @readeflags_test(i32 100, i32 101)
store i64 %10, i64* %2
%11 = load i64, i64* %2
%12 = and i64 %11, 1
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @readeflags_test(i32 100, i32 100)
%2 = and i64 %1, 1
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = tail call i64 @readeflags_test(i32 100, i32 101)
%8 = and i64 %7, 1
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = tail call i32 (...) @abort()
unreachable
12: ; preds = %6
ret i32 0
}