xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int fgetc(FILE *file) {
  unsigned char ch;
  if (fread(&ch, 1, 1, file) != 1) {
    return EOF;
  }
  return (int)ch;
}


x86 assembly (clang, -O0):
<fgetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x11(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
cmp    $0x1,%eax
je     114a <fgetc+0x3a>
mov    0x2ea8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <fgetc+0x41>
movzbl -0x11(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgetc>:
push   %rax
mov    %rdi,%rcx
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
je     1138 <fgetc+0x28>
mov    0x2eb4(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret
movzbl 0x7(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @fgetc(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = call i32 @fread(i8* %4, i32 1, i32 1, i32* %5)
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* @EOF
store i32 %9, i32* %2
br label %13
10: ; preds = %1
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @fgetc(i32* nocapture %0) {
%2 = alloca i8
%3 = call i32 @fread(i8* %2, i32 1, i32 1, i32* %0)
%4 = icmp eq i32 %3, 1
%5 = load i32, i32* @EOF
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = select i1 %4, i32 %7, i32 %5
ret i32 %8
}
/* Type definitions */
struct int_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _list_del(struct int_list *);
int /*<<< orphan*/ free(struct int_list *);
void list_del(struct int_list *cur) {
  _list_del(cur);
  free(cur);
}


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

x86 assembly (clang, -O2):
<list_del>:
push   %rbx
mov    %rdi,%rbx
call   1040 <_list_del@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.int_list = type { i32 }
define void @list_del(%struct.int_list* %0) {
%2 = tail call i32 @_list_del(%struct.int_list* %0)
%3 = tail call i32 @free(%struct.int_list* %0)
ret void
}
void moo(int x, int *y) {
  int z;
  x = x + 3;
  *y = *y + 3;
  z = z + 3;
  printf("moo :  x = %1d, *y = %1d, y = %1d, z = %1d\n", x, *y, y, z);
}


x86 assembly (clang, -O0):
<moo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x3,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<moo>:
mov    %rsi,%rcx
lea    0x3(%rdi),%esi
mov    (%rcx),%edx
add    $0x3,%edx
mov    %edx,(%rcx)
lea    0xedc(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [44 x i8] c"moo : x = %1d, *y = %1d, y = %1d, z = %1d\0A\00"
define void @moo(i32 %0, i32* %1) {
%3 = add nsw i32 %0, 3
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 3
store i32 %5, i32* %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5, i32* %1, i32 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("*****\n");
  printf("*   *\n");
  printf("*   *\n");
  printf("*****\n");
  return 0;
}


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>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xeeb(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xed6(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@str.3 = [6 x i8] c"* *\00"
@str.4 = [6 x i8] c"*****\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.4, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clrvoxel(int, int, int);
int /*<<< orphan*/ setvoxel(int, int, int);
void altervoxel(int x, int y, int z, int state) {
  if (state == 1) {
    setvoxel(x, y, z);
  } else {
    clrvoxel(x, y, z);
  }
}


x86 assembly (clang, -O0):
<altervoxel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jne    1151 <altervoxel+0x31>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <setvoxel@plt>
jmp    115f <altervoxel+0x3f>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <clrvoxel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<altervoxel>:
cmp    $0x1,%ecx
jne    112a <altervoxel+0xa>
jmp    1040 <setvoxel@plt>
jmp    1030 <clrvoxel@plt>

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

LLVM IR (-O2):
define void @altervoxel(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 1
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @setvoxel(i32 %0, i32 %1, i32 %2)
br label %10
8: ; preds = %4
%9 = tail call i32 @clrvoxel(i32 %0, i32 %1, i32 %2)
br label %10
10: ; preds = %8, %6
ret void
}
/* Variables and functions */
int lsmdb_cursor_cmp_fwd(void *const, void *const);
int lsmdb_cursor_cmp_rev(void *const a, void *const b) {
  return lsmdb_cursor_cmp_fwd(a, b) * -1;
}


x86 assembly (clang, -O0):
<lsmdb_cursor_cmp_rev>:
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 <lsmdb_cursor_cmp_fwd@plt>
imul   $0xffffffff,%eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsmdb_cursor_cmp_rev>:
push   %rax
call   1030 <lsmdb_cursor_cmp_fwd@plt>
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @lsmdb_cursor_cmp_rev(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 @lsmdb_cursor_cmp_fwd(i8* %5, i8* %6)
%8 = mul nsw i32 %7, -1
ret i32 %8
}

LLVM IR (-O2):
define i32 @lsmdb_cursor_cmp_rev(i8* %0, i8* %1) {
%3 = tail call i32 @lsmdb_cursor_cmp_fwd(i8* %0, i8* %1)
%4 = sub nsw i32 0, %3
ret i32 %4
}
int cc_cache_colors(void) {
  return ((12 * 1024) / 16 / (((unsigned long)1 << 12) / 1024));
}


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

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

LLVM IR (-O0):
define i32 @cc_cache_colors() {
ret i32 192
}

LLVM IR (-O2):
define i32 @cc_cache_colors() {
ret i32 192
}
/* Variables and functions */
int /*<<< orphan*/ heap_sort();
int /*<<< orphan*/ print_array();
int main(int argv, char *argc[]) {
  heap_sort();
  print_array();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <heap_sort@plt>
mov    $0x0,%al
call   1040 <print_array@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @heap_sort()
%4 = tail call i32 (...) @print_array()
ret i32 0
}
void ScaleARGBRowDown2Box_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @ScaleARGBRowDown2Box_SSE2() {
ret void
}
int getpid() { return 1; }


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

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

LLVM IR (-O0):
define i32 @getpid() {
ret i32 1
}

LLVM IR (-O2):
define i32 @getpid() {
ret i32 1
}
void caller_2_2_2_1_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_2_2_1_2_1_2() {
ret void
}
int do_258() { return 258; }


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

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

LLVM IR (-O0):
define i32 @do_258() {
ret i32 258
}

LLVM IR (-O2):
define i32 @do_258() {
ret i32 258
}
/* Type definitions */
typedef unsigned int time_t;
typedef unsigned int pid_t;

/* Variables and functions */
unsigned int getpid();
int /*<<< orphan*/ srand(unsigned int);
int /*<<< orphan*/ time(unsigned int *);
void ShareSeed(unsigned int inseed, unsigned int *outseed) {
  pid_t thispid;
  time_t nowtime;
  if (inseed != 0) {
    srand(inseed);
    *outseed = inseed;
    return;
  }
  thispid = getpid();
  time(&nowtime);
  inseed = thispid * nowtime;
  srand(inseed);
  *outseed = inseed;
  return;
}


x86 assembly (clang, -O0):
<ShareSeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     115f <ShareSeed+0x2f>
mov    -0x4(%rbp),%edi
call   1040 <srand@plt>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    118d <ShareSeed+0x5d>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x14(%rbp)
lea    -0x18(%rbp),%rdi
call   1050 <time@plt>
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <srand@plt>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShareSeed>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
test   %edi,%edi
je     113e <ShareSeed+0xe>
mov    %edi,%ebp
jmp    1156 <ShareSeed+0x26>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebp
lea    0x4(%rsp),%rdi
call   1050 <time@plt>
imul   0x4(%rsp),%ebp
mov    %ebp,%edi
call   1040 <srand@plt>
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @ShareSeed(i32 %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp eq i32 %0, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @srand(i32 %0)
br label %14
8: ; preds = %2
%9 = tail call i32 (...) @getpid()
%10 = call i32 @time(i32* %3)
%11 = load i32, i32* %3
%12 = mul i32 %11, %9
%13 = call i32 @srand(i32 %12)
br label %14
14: ; preds = %8, %6
%15 = phi i32 [ %12, %8 ], [ %0, %6 ]
store i32 %15, i32* %1
ret void
}
void opt_parse_true(void *value, const char *option, const char *arg) {
  int *ptr = value;
  (void)option;
  (void)arg;
  *ptr = 1;
}


x86 assembly (clang, -O0):
<opt_parse_true>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_parse_true>:
movl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @opt_parse_true(i8* nocapture writeonly %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = bitcast i8* %0 to i32*
store i32 1, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void sighandler(int signo) {
  printf("Handler executed for signal %d\n", signo);
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"Handler executed for signal %d\0A\00"
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Handler executed for signal %d\0A\00"
define void @sighandler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
char *am_strndup(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *am_strdup(const char *str) {
  if (str && *str) {
    return am_strndup(str, strlen(str));
  }
  return NULL;
}


x86 assembly (clang, -O0):
<am_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116c <am_strdup+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116c <am_strdup+0x4c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <am_strndup@plt>
mov    %rax,-0x8(%rbp)
jmp    1174 <am_strdup+0x54>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<am_strdup>:
push   %rbx
test   %rdi,%rdi
je     1141 <am_strdup+0x21>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1141 <am_strdup+0x21>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <am_strndup@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @am_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @strlen(i8* %0)
%8 = tail call i8* @am_strndup(i8* %0, i32 %7)
br label %9
9: ; preds = %1, %3, %6
%10 = phi i8* [ %8, %6 ], [ null, %3 ], [ null, %1 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ init();
int /*<<< orphan*/ interp();
int /*<<< orphan*/ readfile(char *);
int run(char *filename) {
  init();
  readfile(filename);
  interp();
}


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <init@plt>
mov    -0x10(%rbp),%rdi
call   1050 <readfile@plt>
mov    $0x0,%al
call   1030 <interp@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <init@plt>
mov    %rbx,%rdi
call   1050 <readfile@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <interp@plt>

LLVM IR (-O0):
define i32 @run(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (...) @init()
%5 = load i8*, i8** %3
%6 = call i32 @readfile(i8* %5)
%7 = call i32 (...) @interp()
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @run(i8* %0) {
%2 = tail call i32 (...) @init()
%3 = tail call i32 @readfile(i8* %0)
%4 = tail call i32 (...) @interp()
ret i32 undef
}
/* Variables and functions */
int getauxval(int /*<<< orphan*/);
int main(void) { return getauxval(0); }


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

x86 assembly (clang, -O2):
<main>:
xor    %edi,%edi
jmp    1030 <getauxval@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @getauxval(i32 0)
ret i32 %1
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *calloc(size_t nmemb, size_t size) {
  void *v = malloc(size);
  memset(v, 0, size);
  return v;
}


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

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @calloc(i64 %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = tail call i32 @memset(i8* %3, i32 0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int abs(int);
int c_abs(int arg0) { return abs(arg0); }


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

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

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

LLVM IR (-O2):
define i32 @c_abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
char charconv(char c) {
  if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') ||
      (c >= 'a' && c <= 'z') || (c == '.') || (c == '-')) {
    return c;
  } else {
    return '_';
  }
}


x86 assembly (clang, -O0):
<charconv>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x30,%eax
jl     1124 <charconv+0x24>
movsbl -0x2(%rbp),%eax
cmp    $0x39,%eax
jle    1172 <charconv+0x72>
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     113e <charconv+0x3e>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jle    1172 <charconv+0x72>
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     1158 <charconv+0x58>
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jle    1172 <charconv+0x72>
movsbl -0x2(%rbp),%eax
cmp    $0x2e,%eax
je     1172 <charconv+0x72>
movsbl -0x2(%rbp),%eax
cmp    $0x2d,%eax
jne    117d <charconv+0x7d>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1181 <charconv+0x81>
movb   $0x5f,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charconv>:
mov    %edi,%eax
lea    -0x30(%rax),%ecx
cmp    $0xa,%cl
jb     112c <charconv+0x2c>
lea    -0x41(%rax),%ecx
cmp    $0x1a,%cl
jb     112c <charconv+0x2c>
lea    -0x61(%rax),%ecx
lea    -0x2d(%rax),%edx
cmp    $0x1a,%cl
movzbl %al,%ecx
mov    $0x5f,%eax
cmovb  %ecx,%eax
cmp    $0x2,%dl
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @charconv(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %35, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 90
br i1 %18, label %35, label %19
19: ; preds = %15, %11
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp sge i32 %21, 97
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp sle i32 %25, 122
br i1 %26, label %35, label %27
27: ; preds = %23, %19
%28 = load i8, i8* %3
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 46
br i1 %30, label %35, label %31
31: ; preds = %27
%32 = load i8, i8* %3
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 45
br i1 %34, label %35, label %37
35: ; preds = %31, %27, %23, %15, %7
%36 = load i8, i8* %3
store i8 %36, i8* %2
br label %38
37: ; preds = %31
store i8 95, i8* %2
br label %38
38: ; preds = %37, %35
%39 = load i8, i8* %2
ret i8 %39
}

LLVM IR (-O2):
define signext i8 @charconv(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = add i8 %0, -65
%5 = icmp ult i8 %4, 26
%6 = or i1 %3, %5
br i1 %6, label %14, label %7
7: ; preds = %1
%8 = add i8 %0, -97
%9 = icmp ult i8 %8, 26
%10 = add i8 %0, -45
%11 = icmp ult i8 %10, 2
%12 = or i1 %11, %9
%13 = select i1 %12, i8 %0, i8 95
br label %14
14: ; preds = %7, %1
%15 = phi i8 [ %0, %1 ], [ %13, %7 ]
ret i8 %15
}
/* Variables and functions */
int /*<<< orphan*/ b64dec_buf(unsigned char const *, int, char *);
scalar_t__ malloc(int);
char *b64dec(const unsigned char *data, int len) {
  char *dest;
  dest = (char *)malloc(len + 1);
  b64dec_buf(data, len, dest);
  return (dest);
}


x86 assembly (clang, -O0):
<b64dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <b64dec_buf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b64dec>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r15),%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %r15d,%esi
mov    %rax,%rdx
call   1040 <b64dec_buf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @b64dec(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = load i8*, i8** %5
%13 = call i32 @b64dec_buf(i8* %10, i32 %11, i8* %12)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define i8* @b64dec(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @b64dec_buf(i8* %0, i32 %1, i8* %5)
ret i8* %5
}
_Complex signed char foo_char(_Complex signed char x) { return x; }


x86 assembly (clang, -O0):
<foo_char>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x10(%rbp)
mov    -0x10(%rbp),%cl
mov    -0xf(%rbp),%al
mov    %cl,-0x8(%rbp)
mov    %al,-0x7(%rbp)
mov    -0x8(%rbp),%ax
pop    %rbp
ret

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

LLVM IR (-O0):
define i16 @foo_char(i16 %0) {
%2 = alloca { i8, i8 }
%3 = alloca { i8, i8 }
%4 = bitcast { i8, i8 }* %3 to i16*
store i16 %0, i16* %4
%5 = getelementptr inbounds { i8, i8 }, { i8, i8 }* %3, i32 0, i32 0
%6 = load i8, i8* %5
%7 = getelementptr inbounds { i8, i8 }, { i8, i8 }* %3, i32 0, i32 1
%8 = load i8, i8* %7
%9 = getelementptr inbounds { i8, i8 }, { i8, i8 }* %2, i32 0, i32 0
%10 = getelementptr inbounds { i8, i8 }, { i8, i8 }* %2, i32 0, i32 1
store i8 %6, i8* %9
store i8 %8, i8* %10
%11 = bitcast { i8, i8 }* %2 to i16*
%12 = load i16, i16* %11
ret i16 %12
}

LLVM IR (-O2):
define i16 @foo_char(i16 returned %0) {
ret i16 %0
}
long os_atomic_load_long(const volatile long *ptr) {
  return __atomic_load_n(ptr, 5);
}


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

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

LLVM IR (-O0):
define i64 @os_atomic_load_long(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
store i64* %0, i64** %2
%4 = load i64*, i64** %2
%5 = load atomic volatile i64, i64* %4 seq_cst
store i64 %5, i64* %3
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @os_atomic_load_long(i64* %0) {
%2 = load atomic volatile i64, i64* %0 seq_cst
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void message_repos_equals(void) {
  printf("--> Los repositorios son iguales\n");
}


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

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

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

LLVM IR (-O2):
@str = [33 x i8] c"--> Los repositorios son iguales\00"
define void @message_repos_equals() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret void
}
int foo(int x) {
  struct a_struct_named_neato {
    int int_neato;
    float float_neato;
  };
  ;
  return (x + 5);
}


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add nsw i32 %0, 5
ret i32 %2
}
INI_BitsN_TYPE() {}


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

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

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

LLVM IR (-O2):
define i32 @INI_BitsN_TYPE() {
ret i32 undef
}
/* Variables and functions */
scalar_t__ acos(float);
float n_acos(float x) {
  if (x > 1.0f)
    x = 1.0f;
  if (x < -1.0f)
    x = -1.0f;
  return (float)acos(x);
}


x86 assembly (clang, -O0):
<n_acos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xed6(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1140 <n_acos+0x30>
movss  0xec5(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xebc(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    115f <n_acos+0x4f>
movss  0xeaa(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <acos@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n_acos>:
push   %rax
movss  0xee7(%rip),%xmm1
minss  %xmm0,%xmm1
movss  0xedf(%rip),%xmm0
maxss  %xmm1,%xmm0
call   1030 <acos@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @n_acos(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ogt float %3, 1.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
store float 1.000000e+00, float* %2
br label %6
6: ; preds = %5, %1
%7 = load float, float* %2
%8 = fcmp olt float %7, -1.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
store float -1.000000e+00, float* %2
br label %10
10: ; preds = %9, %6
%11 = load float, float* %2
%12 = call i64 @acos(float %11)
%13 = sitofp i64 %12 to float
ret float %13
}

LLVM IR (-O2):
define float @n_acos(float %0) {
%2 = fcmp ogt float %0, 1.000000e+00
%3 = select i1 %2, float 1.000000e+00, float %0
%4 = fcmp olt float %3, -1.000000e+00
%5 = select i1 %4, float -1.000000e+00, float %3
%6 = tail call i64 @acos(float %5)
%7 = sitofp i64 %6 to float
ret float %7
}
int my_func(int stat_loc) {
  return ((union {
           __typeof(stat_loc) __in;
           int __i;
         }){.__in = (stat_loc)})
      .__i;
}


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

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

LLVM IR (-O0):
%union.anon = type { i32 }
define i32 @my_func(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = bitcast %union.anon* %3 to i32*
%5 = load i32, i32* %2
store i32 %5, i32* %4
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @my_func(i32 returned %0) {
ret i32 %0
}
void kshutdown() {}


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

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

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

LLVM IR (-O2):
define void @kshutdown() {
ret void
}
void test_0(int *out, int a, int b) { out[0] = a * b; }


x86 assembly (clang, -O0):
<test_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_0>:
imul   %edx,%esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @test_0(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* %5
%8 = load i32, i32* %6
%9 = mul nsw i32 %7, %8
%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_0(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %1
store i32 %4, i32* %0
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) int is_misc(uint32_t op) {
  return !((op & 0x0F900080) ^ 0x010000000);
}


x86 assembly (clang, -O0):
<is_misc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf900080,%eax
xor    $0x10000000,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_misc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 261095552
%5 = xor i32 %4, 268435456
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_misc(i32 %0) {
ret i32 0
}
/* Type definitions */
struct timex {
  long freq;
};

/* Variables and functions */
void setter_freq(struct timex *txc, long v) { txc->freq = v; }


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

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

LLVM IR (-O0):
%struct.timex = type { i64 }
define void @setter_freq(%struct.timex* %0, i64 %1) {
%3 = alloca %struct.timex*
%4 = alloca i64
store %struct.timex* %0, %struct.timex** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load %struct.timex*, %struct.timex** %3
%7 = getelementptr inbounds %struct.timex, %struct.timex* %6, i32 0, i32 0
store i64 %5, i64* %7
ret void
}

LLVM IR (-O2):
%struct.timex = type { i64 }
define void @setter_freq(%struct.timex* nocapture writeonly %0, i64 %1) {
%3 = getelementptr inbounds %struct.timex, %struct.timex* %0, i64 0, i32 0
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void how_to() {
  printf("usage: opt65 file\n");
  printf("  \"opt65\" is a peephole optimizer for 6502/10-assembler\n");
  printf("  sources. The optimized code is printed to stdout.\n");
  printf("  (This is version 0.12, Aug 23 1996, by 'Poldi')\n");
  exit(1);
}


x86 assembly (clang, -O0):
<how_to>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
lea    0xf09(%rip),%rdi
call   1030 <printf@plt>
lea    0xf32(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<how_to>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf32(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"usage: opt65 file\0A\00"
@.str.1 = [57 x i8] c" \22opt65\22 is a peephole optimizer for 6502/10-assembler\0A\00"
@.str.2 = [53 x i8] c" sources. The optimized code is printed to stdout.\0A\00"
@.str.3 = [51 x i8] c" (This is version 0.12, Aug 23 1996, by 'Poldi')\0A\00"
define void @how_to() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [18 x i8] c"usage: opt65 file\00"
@str.4 = [56 x i8] c" \22opt65\22 is a peephole optimizer for 6502/10-assembler\00"
@str.5 = [52 x i8] c" sources. The optimized code is printed to stdout.\00"
@str.6 = [50 x i8] c" (This is version 0.12, Aug 23 1996, by 'Poldi')\00"
define void @how_to() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
extern void libvamphostsdk_v_2_1_present(void) {}


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

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

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

LLVM IR (-O2):
define void @libvamphostsdk_v_2_1_present() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ loff_t;

/* Variables and functions */
int /*<<< orphan*/ lseek(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ real_llseek(int, int /*<<< orphan*/, int);
scalar_t__ smbw_fd(int);
loff_t llseek(int fd, loff_t ofs, int whence) {
  if (smbw_fd(fd)) {
    return lseek(fd, ofs, whence);
  }
  return real_llseek(fd, ofs, whence);
}


x86 assembly (clang, -O0):
<llseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <smbw_fd@plt>
cmp    $0x0,%rax
je     1169 <llseek+0x39>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <lseek@plt>
mov    %eax,-0x4(%rbp)
jmp    117a <llseek+0x4a>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <real_llseek@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llseek>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
call   1050 <smbw_fd@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
test   %rax,%rax
je     1155 <llseek+0x25>
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <lseek@plt>
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <real_llseek@plt>

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

LLVM IR (-O2):
define i32 @llseek(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @smbw_fd(i32 %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @lseek(i32 %0, i32 %1, i32 %2)
br label %10
8: ; preds = %3
%9 = tail call i32 @real_llseek(i32 %0, i32 %1, i32 %2)
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
ret i32 %11
}
void av_pix_fmt_desc_get_id() {}


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

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

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

LLVM IR (-O2):
define void @av_pix_fmt_desc_get_id() {
ret void
}
float calculate_actual_distance(float virt_dist, float calories,
                                float estimated_calories) {
  return virt_dist * (calories / estimated_calories);
}


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

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

LLVM IR (-O0):
define float @calculate_actual_distance(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = fdiv float %8, %9
%11 = fmul float %7, %10
ret float %11
}

LLVM IR (-O2):
define float @calculate_actual_distance(float %0, float %1, float %2) {
%4 = fdiv float %1, %2
%5 = fmul float %4, %0
ret float %5
}
int git_is_dir_sep(int c) { return c == '/'; }


x86 assembly (clang, -O0):
<git_is_dir_sep>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x2f,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<git_is_dir_sep>:
xor    %eax,%eax
cmp    $0x2f,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @git_is_dir_sep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 47
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @git_is_dir_sep(i32 %0) {
%2 = icmp eq i32 %0, 47
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Led0__set();
void LedsP__Leds__led0Off(void) {
  LedsP__Led0__set();
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @LedsP__Leds__led0Off() {
%1 = tail call i32 (...) @LedsP__Led0__set()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int my_traverse(void *key, void *value, void *data) {
  char *ch = key;
  assert((*ch) > 0);
  return 0;
}


x86 assembly (clang, -O0):
<my_traverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_traverse>:
push   %rax
xor    %eax,%eax
cmpb   $0x0,(%rdi)
setg   %al
mov    %eax,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @my_traverse(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
store i8* %8, i8** %7
%9 = load i8*, i8** %7
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp sgt i32 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @my_traverse(i8* nocapture %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = load i8, i8* %0
%5 = icmp sgt i8 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
ret i32 0
}
/* Variables and functions */
size_t atoi(char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, size_t);
int main(int argc, char *argv[]) {
  char b[10];
  size_t len = atoi(argv[1]);
  (void)memset(b, 0, len);
  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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %rax,-0x28(%rbp)
lea    -0x1a(%rbp),%rdi
mov    -0x28(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
lea    0xe(%rsp),%rdi
xor    %esi,%esi
mov    %rax,%rdx
call   1030 <memset@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i8]
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i64 @atoi(i8* %10)
store i64 %11, i64* %7
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%13 = load i64, i64* %7
%14 = call i32 @memset(i8* %12, i32 0, i64 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @atoi(i8* %6)
%8 = call i32 @memset(i8* %4, i32 0, i64 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char);
int main() {
  printf("%s%c", "Hola a 			todos", '\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xed8(%rip),%rsi
mov    $0xa,%edx
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    0xee6(%rip),%rsi
mov    $0xa,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s%c\00"
@.str.1 = [16 x i8] c"Hola a \09\09\09todos\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8 signext 10)
ret i32 0
}