#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*/ printf(char *, ...);
int rand();
void main() {
  int i, first = 0;
  printf("float drandv[] = {\n");
  for (i = 0; i < 1024 / 4; i++) {
    if (first) {
      printf(",\n");
    }
    printf("\t%f,\t%f,\t%f,\t%f", ((rand() & 0xfffff) / ((float)0xfffff)),
           ((rand() & 0xfffff) / ((float)0xfffff)),
           ((rand() & 0xfffff) / ((float)0xfffff)),
           ((rand() & 0xfffff) / ((float)0xfffff)));
    first = 1;
  }
  printf("\n};\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x8(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    122a <main+0x10a>
cmpl   $0x0,-0x8(%rbp)
je     1169 <main+0x49>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <rand@plt>
and    $0xfffff,%eax
cvtsi2ss %eax,%xmm0
movss  0xe7f(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
and    $0xfffff,%eax
cvtsi2ss %eax,%xmm0
movss  0xe5a(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
and    $0xfffff,%eax
cvtsi2ss %eax,%xmm0
movss  0xe35(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
and    $0xfffff,%eax
cvtsi2ss %eax,%xmm3
movss  0xe01(%rip),%xmm4
divss  %xmm4,%xmm3
cvtss2sd %xmm3,%xmm3
lea    0xe0d(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <main+0x24>
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <rand@plt>
and    $0xfffff,%eax
cvtsi2ss %eax,%xmm0
divss  0xea4(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x18(%rsp)
xor    %eax,%eax
call   1050 <rand@plt>
and    $0xfffff,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
divss  0xe7f(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1050 <rand@plt>
and    $0xfffff,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
divss  0xe5a(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1050 <rand@plt>
and    $0xfffff,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
divss  0xe35(%rip),%xmm0
cvtss2sd %xmm0,%xmm3
lea    0xe2e(%rip),%r14
mov    %r14,%rdi
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
mov    $0x4,%al
call   1040 <printf@plt>
mov    $0xff,%ebp
lea    0xe2d(%rip),%rbx
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <rand@plt>
and    $0xfffff,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  0xddd(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x18(%rsp)
xor    %eax,%eax
call   1050 <rand@plt>
and    $0xfffff,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
divss  0xdb4(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1050 <rand@plt>
and    $0xfffff,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
divss  0xd8f(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1050 <rand@plt>
and    $0xfffff,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
divss  0xd6a(%rip),%xmm0
xorps  %xmm3,%xmm3
cvtss2sd %xmm0,%xmm3
mov    %r14,%rdi
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
mov    $0x4,%al
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    1200 <main+0xd0>
lea    0xd5e(%rip),%rdi
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"float drandv[] = {\0A\00"
@.str.1 = [3 x i8] c",\0A\00"
@.str.2 = [16 x i8] c"\09%f,\09%f,\09%f,\09%f\00"
@.str.3 = [5 x i8] c"\0A};\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %4
4: ; preds = %34, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 256
br i1 %6, label %7, label %37
7: ; preds = %4
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
%13 = call i32 (...) @rand()
%14 = and i32 %13, 1048575
%15 = sitofp i32 %14 to float
%16 = fdiv float %15, 0x412FFFFE00000000
%17 = fpext float %16 to double
%18 = call i32 (...) @rand()
%19 = and i32 %18, 1048575
%20 = sitofp i32 %19 to float
%21 = fdiv float %20, 0x412FFFFE00000000
%22 = fpext float %21 to double
%23 = call i32 (...) @rand()
%24 = and i32 %23, 1048575
%25 = sitofp i32 %24 to float
%26 = fdiv float %25, 0x412FFFFE00000000
%27 = fpext float %26 to double
%28 = call i32 (...) @rand()
%29 = and i32 %28, 1048575
%30 = sitofp i32 %29 to float
%31 = fdiv float %30, 0x412FFFFE00000000
%32 = fpext float %31 to double
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %17, double %22, double %27, double %32)
store i32 1, i32* %2
br label %34
34: ; preds = %12
%35 = load i32, i32* %1
%36 = add nsw i32 %35, 1
store i32 %36, i32* %1
br label %4
37: ; preds = %4
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.2 = [16 x i8] c"\09%f,\09%f,\09%f,\09%f\00"
@str = [19 x i8] c"float drandv[] = {\00"
@str.4 = [4 x i8] c"\0A};\00"
@str.5 = [2 x i8] c",\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @rand()
%3 = and i32 %2, 1048575
%4 = sitofp i32 %3 to float
%5 = fdiv float %4, 0x412FFFFE00000000
%6 = fpext float %5 to double
%7 = tail call i32 (...) @rand()
%8 = and i32 %7, 1048575
%9 = sitofp i32 %8 to float
%10 = fdiv float %9, 0x412FFFFE00000000
%11 = fpext float %10 to double
%12 = tail call i32 (...) @rand()
%13 = and i32 %12, 1048575
%14 = sitofp i32 %13 to float
%15 = fdiv float %14, 0x412FFFFE00000000
%16 = fpext float %15 to double
%17 = tail call i32 (...) @rand()
%18 = and i32 %17, 1048575
%19 = sitofp i32 %18 to float
%20 = fdiv float %19, 0x412FFFFE00000000
%21 = fpext float %20 to double
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %6, double %11, double %16, double %21)
br label %23
23: ; preds = %0, %23
%24 = phi i32 [ 1, %0 ], [ %47, %23 ]
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.5, i64 0, i64 0))
%26 = tail call i32 (...) @rand()
%27 = and i32 %26, 1048575
%28 = sitofp i32 %27 to float
%29 = fdiv float %28, 0x412FFFFE00000000
%30 = fpext float %29 to double
%31 = tail call i32 (...) @rand()
%32 = and i32 %31, 1048575
%33 = sitofp i32 %32 to float
%34 = fdiv float %33, 0x412FFFFE00000000
%35 = fpext float %34 to double
%36 = tail call i32 (...) @rand()
%37 = and i32 %36, 1048575
%38 = sitofp i32 %37 to float
%39 = fdiv float %38, 0x412FFFFE00000000
%40 = fpext float %39 to double
%41 = tail call i32 (...) @rand()
%42 = and i32 %41, 1048575
%43 = sitofp i32 %42 to float
%44 = fdiv float %43, 0x412FFFFE00000000
%45 = fpext float %44 to double
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %30, double %35, double %40, double %45)
%47 = add nuw nsw i32 %24, 1
%48 = icmp eq i32 %47, 256
br i1 %48, label %49, label %23
49: ; preds = %23
%50 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0))
ret void
}