// File: /workspace/github_c_makefile_star2_O0/mrkite[P]regs/src/2mg.cc
// Function: doFile(unsigned short, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::shared_ptr<TheHandle>, int)
static void doFile(uint16_t key, uint32_t len, std::string name,
                   Handle h, int type) {
  h->seek(key * 512);
  std::ofstream f(name, std::ios::out | std::ios::binary | std::ios::trunc);
  if (!f.is_open()) {
    std::cerr << "Failed to create " << name << std::endl;
    return;
  }
  switch (type) {
    case 1:
      dumpSeedling(h, len, f);
      break;
    case 2:
      dumpSapling(h, len, f);
      break;
    case 3:
      dumpTree(h, len, f);
      break;
  }
  f.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2b0, %rsp            # imm = 0x2B0
movq %rcx, -0x280(%rbp)
movq %rdx, -0x278(%rbp)
movl %edi, %eax
movq -0x280(%rbp), %rdi
movw %ax, -0x2(%rbp)
movl %esi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
callq 0x8550
movq %rax, %rdi
movzwl -0x2(%rbp), %eax
shll $0x9, %eax
movl %eax, %esi
callq 0x9b00
movl $0x10, %edi
movl $0x4, %esi
callq 0x8cc0
movl %eax, %edi
movl $0x20, %esi
callq 0x8cc0
movq -0x278(%rbp), %rsi
movl %eax, %edx
leaq -0x220(%rbp), %rdi
movq %rdi, -0x270(%rbp)
callq 0x6480
movq -0x270(%rbp), %rdi
callq 0x6170
movb %al, -0x261(%rbp)
jmp 0x7946
movb -0x261(%rbp), %al
testb $0x1, %al
jne 0x79c5
jmp 0x7952
movq 0x9697(%rip), %rdi      # 0x10ff0
leaq 0x37c1(%rip), %rsi      # 0xb121
callq 0x61e0
movq %rax, -0x288(%rbp)
jmp 0x796e
movq -0x278(%rbp), %rsi
movq -0x288(%rbp), %rdi
callq 0x61c0
movq %rax, -0x290(%rbp)
jmp 0x798a
movq -0x290(%rbp), %rdi
movq 0x9618(%rip), %rsi      # 0x10fb0
callq 0x6240
jmp 0x799f
movl $0x1, -0x230(%rbp)
jmp 0x7b3a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x7b4f
movl -0x1c(%rbp), %eax
movl %eax, -0x294(%rbp)
subl $0x1, %eax
je 0x79f6
jmp 0x79d5
movl -0x294(%rbp), %eax
subl $0x2, %eax
je 0x7a5c
jmp 0x79e2
movl -0x294(%rbp), %eax
subl $0x3, %eax
je 0x7ac2
jmp 0x7b22
movq -0x280(%rbp), %rsi
leaq -0x240(%rbp), %rdi
movq %rdi, -0x2a0(%rbp)
callq 0x8650
movq -0x2a0(%rbp), %rdi
movl -0x8(%rbp), %esi
leaq -0x220(%rbp), %rdx
callq 0x80d0
jmp 0x7a28
leaq -0x240(%rbp), %rdi
callq 0x85d0
jmp 0x7b22
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x85d0
jmp 0x7b4f
movq -0x280(%rbp), %rsi
leaq -0x250(%rbp), %rdi
movq %rdi, -0x2a8(%rbp)
callq 0x8650
movq -0x2a8(%rbp), %rdi
movl -0x8(%rbp), %esi
leaq -0x220(%rbp), %rdx
callq 0x8100
jmp 0x7a8e
leaq -0x250(%rbp), %rdi
callq 0x85d0
jmp 0x7b22
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x250(%rbp), %rdi
callq 0x85d0
jmp 0x7b4f
movq -0x280(%rbp), %rsi
leaq -0x260(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
callq 0x8650
movq -0x2b0(%rbp), %rdi
movl -0x8(%rbp), %esi
leaq -0x220(%rbp), %rdx
callq 0x8280
jmp 0x7af4
leaq -0x260(%rbp), %rdi
callq 0x85d0
jmp 0x7b22
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x85d0
jmp 0x7b4f
leaq -0x220(%rbp), %rdi
callq 0x6350
jmp 0x7b30
movl $0x0, -0x230(%rbp)
leaq -0x220(%rbp), %rdi
callq 0x6380
addq $0x2b0, %rsp            # imm = 0x2B0
popq %rbp
retq
leaq -0x220(%rbp), %rdi
callq 0x6380
movq -0x228(%rbp), %rdi
callq 0x6440
nopw (%rax,%rax)