#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*/ SetIndividual(int, int, int, int *);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void SpawnPopulation(float frequenzy, int *Array) {
  int random, x, y;
  srand(time(NULL));
  for (x = 0; x < 10000; x++)
    for (y = 0; y < 10000; y++) {
      random = rand() % 100;
      if ((float)random / 100. > frequenzy)
        SetIndividual(x, y, 0, Array);
      else
        SetIndividual(x, y, 1, Array);
    }
}


x86 assembly (clang, -O0):
<SpawnPopulation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0x2710,-0x18(%rbp)
jge    1213 <SpawnPopulation+0xd3>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x2710,-0x1c(%rbp)
jge    1200 <SpawnPopulation+0xc0>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
cvtsi2ssl -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe54(%rip),%xmm1
divsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11d9 <SpawnPopulation+0x99>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x10(%rbp),%rcx
xor    %edx,%edx
call   1040 <SetIndividual@plt>
jmp    11ed <SpawnPopulation+0xad>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
call   1040 <SetIndividual@plt>
jmp    11f2 <SpawnPopulation+0xb2>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    117c <SpawnPopulation+0x3c>
jmp    1205 <SpawnPopulation+0xc5>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1168 <SpawnPopulation+0x28>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SpawnPopulation>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r14
movss  %xmm0,0x8(%rsp)
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xe3b(%rip),%xmm0
xor    %edx,%edx
ucomisd 0x8(%rsp),%xmm0
setbe  %dl
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r14,%rcx
call   1040 <SetIndividual@plt>
add    $0x1,%ebx
cmp    $0x2710,%ebx
jne    1190 <SpawnPopulation+0x50>
add    $0x1,%ebp
cmp    $0x2710,%ebp
jne    1180 <SpawnPopulation+0x40>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @SpawnPopulation(float %0, i32* %1) {
%3 = alloca float
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store float %0, float* %3
store i32* %1, i32** %4
%8 = call i32 @time(i32* null)
%9 = call i32 @srand(i32 %8)
store i32 0, i32* %6
br label %10
10: ; preds = %42, %2
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 10000
br i1 %12, label %13, label %45
13: ; preds = %10
store i32 0, i32* %7
br label %14
14: ; preds = %38, %13
%15 = load i32, i32* %7
%16 = icmp slt i32 %15, 10000
br i1 %16, label %17, label %41
17: ; preds = %14
%18 = call i32 (...) @rand()
%19 = srem i32 %18, 100
store i32 %19, i32* %5
%20 = load i32, i32* %5
%21 = sitofp i32 %20 to float
%22 = fpext float %21 to double
%23 = fdiv double %22, 1.000000e+02
%24 = load float, float* %3
%25 = fpext float %24 to double
%26 = fcmp ogt double %23, %25
br i1 %26, label %27, label %32
27: ; preds = %17
%28 = load i32, i32* %6
%29 = load i32, i32* %7
%30 = load i32*, i32** %4
%31 = call i32 @SetIndividual(i32 %28, i32 %29, i32 0, i32* %30)
br label %37
32: ; preds = %17
%33 = load i32, i32* %6
%34 = load i32, i32* %7
%35 = load i32*, i32** %4
%36 = call i32 @SetIndividual(i32 %33, i32 %34, i32 1, i32* %35)
br label %37
37: ; preds = %32, %27
br label %38
38: ; preds = %37
%39 = load i32, i32* %7
%40 = add nsw i32 %39, 1
store i32 %40, i32* %7
br label %14
41: ; preds = %14
br label %42
42: ; preds = %41
%43 = load i32, i32* %6
%44 = add nsw i32 %43, 1
store i32 %44, i32* %6
br label %10
45: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @SpawnPopulation(float %0, i32* %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = fpext float %0 to double
br label %6
6: ; preds = %2, %20
%7 = phi i32 [ 0, %2 ], [ %21, %20 ]
br label %8
8: ; preds = %6, %8
%9 = phi i32 [ 0, %6 ], [ %18, %8 ]
%10 = tail call i32 (...) @rand()
%11 = srem i32 %10, 100
%12 = sitofp i32 %11 to float
%13 = fpext float %12 to double
%14 = fdiv double %13, 1.000000e+02
%15 = fcmp ule double %14, %5
%16 = zext i1 %15 to i32
%17 = tail call i32 @SetIndividual(i32 %7, i32 %9, i32 %16, i32* %1)
%18 = add nuw nsw i32 %9, 1
%19 = icmp eq i32 %18, 10000
br i1 %19, label %20, label %8
20: ; preds = %8
%21 = add nuw nsw i32 %7, 1
%22 = icmp eq i32 %21, 10000
br i1 %22, label %23, label %6
23: ; preds = %20
ret void
}