// File: 7shi[P]8086run/v1/main.cpp
// Function: debug(_IO_FILE*, bool)
void
debug(FILE *f, bool h) {
    if (h) fprintf(f, " AX   BX   CX   DX   SP   BP   SI   DI    FLAGS    ES   SS   DS   CS   IP  dump\n");
    fprintf(f,
            "%04x %04x %04x %04x-%04x %04x %04x %04x %c%c%c%c%c%c%c%c%c %04x %04x %04x %04x:%04x %02x%02x\n",
            AX, BX, CX, DX, SP, BP, SI, DI,
            "-O"[OF], "-D"[DF], "-I"[IF], "-T"[TF], "-S"[SF], "-Z"[ZF], "-A"[AF], "-P"[PF], "-C"[CF],
            *ES, *SS, *DS, *CS, IP, CS[IP], CS[IP + 1]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movb %sil, %al
movq %rdi, -0x30(%rbp)
andb $0x1, %al
movb %al, -0x31(%rbp)
testb $0x1, -0x31(%rbp)
je 0x14a8
movq -0x30(%rbp), %rdi
leaq 0x7113(%rip), %rsi      # 0x85b4
movb $0x0, %al
callq 0x1140
movq -0x30(%rbp), %rax
movq %rax, -0x88(%rbp)
movzwl 0x129d16(%rip), %eax    # 0x12b1d0
movl %eax, -0x80(%rbp)
movzwl 0x129d12(%rip), %eax    # 0x12b1d6
movl %eax, -0x7c(%rbp)
movzwl 0x129d04(%rip), %eax    # 0x12b1d2
movl %eax, -0x78(%rbp)
movzwl 0x129cfc(%rip), %eax    # 0x12b1d4
movl %eax, -0x74(%rbp)
movzwl 0x129cf6(%rip), %eax    # 0x12b1d8
movl %eax, -0x68(%rbp)
movzwl 0x129cee(%rip), %eax    # 0x12b1da
movl %eax, -0x64(%rbp)
movzwl 0x129ce6(%rip), %eax    # 0x12b1dc
movl %eax, -0x60(%rbp)
movzwl 0x129cde(%rip), %eax    # 0x12b1de
movl %eax, -0x5c(%rbp)
movb 0x129d17(%rip), %al     # 0x12b220
andb $0x1, %al
movzbl %al, %eax
movl %eax, %ecx
leaq 0x714c(%rip), %rax      # 0x8663
movsbl (%rax,%rcx), %eax
movl %eax, -0x58(%rbp)
movb 0x129cfd(%rip), %al     # 0x12b221
andb $0x1, %al
movzbl %al, %eax
movl %eax, %ecx
leaq 0x7134(%rip), %rax      # 0x8666
movsbl (%rax,%rcx), %eax
movl %eax, -0x54(%rbp)
movb 0x129ce3(%rip), %al     # 0x12b222
andb $0x1, %al
movzbl %al, %eax
movl %eax, %ecx
leaq 0x711c(%rip), %rax      # 0x8669
movsbl (%rax,%rcx), %eax
movl %eax, -0x50(%rbp)
movb 0x129cc9(%rip), %al     # 0x12b223
andb $0x1, %al
movzbl %al, %eax
movl %eax, %ecx
leaq 0x7104(%rip), %rax      # 0x866c
movsbl (%rax,%rcx), %eax
movl %eax, -0x4c(%rbp)
movb 0x129caf(%rip), %al     # 0x12b224
andb $0x1, %al
movzbl %al, %eax
movl %eax, %ecx
leaq 0x70ec(%rip), %rax      # 0x866f
movsbl (%rax,%rcx), %eax
movl %eax, -0x48(%rbp)
movb 0x129c95(%rip), %al     # 0x12b225
andb $0x1, %al
movzbl %al, %eax
movl %eax, %ecx
leaq 0x70d4(%rip), %rax      # 0x8672
movsbl (%rax,%rcx), %eax
movl %eax, -0x44(%rbp)
movb 0x129c7b(%rip), %al     # 0x12b226
andb $0x1, %al
movzbl %al, %eax
movl %eax, %ecx
leaq 0x70bc(%rip), %rax      # 0x8675
movsbl (%rax,%rcx), %eax
movl %eax, -0x40(%rbp)
movb 0x129c61(%rip), %al     # 0x12b227
andb $0x1, %al
movzbl %al, %eax
movl %eax, %ecx
leaq 0x70a4(%rip), %rax      # 0x8678
movsbl (%rax,%rcx), %eax
movl %eax, -0x3c(%rbp)
movb 0x129c47(%rip), %al     # 0x12b228
andb $0x1, %al
movzbl %al, %eax
movl %eax, %ecx
leaq 0x708c(%rip), %rax      # 0x867b
movsbl (%rax,%rcx), %r13d
leaq 0x129d35(%rip), %rdi    # 0x12b330
callq 0x60f0
movzwl %ax, %r12d
leaq 0x129d25(%rip), %rdi    # 0x12b330
addq $0x20, %rdi
callq 0x60f0
movzwl %ax, %r15d
leaq 0x129d11(%rip), %rdi    # 0x12b330
addq $0x30, %rdi
callq 0x60f0
movzwl %ax, %r14d
leaq 0x129cfd(%rip), %rdi    # 0x12b330
addq $0x10, %rdi
callq 0x60f0
movzwl %ax, %ebx
movzwl 0x129b7a(%rip), %eax    # 0x12b1c0
movl %eax, -0x70(%rbp)
movzwl 0x129b70(%rip), %esi    # 0x12b1c0
leaq 0x129cd9(%rip), %rdi    # 0x12b330
addq $0x10, %rdi
callq 0x6110
movzbl (%rax), %eax
movl %eax, -0x6c(%rbp)
movzwl 0x129b53(%rip), %esi    # 0x12b1c0
addl $0x1, %esi
leaq 0x129cb9(%rip), %rdi    # 0x12b330
addq $0x10, %rdi
callq 0x6110
movq -0x88(%rbp), %rdi
movl -0x80(%rbp), %edx
movl -0x7c(%rbp), %ecx
movl -0x78(%rbp), %r8d
movl -0x74(%rbp), %r9d
movl -0x70(%rbp), %r11d
movl -0x6c(%rbp), %r10d
movq %rax, %rsi
movl -0x68(%rbp), %eax
movzbl (%rsi), %esi
movl %esi, -0x38(%rbp)
leaq 0x6f55(%rip), %rsi      # 0x8605
movl %eax, (%rsp)
movl -0x64(%rbp), %eax
movl %eax, 0x8(%rsp)
movl -0x60(%rbp), %eax
movl %eax, 0x10(%rsp)
movl -0x5c(%rbp), %eax
movl %eax, 0x18(%rsp)
movl -0x58(%rbp), %eax
movl %eax, 0x20(%rsp)
movl -0x54(%rbp), %eax
movl %eax, 0x28(%rsp)
movl -0x50(%rbp), %eax
movl %eax, 0x30(%rsp)
movl -0x4c(%rbp), %eax
movl %eax, 0x38(%rsp)
movl -0x48(%rbp), %eax
movl %eax, 0x40(%rsp)
movl -0x44(%rbp), %eax
movl %eax, 0x48(%rsp)
movl -0x40(%rbp), %eax
movl %eax, 0x50(%rsp)
movl -0x3c(%rbp), %eax
movl %eax, 0x58(%rsp)
movl -0x38(%rbp), %eax
movl %r13d, 0x60(%rsp)
movl %r12d, 0x68(%rsp)
movl %r15d, 0x70(%rsp)
movl %r14d, 0x78(%rsp)
movl %ebx, 0x80(%rsp)
movl %r11d, 0x88(%rsp)
movl %r10d, 0x90(%rsp)
movl %eax, 0x98(%rsp)
movb $0x0, %al
callq 0x1140
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop