#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ create_rand_array(unsigned long long *, int);
int /*<<< orphan*/ read_file(unsigned long long *, int, char *);
int /*<<< orphan*/ sorting_file(unsigned long long *, int, char *);
int /*<<< orphan*/ write_file(unsigned long long *, int, char *);
int main(int argc, char *argv[]) {
  unsigned long long arr[1000000];
  create_rand_array(arr, 1000000);
  write_file(arr, 1000000, "./raw_data");
  read_file(arr, 1000000, "./raw_data");
  sorting_file(arr, 1000000, "./raw_data");
  write_file(arr, 1000000, "./sorting_data");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7a1210,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x7a1210(%rbp),%rdi
mov    $0xf4240,%esi
call   1030 <create_rand_array@plt>
lea    -0x7a1210(%rbp),%rdi
mov    $0xf4240,%esi
lea    0xe83(%rip),%rdx
call   1040 <write_file@plt>
lea    -0x7a1210(%rbp),%rdi
mov    $0xf4240,%esi
lea    0xe6b(%rip),%rdx
call   1050 <read_file@plt>
lea    -0x7a1210(%rbp),%rdi
mov    $0xf4240,%esi
lea    0xe53(%rip),%rdx
call   1060 <sorting_file@plt>
lea    -0x7a1210(%rbp),%rdi
mov    $0xf4240,%esi
lea    0xe46(%rip),%rdx
call   1040 <write_file@plt>
xor    %eax,%eax
add    $0x7a1210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x7a1208,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xf4240,%esi
call   1030 <create_rand_array@plt>
lea    0xe9f(%rip),%r14
mov    %rbx,%rdi
mov    $0xf4240,%esi
mov    %r14,%rdx
call   1040 <write_file@plt>
mov    %rbx,%rdi
mov    $0xf4240,%esi
mov    %r14,%rdx
call   1050 <read_file@plt>
mov    %rbx,%rdi
mov    $0xf4240,%esi
mov    %r14,%rdx
call   1060 <sorting_file@plt>
lea    0xe73(%rip),%rdx
mov    %rbx,%rdi
mov    $0xf4240,%esi
call   1040 <write_file@plt>
xor    %eax,%eax
add    $0x7a1208,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"./raw_data\00"
@.str.1 = [15 x i8] c"./sorting_data\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1000000 x i64]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [1000000 x i64], [1000000 x i64]* %6, i64 0, i64 0
%8 = call i32 @create_rand_array(i64* %7, i32 1000000)
%9 = getelementptr inbounds [1000000 x i64], [1000000 x i64]* %6, i64 0, i64 0
%10 = call i32 @write_file(i64* %9, i32 1000000, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%11 = getelementptr inbounds [1000000 x i64], [1000000 x i64]* %6, i64 0, i64 0
%12 = call i32 @read_file(i64* %11, i32 1000000, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%13 = getelementptr inbounds [1000000 x i64], [1000000 x i64]* %6, i64 0, i64 0
%14 = call i32 @sorting_file(i64* %13, i32 1000000, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%15 = getelementptr inbounds [1000000 x i64], [1000000 x i64]* %6, i64 0, i64 0
%16 = call i32 @write_file(i64* %15, i32 1000000, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"./raw_data\00"
@.str.1 = [15 x i8] c"./sorting_data\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1000000 x i64]
%4 = bitcast [1000000 x i64]* %3 to i8*
%5 = getelementptr inbounds [1000000 x i64], [1000000 x i64]* %3, i64 0, i64 0
%6 = call i32 @create_rand_array(i64* %5, i32 1000000)
%7 = call i32 @write_file(i64* %5, i32 1000000, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @read_file(i64* %5, i32 1000000, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @sorting_file(i64* %5, i32 1000000, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @write_file(i64* %5, i32 1000000, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}