// File: /workspace/github_c_makefile_star2_O0/mikeakohn[P]print_pe/build/../src/minidump.c
// Function: print_minidump_handle_data
void print_minidump_handle_data(FILE *in)
{
  uint32_t n;

  printf("\n");
  printf("     size_of_header: %u\n", read_uint32(in));

  uint32_t size_of_descriptor = read_uint32(in);
  uint32_t number_of_descriptors = read_uint32(in);

  printf(" size_of_descriptor: %u\n", size_of_descriptor);
  printf(" number_descriptors: %u\n", number_of_descriptors);
  printf("           reserved: %u\n", read_uint32(in));

  for (n = 0; n < number_of_descriptors; n++)
  {
    printf("       --- handle descriptor %d ---\n", n);
    long marker = ftell(in);

    printf("               handle: 0x%" PRIx64 "\n", read_uint64(in));

    uint32_t type_name_offset = read_uint32(in);
    uint32_t object_name_offset = read_uint32(in);

    printf("            type_name: offset=%d,", type_name_offset);
    print_minidump_string(in, type_name_offset);

    printf("          object_name: offset=%d,", object_name_offset);
    print_minidump_string(in, object_name_offset);

    printf("           attributes: 0x%x\n", read_uint32(in));
    printf("       granted_access: 0x%x\n", read_uint32(in));
    printf("         handle_count: %u\n", read_uint32(in));
    printf("        pointer_count: %u\n", read_uint32(in));

    if (size_of_descriptor > 32)
    {
      printf("          object_info: offset=%u\n", read_uint32(in));
      printf("             reserved: %u\n", read_uint32(in));
    }

    long end = ftell(in);

    if (end - marker < size_of_descriptor)
    {
      fseek(in, end - marker - size_of_descriptor, SEEK_CUR);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x13c8(%rip), %rdi      # 0x40fb
movb $0x0, %al
callq 0x1050
movq -0x8(%rbp), %rdi
callq 0x1a00
movl %eax, %esi
leaq 0x1d2d(%rip), %rdi      # 0x4a79
movb $0x0, %al
callq 0x1050
movq -0x8(%rbp), %rdi
callq 0x1a00
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1a00
movl %eax, -0x14(%rbp)
movl -0x10(%rbp), %esi
leaq 0x1d1d(%rip), %rdi      # 0x4a92
movb $0x0, %al
callq 0x1050
movl -0x14(%rbp), %esi
leaq 0x1d25(%rip), %rdi      # 0x4aab
movb $0x0, %al
callq 0x1050
movq -0x8(%rbp), %rdi
callq 0x1a00
movl %eax, %esi
leaq 0x1e40(%rip), %rdi      # 0x4bdf
movb $0x0, %al
callq 0x1050
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x14(%rbp), %eax
jae 0x2f28
movl -0xc(%rbp), %esi
leaq 0x1d01(%rip), %rdi      # 0x4ac4
movb $0x0, %al
callq 0x1050
movq -0x8(%rbp), %rdi
callq 0x1090
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1930
movq %rax, %rsi
leaq 0x1cff(%rip), %rdi      # 0x4ae9
movb $0x0, %al
callq 0x1050
movq -0x8(%rbp), %rdi
callq 0x1a00
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1a00
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %esi
leaq 0x1cf4(%rip), %rdi      # 0x4b07
movb $0x0, %al
callq 0x1050
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x23f0
movl -0x28(%rbp), %esi
leaq 0x1cf9(%rip), %rdi      # 0x4b29
movb $0x0, %al
callq 0x1050
movq -0x8(%rbp), %rdi
movl -0x28(%rbp), %esi
callq 0x23f0
movq -0x8(%rbp), %rdi
callq 0x1a00
movl %eax, %esi
leaq 0x1cf6(%rip), %rdi      # 0x4b4b
movb $0x0, %al
callq 0x1050
movq -0x8(%rbp), %rdi
callq 0x1a00
movl %eax, %esi
leaq 0x1cfa(%rip), %rdi      # 0x4b68
movb $0x0, %al
callq 0x1050
movq -0x8(%rbp), %rdi
callq 0x1a00
movl %eax, %esi
leaq 0x1cfe(%rip), %rdi      # 0x4b85
movb $0x0, %al
callq 0x1050
movq -0x8(%rbp), %rdi
callq 0x1a00
movl %eax, %esi
leaq 0x1d00(%rip), %rdi      # 0x4ba0
movb $0x0, %al
callq 0x1050
cmpl $0x20, -0x10(%rbp)
jbe 0x2edf
movq -0x8(%rbp), %rdi
callq 0x1a00
movl %eax, %esi
leaq 0x1cfc(%rip), %rdi      # 0x4bbb
movb $0x0, %al
callq 0x1050
movq -0x8(%rbp), %rdi
callq 0x1a00
movl %eax, %esi
leaq 0x1d05(%rip), %rdi      # 0x4bdd
movb $0x0, %al
callq 0x1050
movq -0x8(%rbp), %rdi
callq 0x1090
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
subq -0x20(%rbp), %rax
movl -0x10(%rbp), %ecx
cmpq %rcx, %rax
jge 0x2f18
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
subq -0x20(%rbp), %rsi
movl -0x10(%rbp), %eax
subq %rax, %rsi
movl $0x1, %edx
callq 0x10b0
jmp 0x2f1a
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x2dad
addq $0x30, %rsp
popq %rbp
retq
nop