// File: /workspace/github_c_makefile_star2_O1/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 0x55dc
testq %rax, %rax
je 0x61d1
movq %rax, %rbx
leaq 0x6dd0(%rip), %rdi      # 0xcdcb
callq 0x1050
leaq 0xd0(%rsp), %rbp
movq %rbx, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x59a1
movq 0x9fc4(%rip), %r13      # 0xffe0
movq (%r13), %rdi
leaq 0x6cd6(%rip), %rsi      # 0xccfd
xorl %edx, %edx
movq %rbp, %rcx
movl $0xc0, %r8d
movl $0x1, %r9d
callq 0x54cc
movq (%r13), %rdi
leaq 0x6cc0(%rip), %rsi      # 0xcd08
xorl %edx, %edx
movq %rbp, %rcx
movl $0x60, %r8d
xorl %r9d, %r9d
callq 0x54cc
movq (%r13), %rdi
leaq 0x130(%rsp), %rcx
leaq 0x6ca5(%rip), %rsi      # 0xcd13
xorl %edx, %edx
movl $0x30, %r8d
xorl %r9d, %r9d
callq 0x54cc
movq (%r13), %rdi
movl $0x90, %r14d
leaq (%r14,%rbp), %rcx
leaq 0x6c8b(%rip), %rsi      # 0xcd1e
xorl %edx, %edx
movl $0x18, %r8d
xorl %r9d, %r9d
callq 0x54cc
movq (%r13), %rdi
movl $0xa8, %r12d
leaq (%r12,%rbp), %rcx
leaq 0x6c71(%rip), %rsi      # 0xcd29
xorl %edx, %edx
movl $0x10, %r8d
xorl %r9d, %r9d
callq 0x54cc
movq (%r13), %rdi
movl $0xb8, %eax
addq %rax, %rbp
leaq 0x6c59(%rip), %r15      # 0xcd34
movq %r15, %rsi
xorl %edx, %edx
movq %rbp, %rcx
movl $0x8, %r8d
xorl %r9d, %r9d
callq 0x54cc
leaq 0x10(%rsp), %rbp
movq %rbx, %rdi
movq %rbp, %rsi
movl $0xa, %edx
callq 0x59a1
movq (%r13), %rdi
leaq 0x6c2e(%rip), %rsi      # 0xcd3f
xorl %edx, %edx
movq %rbp, %rcx
movl $0xc0, %r8d
movl $0x1, %r9d
callq 0x54cc
movq (%r13), %rdi
leaq 0x6bd6(%rip), %rsi      # 0xcd08
xorl %edx, %edx
movq %rbp, %rcx
movl $0x60, %r8d
xorl %r9d, %r9d
callq 0x54cc
movq (%r13), %rdi
leaq 0x70(%rsp), %rcx
leaq 0x6bbe(%rip), %rsi      # 0xcd13
xorl %edx, %edx
movl $0x30, %r8d
xorl %r9d, %r9d
callq 0x54cc
movq (%r13), %rdi
addq %rbp, %r14
leaq 0x6bab(%rip), %rsi      # 0xcd1e
xorl %edx, %edx
movq %r14, %rcx
movl $0x18, %r8d
xorl %r9d, %r9d
callq 0x54cc
movq (%r13), %rdi
addq %rbp, %r12
leaq 0x6b95(%rip), %rsi      # 0xcd29
xorl %edx, %edx
movq %r12, %rcx
movl $0x10, %r8d
xorl %r9d, %r9d
callq 0x54cc
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 0x54cc
movq %rbx, %rdi
callq 0x1030
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq