// File: /workspace/github_c_makefile_star2_O0/mrkite[P]regs/src/2mg.cc
// Function: doGSOS(unsigned short, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned char, std::shared_ptr<TheHandle>, int)
static void doGSOS(uint16_t key, std::string filename, uint8_t type,
                   Handle h, int depth) {
  h->seek(key * 512);
  auto filetype = h->r8();
  auto subkey = h->r16();
  h->skip(2);
  auto eof = h->r24();
  if (depth < 0) {
    doFile(subkey, eof, filename, h, filetype);
  }
  std::string resname = filename;
  resname += ".res";
  h->seek(key * 512 + 0x100);
  filetype = h->r8();
  subkey = h->r16();
  h->skip(2);
  auto reof = h->r24();
  if (depth < 0) {
    doFile(subkey, reof, resname, h, filetype);
  } else {
    indent(depth);
    std::cout << filename << "  " << eof << " bytes  resource: "
              << reof << " bytes" << std::endl;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rcx, -0xd0(%rbp)
movq %rsi, -0xd8(%rbp)
movl %edi, %ecx
movq -0xd0(%rbp), %rdi
movb %dl, %al
movw %cx, -0x2(%rbp)
movq %rsi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq %rdi, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
callq 0x8550
movq %rax, %rdi
movzwl -0x2(%rbp), %eax
shll $0x9, %eax
movslq %eax, %rsi
callq 0x9b00
movq -0xd0(%rbp), %rdi
callq 0x8550
movq %rax, %rdi
callq 0x98b0
movq -0xd0(%rbp), %rdi
movb %al, -0x25(%rbp)
callq 0x8550
movq %rax, %rdi
callq 0x9860
movq -0xd0(%rbp), %rdi
movw %ax, -0x28(%rbp)
callq 0x8550
movq %rax, %rdi
movl $0x2, %esi
callq 0x9b20
movq -0xd0(%rbp), %rdi
callq 0x8550
movq %rax, %rdi
callq 0x9800
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x24(%rbp)
jge 0x7e25
movq -0xd8(%rbp), %rsi
movzwl -0x28(%rbp), %eax
movl %eax, -0xf0(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0xec(%rbp)
leaq -0x50(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x60f0
movq -0xd0(%rbp), %rsi
leaq -0x60(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0x8650
movl -0xf0(%rbp), %edi
movl -0xec(%rbp), %esi
movq -0xe8(%rbp), %rdx
movq -0xe0(%rbp), %rcx
movzbl -0x25(%rbp), %r8d
callq 0x78b0
jmp 0x7dee
leaq -0x60(%rbp), %rdi
callq 0x85d0
leaq -0x50(%rbp), %rdi
callq 0x6130
jmp 0x7e25
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x85d0
leaq -0x50(%rbp), %rdi
callq 0x6130
jmp 0x80be
movq -0xd8(%rbp), %rsi
leaq -0x90(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x60f0
movq -0xf8(%rbp), %rdi
leaq 0x44da(%rip), %rsi      # 0xc327
callq 0x61d0
jmp 0x7e54
movq -0xd0(%rbp), %rdi
callq 0x8550
movq %rax, %rdi
movzwl -0x2(%rbp), %eax
shll $0x9, %eax
orl $0x100, %eax            # imm = 0x100
movl %eax, %esi
callq 0x9b00
jmp 0x7e78
movq -0xd0(%rbp), %rdi
callq 0x8550
movq %rax, %rdi
callq 0x98b0
movb %al, -0xf9(%rbp)
jmp 0x7e94
movq -0xd0(%rbp), %rdi
movb -0xf9(%rbp), %al
movb %al, -0x25(%rbp)
callq 0x8550
movq %rax, %rdi
callq 0x9860
movw %ax, -0xfc(%rbp)
jmp 0x7eba
movq -0xd0(%rbp), %rdi
movw -0xfc(%rbp), %ax
movw %ax, -0x28(%rbp)
callq 0x8550
movq %rax, %rdi
movl $0x2, %esi
callq 0x9b20
jmp 0x7ee0
movq -0xd0(%rbp), %rdi
callq 0x8550
movq %rax, %rdi
callq 0x9800
movl %eax, -0x100(%rbp)
jmp 0x7efc
movl -0x100(%rbp), %eax
movl %eax, -0x94(%rbp)
cmpl $0x0, -0x24(%rbp)
jge 0x7fd9
movw -0x28(%rbp), %ax
movw %ax, -0x106(%rbp)
movl -0x94(%rbp), %eax
movl %eax, -0x104(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x60f0
jmp 0x7f3e
movq -0xd0(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0x8650
movw -0x106(%rbp), %ax
movl -0x104(%rbp), %esi
movq -0x110(%rbp), %rcx
movzbl -0x25(%rbp), %r8d
movzwl %ax, %edi
leaq -0xb8(%rbp), %rdx
callq 0x78b0
jmp 0x7f82
leaq -0xc8(%rbp), %rdi
callq 0x85d0
leaq -0xb8(%rbp), %rdi
callq 0x6130
jmp 0x809d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x80b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x85d0
leaq -0xb8(%rbp), %rdi
callq 0x6130
jmp 0x80b2
movl -0x24(%rbp), %edi
callq 0x7000
jmp 0x7fe3
movq -0xd8(%rbp), %rsi
movq 0x8fdf(%rip), %rdi      # 0x10fd0
callq 0x61c0
movq %rax, -0x118(%rbp)
jmp 0x7fff
movq -0x118(%rbp), %rdi
leaq 0x30c6(%rip), %rsi      # 0xb0d3
callq 0x61e0
movq %rax, -0x120(%rbp)
jmp 0x801b
movq -0x120(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x6300
movq %rax, -0x128(%rbp)
jmp 0x8033
movq -0x128(%rbp), %rdi
leaq 0x42eb(%rip), %rsi      # 0xc32c
callq 0x61e0
movq %rax, -0x130(%rbp)
jmp 0x804f
movq -0x130(%rbp), %rdi
movl -0x94(%rbp), %esi
callq 0x6300
movq %rax, -0x138(%rbp)
jmp 0x806a
movq -0x138(%rbp), %rdi
leaq 0x42c7(%rip), %rsi      # 0xc33f
callq 0x61e0
movq %rax, -0x140(%rbp)
jmp 0x8086
movq -0x140(%rbp), %rdi
movq 0x8f1c(%rip), %rsi      # 0x10fb0
callq 0x6240
jmp 0x809b
jmp 0x809d
leaq -0x90(%rbp), %rdi
callq 0x6130
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
leaq -0x90(%rbp), %rdi
callq 0x6130
movq -0x68(%rbp), %rdi
callq 0x6440
nopw (%rax,%rax)