#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*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ gendata(int, int, char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ stdout;
int main(void) {
  int data_type, data_size;
  char data_name[50];
  fprintf(stdout,
          "Precise Data Generator %.1f\n"
          "------------------------------\n\n",
          1.2);
  fprintf(stdout, "Type of size file | (0)Bytes - (1) KB - (2) MB - (3) GB : ");
  scanf("%d", &data_type);
  fprintf(stdout, "File Size: ");
  scanf("%d", &data_size);
  fprintf(stdout, "Name of Data: ");
  scanf("%s", data_name);
  puts("------------------------------\n"
       "Generating Data, Please wait !");
  gendata(data_type, data_size, data_name);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%rip),%rsi
movsd  0xe89(%rip),%xmm0
mov    $0x1,%al
call   1050 <fprintf@plt>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
lea    0xeb7(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
lea    0xee4(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    0x2e32(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
lea    0xebb(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    0x2e09(%rip),%rax
mov    (%rax),%edi
lea    0xeaf(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
lea    -0x40(%rbp),%rsi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
lea    -0x40(%rbp),%rdx
call   1040 <gendata@plt>
mov    0x2dbd(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    0x2e82(%rip),%r14
mov    (%r14),%edi
lea    0xea0(%rip),%rsi
movsd  0xe90(%rip),%xmm0
mov    $0x1,%al
call   1050 <fprintf@plt>
mov    (%r14),%edi
lea    0xec4(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xef1(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    (%r14),%edi
lea    0xedb(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    (%r14),%edi
lea    0xec7(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xec8(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    %rbx,%rdx
call   1040 <gendata@plt>
mov    0x2dd0(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [61 x i8] c"Precise Data Generator %.1f\0A------------------------------\0A\0A\00"
@.str.1 = [59 x i8] c"Type of size file | (0)Bytes - (1) KB - (2) MB - (3) GB : \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [12 x i8] c"File Size: \00"
@.str.4 = [15 x i8] c"Name of Data: \00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [62 x i8] c"------------------------------\0AGenerating Data, Please wait !\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [50 x i8]
store i32 0, i32* %1
%5 = load i32, i32* @stdout
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), double 1.200000e+00)
%7 = load i32, i32* @stdout
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%10 = load i32, i32* @stdout
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%13 = load i32, i32* @stdout
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%15 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %15)
%17 = call i32 @puts(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.6, i64 0, i64 0))
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%21 = call i32 @gendata(i32 %18, i32 %19, i8* %20)
%22 = load i32, i32* @EXIT_SUCCESS
%23 = call i32 @exit(i32 %22)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [61 x i8] c"Precise Data Generator %.1f\0A------------------------------\0A\0A\00"
@.str.1 = [59 x i8] c"Type of size file | (0)Bytes - (1) KB - (2) MB - (3) GB : \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [12 x i8] c"File Size: \00"
@.str.4 = [15 x i8] c"Name of Data: \00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [62 x i8] c"------------------------------\0AGenerating Data, Please wait !\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [50 x i8]
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%7 = load i32, i32* @stdout
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), double 1.200000e+00)
%9 = load i32, i32* @stdout
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%12 = load i32, i32* @stdout
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%15 = load i32, i32* @stdout
%16 = call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %6)
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.6, i64 0, i64 0))
%19 = load i32, i32* %1
%20 = load i32, i32* %2
%21 = call i32 @gendata(i32 %19, i32 %20, i8* %6)
%22 = load i32, i32* @EXIT_SUCCESS
%23 = call i32 @exit(i32 %22)
unreachable
}