// File: /workspace/github_c_makefile_star2_O3/jogolden[P]ps4flashtool/southbridge.c
// Function: init_eap_keys
void init_eap_keys() {
    int i;

    mersenne_init(random_seeds,
        eap_keys[7][0] + eap_keys[3][0] + eap_keys[6][0]
        + 2 * (eap_keys[7][1] + eap_keys[3][1] + eap_keys[6][1])
        + 3 * (eap_keys[7][2] + eap_keys[3][2] + eap_keys[6][2])
        + 4 * (eap_keys[7][3] + eap_keys[3][3] + eap_keys[6][3]
    ));

    for(i = 0; i < 4; i++) {
        eap_keys[3][i] ^= mersenne_twister(random_seeds);
        eap_keys[7][i] ^= mersenne_twister(random_seeds);
    }

    mersenne_init(random_seeds,
        eap_keys[4][0] + eap_keys[5][0] + eap_keys[6][0]
        + 2 * (eap_keys[6][1] + eap_keys[5][1] + eap_keys[4][1])
        + 3 * (eap_keys[5][2] + eap_keys[4][2] + eap_keys[6][2])
        + 4 * (eap_keys[4][3] + eap_keys[5][3] + eap_keys[6][3])
    );

    for(i = 0; i < 4; i++) {
        eap_keys[4][i] ^= mersenne_twister(random_seeds);
        eap_keys[5][i] ^= mersenne_twister(random_seeds);
    }

    mersenne_init(random_seeds,
        eap_keys[0][0] + eap_keys[1][0] + eap_keys[2][0]
        + 2 * (eap_keys[1][1] + eap_keys[2][1] + eap_keys[0][1])
        + 3 * (eap_keys[1][2] + eap_keys[2][2] + eap_keys[0][2])
        + 4 * (eap_keys[2][3] + eap_keys[1][3] + eap_keys[0][3])
    );

    for(i = 0; i < 4; i++) {
        eap_keys[1][i] ^= mersenne_twister(random_seeds);
        eap_keys[2][i] ^= mersenne_twister(random_seeds);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x53de(%rip), %xmm0     # 0xc3d0
movq 0x5396(%rip), %xmm1     # 0xc390
paddd %xmm0, %xmm1
movq 0x53ba(%rip), %xmm0     # 0xc3c0
paddd %xmm1, %xmm0
pshufd $0x55, %xmm0, %xmm1     # xmm1 = xmm0[1,1,1,1]
movd %xmm1, %eax
movd %xmm0, %ecx
leal (%rcx,%rax,2), %eax
movl 0x5378(%rip), %ecx      # 0xc398
addl 0x53b2(%rip), %ecx      # 0xc3d8
addl 0x539c(%rip), %ecx      # 0xc3c8
leal (%rcx,%rcx,2), %ecx
movl 0x5367(%rip), %edx      # 0xc39c
addl 0x53a1(%rip), %edx      # 0xc3dc
addl %eax, %ecx
addl 0x5389(%rip), %edx      # 0xc3cc
leal (%rcx,%rdx,4), %esi
leaq 0x5393(%rip), %rbx      # 0xc3e0
movq %rbx, %rdi
callq 0x6f97
xorl %r15d, %r15d
leaq 0x5301(%rip), %r14      # 0xc360
movq %rbx, %rdi
callq 0x6ef8
xorl %eax, 0x30(%r14,%r15,4)
movq %rbx, %rdi
callq 0x6ef8
xorl %eax, 0x70(%r14,%r15,4)
incq %r15
cmpq $0x4, %r15
jne 0x705f
movl 0x5328(%rip), %eax      # 0xc3b0
addl 0x5312(%rip), %eax      # 0xc3a0
addl 0x532c(%rip), %eax      # 0xc3c0
movl 0x531a(%rip), %ecx      # 0xc3b4
addl 0x5324(%rip), %ecx      # 0xc3c4
addl 0x52fe(%rip), %ecx      # 0xc3a4
leal (%rax,%rcx,2), %eax
movl 0x52f9(%rip), %ecx      # 0xc3a8
addl 0x5303(%rip), %ecx      # 0xc3b8
addl 0x530d(%rip), %ecx      # 0xc3c8
leal (%rcx,%rcx,2), %ecx
movl 0x52f8(%rip), %edx      # 0xc3bc
addl 0x52e2(%rip), %edx      # 0xc3ac
addl %eax, %ecx
addl 0x52fa(%rip), %edx      # 0xc3cc
leal (%rcx,%rdx,4), %esi
leaq 0x5304(%rip), %rbx      # 0xc3e0
movq %rbx, %rdi
callq 0x6f97
movq $-0x4, %r15
movq %rbx, %rdi
callq 0x6ef8
xorl %eax, 0x50(%r14,%r15,4)
movq %rbx, %rdi
callq 0x6ef8
xorl %eax, 0x60(%r14,%r15,4)
incq %r15
jne 0x70eb
movl 0x5260(%rip), %eax      # 0xc370
addl 0x524a(%rip), %eax      # 0xc360
addl 0x5264(%rip), %eax      # 0xc380
movl 0x5262(%rip), %ecx      # 0xc384
addl 0x524c(%rip), %ecx      # 0xc374
addl 0x5236(%rip), %ecx      # 0xc364
leal (%rax,%rcx,2), %eax
movl 0x5251(%rip), %ecx      # 0xc388
addl 0x523b(%rip), %ecx      # 0xc378
addl 0x5225(%rip), %ecx      # 0xc368
leal (%rcx,%rcx,2), %ecx
movl 0x5230(%rip), %edx      # 0xc37c
addl 0x523a(%rip), %edx      # 0xc38c
addl %eax, %ecx
addl 0x5212(%rip), %edx      # 0xc36c
leal (%rcx,%rdx,4), %esi
leaq 0x527c(%rip), %rbx      # 0xc3e0
movq %rbx, %rdi
callq 0x6f97
movq $-0x4, %r15
movq %rbx, %rdi
callq 0x6ef8
xorl %eax, 0x20(%r14,%r15,4)
movq %rbx, %rdi
callq 0x6ef8
xorl %eax, 0x30(%r14,%r15,4)
incq %r15
jne 0x7173
popq %rbx
popq %r14
popq %r15
retq