// File: /workspace/github_c_makefile_star2_O2/ww9210[P]xnuca_final_ssp/main.c
// Function: dump_program_header_entry
void dump_program_header_entry(ELF64_FileRef file, ELF64_HeaderRef header){
    ELF64_ProgramHeaderEntryRef pHeader;
    ELF64_SectionHeaderEntryRef sHeader;
    ELF64_Half i;
    for( i = 0; i < ELF64_HeaderGetProgramHeaderEntryCount( header ); i++ )
    {
        pHeader = ELF64_FileGetProgramHeaderEntry( file, i );
        
        printf
        (
            "    ### Program header entry (%lu):\n"
            "    \n"
            "        - Segment type:                %s\n"
            "        - Segment attributes:          %lu (%s)\n"
            "        - Offset in file:              0x%016lx\n"
            "        - Virtual address in memory:   0x%016lx\n"
            "        - Size of segment in file:     %lu\n"
            "        - Size of segment in memory:   %lu\n"
            "        - Alignment of segment:        %lu\n"
            "    \n",
            ( unsigned long )i,
            ELF64_ProgramHeaderEntryGetTypeString( pHeader ),
            ( unsigned long )ELF64_ProgramHeaderEntryGetAttributes( pHeader ),
            ELF64_ProgramHeaderEntryGetAttributesString( pHeader ),
            ELF64_ProgramHeaderEntryGetFileOffset( pHeader ),
            ELF64_ProgramHeaderEntryGetMemoryVirtualAddress( pHeader ),
            ( unsigned long )ELF64_ProgramHeaderEntryGetFileSize( pHeader ),
            ( unsigned long )ELF64_ProgramHeaderEntryGetMemorySize( pHeader ),
            ( unsigned long )ELF64_ProgramHeaderEntryGetAlignment( pHeader )
        );
    }
   
    for( i = 0; i < ELF64_HeaderGetSectionHeaderEntryCount( header ); i++ )
    {
        sHeader = ELF64_FileGetSectionHeaderEntry( file, i );

        printf
        (
            "    ### Section header entry (%lu):\n"
            "    \n"
            "        - Section name:                            %s\n"
            "        - Section type:                            %s\n"
            "        - Section attributes:                      %lu (%s)\n"
            "        - Virtual address in memory:               0x%016lx\n"
            "        - Offset in file:                          %lu\n"
            "        - Size of section:                         %lu\n"
            "        - Link to other section:                   %lu\n"
            "        - Miscellaneous information:               %lu\n"
            "        - Address alignment boundary:              %lu\n"
            "        - Size of entries, if section has table:   %lu\n"
            "    \n",
            ( unsigned long )i,
            ELF64_FileGetNameOfSection( file, sHeader ),
            ELF64_SectionHeaderEntryGetTypeString( sHeader ),
            ( unsigned long )ELF64_SectionHeaderEntryGetAttributes( sHeader ),
            ELF64_SectionHeaderEntryGetAttributesString( sHeader ),
            ELF64_SectionHeaderEntryGetMemoryVirtualAddress( sHeader ),
            ( unsigned long )ELF64_SectionHeaderEntryGetFileOffset( sHeader ),
            ( unsigned long )ELF64_SectionHeaderEntryGetSectionSize( sHeader ),
            ( unsigned long )ELF64_SectionHeaderEntryGetLinkedSectionIndex( sHeader ),
            ( unsigned long )ELF64_SectionHeaderEntryGetMiscInfo( sHeader ),
            ( unsigned long )ELF64_SectionHeaderEntryGetAddressAlignmentBoundary( sHeader ),
            ( unsigned long )ELF64_SectionHeaderEntryGetEntrySize( sHeader )
        );
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, -0x58(%rbp)
movq %rdi, -0x50(%rbp)
xorl %r12d, %r12d
movq -0x58(%rbp), %rdi
callq 0x2989
movzwl %ax, %eax
cmpq %rax, %r12
jae 0x1813
movq -0x50(%rbp), %rdi
movl %r12d, %esi
callq 0x2964
movq %rax, %r14
movq %rax, %rdi
callq 0x305e
movq %rax, -0x48(%rbp)
movq %r14, %rdi
callq 0x3089
movl %eax, %eax
movq %rax, -0x40(%rbp)
movq %r14, %rdi
callq 0x309b
movq %rax, -0x38(%rbp)
movq %r14, %rdi
callq 0x311f
movq %rax, -0x30(%rbp)
movq %r14, %rdi
callq 0x3132
movq %rax, %r13
movq %r14, %rdi
callq 0x3145
movq %rax, %r15
movq %r14, %rdi
callq 0x3158
movq %rax, %rbx
movq %r14, %rdi
callq 0x316b
movq %rax, %r10
leaq 0x2899(%rip), %rdi      # 0x407f
movq %r12, %rsi
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %r8
movq -0x30(%rbp), %r9
xorl %eax, %eax
pushq %r10
pushq %rbx
pushq %r15
pushq %r13
callq 0x10d0
addq $0x20, %rsp
incq %r12
jmp 0x175d
xorl %r12d, %r12d
movq -0x58(%rbp), %rdi
callq 0x29e7
movzwl %ax, %eax
cmpq %rax, %r12
jae 0x1901
movq -0x50(%rbp), %rbx
movq %rbx, %rdi
movl %r12d, %esi
callq 0x29c2
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2a20
movq %rax, -0x48(%rbp)
movq %r15, %rdi
callq 0x317e
movq %rax, -0x40(%rbp)
movq %r15, %rdi
callq 0x31a9
movq %rax, -0x38(%rbp)
movq %r15, %rdi
callq 0x31bc
movq %rax, -0x70(%rbp)
movq %r15, %rdi
callq 0x3220
movq %rax, -0x30(%rbp)
movq %r15, %rdi
callq 0x2ade
movq %rax, -0x68(%rbp)
movq %r15, %rdi
callq 0x3233
movq %rax, -0x60(%rbp)
movq %r15, %rdi
callq 0x2c39
movl %eax, %r14d
movq %r15, %rdi
callq 0x3246
movl %eax, %r13d
movq %r15, %rdi
callq 0x3258
movq %rax, %rbx
movq %r15, %rdi
callq 0x2bd0
movq %rax, %r10
subq $0x8, %rsp
leaq 0x291e(%rip), %rdi      # 0x41e9
movq %r12, %rsi
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %r8
movq -0x70(%rbp), %r9
xorl %eax, %eax
pushq %r10
pushq %rbx
pushq %r13
pushq %r14
pushq -0x60(%rbp)
pushq -0x68(%rbp)
pushq -0x30(%rbp)
callq 0x10d0
addq $0x40, %rsp
incq %r12
jmp 0x1816
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq