// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1a00
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1a00
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1930
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %esi
leaq 0x1fae(%rip), %rdi      # 0x4689
movb $0x0, %al
callq 0x1050
movl -0x18(%rbp), %esi
leaq 0x2620(%rip), %rdi      # 0x4d0c
movb $0x0, %al
callq 0x1050
movq -0x20(%rbp), %rsi
leaq 0x1fa3(%rip), %rdi      # 0x46a1
movb $0x0, %al
callq 0x1050
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x2886
movq -0x8(%rbp), %rdi
callq 0x1090
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
callq 0x10a0
cmpl $0x0, %eax
je 0x2749
leaq 0x1f7d(%rip), %rdi      # 0x46ba
movb $0x0, %al
callq 0x1050
jmp 0x2886
movq -0x10(%rbp), %rsi
leaq 0x1f85(%rip), %rdi      # 0x46d9
movb $0x0, %al
callq 0x1050
movq -0x8(%rbp), %rdi
callq 0x1930
movq %rax, %rsi
leaq 0x1f84(%rip), %rdi      # 0x46f2
movb $0x0, %al
callq 0x1050
movq -0x8(%rbp), %rdi
callq 0x1930
movq %rax, %rsi
leaq 0x1f85(%rip), %rdi      # 0x470d
movb $0x0, %al
callq 0x1050
movq -0x8(%rbp), %rdi
callq 0x1a00
movl %eax, %esi
leaq 0x1f87(%rip), %rdi      # 0x4728
movb $0x0, %al
callq 0x1050
movq -0x8(%rbp), %rdi
callq 0x1a00
movl %eax, %esi
leaq 0x1f88(%rip), %rdi      # 0x4742
movb $0x0, %al
callq 0x1050
movq -0x8(%rbp), %rdi
callq 0x1930
movq %rax, %rsi
leaq 0x1f86(%rip), %rdi      # 0x475a
movb $0x0, %al
callq 0x1050
movq -0x8(%rbp), %rdi
callq 0x1a00
movl %eax, %esi
leaq 0x1f86(%rip), %rdi      # 0x4773
movb $0x0, %al
callq 0x1050
movq -0x8(%rbp), %rdi
callq 0x1a00
movl %eax, %esi
leaq 0x1f85(%rip), %rdi      # 0x478b
movb $0x0, %al
callq 0x1050
movq -0x8(%rbp), %rdi
callq 0x1a00
movl %eax, %esi
leaq 0x1f84(%rip), %rdi      # 0x47a3
movb $0x0, %al
callq 0x1050
movq -0x8(%rbp), %rdi
callq 0x1a00
movl %eax, %esi
leaq 0x1f83(%rip), %rdi      # 0x47bb
movb $0x0, %al
callq 0x1050
movq -0x8(%rbp), %rdi
callq 0x1090
subq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movl -0x18(%rbp), %ecx
cmpq %rcx, %rax
jae 0x2873
movq -0x8(%rbp), %rdi
movl -0x18(%rbp), %eax
movl %eax, %esi
subq -0x28(%rbp), %rsi
movl $0x1, %edx
callq 0x10b0
jmp 0x2875
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x270d
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)