// File: /workspace/github_c_makefile_star2_O3/zecoxao[P]ps3_decrypt_tools/lib/eid.c
// Function: eid0_list_infos
void eid0_list_infos(s8 *file_in) {
    u32 length;
    eid05_section_t *sptr;
    u8 *eid0 = _read_buffer(file_in, &length);

    if (eid0 != NULL) {
        printf("EID0:\n");

        u8 section_0[EID0_SECTION_0_SIZE];
        eid0_decrypt_section(eid0, section_0, 0);
        _hexdump(stdout, "Section 0:", 0, section_0, EID0_SECTION_0_SIZE, TRUE);
        sptr = (eid05_section_t *) section_0;
        _hexdump(stdout, " Data:    ", 0, sptr->data, 0x60, FALSE);
        _hexdump(stdout, " Common:  ", 0, sptr->common, 0x30, FALSE);
        _hexdump(stdout, " Unk:     ", 0, sptr->unk, 0x18, FALSE);
        _hexdump(stdout, " OMAC:    ", 0, sptr->omac, 0x10, FALSE);
        _hexdump(stdout, " Pad:     ", 0, sptr->pad, 0x08, FALSE);

        u8 section_A[EID0_SECTION_A_SIZE];
        eid0_decrypt_section(eid0, section_A, 10);
        _hexdump(stdout, "Section A:", 0, section_A, EID0_SECTION_A_SIZE, TRUE);
        sptr = (eid05_section_t *) section_A;
        _hexdump(stdout, " Data:    ", 0, sptr->data, 0x60, FALSE);
        _hexdump(stdout, " Common:  ", 0, sptr->common, 0x30, FALSE);
        _hexdump(stdout, " Unk:     ", 0, sptr->unk, 0x18, FALSE);
        _hexdump(stdout, " OMAC:    ", 0, sptr->omac, 0x10, FALSE);
        _hexdump(stdout, " Pad:     ", 0, sptr->pad, 0x08, FALSE);

        free(eid0);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
leaq 0xc(%rsp), %rsi
callq 0x5588
testq %rax, %rax
je 0x6179
movq %rax, %rbx
leaq 0x6e58(%rip), %rdi      # 0xcdfb
callq 0x1050
leaq 0xd0(%rsp), %rbp
movq %rbx, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x5949
movq 0xa01c(%rip), %r13      # 0xffe0
movq (%r13), %rdi
leaq 0x6d5e(%rip), %rsi      # 0xcd2d
xorl %edx, %edx
movq %rbp, %rcx
movl $0xc0, %r8d
movl $0x1, %r9d
callq 0x5478
movq (%r13), %rdi
leaq 0x6d48(%rip), %rsi      # 0xcd38
xorl %edx, %edx
movq %rbp, %rcx
movl $0x60, %r8d
xorl %r9d, %r9d
callq 0x5478
movq (%r13), %rdi
leaq 0x130(%rsp), %rcx
leaq 0x6d2d(%rip), %rsi      # 0xcd43
xorl %edx, %edx
movl $0x30, %r8d
xorl %r9d, %r9d
callq 0x5478
movq (%r13), %rdi
movl $0x90, %r14d
leaq (%r14,%rbp), %rcx
leaq 0x6d13(%rip), %rsi      # 0xcd4e
xorl %edx, %edx
movl $0x18, %r8d
xorl %r9d, %r9d
callq 0x5478
movq (%r13), %rdi
movl $0xa8, %r12d
leaq (%r12,%rbp), %rcx
leaq 0x6cf9(%rip), %rsi      # 0xcd59
xorl %edx, %edx
movl $0x10, %r8d
xorl %r9d, %r9d
callq 0x5478
movq (%r13), %rdi
movl $0xb8, %eax
addq %rax, %rbp
leaq 0x6ce1(%rip), %r15      # 0xcd64
movq %r15, %rsi
xorl %edx, %edx
movq %rbp, %rcx
movl $0x8, %r8d
xorl %r9d, %r9d
callq 0x5478
leaq 0x10(%rsp), %rbp
movq %rbx, %rdi
movq %rbp, %rsi
movl $0xa, %edx
callq 0x5949
movq (%r13), %rdi
leaq 0x6cb6(%rip), %rsi      # 0xcd6f
xorl %edx, %edx
movq %rbp, %rcx
movl $0xc0, %r8d
movl $0x1, %r9d
callq 0x5478
movq (%r13), %rdi
leaq 0x6c5e(%rip), %rsi      # 0xcd38
xorl %edx, %edx
movq %rbp, %rcx
movl $0x60, %r8d
xorl %r9d, %r9d
callq 0x5478
movq (%r13), %rdi
leaq 0x70(%rsp), %rcx
leaq 0x6c46(%rip), %rsi      # 0xcd43
xorl %edx, %edx
movl $0x30, %r8d
xorl %r9d, %r9d
callq 0x5478
movq (%r13), %rdi
addq %rbp, %r14
leaq 0x6c33(%rip), %rsi      # 0xcd4e
xorl %edx, %edx
movq %r14, %rcx
movl $0x18, %r8d
xorl %r9d, %r9d
callq 0x5478
movq (%r13), %rdi
addq %rbp, %r12
leaq 0x6c1d(%rip), %rsi      # 0xcd59
xorl %edx, %edx
movq %r12, %rcx
movl $0x10, %r8d
xorl %r9d, %r9d
callq 0x5478
movq (%r13), %rdi
movl $0xb8, %eax
addq %rax, %rbp
movq %r15, %rsi
xorl %edx, %edx
movq %rbp, %rcx
movl $0x8, %r8d
xorl %r9d, %r9d
callq 0x5478
movq %rbx, %rdi
callq 0x1030
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq