// File: boczeratul[P]StarCraftGA/mt19937ar.cpp
// Function: init_by_array(unsigned long*, int)
void
init_by_array (unsigned long init_key[], int key_length)
{
    int i, j, k;
    init_genrand (19650218UL);
    i = 1;
    j = 0;
    k = (N > key_length ? N : key_length);
    for (; k; k--) {
                                 /* non linear */
        mt[i] = (mt[i] ^ ((mt[i - 1] ^ (mt[i - 1] >> 30)) * 1664525UL)) + init_key[j] + j;
        mt[i] &= 0xffffffffUL;   /* for WORDSIZE > 32 machines */
        i++;
        j++;
        if (i >= N) {
            mt[0] = mt[N - 1];
            i = 1;
        }
        if (j >= key_length)
            j = 0;
    }
    for (k = N - 1; k; k--) {
                                 /* non linear */
        mt[i] = (mt[i] ^ ((mt[i - 1] ^ (mt[i - 1] >> 30)) * 1566083941UL)) - i;
        mt[i] &= 0xffffffffUL;   /* for WORDSIZE > 32 machines */
        i++;
        if (i >= N) {
            mt[0] = mt[N - 1];
            i = 1;
        }
    }

    mt[0] = 0x80000000UL;        /* MSB is 1; assuring non-zero initial array */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x12bd6aa, %edi        # imm = 0x12BD6AA
callq 0x3060
movl $0x1, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x270, %eax            # imm = 0x270
cmpl -0xc(%rbp), %eax
jle 0x316b
movl $0x270, %eax            # imm = 0x270
movl %eax, -0x1c(%rbp)
jmp 0x3171
movl -0xc(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x325e
movslq -0x10(%rbp), %rcx
leaq 0xb2d4(%rip), %rax      # 0xe460
movq (%rax,%rcx,8), %rdx
movl -0x10(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0xb2c0(%rip), %rax      # 0xe460
movq (%rax,%rcx,8), %rax
movl -0x10(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rsi
leaq 0xb2ac(%rip), %rcx      # 0xe460
movq (%rcx,%rsi,8), %rcx
shrq $0x1e, %rcx
xorq %rcx, %rax
imulq $0x19660d, %rax, %rax   # imm = 0x19660D
xorq %rax, %rdx
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq (%rax,%rcx,8), %rdx
movslq -0x14(%rbp), %rax
addq %rax, %rdx
movslq -0x10(%rbp), %rcx
leaq 0xb279(%rip), %rax      # 0xe460
movq %rdx, (%rax,%rcx,8)
movslq -0x10(%rbp), %rcx
leaq 0xb26a(%rip), %rax      # 0xe460
movabsq $0xffffffff, %rdx       # imm = 0xFFFFFFFF
andq (%rax,%rcx,8), %rdx
leaq 0xb255(%rip), %rax      # 0xe460
movq %rdx, (%rax,%rcx,8)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
cmpl $0x270, -0x10(%rbp)     # imm = 0x270
jl 0x323f
movq 0xc5a7(%rip), %rax      # 0xf7d8
movq %rax, 0xb228(%rip)      # 0xe460
movl $0x1, -0x10(%rbp)
movl -0x14(%rbp), %eax
cmpl -0xc(%rbp), %eax
jl 0x324e
movl $0x0, -0x14(%rbp)
jmp 0x3250
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x3177
movl $0x26f, -0x18(%rbp)     # imm = 0x26F
cmpl $0x0, -0x18(%rbp)
je 0x3328
movslq -0x10(%rbp), %rcx
leaq 0xb1e6(%rip), %rax      # 0xe460
movq (%rax,%rcx,8), %rdx
movl -0x10(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0xb1d2(%rip), %rax      # 0xe460
movq (%rax,%rcx,8), %rax
movl -0x10(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rsi
leaq 0xb1be(%rip), %rcx      # 0xe460
movq (%rcx,%rsi,8), %rcx
shrq $0x1e, %rcx
xorq %rcx, %rax
imulq $0x5d588b65, %rax, %rax # imm = 0x5D588B65
xorq %rax, %rdx
movslq -0x10(%rbp), %rax
subq %rax, %rdx
movslq -0x10(%rbp), %rcx
leaq 0xb197(%rip), %rax      # 0xe460
movq %rdx, (%rax,%rcx,8)
movslq -0x10(%rbp), %rcx
leaq 0xb188(%rip), %rax      # 0xe460
movabsq $0xffffffff, %rdx       # imm = 0xFFFFFFFF
andq (%rax,%rcx,8), %rdx
leaq 0xb173(%rip), %rax      # 0xe460
movq %rdx, (%rax,%rcx,8)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
cmpl $0x270, -0x10(%rbp)     # imm = 0x270
jl 0x3318
movq 0xc4ce(%rip), %rax      # 0xf7d8
movq %rax, 0xb14f(%rip)      # 0xe460
movl $0x1, -0x10(%rbp)
jmp 0x331a
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x3265
movl $0x80000000, %eax       # imm = 0x80000000
movq %rax, 0xb12c(%rip)      # 0xe460
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)