// File: /workspace/github_c_makefile_star2_O1/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
movl 0x55b0(%rip), %eax      # 0xc390
addl 0x55ea(%rip), %eax      # 0xc3d0
addl 0x55d4(%rip), %eax      # 0xc3c0
movl 0x55a2(%rip), %ecx      # 0xc394
addl 0x55dc(%rip), %ecx      # 0xc3d4
addl 0x55c6(%rip), %ecx      # 0xc3c4
leal (%rax,%rcx,2), %eax
movl 0x5591(%rip), %ecx      # 0xc398
addl 0x55cb(%rip), %ecx      # 0xc3d8
addl 0x55b5(%rip), %ecx      # 0xc3c8
leal (%rcx,%rcx,2), %ecx
movl 0x5580(%rip), %edx      # 0xc39c
addl 0x55ba(%rip), %edx      # 0xc3dc
addl %eax, %ecx
addl 0x55a2(%rip), %edx      # 0xc3cc
leal (%rcx,%rdx,4), %esi
leaq 0x55ac(%rip), %rbx      # 0xc3e0
movq %rbx, %rdi
callq 0x6d87
xorl %r15d, %r15d
leaq 0x551a(%rip), %r14      # 0xc360
movq %rbx, %rdi
callq 0x6ce8
xorl %eax, 0x30(%r14,%r15,4)
movq %rbx, %rdi
callq 0x6ce8
xorl %eax, 0x70(%r14,%r15,4)
incq %r15
cmpq $0x4, %r15
jne 0x6e46
movl 0x5541(%rip), %eax      # 0xc3b0
addl 0x552b(%rip), %eax      # 0xc3a0
addl 0x5545(%rip), %eax      # 0xc3c0
movl 0x5533(%rip), %ecx      # 0xc3b4
addl 0x553d(%rip), %ecx      # 0xc3c4
addl 0x5517(%rip), %ecx      # 0xc3a4
leal (%rax,%rcx,2), %eax
movl 0x5512(%rip), %ecx      # 0xc3a8
addl 0x551c(%rip), %ecx      # 0xc3b8
addl 0x5526(%rip), %ecx      # 0xc3c8
leal (%rcx,%rcx,2), %ecx
movl 0x5511(%rip), %edx      # 0xc3bc
addl 0x54fb(%rip), %edx      # 0xc3ac
addl %eax, %ecx
addl 0x5513(%rip), %edx      # 0xc3cc
leal (%rcx,%rdx,4), %esi
leaq 0x551d(%rip), %rbx      # 0xc3e0
movq %rbx, %rdi
callq 0x6d87
movq $-0x4, %r15
movq %rbx, %rdi
callq 0x6ce8
xorl %eax, 0x50(%r14,%r15,4)
movq %rbx, %rdi
callq 0x6ce8
xorl %eax, 0x60(%r14,%r15,4)
incq %r15
jne 0x6ed2
movl 0x5479(%rip), %eax      # 0xc370
addl 0x5463(%rip), %eax      # 0xc360
addl 0x547d(%rip), %eax      # 0xc380
movl 0x547b(%rip), %ecx      # 0xc384
addl 0x5465(%rip), %ecx      # 0xc374
addl 0x544f(%rip), %ecx      # 0xc364
leal (%rax,%rcx,2), %eax
movl 0x546a(%rip), %ecx      # 0xc388
addl 0x5454(%rip), %ecx      # 0xc378
addl 0x543e(%rip), %ecx      # 0xc368
leal (%rcx,%rcx,2), %ecx
movl 0x5449(%rip), %edx      # 0xc37c
addl 0x5453(%rip), %edx      # 0xc38c
addl %eax, %ecx
addl 0x542b(%rip), %edx      # 0xc36c
leal (%rcx,%rdx,4), %esi
leaq 0x5495(%rip), %rbx      # 0xc3e0
movq %rbx, %rdi
callq 0x6d87
movq $-0x4, %r15
movq %rbx, %rdi
callq 0x6ce8
xorl %eax, 0x20(%r14,%r15,4)
movq %rbx, %rdi
callq 0x6ce8
xorl %eax, 0x30(%r14,%r15,4)
incq %r15
jne 0x6f5a
popq %rbx
popq %r14
popq %r15
retq