#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();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
void numRandon(float *r1, float *r2) {
  srand((unsigned)time(NULL));
  *r1 = 1 + rand() % 3;
  *r2 = 1 + rand() % 3;
  *r1 = *r1 / 10;
  *r2 = *r2 / 10;
}


x86 assembly (clang, -O0):
<numRandon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
cvtsi2ss %edx,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
cvtsi2ss %edx,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  0xe64(%rip),%xmm1
divss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  0xe48(%rip),%xmm1
divss  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numRandon>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,(%rbx)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,(%r14)
movss  (%rbx),%xmm0
movss  0xe4a(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,(%rbx)
movss  (%r14),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @numRandon(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = call i64 @time(i32* null)
%6 = trunc i64 %5 to i32
%7 = call i32 @srand(i32 %6)
%8 = call i32 (...) @rand()
%9 = srem i32 %8, 3
%10 = add nsw i32 1, %9
%11 = sitofp i32 %10 to float
%12 = load float*, float** %3
store float %11, float* %12
%13 = call i32 (...) @rand()
%14 = srem i32 %13, 3
%15 = add nsw i32 1, %14
%16 = sitofp i32 %15 to float
%17 = load float*, float** %4
store float %16, float* %17
%18 = load float*, float** %3
%19 = load float, float* %18
%20 = fdiv float %19, 1.000000e+01
%21 = load float*, float** %3
store float %20, float* %21
%22 = load float*, float** %4
%23 = load float, float* %22
%24 = fdiv float %23, 1.000000e+01
%25 = load float*, float** %4
store float %24, float* %25
ret void
}

LLVM IR (-O2):
define void @numRandon(float* nocapture %0, float* nocapture %1) {
%3 = tail call i64 @time(i32* null)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @srand(i32 %4)
%6 = tail call i32 (...) @rand()
%7 = srem i32 %6, 3
%8 = add nsw i32 %7, 1
%9 = sitofp i32 %8 to float
store float %9, float* %0
%10 = tail call i32 (...) @rand()
%11 = srem i32 %10, 3
%12 = add nsw i32 %11, 1
%13 = sitofp i32 %12 to float
store float %13, float* %1
%14 = load float, float* %0
%15 = fdiv float %14, 1.000000e+01
store float %15, float* %0
%16 = load float, float* %1
%17 = fdiv float %16, 1.000000e+01
store float %17, float* %1
ret void
}