#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int RAND_MAX;
int atoi(char *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, float);
int /*<<< orphan*/ printf(char *);
float rand();
int /*<<< orphan*/ srand(int);
long time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  int utime;
  long int ltime;
  int i;
  int coordinate_index = atoi(argv[2]);
  float cords[coordinate_index][3];
  ltime = time(NULL);
  utime = (unsigned int)ltime / 2;
  srand(utime);
  for (i = 0; i < coordinate_index; i++) {
    cords[i][0] = (float)34 * rand() / (RAND_MAX - 1);
    cords[i][1] = (float)34 * rand() / (RAND_MAX - 1);
    cords[i][2] = (float)34 * rand() / (RAND_MAX - 1);
  }
  FILE *output = fopen(argv[1], "w");
  if (output == NULL) {
    printf("Error opening file!\n");
    return 1;
  }
  for (i = 0; i < coordinate_index; i++) {
    fprintf(output, "%f ", cords[i][0]);
    fprintf(output, "%f ", cords[i][1]);
    fprintf(output, "%f\n", cords[i][2]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
lea    (%rax,%rax,2),%rcx
lea    0xf(,%rcx,4),%rdx
movabs $0x1ffffffff0,%rcx
and    %rcx,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x50(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
shr    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <srand@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    12c3 <main+0x153>
mov    $0x0,%al
call   1090 <rand@plt>
mov    -0x50(%rbp),%rax
movaps %xmm0,%xmm1
movss  0xdee(%rip),%xmm0
mulss  %xmm1,%xmm0
mov    0x2dcb(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
cvtsi2ss %ecx,%xmm1
divss  %xmm1,%xmm0
movslq -0x24(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movss  %xmm0,(%rax)
mov    $0x0,%al
call   1090 <rand@plt>
mov    -0x50(%rbp),%rax
movaps %xmm0,%xmm1
movss  0xdb1(%rip),%xmm0
mulss  %xmm1,%xmm0
mov    0x2d8e(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
cvtsi2ss %ecx,%xmm1
divss  %xmm1,%xmm0
movslq -0x24(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movss  %xmm0,0x4(%rax)
mov    $0x0,%al
call   1090 <rand@plt>
mov    -0x50(%rbp),%rax
movaps %xmm0,%xmm1
movss  0xd73(%rip),%xmm0
mulss  %xmm1,%xmm0
mov    0x2d50(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
cvtsi2ss %ecx,%xmm1
divss  %xmm1,%xmm0
movslq -0x24(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movss  %xmm0,0x8(%rax)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11f0 <main+0x80>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd32(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    1305 <main+0x195>
lea    0xd19(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x44(%rbp)
jmp    1398 <main+0x228>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    1391 <main+0x221>
mov    -0x50(%rbp),%rax
mov    -0x40(%rbp),%rdi
movslq -0x24(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movss  (%rax),%xmm0
lea    0xce5(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x50(%rbp),%rax
mov    -0x40(%rbp),%rdi
movslq -0x24(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movss  0x4(%rax),%xmm0
lea    0xcc1(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x50(%rbp),%rax
mov    -0x40(%rbp),%rdi
movslq -0x24(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movss  0x8(%rax),%xmm0
lea    0xca1(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    130c <main+0x19c>
movl   $0x0,-0x44(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r13
mov    0x10(%rsi),%rdi
call   1080 <atoi@plt>
mov    %eax,%r12d
mov    %eax,%ebx
lea    (%rbx,%rbx,2),%rax
lea    0xf(,%rax,4),%rax
movabs $0x1ffffffff0,%rcx
and    %rax,%rcx
mov    %rsp,%r14
sub    %rcx,%r14
mov    %r14,%rsp
xor    %r15d,%r15d
xor    %edi,%edi
call   1060 <time@plt>
shr    %eax
mov    %eax,%edi
call   1040 <srand@plt>
test   %r12d,%r12d
jle    12e7 <main+0x177>
mov    %rbx,-0x30(%rbp)
lea    0x0(,%rbx,4),%rax
lea    (%rax,%rax,2),%r15
mov    0x2e04(%rip),%r12
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1090 <rand@plt>
mov    (%r12),%eax
add    $0xffffffff,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
movss  0xdf3(%rip),%xmm2
mulss  %xmm2,%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,(%r14,%rbx,1)
xor    %eax,%eax
call   1090 <rand@plt>
mov    (%r12),%eax
add    $0xffffffff,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
mulss  0xdc8(%rip),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,0x4(%r14,%rbx,1)
xor    %eax,%eax
call   1090 <rand@plt>
mulss  0xdae(%rip),%xmm0
mov    (%r12),%eax
add    $0xffffffff,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,0x8(%r14,%rbx,1)
add    $0xc,%rbx
cmp    %rbx,%r15
jne    11f0 <main+0x80>
mov    0x8(%r13),%rdi
lea    0xd81(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     12fc <main+0x18c>
cmpl   $0x0,-0x30(%rbp)
jle    12e2 <main+0x172>
mov    %rax,%r13
lea    0xd69(%rip),%rbx
xor    %r12d,%r12d
movss  (%r14,%r12,1),%xmm0
mov    %r13,%rdi
mov    %rbx,%rsi
call   1050 <fprintf@plt>
movss  0x4(%r14,%r12,1),%xmm0
mov    %r13,%rdi
mov    %rbx,%rsi
call   1050 <fprintf@plt>
movss  0x8(%r14,%r12,1),%xmm0
mov    %r13,%rdi
lea    0xd36(%rip),%rsi
call   1050 <fprintf@plt>
add    $0xc,%r12
cmp    %r12,%r15
jne    12a0 <main+0x130>
xor    %r15d,%r15d
jmp    130e <main+0x19e>
mov    0x8(%r13),%rdi
lea    0xd12(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
jne    130e <main+0x19e>
lea    0xd0b(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%r15d
mov    %r15d,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
@.str = [2 x i8] c"w\00"
@.str.1 = [21 x i8] c"Error opening file!\0A\00"
@.str.2 = [4 x i8] c"%f \00"
@.str.3 = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i32*
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call i32 @atoi(i8* %16)
store i32 %17, i32* %9
%18 = load i32, i32* %9
%19 = zext i32 %18 to i64
%20 = call i8* @llvm.stacksave()
store i8* %20, i8** %10
%21 = alloca [3 x float], i64 %19
store i64 %19, i64* %11
%22 = call i64 @time(i32* null)
store i64 %22, i64* %7
%23 = load i64, i64* %7
%24 = trunc i64 %23 to i32
%25 = udiv i32 %24, 2
store i32 %25, i32* %6
%26 = load i32, i32* %6
%27 = call i32 @srand(i32 %26)
store i32 0, i32* %8
br label %28
28: ; preds = %63, %2
%29 = load i32, i32* %8
%30 = load i32, i32* %9
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %66
32: ; preds = %28
%33 = call float (...) @rand()
%34 = fmul float 3.400000e+01, %33
%35 = load i32, i32* @RAND_MAX
%36 = sub nsw i32 %35, 1
%37 = sitofp i32 %36 to float
%38 = fdiv float %34, %37
%39 = load i32, i32* %8
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [3 x float], [3 x float]* %21, i64 %40
%42 = getelementptr inbounds [3 x float], [3 x float]* %41, i64 0, i64 0
store float %38, float* %42
%43 = call float (...) @rand()
%44 = fmul float 3.400000e+01, %43
%45 = load i32, i32* @RAND_MAX
%46 = sub nsw i32 %45, 1
%47 = sitofp i32 %46 to float
%48 = fdiv float %44, %47
%49 = load i32, i32* %8
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [3 x float], [3 x float]* %21, i64 %50
%52 = getelementptr inbounds [3 x float], [3 x float]* %51, i64 0, i64 1
store float %48, float* %52
%53 = call float (...) @rand()
%54 = fmul float 3.400000e+01, %53
%55 = load i32, i32* @RAND_MAX
%56 = sub nsw i32 %55, 1
%57 = sitofp i32 %56 to float
%58 = fdiv float %54, %57
%59 = load i32, i32* %8
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [3 x float], [3 x float]* %21, i64 %60
%62 = getelementptr inbounds [3 x float], [3 x float]* %61, i64 0, i64 2
store float %58, float* %62
br label %63
63: ; preds = %32
%64 = load i32, i32* %8
%65 = add nsw i32 %64, 1
store i32 %65, i32* %8
br label %28
66: ; preds = %28
%67 = load i8**, i8*** %5
%68 = getelementptr inbounds i8*, i8** %67, i64 1
%69 = load i8*, i8** %68
%70 = call i32* @fopen(i8* %69, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %70, i32** %12
%71 = load i32*, i32** %12
%72 = icmp eq i32* %71, null
br i1 %72, label %73, label %75
73: ; preds = %66
%74 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
store i32 1, i32* %13
br label %106
75: ; preds = %66
store i32 0, i32* %8
br label %76
76: ; preds = %102, %75
%77 = load i32, i32* %8
%78 = load i32, i32* %9
%79 = icmp slt i32 %77, %78
br i1 %79, label %80, label %105
80: ; preds = %76
%81 = load i32*, i32** %12
%82 = load i32, i32* %8
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [3 x float], [3 x float]* %21, i64 %83
%85 = getelementptr inbounds [3 x float], [3 x float]* %84, i64 0, i64 0
%86 = load float, float* %85
%87 = call i32 @fprintf(i32* %81, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), float %86)
%88 = load i32*, i32** %12
%89 = load i32, i32* %8
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [3 x float], [3 x float]* %21, i64 %90
%92 = getelementptr inbounds [3 x float], [3 x float]* %91, i64 0, i64 1
%93 = load float, float* %92
%94 = call i32 @fprintf(i32* %88, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), float %93)
%95 = load i32*, i32** %12
%96 = load i32, i32* %8
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [3 x float], [3 x float]* %21, i64 %97
%99 = getelementptr inbounds [3 x float], [3 x float]* %98, i64 0, i64 2
%100 = load float, float* %99
%101 = call i32 @fprintf(i32* %95, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), float %100)
br label %102
102: ; preds = %80
%103 = load i32, i32* %8
%104 = add nsw i32 %103, 1
store i32 %104, i32* %8
br label %76
105: ; preds = %76
store i32 0, i32* %13
br label %106
106: ; preds = %105, %73
%107 = load i8*, i8** %10
%108 = load i32, i32* %13
switch i32 %108, label %111 [
i32 0, label %109
i32 1, label %109
]
109: ; preds = %106, %106
%110 = load i32, i32* %3
ret i32 %110
111: ; preds = %106
unreachable
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
@.str = [2 x i8] c"w\00"
@.str.2 = [4 x i8] c"%f \00"
@.str.3 = [4 x i8] c"%f\0A\00"
@str = [20 x i8] c"Error opening file!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 2
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = zext i32 %5 to i64
%7 = alloca [3 x float], i64 %6
%8 = tail call i64 @time(i32* null)
%9 = trunc i64 %8 to i32
%10 = lshr i32 %9, 1
%11 = tail call i32 @srand(i32 %10)
%12 = icmp sgt i32 %5, 0
br i1 %12, label %13, label %43
13: ; preds = %2, %13
%14 = phi i64 [ %36, %13 ], [ 0, %2 ]
%15 = tail call float (...) @rand()
%16 = fmul float %15, 3.400000e+01
%17 = load i32, i32* @RAND_MAX
%18 = add nsw i32 %17, -1
%19 = sitofp i32 %18 to float
%20 = fdiv float %16, %19
%21 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 %14, i64 0
store float %20, float* %21
%22 = tail call float (...) @rand()
%23 = fmul float %22, 3.400000e+01
%24 = load i32, i32* @RAND_MAX
%25 = add nsw i32 %24, -1
%26 = sitofp i32 %25 to float
%27 = fdiv float %23, %26
%28 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 %14, i64 1
store float %27, float* %28
%29 = tail call float (...) @rand()
%30 = fmul float %29, 3.400000e+01
%31 = load i32, i32* @RAND_MAX
%32 = add nsw i32 %31, -1
%33 = sitofp i32 %32 to float
%34 = fdiv float %30, %33
%35 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 %14, i64 2
store float %34, float* %35
%36 = add nuw nsw i64 %14, 1
%37 = icmp eq i64 %36, %6
br i1 %37, label %38, label %13
38: ; preds = %13
%39 = getelementptr inbounds i8*, i8** %1, i64 1
%40 = load i8*, i8** %39
%41 = tail call i32* @fopen(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%42 = icmp eq i32* %41, null
br i1 %42, label %49, label %48
43: ; preds = %2
%44 = getelementptr inbounds i8*, i8** %1, i64 1
%45 = load i8*, i8** %44
%46 = tail call i32* @fopen(i8* %45, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%47 = icmp eq i32* %46, null
br i1 %47, label %49, label %64
48: ; preds = %38
br i1 %12, label %51, label %64
49: ; preds = %43, %38
%50 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
br label %64
51: ; preds = %48, %51
%52 = phi i64 [ %62, %51 ], [ 0, %48 ]
%53 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 %52, i64 0
%54 = load float, float* %53
%55 = tail call i32 @fprintf(i32* %41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), float %54)
%56 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 %52, i64 1
%57 = load float, float* %56
%58 = tail call i32 @fprintf(i32* %41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), float %57)
%59 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 %52, i64 2
%60 = load float, float* %59
%61 = tail call i32 @fprintf(i32* %41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), float %60)
%62 = add nuw nsw i64 %52, 1
%63 = icmp eq i64 %62, %6
br i1 %63, label %64, label %51
64: ; preds = %51, %43, %48, %49
%65 = phi i32 [ 1, %49 ], [ 0, %48 ], [ 0, %43 ], [ 0, %51 ]
ret i32 %65
}