xunge/DecIR huggingface dataset:
/* Type definitions */
struct editor {
  int dummy;
};

/* Variables and functions */
int get(struct editor *, int);
int next_line(struct editor *ed, int pos) {
  while (1) {
    int ch = get(ed, pos);
    if (ch < 0)
      return -1;
    pos++;
    if (ch == '\n')
      return pos;
  }
}


x86 assembly (clang, -O0):
<next_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <get@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1144 <next_line+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <next_line+0x57>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0xa,-0x18(%rbp)
jne    1162 <next_line+0x52>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <next_line+0x57>
jmp    111f <next_line+0xf>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_line>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0xffffffff,%r15d
mov    %esi,%ebx
mov    %r14,%rdi
call   1030 <get@plt>
lea    0x1(%rbx),%esi
cmp    $0xa,%eax
cmove  %esi,%ebp
test   %eax,%eax
cmovs  %ebx,%esi
cmovs  %r15d,%ebp
js     1143 <next_line+0x33>
cmp    $0xa,%eax
jne    1120 <next_line+0x10>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.editor = type { i32 }
define i32 @next_line(%struct.editor* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.editor*
%5 = alloca i32
%6 = alloca i32
store %struct.editor* %0, %struct.editor** %4
store i32 %1, i32* %5
br label %7
7: ; preds = %2, %21
%8 = load %struct.editor*, %struct.editor** %4
%9 = load i32, i32* %5
%10 = call i32 @get(%struct.editor* %8, i32 %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %7
store i32 -1, i32* %3
br label %22
14: ; preds = %7
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
store i32 %16, i32* %5
%17 = load i32, i32* %6
%18 = icmp eq i32 %17, 10
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = load i32, i32* %5
store i32 %20, i32* %3
br label %22
21: ; preds = %14
br label %7
22: ; preds = %19, %13
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
%struct.editor = type { i32 }
define i32 @next_line(%struct.editor* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %1, %2 ], [ %11, %3 ]
%5 = phi i32 [ undef, %2 ], [ %12, %3 ]
%6 = tail call i32 @get(%struct.editor* %0, i32 %4)
%7 = icmp slt i32 %6, 0
%8 = add nsw i32 %4, 1
%9 = icmp eq i32 %6, 10
%10 = select i1 %9, i32 %8, i32 %5
%11 = select i1 %7, i32 %4, i32 %8
%12 = select i1 %7, i32 -1, i32 %10
%13 = or i1 %7, %9
br i1 %13, label %14, label %3
14: ; preds = %3
ret i32 %12
}
unsigned kol_system_memfree() { asm volatile("int $0x40" ::"a"(18), "b"(16)); }


x86 assembly (clang, -O0):
<kol_system_memfree>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x12,%eax
mov    $0x10,%ebx
int    $0x40
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_system_memfree>:
push   %rbx
mov    $0x12,%eax
mov    $0x10,%ebx
int    $0x40
pop    %rbx
ret

LLVM IR (-O0):
define i32 @kol_system_memfree() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @kol_system_memfree() {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 18, i32 16)
ret i32 undef
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buffer_end(struct buffer *);
int /*<<< orphan*/ buffer_grow(struct buffer *, size_t);
int /*<<< orphan*/ buffer_increment(struct buffer *, size_t);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/, char const *, size_t);
void buffer_append(struct buffer *b, const char *data, size_t size) {
  buffer_grow(b, size);
  memcpy(buffer_end(b), data, size);
  buffer_increment(b, size);
}


x86 assembly (clang, -O0):
<buffer_append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <buffer_grow@plt>
mov    -0x8(%rbp),%rdi
call   1040 <buffer_end@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <buffer_increment@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.buffer = type { i32 }
define void @buffer_append(%struct.buffer* %0, i8* %1, i64 %2) {
%4 = tail call i32 @buffer_grow(%struct.buffer* %0, i64 %2)
%5 = tail call i32 @buffer_end(%struct.buffer* %0)
%6 = tail call i32 @memcpy(i32 %5, i8* %1, i64 %2)
%7 = tail call i32 @buffer_increment(%struct.buffer* %0, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ event_add(int, void *);
int /*<<< orphan*/ promptcmd_log_cmd(char *);
void promptcmd_halt(char *args[], int arg_num) {
  event_add(1, (void *)NULL);
  promptcmd_log_cmd("Added halt event,");
}


x86 assembly (clang, -O0):
<promptcmd_halt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <event_add@plt>
lea    0xebc(%rip),%rdi
call   1040 <promptcmd_log_cmd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<promptcmd_halt>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <event_add@plt>
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <promptcmd_log_cmd@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Added halt event,\00"
define void @promptcmd_halt(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = call i32 @event_add(i32 1, i8* null)
%6 = call i32 @promptcmd_log_cmd(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Added halt event,\00"
define void @promptcmd_halt(i8** nocapture readnone %0, i32 %1) {
%3 = tail call i32 @event_add(i32 1, i8* null)
%4 = tail call i32 @promptcmd_log_cmd(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *vrna_db_unpack(char const *);
char *unpack_structure(const char *packed) { return vrna_db_unpack(packed); }


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

x86 assembly (clang, -O2):
<unpack_structure>:
jmp    1030 <vrna_db_unpack@plt>

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

LLVM IR (-O2):
define i8* @unpack_structure(i8* %0) {
%2 = tail call i8* @vrna_db_unpack(i8* %0)
ret i8* %2
}
int insy_gcm_mult_data_cnt_csr_debug_set(
    unsigned int dev_id, union insy_gcm_mult_data_cnt_csr_debug_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.insy_gcm_mult_data_cnt_csr_debug_u = type opaque
define i32 @insy_gcm_mult_data_cnt_csr_debug_set(i32 %0, %union.insy_gcm_mult_data_cnt_csr_debug_u* %1) {
%3 = alloca i32
%4 = alloca %union.insy_gcm_mult_data_cnt_csr_debug_u*
store i32 %0, i32* %3
store %union.insy_gcm_mult_data_cnt_csr_debug_u* %1, %union.insy_gcm_mult_data_cnt_csr_debug_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.insy_gcm_mult_data_cnt_csr_debug_u = type opaque
define i32 @insy_gcm_mult_data_cnt_csr_debug_set(i32 %0, %union.insy_gcm_mult_data_cnt_csr_debug_u* nocapture readnone %1) {
ret i32 1
}
void ajTaxoutExit(void) { return; }


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

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

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

LLVM IR (-O2):
define void @ajTaxoutExit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ printf(char *, void *);
int /*<<< orphan*/ stdout;
void FreeIt(void *p) {
  printf("Freed object at %p\n", p);
  fflush(stdout);
  free(p);
}


x86 assembly (clang, -O0):
<FreeIt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FreeIt>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Freed object at %p\0A\00"
@stdout = global i32 0
define void @FreeIt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Freed object at %p\0A\00"
@stdout = global i32 0
define void @FreeIt(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
void *realloc(void *, size_t);
void *sc_realloc(void *ptr, size_t size) { return realloc(ptr, size); }


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

x86 assembly (clang, -O2):
<sc_realloc>:
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @sc_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
void mbr_printk(const char *level, const int debug_mask, const char *fmt, ...) {
}


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

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

LLVM IR (-O0):
define void @mbr_printk(i8* %0, i32 %1, i8* %2, ...) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @mbr_printk(i8* nocapture %0, i32 %1, i8* nocapture %2, ...) {
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *sc_util_strcpy(char *str) {
  size_t len;
  len = strlen(str) + 1;
  char *buffer = (char *)malloc(len * sizeof(char));
  strcpy(buffer, str);
  return buffer;
}


x86 assembly (clang, -O0):
<sc_util_strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
shl    $0x0,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sc_util_strcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
add    $0x1,%eax
movslq %eax,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @sc_util_strcpy(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 = mul i64 %9, 1
%11 = call i64 @malloc(i64 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = load i8*, i8** %2
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
define i8* @sc_util_strcpy(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @strcpy(i8* %6, i8* %0)
ret i8* %6
}
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int i, t;
  printf("%d\n", fib(5));
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @fib(i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void ft_strdel(char **as) {
  if (as) {
    free(*as);
    *as = NULL;
  }
}


x86 assembly (clang, -O0):
<ft_strdel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113e <ft_strdel+0x2e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strdel>:
test   %rdi,%rdi
je     1129 <ft_strdel+0x19>
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_strdel(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = tail call i32 @free(i8* %4)
store i8* null, i8** %0
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int main() {
  printf("%s a %s\n", "Hola", "todos");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"%s a %s\0A\00"
@.str.1 = [5 x i8] c"Hola\00"
@.str.2 = [6 x i8] c"todos\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s a %s\0A\00"
@.str.1 = [5 x i8] c"Hola\00"
@.str.2 = [6 x i8] c"todos\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct _stor_lookup_create_req {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ osapi_free(struct _stor_lookup_create_req *);
void stor_lookup_create_req_free(struct _stor_lookup_create_req *ptr) {
  osapi_free(ptr);
}


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

x86 assembly (clang, -O2):
<stor_lookup_create_req_free>:
jmp    1030 <osapi_free@plt>

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

LLVM IR (-O2):
%struct._stor_lookup_create_req = type { i32 }
define void @stor_lookup_create_req_free(%struct._stor_lookup_create_req* %0) {
%2 = tail call i32 @osapi_free(%struct._stor_lookup_create_req* %0)
ret void
}
unsigned short int f85(unsigned short int x, int y) {
  return (x << (8 * 2 - y)) + (x >> y);
}


x86 assembly (clang, -O0):
<f85>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
mov    $0x10,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f85>:
mov    $0x10,%cl
sub    %sil,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f85(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = sub nsw i32 16, %7
%9 = shl i32 %6, %8
%10 = load i16, i16* %3
%11 = zext i16 %10 to i32
%12 = load i32, i32* %4
%13 = ashr i32 %11, %12
%14 = add nsw i32 %9, %13
%15 = trunc i32 %14 to i16
ret i16 %15
}

LLVM IR (-O2):
define zeroext i16 @f85(i16 zeroext %0, i32 %1) {
%3 = zext i16 %0 to i32
%4 = sub nsw i32 16, %1
%5 = shl i32 %3, %4
%6 = lshr i32 %3, %1
%7 = add nsw i32 %5, %6
%8 = trunc i32 %7 to i16
ret i16 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: bigfile-cat [-b] [-n nmemb] filepath block dtype\n");
  fprintf(stderr, "-B blocksize in bytes used in IO \n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xef0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xefa(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [57 x i8] c"usage: bigfile-cat [-b] [-n nmemb] filepath block dtype\0A\00"
@.str.1 = [35 x i8] c"-B blocksize in bytes used in IO \0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [57 x i8] c"usage: bigfile-cat [-b] [-n nmemb] filepath block dtype\0A\00"
@.str.1 = [35 x i8] c"-B blocksize in bytes used in IO \0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
void mmr_jump(void) {
  int (*foo)(void);
  foo = (void *)((0xFFC00014));
  (*foo)();
}


x86 assembly (clang, -O0):
<mmr_jump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xffc00014,%eax
mov    %rax,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmr_jump>:
mov    $0xffc00014,%eax
jmp    *%rax

LLVM IR (-O0):
define void @mmr_jump() {
%1 = alloca i32 ()*
store i32 ()* inttoptr (i64 4290773012 to i32 ()*), i32 ()** %1
%2 = load i32 ()*, i32 ()** %1
%3 = call i32 %2()
ret void
}

LLVM IR (-O2):
define void @mmr_jump() {
%1 = tail call i32 inttoptr (i64 4290773012 to i32 ()*)()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int self();
int /*<<< orphan*/ usleep(int);
void fun3() {
  printf("process %d start\n", self());
  while (1) {
    usleep(100);
    printf("process %d execution\n", self());
  }
}


x86 assembly (clang, -O0):
<fun3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <self@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x64,%edi
call   1050 <usleep@plt>
mov    $0x0,%al
call   1040 <self@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
jmp    1149 <fun3+0x19>

x86 assembly (clang, -O2):
<fun3>:
push   %rbx
xor    %eax,%eax
call   1040 <self@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xec5(%rip),%rbx
nopl   (%rax)
mov    $0x64,%edi
call   1050 <usleep@plt>
xor    %eax,%eax
call   1040 <self@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
jmp    1150 <fun3+0x20>

LLVM IR (-O0):
@.str = [18 x i8] c"process %d start\0A\00"
@.str.1 = [22 x i8] c"process %d execution\0A\00"
define void @fun3() {
%1 = call i32 (...) @self()
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %3
3: ; preds = %0, %3
%4 = call i32 @usleep(i32 100)
%5 = call i32 (...) @self()
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %5)
br label %3
}

LLVM IR (-O2):
@.str = [18 x i8] c"process %d start\0A\00"
@.str.1 = [22 x i8] c"process %d execution\0A\00"
define void @fun3() {
%1 = tail call i32 (...) @self()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %3
3: ; preds = %0, %3
%4 = tail call i32 @usleep(i32 100)
%5 = tail call i32 (...) @self()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %5)
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: IHFSsplit <ihfs_img> <output_dir>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"usage: IHFSsplit <ihfs_img> <output_dir>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"usage: IHFSsplit <ihfs_img> <output_dir>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int __attribute__((weak)) _isatty(int file) { return 1; }


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

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

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

LLVM IR (-O2):
define weak i32 @_isatty(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_ldi_a_hlp(void) { op_write1(0x2a); }


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

x86 assembly (clang, -O2):
<op_enc_ldi_a_hlp>:
mov    $0x2a,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_ldi_a_hlp() {
%1 = call i32 @op_write1(i32 42)
ret void
}

LLVM IR (-O2):
define void @op_enc_ldi_a_hlp() {
%1 = tail call i32 @op_write1(i32 42)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CG_Argv(int);
int /*<<< orphan*/ CG_Printf(char *);
int trap_Argc();
int /*<<< orphan*/ trap_SendConsoleCommand(int /*<<< orphan*/);
int /*<<< orphan*/ va(char *, int /*<<< orphan*/);
void CG_vstrDown_f(void) {
  if (trap_Argc() == 5) {
    trap_SendConsoleCommand(va("vstr %s;", CG_Argv(1)));
  } else {
    CG_Printf("[cgnotify]Usage: +vstr [down_vstr] [up_vstr]\n");
  }
}


x86 assembly (clang, -O0):
<CG_vstrDown_f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <trap_Argc@plt>
cmp    $0x5,%eax
jne    1188 <CG_vstrDown_f+0x38>
mov    $0x1,%edi
call   1030 <CG_Argv@plt>
mov    %eax,%esi
lea    0xe89(%rip),%rdi
call   1060 <va@plt>
mov    %eax,%edi
call   1070 <trap_SendConsoleCommand@plt>
jmp    1194 <CG_vstrDown_f+0x44>
lea    0xe7a(%rip),%rdi
call   1050 <CG_Printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_vstrDown_f>:
push   %rax
xor    %eax,%eax
call   1040 <trap_Argc@plt>
cmp    $0x5,%eax
jne    117d <CG_vstrDown_f+0x2d>
mov    $0x1,%edi
call   1030 <CG_Argv@plt>
lea    0xe92(%rip),%rdi
mov    %eax,%esi
call   1060 <va@plt>
mov    %eax,%edi
pop    %rax
jmp    1070 <trap_SendConsoleCommand@plt>
lea    0xe85(%rip),%rdi
pop    %rax
jmp    1050 <CG_Printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"vstr %s;\00"
@.str.1 = [46 x i8] c"[cgnotify]Usage: +vstr [down_vstr] [up_vstr]\0A\00"
define void @CG_vstrDown_f() {
%1 = call i32 (...) @trap_Argc()
%2 = icmp eq i32 %1, 5
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = call i32 @CG_Argv(i32 1)
%5 = call i32 @va(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @trap_SendConsoleCommand(i32 %5)
br label %9
7: ; preds = %0
%8 = call i32 @CG_Printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"vstr %s;\00"
@.str.1 = [46 x i8] c"[cgnotify]Usage: +vstr [down_vstr] [up_vstr]\0A\00"
define void @CG_vstrDown_f() {
%1 = tail call i32 (...) @trap_Argc()
%2 = icmp eq i32 %1, 5
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @CG_Argv(i32 1)
%5 = tail call i32 @va(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @trap_SendConsoleCommand(i32 %5)
br label %9
7: ; preds = %0
%8 = tail call i32 @CG_Printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
ret void
}
int willusgui_semaphore_status(void *semaphore) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @willusgui_semaphore_status(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void reply() { printf("%d\n", 100); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @reply() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 100)
ret void
}
/* Variables and functions */
scalar_t__ Q_isalphanumeric(int);
int Q_isforfilename(int c) {
  if ((Q_isalphanumeric(c) || c == '_') && c != ' ') {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<Q_isforfilename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <Q_isalphanumeric@plt>
cmp    $0x0,%rax
jne    1137 <Q_isforfilename+0x27>
cmpl   $0x5f,-0x8(%rbp)
jne    114d <Q_isforfilename+0x3d>
cmpl   $0x20,-0x8(%rbp)
je     114d <Q_isforfilename+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1154 <Q_isforfilename+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_isforfilename>:
push   %rbx
mov    %edi,%ebx
call   1030 <Q_isalphanumeric@plt>
test   %rax,%rax
setne  %al
cmp    $0x5f,%ebx
sete   %cl
or     %al,%cl
cmp    $0x20,%ebx
setne  %al
and    %cl,%al
movzbl %al,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @Q_isforfilename(i32 %0) {
%2 = tail call i64 @Q_isalphanumeric(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i32 %0, 95
%5 = or i1 %4, %3
%6 = icmp ne i32 %0, 32
%7 = and i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ evthread_use_pthreads();
void natsLibevent_Init(void) { evthread_use_pthreads(); }


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

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

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

LLVM IR (-O2):
define void @natsLibevent_Init() {
%1 = tail call i32 (...) @evthread_use_pthreads()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup2(int, int);
void restore_fd(int restore, int replace) {
  dup2(restore, replace);
  close(replace);
}


x86 assembly (clang, -O0):
<restore_fd>:
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 <dup2@plt>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<restore_fd>:
push   %rbx
mov    %esi,%ebx
call   1030 <dup2@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

LLVM IR (-O0):
define void @restore_fd(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 @dup2(i32 %5, i32 %6)
%8 = load i32, i32* %4
%9 = call i32 @close(i32 %8)
ret void
}

LLVM IR (-O2):
define void @restore_fd(i32 %0, i32 %1) {
%3 = tail call i32 @dup2(i32 %0, i32 %1)
%4 = tail call i32 @close(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addDivisors(int);
int /*<<< orphan*/ compare(int /*<<< orphan*/, int);
int getNumber();
int /*<<< orphan*/ printResult(int /*<<< orphan*/, int, int);
int main() {
  int n1, n2;
  n1 = getNumber();
  n2 = getNumber();
  printResult(compare(addDivisors(n1), n2), n1, n2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getNumber@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getNumber@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <addDivisors@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1060 <compare@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <printResult@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <getNumber@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <getNumber@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <addDivisors@plt>
mov    %eax,%edi
mov    %ebp,%esi
call   1060 <compare@plt>
mov    %eax,%edi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <printResult@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @getNumber()
store i32 %4, i32* %2
%5 = call i32 (...) @getNumber()
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = call i32 @addDivisors(i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @compare(i32 %7, i32 %8)
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @printResult(i32 %9, i32 %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getNumber()
%2 = tail call i32 (...) @getNumber()
%3 = tail call i32 @addDivisors(i32 %1)
%4 = tail call i32 @compare(i32 %3, i32 %2)
%5 = tail call i32 @printResult(i32 %4, i32 %1, i32 %2)
ret i32 0
}
void gdk_gc_set_colormap() {}


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

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

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

LLVM IR (-O2):
define void @gdk_gc_set_colormap() {
ret void
}
/* Type definitions */
struct vli_reader {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct vli_reader *);
void delete_vli_reader(struct vli_reader *vli) { free(vli); }


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

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

LLVM IR (-O2):
%struct.vli_reader = type { i32 }
define void @delete_vli_reader(%struct.vli_reader* nocapture %0) {
%2 = tail call i32 @free(%struct.vli_reader* %0)
ret void
}
/* Variables and functions */
int ptr_valid(void *, size_t, size_t, int);
bool ptr_valid_w(void *p, size_t align, size_t size) {
  return ptr_valid(p, align, size, true);
}


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

x86 assembly (clang, -O2):
<ptr_valid_w>:
mov    $0x1,%ecx
jmp    1030 <ptr_valid@plt>

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

LLVM IR (-O2):
define i32 @ptr_valid_w(i8* %0, i64 %1, i64 %2) {
%4 = tail call i32 @ptr_valid(i8* %0, i64 %1, i64 %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int strlen(char *);
char *DelFinalChar(char *pszString, int iChar) {
  int iStrLength = strlen(pszString);
  if (iStrLength > 0 && pszString[iStrLength - 1] == iChar)
    pszString[iStrLength - 1] = '\0';
  return pszString;
}


x86 assembly (clang, -O0):
<DelFinalChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1160 <DelFinalChar+0x50>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    -0xc(%rbp),%eax
jne    1160 <DelFinalChar+0x50>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DelFinalChar>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    1130 <DelFinalChar+0x20>
add    $0xffffffff,%eax
movsbl (%rbx,%rax,1),%ecx
cmp    %ebp,%ecx
jne    1130 <DelFinalChar+0x20>
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @DelFinalChar(i8* returned %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = add nsw i32 %3, -1
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, %1
br i1 %11, label %12, label %13
12: ; preds = %5
store i8 0, i8* %8
br label %13
13: ; preds = %12, %5, %2
ret i8* %0
}
void set_4in6(unsigned char ipv6[16], unsigned ip) {
  *(long long *)ipv6 = 0;
  ((int *)ipv6)[2] = -0x10000;
  ((int *)ipv6)[3] = ip;
}


x86 assembly (clang, -O0):
<set_4in6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movl   $0xffff0000,0x8(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_4in6>:
movq   $0x0,(%rdi)
movl   $0xffff0000,0x8(%rdi)
mov    %esi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @set_4in6(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 = bitcast i8* %5 to i64*
store i64 0, i64* %6
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = getelementptr inbounds i32, i32* %8, i64 2
store i32 -65536, i32* %9
%10 = load i32, i32* %4
%11 = load i8*, i8** %3
%12 = bitcast i8* %11 to i32*
%13 = getelementptr inbounds i32, i32* %12, i64 3
store i32 %10, i32* %13
ret void
}

LLVM IR (-O2):
define void @set_4in6(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i64*
store i64 0, i64* %3
%4 = getelementptr inbounds i8, i8* %0, i64 8
%5 = bitcast i8* %4 to i32*
store i32 -65536, i32* %5
%6 = getelementptr inbounds i8, i8* %0, i64 12
%7 = bitcast i8* %6 to i32*
store i32 %1, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("The value of 1<2 is %v\n", (1 < 2));
  printf("The value of 2<1 is %v\n", (2 < 1));
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"The value of 1<2 is %v\0A\00"
@.str.1 = [24 x i8] c"The value of 2<1 is %v\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"The value of 1<2 is %v\0A\00"
@.str.1 = [24 x i8] c"The value of 2<1 is %v\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
int get16();
int /*<<< orphan*/ printf(char *, int);
int decode_length_type() {
  int length_type = get16();
  if (length_type == 0x8100) {
    printf("VLAN: %04x\n", get16());
    length_type = get16();
  }
  return length_type;
}


x86 assembly (clang, -O0):
<decode_length_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <get16@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x8100,-0x4(%rbp)
jne    115e <decode_length_type+0x3e>
mov    $0x0,%al
call   1040 <get16@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <get16@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_length_type>:
push   %rax
xor    %eax,%eax
call   1040 <get16@plt>
cmp    $0x8100,%eax
jne    114c <decode_length_type+0x2c>
xor    %eax,%eax
call   1040 <get16@plt>
lea    0xec3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <get16@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"VLAN: %04x\0A\00"
define i32 @decode_length_type() {
%1 = alloca i32
%2 = call i32 (...) @get16()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 33024
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = call i32 (...) @get16()
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 (...) @get16()
store i32 %8, i32* %1
br label %9
9: ; preds = %5, %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [12 x i8] c"VLAN: %04x\0A\00"
define i32 @decode_length_type() {
%1 = tail call i32 (...) @get16()
%2 = icmp eq i32 %1, 33024
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 (...) @get16()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 (...) @get16()
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ %6, %3 ], [ %1, %0 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ testAngle();
int /*<<< orphan*/ testExp();
int /*<<< orphan*/ testInverseTrig();
int /*<<< orphan*/ testLog();
int /*<<< orphan*/ testSqrt();
int /*<<< orphan*/ testTrig();
int main(int argc, char **argv) {
  testInverseTrig();
  testTrig();
  testLog();
  testSqrt();
  testExp();
  testAngle();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <testInverseTrig@plt>
mov    $0x0,%al
call   1030 <testTrig@plt>
mov    $0x0,%al
call   1060 <testLog@plt>
mov    $0x0,%al
call   1070 <testSqrt@plt>
mov    $0x0,%al
call   1080 <testExp@plt>
mov    $0x0,%al
call   1040 <testAngle@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <testInverseTrig@plt>
xor    %eax,%eax
call   1030 <testTrig@plt>
xor    %eax,%eax
call   1060 <testLog@plt>
xor    %eax,%eax
call   1070 <testSqrt@plt>
xor    %eax,%eax
call   1080 <testExp@plt>
xor    %eax,%eax
call   1040 <testAngle@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @testInverseTrig()
%6 = call i32 (...) @testTrig()
%7 = call i32 (...) @testLog()
%8 = call i32 (...) @testSqrt()
%9 = call i32 (...) @testExp()
%10 = call i32 (...) @testAngle()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @testInverseTrig()
%4 = tail call i32 (...) @testTrig()
%5 = tail call i32 (...) @testLog()
%6 = tail call i32 (...) @testSqrt()
%7 = tail call i32 (...) @testExp()
%8 = tail call i32 (...) @testAngle()
ret i32 0
}
void swapString(const char **a, const char **b) {
  const char *tmp = *a;
  *a = *b;
  *b = tmp;
}


x86 assembly (clang, -O0):
<swapString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @swapString(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
%5 = alloca i8*
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %3
store i8* %9, i8** %10
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %4
store i8* %11, i8** %12
ret void
}

LLVM IR (-O2):
define void @swapString(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}