#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 RAND_MAX;
int /*<<< orphan*/ printf(char *, float, float);
scalar_t__ rand();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  int i;
  srand((unsigned int)time(NULL));
  float x, y, z;
  for (i = 0; i < 100; i++) {
    x = 1.0f - (float)rand() / (float)(RAND_MAX / 2);
    y = 1.0f - (float)rand() / (float)(RAND_MAX / 2);
    printf("%f,%f,0,0\n", x, y);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jge    1207 <main+0xc7>
mov    $0x0,%al
call   1060 <rand@plt>
cvtsi2ss %rax,%xmm1
mov    0x2e5e(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
divss  %xmm0,%xmm1
movss  0xe5c(%rip),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
cvtsi2ss %rax,%xmm1
mov    0x2e28(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
divss  %xmm0,%xmm1
movss  0xe26(%rip),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x18(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm1
lea    0xe10(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116d <main+0x2d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x64,%ebp
mov    0x2e86(%rip),%rbx
lea    0xe9b(%rip),%r14
nopl   0x0(%rax)
xor    %eax,%eax
call   1060 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
mov    (%rbx),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
xorps  %xmm1,%xmm1
cvtsi2ss %ecx,%xmm1
divss  %xmm1,%xmm0
movss  0xe63(%rip),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
xor    %eax,%eax
call   1060 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
mov    (%rbx),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
xorps  %xmm1,%xmm1
cvtsi2ss %ecx,%xmm1
divss  %xmm1,%xmm0
movss  0xe2c(%rip),%xmm1
subss  %xmm0,%xmm1
mov    %r14,%rdi
movss  0xc(%rsp),%xmm0
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1170 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
@.str = [11 x i8] c"%f,%f,0,0\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float
%8 = alloca float
%9 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i64 @time(i32* null)
%11 = trunc i64 %10 to i32
%12 = call i32 @srand(i32 %11)
store i32 0, i32* %6
br label %13
13: ; preds = %34, %2
%14 = load i32, i32* %6
%15 = icmp slt i32 %14, 100
br i1 %15, label %16, label %37
16: ; preds = %13
%17 = call i64 (...) @rand()
%18 = sitofp i64 %17 to float
%19 = load i32, i32* @RAND_MAX
%20 = sdiv i32 %19, 2
%21 = sitofp i32 %20 to float
%22 = fdiv float %18, %21
%23 = fsub float 1.000000e+00, %22
store float %23, float* %7
%24 = call i64 (...) @rand()
%25 = sitofp i64 %24 to float
%26 = load i32, i32* @RAND_MAX
%27 = sdiv i32 %26, 2
%28 = sitofp i32 %27 to float
%29 = fdiv float %25, %28
%30 = fsub float 1.000000e+00, %29
store float %30, float* %8
%31 = load float, float* %7
%32 = load float, float* %8
%33 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), float %31, float %32)
br label %34
34: ; preds = %16
%35 = load i32, i32* %6
%36 = add nsw i32 %35, 1
store i32 %36, i32* %6
br label %13
37: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
@.str = [11 x i8] c"%f,%f,0,0\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @time(i32* null)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @srand(i32 %4)
br label %6
6: ; preds = %2, %6
%7 = phi i32 [ 0, %2 ], [ %23, %6 ]
%8 = tail call i64 (...) @rand()
%9 = sitofp i64 %8 to float
%10 = load i32, i32* @RAND_MAX
%11 = sdiv i32 %10, 2
%12 = sitofp i32 %11 to float
%13 = fdiv float %9, %12
%14 = fsub float 1.000000e+00, %13
%15 = tail call i64 (...) @rand()
%16 = sitofp i64 %15 to float
%17 = load i32, i32* @RAND_MAX
%18 = sdiv i32 %17, 2
%19 = sitofp i32 %18 to float
%20 = fdiv float %16, %19
%21 = fsub float 1.000000e+00, %20
%22 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), float %14, float %21)
%23 = add nuw nsw i32 %7, 1
%24 = icmp eq i32 %23, 100
br i1 %24, label %25, label %6
25: ; preds = %6
ret i32 0
}