// File: /workspace/github_c_makefile_star2_O2/mikeakohn[P]print_pe/build/../src/minidump.c
// Function: print_minidump_memory_info_list
void print_minidump_memory_info_list(FILE *in)
{
  uint64_t n;
  uint32_t size_of_headers = read_uint32(in);
  uint32_t size_of_entry = read_uint32(in);
  uint64_t number_of_entries = read_uint64(in);

  printf("   size_of_headers: %u\n", size_of_headers);
  printf("     size_of_entry: %u\n", size_of_entry);
  printf(" number_of_entries: %ld\n", number_of_entries);

  for (n = 0; n < number_of_entries; n++)
  {
    uint64_t marker = ftell(in);

    if (feof(in) != 0)
    {
       printf("Error: Premature end of file?\n");
       break;
    }

    printf("  -- Memory Info %ld --\n", n);

    printf("      base_address: 0x%" PRIx64 "\n", read_uint64(in));
    printf("   allocation_base: 0x%" PRIx64 "\n", read_uint64(in));
    printf("allocation_protect: 0x%x\n", read_uint32(in));
    printf("      __alignment1: %d\n", read_uint32(in));
    printf("       region_size: %" PRId64 "\n", read_uint64(in));
    printf("             state: %d\n", read_uint32(in));
    printf("           protect: %d\n", read_uint32(in));
    printf("              type: %d\n", read_uint32(in));
    printf("      __alignment2: %d\n", read_uint32(in));

    uint64_t length = ftell(in) - marker;

    if (length < size_of_entry)
    {
      fseek(in, size_of_entry - marker, SEEK_CUR);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x1766
movl %eax, %ebp
movq %rbx, %rdi
callq 0x1766
movl %eax, %r15d
movq %rbx, %rdi
callq 0x16cc
movq %rax, %r14
leaq 0x1ba6(%rip), %rdi      # 0x462f
movl %ebp, %esi
xorl %eax, %eax
callq 0x1060
leaq 0x21e5(%rip), %rdi      # 0x4c7e
movl %r15d, %esi
xorl %eax, %eax
callq 0x1060
leaq 0x1b9d(%rip), %rdi      # 0x4647
movq %r14, %rsi
xorl %eax, %eax
callq 0x1060
movl %r15d, %r15d
leaq 0x1c84(%rip), %r12      # 0x4742
xorl %r13d, %r13d
cmpq %r13, %r14
je 0x2bf6
movq %rbx, %rdi
callq 0x1090
movq %rax, %rbp
movq %rbx, %rdi
callq 0x10a0
testl %eax, %eax
jne 0x2c05
leaq 0x1b74(%rip), %rdi      # 0x4660
movq %r13, %rsi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x16cc
leaq 0x1b74(%rip), %rdi      # 0x4679
movq %rax, %rsi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x16cc
leaq 0x1b76(%rip), %rdi      # 0x4694
movq %rax, %rsi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x1766
leaq 0x1b78(%rip), %rdi      # 0x46af
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x1766
leaq 0x1b7a(%rip), %rdi      # 0x46c9
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x16cc
leaq 0x1b7a(%rip), %rdi      # 0x46e1
movq %rax, %rsi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x1766
leaq 0x1b7a(%rip), %rdi      # 0x46fa
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x1766
leaq 0x1b7a(%rip), %rdi      # 0x4712
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x1766
leaq 0x1b7a(%rip), %rdi      # 0x472a
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x1766
movq %r12, %rdi
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x1090
subq %rbp, %rax
cmpq %r15, %rax
jae 0x2bee
movq %r15, %rsi
subq %rbp, %rsi
movq %rbx, %rdi
pushq $0x1
popq %rdx
callq 0x10b0
incq %r13
jmp 0x2ac1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2a30(%rip), %rdi      # 0x563c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1040