// File: /workspace/github_c_makefile_star2_O1/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 0x178e
movl %eax, %r15d
movq %rbx, %rdi
callq 0x178e
movl %eax, %ebp
movq %rbx, %rdi
callq 0x16f4
movq %rax, %r14
leaq 0x1b28(%rip), %rdi      # 0x462f
movl %r15d, %esi
xorl %eax, %eax
callq 0x1060
leaq 0x2166(%rip), %rdi      # 0x4c7e
movl %ebp, %esi
xorl %eax, %eax
callq 0x1060
leaq 0x1b1f(%rip), %rdi      # 0x4647
movq %r14, %rsi
xorl %eax, %eax
callq 0x1060
testq %r14, %r14
je 0x2c91
movl %ebp, %r15d
decq %r14
xorl %r13d, %r13d
movq %rbx, %rdi
callq 0x1090
movq %rax, %r12
movq %rbx, %rdi
callq 0x10a0
movl %eax, %ebp
testl %eax, %eax
je 0x2b6e
leaq 0x2ad8(%rip), %rdi      # 0x563c
callq 0x1040
jmp 0x2c7d
leaq 0x1aeb(%rip), %rdi      # 0x4660
movq %r13, %rsi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x16f4
leaq 0x1aeb(%rip), %rdi      # 0x4679
movq %rax, %rsi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x16f4
leaq 0x1aed(%rip), %rdi      # 0x4694
movq %rax, %rsi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x178e
leaq 0x1aef(%rip), %rdi      # 0x46af
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x178e
leaq 0x1af1(%rip), %rdi      # 0x46c9
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x16f4
leaq 0x1af1(%rip), %rdi      # 0x46e1
movq %rax, %rsi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x178e
leaq 0x1af1(%rip), %rdi      # 0x46fa
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x178e
leaq 0x1af1(%rip), %rdi      # 0x4712
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x178e
leaq 0x1af1(%rip), %rdi      # 0x472a
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x178e
leaq 0x1af1(%rip), %rdi      # 0x4742
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x1090
subq %r12, %rax
cmpq %r15, %rax
jae 0x2c7d
movq %r15, %rsi
subq %r12, %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x10b0
testl %ebp, %ebp
jne 0x2c91
leaq 0x1(%r13), %rax
cmpq %r13, %r14
movq %rax, %r13
jne 0x2b44
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq