// File: /workspace/github_c_makefile_star2_O0/mrkite[P]regs/src/2mg.cc
// Function: doEntry(unsigned int, std::shared_ptr<TheHandle>, int)
static void doEntry(uint32_t entry, Handle h, int depth) {
  h->seek(entry);
  auto type = h->r8();
  std::string filename = readFilename(h, type & 0xf);

  h->seek(entry + 0x10);
  auto filetype = h->r8();
  auto key = h->r16();
  h->skip(2);
  auto eof = h->r24();

  switch (type & 0xf0) {
    case 0x10:  // seedling
    case 0x20:  // sapling
    case 0x30:  // tree
      if (depth < 0) {
        doFile(key, eof, filename, h, type >> 4);
      } else {
        auto createDate = h->r16();
        auto createTime = h->r16();
        h->skip(3);
        auto aux = h->r16();
        auto modDate = h->r16();
        auto modTime = h->r16();
        indent(depth);
        std::cout << filename << std::endl;
        indent(depth);
        std::cout << "  Size: " << eof;
        std::cout << " Created: ";
        printDateTime(createDate, createTime);
        std::cout << " Modified: ";
        printDateTime(modDate, modTime);
        std::cout << std::endl;
        indent(depth);
        std::cout << "  Type: $" << std::hex << std::setw(2)
                  << std::setfill('0') << static_cast<int>(filetype)
                  << " Aux: $" << std::setw(4) << aux << std::dec << " ";
        uint32_t typeaux = filetype | (aux << 8);
        for (int i = 0; i < numTypes; i++) {
          if ((typeaux & fileTypes[i].mask) == fileTypes[i].id) {
            std::cout << fileTypes[i].ext << "/" << fileTypes[i].desc;
            break;
          }
        }
        std::cout << std::endl;
      }
      break;
    case 0x50:
      doGSOS(key, filename, filetype, h, depth);
      break;
    case 0xd0:
      doDirectory(key, h, depth < 0 ? -1 : depth + 1);
      break;
    default:
      std::cerr << "Unknown file storage: " << static_cast<int>(type)
                << std::endl;
      return;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1f0, %rsp            # imm = 0x1F0
movq %rsi, -0x110(%rbp)
movl %edi, %eax
movq -0x110(%rbp), %rdi
movq %rdi, -0x108(%rbp)
movl %eax, -0x4(%rbp)
movq %rdi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
callq 0x8550
movq %rax, %rdi
movl -0x4(%rbp), %eax
movl %eax, %esi
callq 0x9b00
movq -0x108(%rbp), %rdi
callq 0x8550
movq %rax, %rdi
callq 0x98b0
movq -0x108(%rbp), %rsi
movb %al, -0x15(%rbp)
leaq -0x48(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x8650
movq -0x100(%rbp), %rsi
movzbl -0x15(%rbp), %edx
andl $0xf, %edx
leaq -0x38(%rbp), %rdi
callq 0x6ec0
jmp 0x70c5
leaq -0x48(%rbp), %rdi
callq 0x85d0
movq -0x108(%rbp), %rdi
callq 0x8550
movq %rax, %rdi
movl -0x4(%rbp), %eax
addl $0x10, %eax
movl %eax, %esi
callq 0x9b00
jmp 0x70ec
movq -0x108(%rbp), %rdi
callq 0x8550
movq %rax, %rdi
callq 0x98b0
movb %al, -0x111(%rbp)
jmp 0x7108
movq -0x108(%rbp), %rdi
movb -0x111(%rbp), %al
movb %al, -0x55(%rbp)
callq 0x8550
movq %rax, %rdi
callq 0x9860
movw %ax, -0x114(%rbp)
jmp 0x712e
movq -0x108(%rbp), %rdi
movw -0x114(%rbp), %ax
movw %ax, -0x58(%rbp)
callq 0x8550
movq %rax, %rdi
movl $0x2, %esi
callq 0x9b20
jmp 0x7154
movq -0x108(%rbp), %rdi
callq 0x8550
movq %rax, %rdi
callq 0x9800
movl %eax, -0x118(%rbp)
jmp 0x7170
movl -0x118(%rbp), %eax
movl %eax, -0x5c(%rbp)
movzbl -0x15(%rbp), %eax
andl $-0x10, %eax
movl %eax, -0x11c(%rbp)
subl $0x10, %eax
je 0x71f9
jmp 0x718d
movl -0x11c(%rbp), %eax
subl $0x20, %eax
je 0x71f9
jmp 0x719a
movl -0x11c(%rbp), %eax
subl $0x30, %eax
je 0x71f9
jmp 0x71a7
movl -0x11c(%rbp), %eax
subl $0x50, %eax
je 0x76f0
jmp 0x71b8
movl -0x11c(%rbp), %eax
subl $0xd0, %eax
je 0x77a0
jmp 0x7823
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x85d0
jmp 0x789e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x7895
cmpl $0x0, -0x14(%rbp)
jge 0x72ab
movw -0x58(%rbp), %ax
movw %ax, -0x122(%rbp)
movl -0x5c(%rbp), %eax
movl %eax, -0x120(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x60f0
jmp 0x7226
movq -0x108(%rbp), %rsi
leaq -0x90(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x8650
movw -0x122(%rbp), %ax
movl -0x120(%rbp), %esi
movq -0x130(%rbp), %rcx
movzbl -0x15(%rbp), %r8d
shrl $0x4, %r8d
movzwl %ax, %edi
leaq -0x80(%rbp), %rdx
callq 0x78b0
jmp 0x726b
leaq -0x90(%rbp), %rdi
callq 0x85d0
leaq -0x80(%rbp), %rdi
callq 0x6130
jmp 0x76eb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x85d0
leaq -0x80(%rbp), %rdi
callq 0x6130
jmp 0x7895
movq -0x108(%rbp), %rdi
callq 0x8550
movq %rax, %rdi
callq 0x9860
movw %ax, -0x132(%rbp)
jmp 0x72c8
movq -0x108(%rbp), %rdi
movw -0x132(%rbp), %ax
movw %ax, -0x92(%rbp)
callq 0x8550
movq %rax, %rdi
callq 0x9860
movw %ax, -0x134(%rbp)
jmp 0x72f3
movq -0x108(%rbp), %rdi
movw -0x134(%rbp), %ax
movw %ax, -0x94(%rbp)
callq 0x8550
movq %rax, %rdi
movl $0x3, %esi
callq 0x9b20
jmp 0x731c
movq -0x108(%rbp), %rdi
callq 0x8550
movq %rax, %rdi
callq 0x9860
movw %ax, -0x136(%rbp)
jmp 0x7339
movq -0x108(%rbp), %rdi
movw -0x136(%rbp), %ax
movw %ax, -0x96(%rbp)
callq 0x8550
movq %rax, %rdi
callq 0x9860
movw %ax, -0x138(%rbp)
jmp 0x7364
movq -0x108(%rbp), %rdi
movw -0x138(%rbp), %ax
movw %ax, -0x98(%rbp)
callq 0x8550
movq %rax, %rdi
callq 0x9860
movw %ax, -0x13a(%rbp)
jmp 0x738f
movw -0x13a(%rbp), %ax
movw %ax, -0x9a(%rbp)
movl -0x14(%rbp), %edi
callq 0x7000
jmp 0x73a7
movq 0x9c22(%rip), %rdi      # 0x10fd0
leaq -0x38(%rbp), %rsi
callq 0x61c0
movq %rax, -0x148(%rbp)
jmp 0x73c0
movq -0x148(%rbp), %rdi
movq 0x9be2(%rip), %rsi      # 0x10fb0
callq 0x6240
jmp 0x73d5
movl -0x14(%rbp), %edi
callq 0x7000
jmp 0x73df
movq 0x9bea(%rip), %rdi      # 0x10fd0
leaq 0x3ce9(%rip), %rsi      # 0xb0d6
callq 0x61e0
movq %rax, -0x150(%rbp)
jmp 0x73fb
movq -0x150(%rbp), %rdi
movl -0x5c(%rbp), %esi
callq 0x6300
jmp 0x740c
movq 0x9bbd(%rip), %rdi      # 0x10fd0
leaq 0x3cc5(%rip), %rsi      # 0xb0df
callq 0x61e0
jmp 0x7421
movzwl -0x92(%rbp), %edi
movzwl -0x94(%rbp), %esi
callq 0x7b70
jmp 0x7436
movq 0x9b93(%rip), %rdi      # 0x10fd0
leaq 0x3ca6(%rip), %rsi      # 0xb0ea
callq 0x61e0
jmp 0x744b
movzwl -0x98(%rbp), %edi
movzwl -0x9a(%rbp), %esi
callq 0x7b70
jmp 0x7460
movq 0x9b69(%rip), %rdi      # 0x10fd0
movq 0x9b42(%rip), %rsi      # 0x10fb0
callq 0x6240
jmp 0x7475
movl -0x14(%rbp), %edi
callq 0x7000
jmp 0x747f
movq 0x9b4a(%rip), %rdi      # 0x10fd0
leaq 0x3c69(%rip), %rsi      # 0xb0f6
callq 0x61e0
movq %rax, -0x158(%rbp)
jmp 0x749b
movq -0x158(%rbp), %rdi
leaq 0x1777(%rip), %rsi      # 0x8c20
callq 0x60b0
movq %rax, -0x160(%rbp)
jmp 0x74b7
movl $0x2, %edi
callq 0x8c50
movl %eax, -0x164(%rbp)
jmp 0x74c9
movq -0x160(%rbp), %rdi
movl -0x164(%rbp), %eax
movl %eax, -0xa0(%rbp)
movl -0xa0(%rbp), %esi
callq 0x62b0
movq %rax, -0x170(%rbp)
jmp 0x74f0
movl $0x30, %edi
callq 0x8c70
movb %al, -0x171(%rbp)
jmp 0x7502
movq -0x170(%rbp), %rdi
movb -0x171(%rbp), %al
movb %al, -0xa1(%rbp)
movzbl -0xa1(%rbp), %esi
callq 0x63b0
movq %rax, -0x180(%rbp)
jmp 0x752a
movq -0x180(%rbp), %rdi
movzbl -0x55(%rbp), %esi
callq 0x6410
movq %rax, -0x188(%rbp)
jmp 0x7543
movq -0x188(%rbp), %rdi
leaq 0x3baf(%rip), %rsi      # 0xb100
callq 0x61e0
movq %rax, -0x190(%rbp)
jmp 0x755f
movl $0x4, %edi
callq 0x8c50
movl %eax, -0x194(%rbp)
jmp 0x7571
movq -0x190(%rbp), %rdi
movl -0x194(%rbp), %eax
movl %eax, -0xa8(%rbp)
movl -0xa8(%rbp), %esi
callq 0x62b0
movq %rax, -0x1a0(%rbp)
jmp 0x7598
movq -0x1a0(%rbp), %rdi
movzwl -0x96(%rbp), %esi
callq 0x6400
movq %rax, -0x1a8(%rbp)
jmp 0x75b4
movq -0x1a8(%rbp), %rdi
leaq 0x16ce(%rip), %rsi      # 0x8c90
callq 0x60b0
movq %rax, -0x1b0(%rbp)
jmp 0x75d0
movq -0x1b0(%rbp), %rdi
leaq 0x3af6(%rip), %rsi      # 0xb0d4
callq 0x61e0
jmp 0x75e5
movzbl -0x55(%rbp), %eax
movzwl -0x96(%rbp), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movl %eax, -0xac(%rbp)
movl $0x0, -0xb0(%rbp)
movslq -0xb0(%rbp), %rax
cmpq $0xf9, %rax
jae 0x76d4
movl -0xac(%rbp), %eax
movslq -0xb0(%rbp), %rdx
leaq 0x7f64(%rip), %rcx      # 0xf590
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
andl (%rcx), %eax
movslq -0xb0(%rbp), %rdx
leaq 0x7f4d(%rip), %rcx      # 0xf590
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x4(%rcx), %eax
jne 0x76be
movslq -0xb0(%rbp), %rax
leaq (%rax,%rax,2), %rcx
leaq 0x7f2f(%rip), %rax      # 0xf590
movq 0x8(%rax,%rcx,8), %rsi
movq 0x9963(%rip), %rdi      # 0x10fd0
callq 0x61e0
movq %rax, -0x1b8(%rbp)
jmp 0x767b
movq -0x1b8(%rbp), %rdi
leaq 0x3a7f(%rip), %rsi      # 0xb108
callq 0x61e0
movq %rax, -0x1c0(%rbp)
jmp 0x7697
movq -0x1c0(%rbp), %rdi
movslq -0xb0(%rbp), %rax
leaq (%rax,%rax,2), %rcx
leaq 0x7ee0(%rip), %rax      # 0xf590
movq 0x10(%rax,%rcx,8), %rsi
callq 0x61e0
jmp 0x76bc
jmp 0x76d4
jmp 0x76c0
movl -0xb0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb0(%rbp)
jmp 0x7605
movq 0x98f5(%rip), %rdi      # 0x10fd0
movq 0x98ce(%rip), %rsi      # 0x10fb0
callq 0x6240
jmp 0x76e9
jmp 0x76eb
jmp 0x7879
movw -0x58(%rbp), %ax
movw %ax, -0x1c2(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x60f0
jmp 0x770d
movq -0x108(%rbp), %rsi
movzbl -0x55(%rbp), %eax
movl %eax, -0x1d4(%rbp)
leaq -0xe0(%rbp), %rdi
movq %rdi, -0x1d0(%rbp)
callq 0x8650
movw -0x1c2(%rbp), %ax
movl -0x1d4(%rbp), %edx
movq -0x1d0(%rbp), %rcx
movl -0x14(%rbp), %r8d
movzwl %ax, %edi
leaq -0xd0(%rbp), %rsi
callq 0x7cd0
jmp 0x775a
leaq -0xe0(%rbp), %rdi
callq 0x85d0
leaq -0xd0(%rbp), %rdi
callq 0x6130
jmp 0x7879
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x85d0
leaq -0xd0(%rbp), %rdi
callq 0x6130
jmp 0x7895
movq -0x108(%rbp), %rsi
movw -0x58(%rbp), %ax
movw %ax, -0x1d6(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x8650
cmpl $0x0, -0x14(%rbp)
jge 0x77d1
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x1dc(%rbp)
jmp 0x77dd
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1dc(%rbp)
movw -0x1d6(%rbp), %ax
movl -0x1dc(%rbp), %edx
movzwl %ax, %edi
leaq -0xf0(%rbp), %rsi
callq 0x6a60
jmp 0x77fb
leaq -0xf0(%rbp), %rdi
callq 0x85d0
jmp 0x7879
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x85d0
jmp 0x7895
movq 0x97c6(%rip), %rdi      # 0x10ff0
leaq 0x38d9(%rip), %rsi      # 0xb10a
callq 0x61e0
movq %rax, -0x1e8(%rbp)
jmp 0x783f
movq -0x1e8(%rbp), %rdi
movzbl -0x15(%rbp), %esi
callq 0x6410
movq %rax, -0x1f0(%rbp)
jmp 0x7858
movq -0x1f0(%rbp), %rdi
movq 0x974a(%rip), %rsi      # 0x10fb0
callq 0x6240
jmp 0x786d
movl $0x1, -0xf4(%rbp)
jmp 0x7883
movl $0x0, -0xf4(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x6130
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x6130
movq -0x50(%rbp), %rdi
callq 0x6440
nopw (%rax,%rax)