// File: /workspace/github_c_makefile_star2_O0/shuffle2[P]nx2elf/nx2elf.cpp
// Function: NsoFile::Dump(bool)
void Dump(bool verbose = false) {
    char msg[1024];
    char* p = msg;
    const char* idx2prot[kNumSegment] = {"r-x", "r--", "rw-"};

#define FMT_FIELD(f) p += sprintf(p, #f ": %8x\n", header.f);

    if (verbose) {
      FMT_FIELD(field_4);
      FMT_FIELD(field_8);
      FMT_FIELD(field_c);
    }

    p += sprintf(p, "gnu_build_id: ");
    p = FormatBytes(p, header.gnu_build_id);
    p += sprintf(p, "\n");

    p += sprintf(p, "         %-8s %-8s %-8s %-8s %-8s\n", "file off",
                 "file len", "mem off", "mem len", "bss/algn");
    for (int i = 0; i < kNumSegment; i++) {
      auto& seg = header.segments[i];
      auto& file_size = header.segment_file_sizes[i];
      p += sprintf(p, "%d [%-3s]: %8x %8x %8x %8x %8x\n", i, idx2prot[i],
                   seg.file_offset, file_size, seg.mem_offset, seg.mem_size,
                   seg.bss_align);
    }

    if (verbose) {
      for (int i = 0; i < ARRAY_SIZE(header.field_6c); i++)
        FMT_FIELD(field_6c[i]);
    }

    p += sprintf(p, ".rodata-relative:\n");
    p += sprintf(p, "  .dynstr: %8x %8x\n", header.dynstr.offset,
                 header.dynstr.size);
    p += sprintf(p, "  .dynsym: %8x %8x\n", header.dynsym.offset,
                 header.dynsym.size);

    p += sprintf(p, "segment digests:\n");
    for (int i = 0; i < kNumSegment; i++) {
      p += sprintf(p, "%d [%-3s]: ", i, idx2prot[i]);
      p = FormatBytes(p, header.segment_digests[i]);
      p += sprintf(p, "\n");
    }

#undef FMT_FIELD

    printf("%s", msg);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4c0, %rsp            # imm = 0x4C0
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x498(%rbp)
leaq -0x410(%rbp), %rax
movq %rax, -0x418(%rbp)
movq 0x6d879(%rip), %rax     # 0x72d40
movq %rax, -0x430(%rbp)
movq 0x6d873(%rip), %rax     # 0x72d48
movq %rax, -0x428(%rbp)
movq 0x6d86d(%rip), %rax     # 0x72d50
movq %rax, -0x420(%rbp)
testb $0x1, -0x9(%rbp)
je 0x5593
movq -0x498(%rbp), %rax
movq -0x418(%rbp), %rdi
movl 0x8(%rax), %edx
leaq 0x62d7b(%rip), %rsi     # 0x68287
movb $0x0, %al
callq 0x2050
movl %eax, %edx
movq -0x498(%rbp), %rax
movq -0x418(%rbp), %rcx
movslq %edx, %rdx
addq %rdx, %rcx
movq %rcx, -0x418(%rbp)
movq -0x418(%rbp), %rdi
movl 0xc(%rax), %edx
leaq 0x62d54(%rip), %rsi     # 0x68295
movb $0x0, %al
callq 0x2050
movl %eax, %edx
movq -0x498(%rbp), %rax
movq -0x418(%rbp), %rcx
movslq %edx, %rdx
addq %rdx, %rcx
movq %rcx, -0x418(%rbp)
movq -0x418(%rbp), %rdi
movl 0x10(%rax), %edx
leaq 0x62d2d(%rip), %rsi     # 0x682a3
movb $0x0, %al
callq 0x2050
movl %eax, %ecx
movq -0x418(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x418(%rbp)
movq -0x418(%rbp), %rdi
leaq 0x62d10(%rip), %rsi     # 0x682b1
movb $0x0, %al
callq 0x2050
movq -0x498(%rbp), %rdi
movl %eax, %ecx
movq -0x418(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x418(%rbp)
movq -0x418(%rbp), %rsi
movq 0x44(%rdi), %rax
movq %rax, -0x450(%rbp)
movq 0x4c(%rdi), %rax
movq %rax, -0x448(%rbp)
movq 0x54(%rdi), %rax
movq %rax, -0x440(%rbp)
movq 0x5c(%rdi), %rax
movq %rax, -0x438(%rbp)
leaq -0x450(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
callq 0xd370
movq %rax, -0x418(%rbp)
movq -0x418(%rbp), %rdi
leaq 0x62c24(%rip), %rsi     # 0x6825f
movb $0x0, %al
callq 0x2050
movl %eax, %ecx
movq -0x418(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x418(%rbp)
movq -0x418(%rbp), %rdi
leaq 0x62c5a(%rip), %rsi     # 0x682c0
leaq 0x62c76(%rip), %rdx     # 0x682e3
leaq 0x62c78(%rip), %rcx     # 0x682ec
leaq 0x62c7a(%rip), %r8      # 0x682f5
leaq 0x62c7b(%rip), %r9      # 0x682fd
leaq 0x62c7c(%rip), %rax     # 0x68305
movq %rax, (%rsp)
movb $0x0, %al
callq 0x2050
movl %eax, %ecx
movq -0x418(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x418(%rbp)
movl $0x0, -0x454(%rbp)
cmpl $0x3, -0x454(%rbp)
jge 0x579a
movq -0x498(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
addq $0x10, %rcx
movslq -0x454(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq %rcx, -0x460(%rbp)
addq $0x4, %rax
addq $0x60, %rax
movslq -0x454(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x468(%rbp)
movq -0x418(%rbp), %rdi
movl -0x454(%rbp), %edx
movslq -0x454(%rbp), %rax
movq -0x430(%rbp,%rax,8), %rcx
movq -0x460(%rbp), %rax
movl (%rax), %r8d
movq -0x468(%rbp), %rax
movl (%rax), %r9d
movq -0x460(%rbp), %rax
movl 0x4(%rax), %r11d
movq -0x460(%rbp), %rax
movl 0x8(%rax), %r10d
movq -0x460(%rbp), %rax
movl 0xc(%rax), %eax
leaq 0x62bb2(%rip), %rsi     # 0x6830e
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movl %eax, 0x10(%rsp)
movb $0x0, %al
callq 0x2050
movl %eax, %ecx
movq -0x418(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x418(%rbp)
movl -0x454(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x454(%rbp)
jmp 0x56b4
testb $0x1, -0x9(%rbp)
je 0x5807
movl $0x0, -0x46c(%rbp)
movslq -0x46c(%rbp), %rax
cmpq $0x9, %rax
jae 0x5805
movq -0x498(%rbp), %rax
movq -0x418(%rbp), %rdi
movslq -0x46c(%rbp), %rcx
movl 0x70(%rax,%rcx,4), %edx
leaq 0x62b57(%rip), %rsi     # 0x6832e
movb $0x0, %al
callq 0x2050
movl %eax, %ecx
movq -0x418(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x418(%rbp)
movl -0x46c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x46c(%rbp)
jmp 0x57aa
jmp 0x5807
movq -0x418(%rbp), %rdi
leaq 0x62b2b(%rip), %rsi     # 0x68340
movb $0x0, %al
callq 0x2050
movl %eax, %edx
movq -0x498(%rbp), %rax
movq -0x418(%rbp), %rcx
movslq %edx, %rdx
addq %rdx, %rcx
movq %rcx, -0x418(%rbp)
movq -0x418(%rbp), %rdi
movl 0x94(%rax), %edx
movl 0x98(%rax), %ecx
leaq 0x62b00(%rip), %rsi     # 0x68353
movb $0x0, %al
callq 0x2050
movl %eax, %edx
movq -0x498(%rbp), %rax
movq -0x418(%rbp), %rcx
movslq %edx, %rdx
addq %rdx, %rcx
movq %rcx, -0x418(%rbp)
movq -0x418(%rbp), %rdi
movl 0x9c(%rax), %edx
movl 0xa0(%rax), %ecx
leaq 0x62ad6(%rip), %rsi     # 0x68367
movb $0x0, %al
callq 0x2050
movl %eax, %ecx
movq -0x418(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x418(%rbp)
movq -0x418(%rbp), %rdi
leaq 0x62abf(%rip), %rsi     # 0x6837b
movb $0x0, %al
callq 0x2050
movl %eax, %ecx
movq -0x418(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x418(%rbp)
movl $0x0, -0x470(%rbp)
cmpl $0x3, -0x470(%rbp)
jge 0x59f8
movq -0x418(%rbp), %rdi
movl -0x470(%rbp), %edx
movslq -0x470(%rbp), %rax
movq -0x430(%rbp,%rax,8), %rcx
leaq 0x62a7a(%rip), %rsi     # 0x6838d
movb $0x0, %al
callq 0x2050
movq -0x498(%rbp), %rdi
movl %eax, %ecx
movq -0x418(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x418(%rbp)
movq -0x418(%rbp), %rsi
movq %rdi, %rax
addq $0x4, %rax
addq $0xa0, %rax
movslq -0x470(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x490(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x488(%rbp)
movq 0x10(%rax), %rcx
movq %rcx, -0x480(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0x478(%rbp)
leaq -0x490(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
callq 0xd370
movq %rax, -0x418(%rbp)
movq -0x418(%rbp), %rdi
leaq 0x62898(%rip), %rsi     # 0x6825f
movb $0x0, %al
callq 0x2050
movl %eax, %ecx
movq -0x418(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x418(%rbp)
movl -0x470(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x470(%rbp)
jmp 0x58e3
leaq -0x410(%rbp), %rsi
leaq 0x62993(%rip), %rdi     # 0x68399
movb $0x0, %al
callq 0x2030
addq $0x4c0, %rsp            # imm = 0x4C0
popq %rbp
retq
nopw %cs:(%rax,%rax)