// File: /workspace/github_c_makefile_star2_O3/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, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x2afd
testw %ax, %ax
movq %rbx, -0x58(%rbp)
movq %r14, -0x50(%rbp)
je 0x18aa
xorl %r12d, %r12d
movq %r14, %rdi
movl %r12d, %esi
callq 0x2ad8
movq %rax, %r14
movq %rax, %rdi
callq 0x32b8
movq %rax, -0x48(%rbp)
movq %r14, %rdi
callq 0x32e3
movl %eax, %eax
movq %rax, -0x40(%rbp)
movq %r14, %rdi
callq 0x32f5
movq %rax, -0x38(%rbp)
movq %r14, %rdi
callq 0x3379
movq %rax, -0x30(%rbp)
movq %r14, %rdi
callq 0x338c
movq %rax, %r13
movq %r14, %rdi
callq 0x339f
movq %rax, %r15
movq %r14, %rdi
callq 0x33b2
movq %rax, %rbx
movq %r14, %rdi
movq -0x50(%rbp), %r14
callq 0x33c5
movq %rax, %r10
leaq 0x2815(%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
movq -0x58(%rbp), %rbx
pushq %r15
pushq %r13
callq 0x10d0
addq $0x20, %rsp
incq %r12
movq %rbx, %rdi
callq 0x2afd
movzwl %ax, %eax
cmpq %rax, %r12
jb 0x17f3
movq %rbx, %rdi
callq 0x2b5b
testw %ax, %ax
je 0x19a4
xorl %r12d, %r12d
movq %r14, %rdi
movl %r12d, %esi
callq 0x2b36
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x2b94
movq %rax, -0x48(%rbp)
movq %r15, %rdi
callq 0x33d8
movq %rax, -0x40(%rbp)
movq %r15, %rdi
callq 0x3403
movq %rax, -0x38(%rbp)
movq %r15, %rdi
callq 0x3416
movq %rax, -0x70(%rbp)
movq %r15, %rdi
callq 0x347f
movq %rax, -0x30(%rbp)
movq %r15, %rdi
callq 0x2c6b
movq %rax, -0x68(%rbp)
movq %r15, %rdi
callq 0x3492
movq %rax, -0x60(%rbp)
movq %r15, %rdi
callq 0x2ddf
movl %eax, %r14d
movq %r15, %rdi
callq 0x34a5
movl %eax, %r13d
movq %r15, %rdi
callq 0x34b7
movq %rax, %rbx
movq %r15, %rdi
callq 0x2d76
movq %rax, %r10
subq $0x8, %rsp
leaq 0x288f(%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
movq -0x50(%rbp), %r14
pushq -0x60(%rbp)
pushq -0x68(%rbp)
pushq -0x30(%rbp)
callq 0x10d0
addq $0x40, %rsp
incq %r12
movq -0x58(%rbp), %rdi
callq 0x2b5b
movzwl %ax, %eax
cmpq %rax, %r12
jb 0x18be
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq