// File: /workspace/github_c_makefile_star2_O3/mikeakohn[P]print_pe/build/../src/resource.c
// Function: parse_version_info
int parse_version_info(FILE *in, long offset, int size)
{
  struct fixed_file_info_t fixed_file_info;
  long marker;
  uint16_t wLength, wValueLength, wType;
  char szKey[128];
  int len;

  marker = ftell(in);
  fseek(in, offset, SEEK_SET);

  len = read_struct_info(in, &wLength, &wValueLength, &wType, szKey, sizeof(szKey));

#if 0
fseek(in, offset, SEEK_SET);
//char buffer[2192];
char buffer[wLength];
fread(buffer, 1, sizeof(buffer), in);
fclose(in);

FILE *fp = fopen("vs_versionfinfo.bin", "wb");
fwrite(buffer, 1, sizeof(buffer), fp);
fclose(fp);
exit(0);
#endif

  len += read_padding(in, len);
  len += read_fixed_file_info(in, &fixed_file_info);
  print_fixed_file_info(&fixed_file_info);
  len += read_padding(in, len);

  while (len < wLength)
  {
    len += parse_x_file_info(in);
  }

  fseek(in, marker, SEEK_SET);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movq %rsi, %r14
movq %rdi, %rbx
callq 0x30f0
movq %rax, 0x38(%rsp)
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3100
leaq 0x10(%rsp), %rsi
leaq 0x2c(%rsp), %rdx
leaq 0x2a(%rsp), %rcx
leaq 0x200(%rsp), %r8
movq %rbx, %rdi
callq 0x638b
movl %eax, %r14d
movl $0x0, %r13d
testb $0x3, %r14b
je 0x60eb
movl %r14d, %r12d
negb %r12b
movl %r14d, %r15d
andl $0x3, %r15d
movl $0x1, %r13d
andb $0x3, %r12b
movq %rbx, %rdi
callq 0x3150
movl %r13d, %eax
andb $0x3, %al
incl %r13d
cmpb %r12b, %al
jne 0x60cd
movl $0x4, %r13d
subl %r15d, %r13d
leal (%r14,%r13), %r12d
leaq 0xcc(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x64f6
addl %r14d, %r13d
addl $0x34, %r13d
movq %r15, %rdi
callq 0x6598
testb $0x3, %r12b
je 0x6148
movl %r12d, %ebp
negb %bpl
andl $0x3, %r12d
movl $0x1, %r14d
andb $0x3, %bpl
movq %rbx, %rdi
callq 0x3150
movl %r14d, %eax
andb $0x3, %al
incl %r14d
cmpb %bpl, %al
jne 0x612b
movl $0x4, %ebp
subl %r12d, %ebp
addl %ebp, %r13d
movzwl 0x10(%rsp), %ebp
cmpl %ebp, %r13d
jge 0x6368
movl %ebp, 0x18(%rsp)
leaq 0x41de(%rip), %rdi      # 0xa342
callq 0x3060
movq %rbx, %rdi
leaq 0x12(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x2e(%rsp), %rcx
leaq 0x40(%rsp), %r8
callq 0x638b
movq 0x40(%rsp), %rsi
movabsq $0x6946676e69727453, %rcx # imm = 0x6946676E69727453
xorq %rcx, %rsi
movq 0x47(%rsp), %rcx
movabsq $0x6f666e49656c69, %rdx # imm = 0x6F666E49656C69
xorq %rdx, %rcx
orq %rsi, %rcx
je 0x61e3
movq 0x40(%rsp), %rdx
movabsq $0x49656c6946726156, %rcx # imm = 0x49656C6946726156
xorq %rcx, %rdx
movl 0x48(%rsp), %ecx
xorq $0x6f666e, %rcx         # imm = 0x6F666E
orq %rdx, %rcx
je 0x6306
movzwl 0x12(%rsp), %r15d
addl $-0x4, %r15d
jmp 0x6359
movl %eax, 0x1c(%rsp)
movl %r13d, 0x20(%rsp)
leaq 0x4167(%rip), %rdi      # 0xa35a
callq 0x3060
movq %rbx, %rdi
leaq 0x14(%rsp), %rsi
leaq 0x34(%rsp), %rdx
leaq 0x32(%rsp), %rcx
leaq 0x100(%rsp), %r8
callq 0x638b
movl %eax, %r15d
movzwl 0x14(%rsp), %eax
movl %eax, 0x24(%rsp)
cmpl %eax, %r15d
jge 0x62f7
leaq 0x414b(%rip), %rdi      # 0xa37e
callq 0x3060
movq %rbx, %rdi
leaq 0x16(%rsp), %rsi
leaq 0xe(%rsp), %rdx
leaq 0x36(%rsp), %rcx
leaq 0x180(%rsp), %r8
callq 0x638b
movl %eax, %ebp
leaq 0x40ab(%rip), %rdi      # 0xa30b
xorl %eax, %eax
callq 0x3090
movzwl 0xe(%rsp), %r13d
testl %r13d, %r13d
je 0x62a0
movl %r13d, %r14d
movq %rbx, %rdi
callq 0x3150
movl %eax, %r12d
movq %rbx, %rdi
callq 0x3150
shll $0x8, %eax
orl %eax, %r12d
movl %r12d, %edi
callq 0x3030
decl %r14d
jne 0x6275
leal (%rbp,%r13,2), %ebp
leaq 0x1e73(%rip), %rdi      # 0x811a
callq 0x3060
movl %ebp, %r12d
andl $0x3, %r12d
je 0x62e4
movl %ebp, %r14d
negb %r14b
movl $0x1, %r13d
andb $0x3, %r14b
movq %rbx, %rdi
callq 0x3150
movl %r13d, %eax
andb $0x3, %al
incl %r13d
cmpb %r14b, %al
jne 0x62c5
movl $0x4, %eax
subl %r12d, %eax
jmp 0x62e6
xorl %eax, %eax
addl %ebp, %r15d
addl %eax, %r15d
cmpl 0x24(%rsp), %r15d
jl 0x622c
movl 0x20(%rsp), %r13d
movl 0x18(%rsp), %ebp
movl 0x1c(%rsp), %eax
jmp 0x6359
leaq 0x4063(%rip), %rdi      # 0xa370
movl %eax, %r14d
callq 0x3060
movq %rbx, %rdi
leaq 0x100(%rsp), %rsi
leaq 0x16(%rsp), %rdx
leaq 0xe(%rsp), %rcx
leaq 0x180(%rsp), %r8
callq 0x638b
movl %eax, %r15d
movq %rbx, %rdi
callq 0x51ae
leaq 0x3fcc(%rip), %rdi      # 0xa315
movl %eax, %esi
xorl %eax, %eax
callq 0x3090
movl %r14d, %eax
addl $0x4, %r15d
addl %eax, %r13d
addl %r15d, %r13d
cmpl %ebp, %r13d
jl 0x615d
movq %rbx, %rdi
movq 0x38(%rsp), %rsi
xorl %edx, %edx
callq 0x3100
xorl %eax, %eax
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq