#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(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void randomize(int *x, int *y, int *solvable, int *npit, int *nwumpus) {
  int map_size;
  srand(time(NULL));
  *x = 3 + rand() % (10 - 3);
  *y = 3 + rand() % (10 - 3);
  map_size = (*x) * (*y);
  *solvable = rand() % 2;
  *npit = rand() % (int)(map_size * 0.5);
  *nwumpus = rand() % (int)(map_size * 0.1);
  return;
}


x86 assembly (clang, -O0):
<randomize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%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    $0x7,%ecx
cltd
idiv   %ecx
add    $0x3,%edx
mov    -0x8(%rbp),%rax
mov    %edx,(%rax)
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x7,%ecx
cltd
idiv   %ecx
add    $0x3,%edx
mov    -0x10(%rbp),%rax
mov    %edx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
imul   (%rcx),%eax
mov    %eax,-0x2c(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%rax
mov    %edx,(%rax)
mov    $0x0,%al
call   1050 <rand@plt>
cvtsi2sdl -0x2c(%rbp),%xmm0
movsd  0xe43(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
cltd
idiv   %ecx
mov    -0x20(%rbp),%rax
mov    %edx,(%rax)
mov    $0x0,%al
call   1050 <rand@plt>
cvtsi2sdl -0x2c(%rbp),%xmm0
movsd  0xe16(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
cltd
idiv   %ecx
mov    -0x28(%rbp),%rax
mov    %edx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomize>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%r13
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   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x2,%ecx
add    %edx,%ecx
lea    0x0(,%rcx,8),%edx
sub    %edx,%ecx
add    %ecx,%eax
add    $0x3,%eax
mov    %eax,(%rbx)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x2,%ecx
add    %edx,%ecx
lea    0x0(,%rcx,8),%edx
sub    %edx,%ecx
lea    (%rax,%rcx,1),%ebp
add    $0x3,%ebp
mov    %ebp,0x0(%r13)
imul   (%rbx),%ebp
xor    %eax,%eax
call   1050 <rand@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
mov    %eax,(%r12)
xor    %eax,%eax
call   1050 <rand@plt>
cvtsi2sd %ebp,%xmm1
movsd  %xmm1,(%rsp)
movsd  0xe13(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
cltd
idiv   %ecx
mov    %edx,(%r15)
xor    %eax,%eax
call   1050 <rand@plt>
movsd  (%rsp),%xmm0
mulsd  0xdf9(%rip),%xmm0
cvttsd2si %xmm0,%ecx
cltd
idiv   %ecx
mov    %edx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @randomize(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%12 = call i32 @time(i32* null)
%13 = call i32 @srand(i32 %12)
%14 = call i32 (...) @rand()
%15 = srem i32 %14, 7
%16 = add nsw i32 3, %15
%17 = load i32*, i32** %6
store i32 %16, i32* %17
%18 = call i32 (...) @rand()
%19 = srem i32 %18, 7
%20 = add nsw i32 3, %19
%21 = load i32*, i32** %7
store i32 %20, i32* %21
%22 = load i32*, i32** %6
%23 = load i32, i32* %22
%24 = load i32*, i32** %7
%25 = load i32, i32* %24
%26 = mul nsw i32 %23, %25
store i32 %26, i32* %11
%27 = call i32 (...) @rand()
%28 = srem i32 %27, 2
%29 = load i32*, i32** %8
store i32 %28, i32* %29
%30 = call i32 (...) @rand()
%31 = load i32, i32* %11
%32 = sitofp i32 %31 to double
%33 = fmul double %32, 5.000000e-01
%34 = fptosi double %33 to i32
%35 = srem i32 %30, %34
%36 = load i32*, i32** %9
store i32 %35, i32* %36
%37 = call i32 (...) @rand()
%38 = load i32, i32* %11
%39 = sitofp i32 %38 to double
%40 = fmul double %39, 1.000000e-01
%41 = fptosi double %40 to i32
%42 = srem i32 %37, %41
%43 = load i32*, i32** %10
store i32 %42, i32* %43
ret void
}

LLVM IR (-O2):
define void @randomize(i32* nocapture %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = tail call i32 @time(i32* null)
%7 = tail call i32 @srand(i32 %6)
%8 = tail call i32 (...) @rand()
%9 = srem i32 %8, 7
%10 = add nsw i32 %9, 3
store i32 %10, i32* %0
%11 = tail call i32 (...) @rand()
%12 = srem i32 %11, 7
%13 = add nsw i32 %12, 3
store i32 %13, i32* %1
%14 = load i32, i32* %0
%15 = mul nsw i32 %14, %13
%16 = tail call i32 (...) @rand()
%17 = srem i32 %16, 2
store i32 %17, i32* %2
%18 = tail call i32 (...) @rand()
%19 = sitofp i32 %15 to double
%20 = fmul double %19, 5.000000e-01
%21 = fptosi double %20 to i32
%22 = srem i32 %18, %21
store i32 %22, i32* %3
%23 = tail call i32 (...) @rand()
%24 = fmul double %19, 1.000000e-01
%25 = fptosi double %24 to i32
%26 = srem i32 %23, %25
store i32 %26, i32* %4
ret void
}