#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 *, double);
double rnd(long *);
int time(int /*<<< orphan*/ *);
main() {
  long inicio = time(NULL) % 65536;
  long random = inicio;
  double n;
  short i;
  for (i = 10; i; i--) {
    n = rnd(&random);
    printf("%.8g\n", n);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    $0x10000,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movw   $0xa,-0x22(%rbp)
cmpw   $0x0,-0x22(%rbp)
je     11a0 <main+0x70>
lea    -0x18(%rbp),%rdi
call   1040 <rnd@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
mov    -0x22(%rbp),%ax
add    $0xffff,%ax
mov    %ax,-0x22(%rbp)
jmp    1165 <main+0x35>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
lea    0xffff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffff0000,%ecx
sub    %ecx,%eax
cltq
mov    %rax,(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <rnd@plt>
lea    0xe9a(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
call   1040 <rnd@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
call   1040 <rnd@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
call   1040 <rnd@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
call   1040 <rnd@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
call   1040 <rnd@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
call   1040 <rnd@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
call   1040 <rnd@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
call   1040 <rnd@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
call   1040 <rnd@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%.8g\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca double
%5 = alloca i16
store i32 0, i32* %1
%6 = call i32 @time(i32* null)
%7 = srem i32 %6, 65536
%8 = sext i32 %7 to i64
store i64 %8, i64* %2
%9 = load i64, i64* %2
store i64 %9, i64* %3
store i16 10, i16* %5
br label %10
10: ; preds = %17, %0
%11 = load i16, i16* %5
%12 = icmp ne i16 %11, 0
br i1 %12, label %13, label %20
13: ; preds = %10
%14 = call double @rnd(i64* %3)
store double %14, double* %4
%15 = load double, double* %4
%16 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %15)
br label %17
17: ; preds = %13
%18 = load i16, i16* %5
%19 = add i16 %18, -1
store i16 %19, i16* %5
br label %10
20: ; preds = %10
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.8g\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = tail call i32 @time(i32* null)
%3 = srem i32 %2, 65536
%4 = sext i32 %3 to i64
%5 = bitcast i64* %1 to i8*
store i64 %4, i64* %1
%6 = call double @rnd(i64* %1)
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %6)
%8 = call double @rnd(i64* %1)
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %8)
%10 = call double @rnd(i64* %1)
%11 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %10)
%12 = call double @rnd(i64* %1)
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %12)
%14 = call double @rnd(i64* %1)
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %14)
%16 = call double @rnd(i64* %1)
%17 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %16)
%18 = call double @rnd(i64* %1)
%19 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %18)
%20 = call double @rnd(i64* %1)
%21 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %20)
%22 = call double @rnd(i64* %1)
%23 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %22)
%24 = call double @rnd(i64* %1)
%25 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %24)
ret i32 0
}