xunge/DecIR huggingface dataset:
/* Variables and functions */
char *fooRetPtr();
char *malloc(int);
void mallocAssignment() {
  char *p = malloc(12);
  p = fooRetPtr();
}


x86 assembly (clang, -O0):
<mallocAssignment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <fooRetPtr@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @mallocAssignment() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 12)
store i8* %2, i8** %1
%3 = call i8* (...) @fooRetPtr()
store i8* %3, i8** %1
ret void
}

LLVM IR (-O2):
define void @mallocAssignment() {
%1 = tail call i8* (...) @fooRetPtr()
ret void
}
/* Type definitions */
struct gengetopt_args_info {
  int dummy;
};

/* Variables and functions */
int my_cmdline_parser2(int, char **, struct gengetopt_args_info *,
                       int /*<<< orphan*/, int, int);
int my_cmdline_parser(int argc, char **argv,
                      struct gengetopt_args_info *args_info) {
  return my_cmdline_parser2(argc, argv, args_info, 0, 1, 1);
}


x86 assembly (clang, -O0):
<my_cmdline_parser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <my_cmdline_parser2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_cmdline_parser>:
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <my_cmdline_parser2@plt>

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

LLVM IR (-O2):
%struct.gengetopt_args_info = type { i32 }
define i32 @my_cmdline_parser(i32 %0, i8** %1, %struct.gengetopt_args_info* %2) {
%4 = tail call i32 @my_cmdline_parser2(i32 %0, i8** %1, %struct.gengetopt_args_info* %2, i32 0, i32 1, i32 1)
ret i32 %4
}
/* Type definitions */
struct mloop_timer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mloop__ref_any(struct mloop_timer *);
__attribute__((visibility("default"))) void
mloop_timer_ref(struct mloop_timer *self) {
  mloop__ref_any(self);
}


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

x86 assembly (clang, -O2):
<mloop_timer_ref>:
jmp    1030 <mloop__ref_any@plt>

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

LLVM IR (-O2):
%struct.mloop_timer = type { i32 }
define void @mloop_timer_ref(%struct.mloop_timer* %0) {
%2 = tail call i32 @mloop__ref_any(%struct.mloop_timer* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bzero(char **, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char str[10] = {'a', 'b', 'c', 'd'};
  printf("%s\n", str);
  bzero(&str, 4);
  printf("%s\n", str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xa(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0xa(%rbp),%rsi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    -0xa(%rbp),%rdi
mov    $0x4,%esi
call   1040 <bzero@plt>
lea    -0xa(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movw   $0x0,0x10(%rsp)
movq   $0x64636261,0x8(%rsp)
63 64
lea    0xecc(%rip),%r14
lea    0x8(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <bzero@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@__const.main.str = [10 x i8] c"abcd\00\00\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = bitcast [10 x i8]* %1 to i8**
%5 = call i32 @bzero(i8** %4, i32 4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ inter_pet_delete(int);
int /*<<< orphan*/ mapif_delete_pet_ack(int, int /*<<< orphan*/);
int mapif_delete_pet(int fd, int pet_id) {
  mapif_delete_pet_ack(fd, inter_pet_delete(pet_id));
  return 0;
}


x86 assembly (clang, -O0):
<mapif_delete_pet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <inter_pet_delete@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1040 <mapif_delete_pet_ack@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapif_delete_pet>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <inter_pet_delete@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <mapif_delete_pet_ack@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mapif_delete_pet(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 @inter_pet_delete(i32 %6)
%8 = call i32 @mapif_delete_pet_ack(i32 %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @mapif_delete_pet(i32 %0, i32 %1) {
%3 = tail call i32 @inter_pet_delete(i32 %1)
%4 = tail call i32 @mapif_delete_pet_ack(i32 %0, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ht_sum_valid();
char *u642str(int /*<<< orphan*/, int /*<<< orphan*/);
char *get_str_valid_reqs(void) { return u642str(ht_sum_valid(), 0); }


x86 assembly (clang, -O0):
<get_str_valid_reqs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ht_sum_valid@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <u642str@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_str_valid_reqs>:
push   %rax
xor    %eax,%eax
call   1040 <ht_sum_valid@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <u642str@plt>

LLVM IR (-O0):
define i8* @get_str_valid_reqs() {
%1 = call i32 (...) @ht_sum_valid()
%2 = call i8* @u642str(i32 %1, i32 0)
ret i8* %2
}

LLVM IR (-O2):
define i8* @get_str_valid_reqs() {
%1 = tail call i32 (...) @ht_sum_valid()
%2 = tail call i8* @u642str(i32 %1, i32 0)
ret i8* %2
}
void bfqg_stats_update_io_remove(struct bfq_group *bfqg, int op, int op_flags) {
}


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

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

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

LLVM IR (-O2):
%struct.bfq_group = type opaque
define void @bfqg_stats_update_io_remove(%struct.bfq_group* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Type definitions */
struct mm_array {
  int dummy;
};

/* Variables and functions */
struct mm_array *mm_array_new3(size_t, size_t, int /*<<< orphan*/ *);
struct mm_array *mm_array_new2(size_t element_size, size_t count) {
  return mm_array_new3(element_size, count, NULL);
}


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

x86 assembly (clang, -O2):
<mm_array_new2>:
xor    %edx,%edx
jmp    1030 <mm_array_new3@plt>

LLVM IR (-O0):
%struct.mm_array = type { i32 }
define %struct.mm_array* @mm_array_new2(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call %struct.mm_array* @mm_array_new3(i64 %5, i64 %6, i32* null)
ret %struct.mm_array* %7
}

LLVM IR (-O2):
%struct.mm_array = type { i32 }
define %struct.mm_array* @mm_array_new2(i64 %0, i64 %1) {
%3 = tail call %struct.mm_array* @mm_array_new3(i64 %0, i64 %1, i32* null)
ret %struct.mm_array* %3
}
char *corta_string(char *apuntador) {
  while (*apuntador != ' ')
    apuntador = apuntador + 1;
  return apuntador;
}


x86 assembly (clang, -O0):
<corta_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1129 <corta_string+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <corta_string+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<corta_string>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x20,0x1(%rax)
lea    0x1(%rax),%rax
jne    1110 <corta_string+0x10>
ret

LLVM IR (-O0):
define i8* @corta_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 32
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @corta_string(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 32
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ ft_putaddr(int *);
int main(void) {
  int a;
  int *ptr;
  a = 3;
  ptr = &a;
  ft_putaddr(ptr);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ft_putaddr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x3,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <ft_putaddr@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 3, i32* %1
%3 = call i32 @ft_putaddr(i32* %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int tl1parsestream(FILE *tl1stream) {}


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

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

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

LLVM IR (-O2):
define i32 @tl1parsestream(i32* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
unsigned int rgb_to_pixel15(unsigned int, unsigned int, unsigned int);
unsigned int rgb_to_pixel15_dup(unsigned int r, unsigned int g,
                                unsigned int b) {
  unsigned int col;
  col = rgb_to_pixel15(r, g, b);
  col |= col << 16;
  return col;
}


x86 assembly (clang, -O0):
<rgb_to_pixel15_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <rgb_to_pixel15@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x10,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb_to_pixel15_dup>:
push   %rax
call   1030 <rgb_to_pixel15@plt>
mov    %eax,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @rgb_to_pixel15_dup(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @rgb_to_pixel15(i32 %0, i32 %1, i32 %2)
%5 = shl i32 %4, 16
%6 = or i32 %5, %4
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *itoa(int n) {
  static char text[10][16];
  static int i = 0;
  char *s = text[i++ % 10];
  sprintf(s, "%d", n);
  return s;
}


x86 assembly (clang, -O0):
<itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2fbf(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2fb4(%rip)
mov    $0xa,%ecx
cltd
idiv   %ecx
movslq %edx,%rcx
lea    0x2f02(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xea9(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa>:
push   %rbx
mov    %edi,%edx
movslq 0x2fc6(%rip),%rax
lea    0x1(%rax),%ecx
mov    %ecx,0x2fbd(%rip)
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rcx
add    %esi,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
cltq
shl    $0x4,%rax
lea    0x2ef5(%rip),%rbx
add    %rax,%rbx
lea    0xeab(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@itoa.text = internal global [10 x [16 x i8]] zeroinitializer
@itoa.i = internal global i32 0
@.str = [3 x i8] c"%d\00"
define i8* @itoa(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* @itoa.i
%5 = add nsw i32 %4, 1
store i32 %5, i32* @itoa.i
%6 = srem i32 %4, 10
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [10 x [16 x i8]], [10 x [16 x i8]]* @itoa.text, i64 0, i64 %7
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %8, i64 0, i64 0
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i32, i32* %2
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@itoa.text = internal global [10 x [16 x i8]] zeroinitializer
@itoa.i = internal unnamed_addr global i32 0
@.str = [3 x i8] c"%d\00"
define i8* @itoa(i32 %0) {
%2 = load i32, i32* @itoa.i
%3 = add nsw i32 %2, 1
store i32 %3, i32* @itoa.i
%4 = srem i32 %2, 10
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [10 x [16 x i8]], [10 x [16 x i8]]* @itoa.text, i64 0, i64 %5, i64 0
%7 = tail call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
void init_locale(void) { setlocale(LC_ALL, ""); }


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

x86 assembly (clang, -O2):
<init_locale>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <setlocale@plt>

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
define void @init_locale() {
%1 = load i32, i32* @LC_ALL
%2 = call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
define void @init_locale() {
%1 = load i32, i32* @LC_ALL
%2 = tail call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int FileExists(char *file) {
  FILE *f = fopen(file, "rb");
  if (!f)
    return 0;
  fclose(f);
  return 1;
}


x86 assembly (clang, -O0):
<FileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1157 <FileExists+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1167 <FileExists+0x47>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FileExists>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <FileExists+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define i32 @FileExists(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/apq.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/apq.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/apq.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_suspend_sink_by_index() {
  printf("NOT IMPLEMENTED:"
         "pa_context_suspend_sink_by_index"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [49 x i8] c"NOT IMPLEMENTED:pa_context_suspend_sink_by_index\00"
define i32 @pa_context_suspend_sink_by_index() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct pstore_info {
  int dummy;
};

/* Variables and functions */
int ENODEV;
int pstore_register(struct pstore_info *psi) { return -ENODEV; }


x86 assembly (clang, -O0):
<pstore_register>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pstore_register>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.pstore_info = type { i32 }
@ENODEV = global i32 0
define i32 @pstore_register(%struct.pstore_info* %0) {
%2 = alloca %struct.pstore_info*
store %struct.pstore_info* %0, %struct.pstore_info** %2
%3 = load i32, i32* @ENODEV
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
%struct.pstore_info = type { i32 }
@ENODEV = global i32 0
define i32 @pstore_register(%struct.pstore_info* nocapture readnone %0) {
%2 = load i32, i32* @ENODEV
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
long S_IRGRP;
long S_IROTH;
long S_IRUSR;
long S_IWGRP;
long S_IWOTH;
long S_IWUSR;
long sys_umask(va_list ap) {
  return (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
}


x86 assembly (clang, -O0):
<sys_umask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%rax
mov    0x2ec8(%rip),%rcx
or     (%rcx),%rax
mov    0x2eae(%rip),%rcx
or     (%rcx),%rax
mov    0x2ebc(%rip),%rcx
or     (%rcx),%rax
mov    0x2e92(%rip),%rcx
or     (%rcx),%rax
mov    0x2e70(%rip),%rcx
or     (%rcx),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_umask>:
mov    0x2eb9(%rip),%rcx
mov    0x2ed2(%rip),%rax
mov    (%rax),%rax
or     (%rcx),%rax
mov    0x2eb5(%rip),%rcx
or     (%rcx),%rax
mov    0x2ec3(%rip),%rcx
or     (%rcx),%rax
mov    0x2e99(%rip),%rcx
or     (%rcx),%rax
mov    0x2e77(%rip),%rcx
or     (%rcx),%rax
ret

LLVM IR (-O0):
@S_IRUSR = global i64 0
@S_IWUSR = global i64 0
@S_IRGRP = global i64 0
@S_IWGRP = global i64 0
@S_IROTH = global i64 0
@S_IWOTH = global i64 0
define i64 @sys_umask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i64, i64* @S_IRUSR
%4 = load i64, i64* @S_IWUSR
%5 = or i64 %3, %4
%6 = load i64, i64* @S_IRGRP
%7 = or i64 %5, %6
%8 = load i64, i64* @S_IWGRP
%9 = or i64 %7, %8
%10 = load i64, i64* @S_IROTH
%11 = or i64 %9, %10
%12 = load i64, i64* @S_IWOTH
%13 = or i64 %11, %12
ret i64 %13
}

LLVM IR (-O2):
@S_IRUSR = global i64 0
@S_IWUSR = global i64 0
@S_IRGRP = global i64 0
@S_IWGRP = global i64 0
@S_IROTH = global i64 0
@S_IWOTH = global i64 0
define i64 @sys_umask(i32 %0) {
%2 = load i64, i64* @S_IRUSR
%3 = load i64, i64* @S_IWUSR
%4 = or i64 %3, %2
%5 = load i64, i64* @S_IRGRP
%6 = or i64 %4, %5
%7 = load i64, i64* @S_IWGRP
%8 = or i64 %6, %7
%9 = load i64, i64* @S_IROTH
%10 = or i64 %8, %9
%11 = load i64, i64* @S_IWOTH
%12 = or i64 %10, %11
ret i64 %12
}
float lerp(float a, float b, float progress) { return a + (b - a) * progress; }


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

x86 assembly (clang, -O2):
<lerp>:
subss  %xmm0,%xmm1
mulss  %xmm2,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @lerp(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* %4
%10 = fsub float %8, %9
%11 = load float, float* %6
%12 = call float @llvm.fmuladd.f32(float %10, float %11, float %7)
ret float %12
}

LLVM IR (-O2):
define float @lerp(float %0, float %1, float %2) {
%4 = fsub float %1, %0
%5 = tail call float @llvm.fmuladd.f32(float %4, float %2, float %0)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ DrawPercentageBar(unsigned int, unsigned int, unsigned int,
                                     int, int);
void DrawProgressBar(unsigned int x, unsigned int y, unsigned int percent) {
  DrawPercentageBar(x, y, percent, 1, 100);
}


x86 assembly (clang, -O0):
<DrawProgressBar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x1,%ecx
mov    $0x64,%r8d
call   1030 <DrawPercentageBar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawProgressBar>:
mov    $0x1,%ecx
mov    $0x64,%r8d
jmp    1030 <DrawPercentageBar@plt>

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

LLVM IR (-O2):
define void @DrawProgressBar(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @DrawPercentageBar(i32 %0, i32 %1, i32 %2, i32 1, i32 100)
ret void
}
/* Variables and functions */
long incr(long *, int);
long call_incr() {
  long v1 = 15213;
  long v2 = incr(&v1, 3000);
  return v1 + v2;
}


x86 assembly (clang, -O0):
<call_incr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x3b6d,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0xbb8,%esi
call   1030 <incr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_incr>:
push   %rax
movq   $0x3b6d,(%rsp)
mov    %rsp,%rdi
mov    $0xbb8,%esi
call   1030 <incr@plt>
add    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @call_incr() {
%1 = alloca i64
%2 = alloca i64
store i64 15213, i64* %1
%3 = call i64 @incr(i64* %1, i32 3000)
store i64 %3, i64* %2
%4 = load i64, i64* %1
%5 = load i64, i64* %2
%6 = add nsw i64 %4, %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @call_incr() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 15213, i64* %1
%3 = call i64 @incr(i64* %1, i32 3000)
%4 = load i64, i64* %1
%5 = add nsw i64 %4, %3
ret i64 %5
}
int args0(void) {
  void *local1 = 0;
  void *local2 = 0;
  void *local3 = 0;
  void *local4 = 0;
  void *local5 = 0;
  return local1;
}


x86 assembly (clang, -O0):
<args0>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @args0() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* null, i8** %1
store i8* null, i8** %2
store i8* null, i8** %3
store i8* null, i8** %4
store i8* null, i8** %5
%6 = load i8*, i8** %1
%7 = ptrtoint i8* %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @args0() {
ret i32 0
}
int fun429() { return 429; }


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

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

LLVM IR (-O0):
define i32 @fun429() {
ret i32 429
}

LLVM IR (-O2):
define i32 @fun429() {
ret i32 429
}
int test_imm_14int64_midword_reg(long long val) {
  return ((val >> 16) & (0x14 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_14int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x14,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_14int64_midword_reg>:
test   $0x140000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_14int64_midword_reg(i64 %0) {
%2 = and i64 %0, 1310720
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
_Complex long double foo_long_double(_Complex long double x) { return x; }


x86 assembly (clang, -O0):
<foo_long_double>:
push   %rbp
mov    %rsp,%rbp
lea    0x10(%rbp),%rax
fldt   (%rax)
fldt   0x10(%rax)
fxch   %st(1)
fstpt  -0x20(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_long_double>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
fxch   %st(1)
ret

LLVM IR (-O0):
define { x86_fp80, x86_fp80 } @foo_long_double({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = alloca { x86_fp80, x86_fp80 }
%3 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%4 = load x86_fp80, x86_fp80* %3
%5 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%6 = load x86_fp80, x86_fp80* %5
%7 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i32 0, i32 0
%8 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i32 0, i32 1
store x86_fp80 %4, x86_fp80* %7
store x86_fp80 %6, x86_fp80* %8
%9 = load { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2
ret { x86_fp80, x86_fp80 } %9
}

LLVM IR (-O2):
define { x86_fp80, x86_fp80 } @foo_long_double({ x86_fp80, x86_fp80 }* nocapture byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 0
%3 = load x86_fp80, x86_fp80* %2
%4 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 1
%5 = load x86_fp80, x86_fp80* %4
%6 = insertvalue { x86_fp80, x86_fp80 } poison, x86_fp80 %3, 0
%7 = insertvalue { x86_fp80, x86_fp80 } %6, x86_fp80 %5, 1
ret { x86_fp80, x86_fp80 } %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
unsigned int bcd_byte(uint32_t bcd, int byteno) {
  bcd >>= byteno * 8;
  return (bcd >> 4 & 0xf) * 10 + (bcd & 0xf);
}


x86 assembly (clang, -O0):
<bcd_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
shl    $0x3,%ecx
mov    -0x4(%rbp),%eax
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
imul   $0xa,%eax,%eax
mov    -0x4(%rbp),%ecx
and    $0xf,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcd_byte>:
lea    0x0(,%rsi,8),%ecx
sar    %cl,%edi
mov    %edi,%eax
shr    $0x4,%eax
and    $0xf,%eax
lea    (%rax,%rax,4),%eax
and    $0xf,%edi
lea    (%rdi,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @bcd_byte(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 8
%7 = load i32, i32* %3
%8 = ashr i32 %7, %6
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = ashr i32 %9, 4
%11 = and i32 %10, 15
%12 = mul nsw i32 %11, 10
%13 = load i32, i32* %3
%14 = and i32 %13, 15
%15 = add nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @bcd_byte(i32 %0, i32 %1) {
%3 = shl nsw i32 %1, 3
%4 = ashr i32 %0, %3
%5 = lshr i32 %4, 4
%6 = and i32 %5, 15
%7 = mul nuw nsw i32 %6, 10
%8 = and i32 %4, 15
%9 = add nuw nsw i32 %7, %8
ret i32 %9
}
int _fstat() { return 0; }


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

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

LLVM IR (-O0):
define i32 @_fstat() {
ret i32 0
}

LLVM IR (-O2):
define i32 @_fstat() {
ret i32 0
}
void gpio_activate_audio_ports(void) {}


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

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

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

LLVM IR (-O2):
define void @gpio_activate_audio_ports() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int main() { putchar('\n'); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
void busy_wait(void) {
  long i;
  for (i = 0; i < 0x80000L; i++)
    ;
}


x86 assembly (clang, -O0):
<busy_wait>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
cmpq   $0x80000,-0x8(%rbp)
jge    1130 <busy_wait+0x30>
jmp    111f <busy_wait+0x1f>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <busy_wait+0xc>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @busy_wait() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char i, v;
  scanf("%c", &i);
  v = 'z' - (i - 'a');
  printf("%c", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x1(%rbp),%ecx
sub    $0x61,%ecx
mov    $0x7a,%eax
sub    %ecx,%eax
mov    %al,-0x2(%rbp)
lea    0xeb0(%rip),%rdi
movsbl -0x2(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    $0xdb,%al
sub    0xf(%rsp),%al
movsbl %al,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = sub nsw i32 %5, 97
%7 = sub nsw i32 122, %6
%8 = trunc i32 %7 to i8
store i8 %8, i8* %2
%9 = load i8, i8* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sub i8 -37, %3
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_CIPHER_CTX;
typedef int /*<<< orphan*/ EVP_CIPHER;

/* Variables and functions */
int /*<<< orphan*/ EVP_CIPHER_CTX_reset(int /*<<< orphan*/ *);
int EVP_CipherInit_ex(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                      int /*<<< orphan*/ *, unsigned char const *,
                      unsigned char const *, int);
int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
                   const unsigned char *key, const unsigned char *iv, int enc) {
  EVP_CIPHER_CTX_reset(ctx);
  return EVP_CipherInit_ex(ctx, cipher, NULL, key, iv, enc);
}


x86 assembly (clang, -O0):
<EVP_CipherInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <EVP_CIPHER_CTX_reset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
xor    %eax,%eax
mov    %eax,%edx
call   1040 <EVP_CipherInit_ex@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EVP_CipherInit>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1030 <EVP_CIPHER_CTX_reset@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
mov    %r12,%rcx
mov    %r15,%r8
mov    %r14d,%r9d
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <EVP_CipherInit_ex@plt>

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

LLVM IR (-O2):
define i32 @EVP_CipherInit(i32* %0, i32* %1, i8* %2, i8* %3, i32 %4) {
%6 = tail call i32 @EVP_CIPHER_CTX_reset(i32* %0)
%7 = tail call i32 @EVP_CipherInit_ex(i32* %0, i32* %1, i32* null, i8* %2, i8* %3, i32 %4)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
int /*<<< orphan*/ rewindmusic();
void basRewindMusic(void) { pushNumber(rewindmusic()); }


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

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

LLVM IR (-O0):
define void @basRewindMusic() {
%1 = call i32 (...) @rewindmusic()
%2 = call i32 @pushNumber(i32 %1)
ret void
}

LLVM IR (-O2):
define void @basRewindMusic() {
%1 = tail call i32 (...) @rewindmusic()
%2 = tail call i32 @pushNumber(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void rt_warn(char *mesg) {
  fprintf(stderr, "%s\n", mesg);
  exit(1);
}


x86 assembly (clang, -O0):
<rt_warn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<rt_warn>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @rt_warn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @rt_warn(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
unsigned int test_04(volatile unsigned char *x) { return x[5]; }


x86 assembly (clang, -O0):
<test_04>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x5(%rax),%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_04(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 5
%5 = load volatile i8, i8* %4
%6 = zext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test_04(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 5
%3 = load volatile i8, i8* %2
%4 = zext i8 %3 to i32
ret i32 %4
}
unsigned char *range_uchar(unsigned char *val, unsigned char min,
                           unsigned char max) {
  if (*val < min || max < *val)
    __builtin_abort();
  return val;
}


x86 assembly (clang, -O0):
<range_uchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jl     114d <range_uchar+0x3d>
movzbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
cmp    %ecx,%eax
jge    1152 <range_uchar+0x42>
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<range_uchar>:
push   %rax
mov    (%rdi),%al
cmp    %sil,%al
jb     1121 <range_uchar+0x11>
cmp    %dl,%al
ja     1121 <range_uchar+0x11>
mov    %rdi,%rax
pop    %rcx
ret
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i8* @range_uchar(i8* returned %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = icmp ult i8 %4, %1
%6 = icmp ugt i8 %4, %2
%7 = or i1 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %3
tail call void @abort()
unreachable
9: ; preds = %3
ret i8* %0
}
void lib3ds_matrix_zero(float m[4][4]) {
  int i, j;
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 4; j++)
      m[i][j] = 0.0f;
  }
}


x86 assembly (clang, -O0):
<lib3ds_matrix_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1166 <lib3ds_matrix_zero+0x66>
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    1153 <lib3ds_matrix_zero+0x53>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <lib3ds_matrix_zero+0x20>
jmp    1158 <lib3ds_matrix_zero+0x58>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <lib3ds_matrix_zero+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lib3ds_matrix_zero>:
xorps  %xmm0,%xmm0
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @lib3ds_matrix_zero([4 x float]* nocapture writeonly %0) {
%2 = bitcast [4 x float]* %0 to i8*
ret void
}