// File: boczeratul[P]StarCraftGA/ga.cpp
// Function: initGA(int, int, int, double, double, int, int, int)
void initGA (int n_ell, int n_nInitial, int n_selectionPressure, double n_pc,
                double n_pm, int n_maxGen, int n_maxFe, int optimalFit) {
   
    ell = n_ell;
    nInitial = n_nInitial;
    nCurrent = nInitial;
    selectionPressure = n_selectionPressure;
    pc = n_pc;
    pm = n_pm;
    maxGen = n_maxGen;
    maxFe = n_maxFe;
    optimalFitness = optimalFit;
    
    population = initChromosomes (nInitial, ell);
    offspring = initChromosomes (nInitial, ell);
    fitness = new int[nInitial];
    offspringFitness = new int[nInitial];
    selectionIndex = new int[nInitial];

    initRand();
    
    dontMindTotalProb = 0;
    for ( int i = 1; i < dontMindAction[0]+1; ++i   )
    {
        dontMindTotalProb = dontMindTotalProb + actionProb[dontMindAction[i]];
    }
    
    
    //initializePopulation ();
    initializePopulationByRequest ();
    
//    printPopulation(population);

    //printf("here!!!\n");
    
    evaluate( population,  fitness);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movsd %xmm0, -0x18(%rbp)
movsd %xmm1, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movl -0x4(%rbp), %eax
movl %eax, 0xce31(%rip)      # 0xe0f0
movl -0x8(%rbp), %eax
movl %eax, 0xce2c(%rip)      # 0xe0f4
movl 0xce26(%rip), %eax      # 0xe0f4
movl %eax, 0xce24(%rip)      # 0xe0f8
movl -0xc(%rbp), %eax
movl %eax, 0xcdb3(%rip)      # 0xe090
movsd -0x18(%rbp), %xmm0
movsd %xmm0, 0xcdae(%rip)     # 0xe098
movsd -0x20(%rbp), %xmm0
movsd %xmm0, 0xce09(%rip)     # 0xe100
movl -0x24(%rbp), %eax
movl %eax, 0xcda0(%rip)      # 0xe0a0
movl -0x28(%rbp), %eax
movl %eax, 0xcd9b(%rip)      # 0xe0a4
movl -0x2c(%rbp), %eax
movl %eax, 0xce2e(%rip)      # 0xe140
movl 0xcddc(%rip), %edi      # 0xe0f4
movl 0xcdd2(%rip), %esi      # 0xe0f0
callq 0x1200
movq %rax, 0xcdf6(%rip)      # 0xe120
movl 0xcdc4(%rip), %edi      # 0xe0f4
movl 0xcdba(%rip), %esi      # 0xe0f0
callq 0x1200
movq %rax, 0xcde6(%rip)      # 0xe128
movslq 0xcdab(%rip), %rax      # 0xe0f4
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x1030
movq %rax, 0xcdbf(%rip)      # 0xe130
movslq 0xcd7c(%rip), %rax      # 0xe0f4
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x1030
movq %rax, 0xcd98(%rip)      # 0xe138
movslq 0xcd4d(%rip), %rax      # 0xe0f4
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x1030
movq %rax, 0xcd39(%rip)      # 0xe108
callq 0x2d70
movl $0x0, 0xd062(%rip)      # 0xe440
movl $0x1, -0x30(%rbp)
movl -0x30(%rbp), %eax
movl 0xcd62(%rip), %ecx      # 0xe150
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x1425
movl 0xd045(%rip), %eax      # 0xe440
movslq -0x30(%rbp), %rdx
leaq 0xcd4a(%rip), %rcx      # 0xe150
movslq (%rcx,%rdx,4), %rdx
leaq 0x11f9f(%rip), %rcx     # 0x133b0
addl (%rcx,%rdx,4), %eax
movl %eax, 0xd026(%rip)      # 0xe440
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x13e5
callq 0x1450
movq 0xccef(%rip), %rdi      # 0xe120
movq 0xccf8(%rip), %rsi      # 0xe130
callq 0x1490
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)