// File: 7shi[P]8086run/v1/main.cpp
// Function: bios(int)
void bios(int n) {
    void intr(int);
    static uint8_t buf[512];
    switch (n) {
        case 0x00: // #DE
            error("#DE: division exception");
            break;
        case 0x08: // timer
        {
            uint16_t low = read16(&mem[0x46c]);
            if (!++low) {
                uint16_t high = read16(&mem[0x46e]);
                if (++high >= 24) {
                    high %= 24;
                    mem[0x470] = 1;
                }
                write16(&mem[0x46e], high);
            }
            write16(&mem[0x46c], low);
            intr(0x1c);
            return;
        }
        case 0x09: // keyboard
            while (kbhit()) {
                int head = read16(&mem[0x41a]) - 0x1e;
                int tail = read16(&mem[0x41c]) - 0x1e;
                int next = (tail + 2) & 0x1f;
                if (next == head) break;
                int ch = getch();
                if (ch != EOF && kbscan[ch]) {
                    mem[0x41e + tail] = ch;
                    mem[0x41f + tail] = kbscan[ch];
                    write16(&mem[0x41c], 0x1e + next);
                }
            }
            return;
        case 0x10: // video
            switch (AH) {
                case 0x0e:
                    if (write(STDOUT_FILENO, &AL, 1));
                    return;
            }
            return; // ignore
        case 0x11: // get equipment list
            AX = disks[1].f ? 0x41 : 1;
            return;
        case 0x12: // get memory size
            AX = 640;
            return;
        case 0x13: // disk
        {
            if (DL > 1 || !disks[DL].f) {
                CF = 1; // error
                AH = 1; // invalid
                return;
            }
            Disk *d = &disks[DL];
            int c = CH | ((CL & 0xc0) << 2), s = (CL & 0x3f) - 1;
            int lba = d->s * (d->h * c + DH) + s;
            switch (AH) {
                case 0x00: // reset disk system
                    AH = CF = 0;
                    return;
                case 0x02: // read sectors
                case 0x03: // write sectors
                    if (c >= d->c || DH >= d->h
                            || s < 0 || s >= d->s) {
                        CF = 1; // error
                        AH = 4; // sector
                        return;
                    }
                    fseek(d->f, lba << 9, SEEK_SET);
                    if (AH == 2) {
                        if (fread(&ES[BX], 512, AL, d->f) < 1) {
                            memset(&ES[BX], 0, AL << 9);
                        }
                    } else {
                        fwrite(&ES[BX], 512, AL, d->f);
                    }
                    AH = CF = 0;
                    return;
                case 0x05: // format
                    fseek(d->f, (lba - s) << 9, SEEK_SET);
                    for (int i = 0; i < d->s; ++i) {
                        fwrite(&buf, 512, 1, d->f);
                    }
                    AH = CF = 0;
                    return;
                case 0x08: // get drive params
                    AX = 0;
                    BL = d->type;
                    CH = d->c - 1;
                    CL = d->s | ((d->c >> 2) & 0xc0);
                    DH = d->h - 1;
                    DL = 1;
                    ES = DI = 0;
                    CF = 0;
                    return;
                case 0x15: // get disk type
                    AH = 1;
                    CF = 0;
                    return;
                case 0x17: // set disk type
                    CF = 0; // ignore
                    return;
                case 0x18: // set media type
                    d->c = c + 1;
                    d->s = s + 1;
                    ES = DI = 0;
                    AH = CF = 0;
                    return;
            }
            CF = 1;
            return;
        }
        case 0x15: // system
            switch (AH) {
                case 0x88: // get extended memory size
                    CF = 0;
                    AX = 0;
                    return;
            }
            break;
        case 0x16: // keyboard
        {
            int head = read16(&mem[0x41a]);
            int tail = read16(&mem[0x41c]);
            switch (AH) {
                case 0x00: // get keystroke
                    while (head == tail) {
                        bios(9);
                        tail = read16(&mem[0x41c]);
                    }
                    AX = read16(&mem[0x400 + head]);
                    write16(&mem[0x41a], 0x1e + ((head - 0x1c) & 0x1f));
                    return;
                case 0x01: // check for keystroke
                    if ((ZF = head == tail)) {
                        AX = 0; // empty
                    } else {
                        AX = read16(&mem[0x400 + head]);
                    }
                    return;
            }
            break;
        }
        case 0x1a: // time
            switch (AH) {
                case 0x00: // get system time
                    AL = mem[0x470];
                    CX = read16(&mem[0x46e]);
                    DX = read16(&mem[0x46c]);
                    mem[0x470] = 0;
                    return;
                case 0x01: // set system time
                    write16(&mem[0x46e], CX);
                    write16(&mem[0x46c], DX);
                    mem[0x470] = 0;
                    return;
                case 0x02: // get RTC time
                case 0x04: // get RTC date
                {
                    time_t t = time(NULL);
                    tm *lt = localtime(&t);
                    if (AH == 2) {
                        CH = bcd(lt->tm_hour);
                        CL = bcd(lt->tm_min);
                        DH = bcd(lt->tm_sec);
                        DL = lt->tm_isdst == 1 ? 1 : 0;
                    } else {
                        CH = bcd(lt->tm_year / 100 + 19);
                        CL = bcd(lt->tm_year % 100);
                        DH = bcd(lt->tm_mon + 1);
                        DL = bcd(lt->tm_mday);
                    }
                    CF = 0;
                    return;
                }
                case 0x03: // set RTC time
                case 0x05: // set RTC date
                    return; // ignore
            }
            break;
        case 0x1c: // timer handler
            return;
    }
    error("not implemented: int %02x,%02x", n, AH);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
movq %rax, -0x50(%rbp)
subq $0x1c, %rax
ja 0x2369
movq -0x50(%rbp), %rax
leaq 0x653d(%rip), %rcx      # 0x8004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x6c00(%rip), %rdi      # 0x86d7
movb $0x0, %al
callq 0x1840
jmp 0x2369
leaq 0x96d6(%rip), %rdi      # 0xb1c0
addq $0x46c, %rdi            # imm = 0x46C
callq 0x6130
movw %ax, -0x6(%rbp)
movw -0x6(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x6(%rbp)
cmpw $0x0, %ax
jne 0x1b68
leaq 0x96ad(%rip), %rdi      # 0xb1c0
addq $0x46e, %rdi            # imm = 0x46E
callq 0x6130
movw %ax, -0x8(%rbp)
movw -0x8(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x8(%rbp)
movzwl %ax, %eax
cmpl $0x18, %eax
jl 0x1b51
movzwl -0x8(%rbp), %eax
movl $0x18, %ecx
cltd
idivl %ecx
movw %dx, %ax
movw %ax, -0x8(%rbp)
movb $0x1, 0x9adf(%rip)      # 0xb630
leaq 0x9668(%rip), %rdi      # 0xb1c0
addq $0x46e, %rdi            # imm = 0x46E
movzwl -0x8(%rbp), %esi
callq 0x6150
leaq 0x9651(%rip), %rdi      # 0xb1c0
addq $0x46c, %rdi            # imm = 0x46C
movzwl -0x6(%rbp), %esi
callq 0x6150
movl $0x1c, %edi
callq 0x2390
jmp 0x2384
jmp 0x1b90
callq 0x1300
cmpl $0x0, %eax
je 0x1c69
leaq 0x961b(%rip), %rdi      # 0xb1c0
addq $0x41a, %rdi            # imm = 0x41A
callq 0x6130
movzwl %ax, %eax
subl $0x1e, %eax
movl %eax, -0xc(%rbp)
leaq 0x95ff(%rip), %rdi      # 0xb1c0
addq $0x41c, %rdi            # imm = 0x41C
callq 0x6130
movzwl %ax, %eax
subl $0x1e, %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
addl $0x2, %eax
andl $0x1f, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0xc(%rbp), %eax
jne 0x1bec
jmp 0x1c69
callq 0x1290
movl %eax, -0x18(%rbp)
cmpl $-0x1, -0x18(%rbp)
je 0x1c64
movslq -0x18(%rbp), %rcx
leaq 0x94eb(%rip), %rax      # 0xb0f0
cmpb $0x0, (%rax,%rcx)
je 0x1c64
movl -0x18(%rbp), %eax
movb %al, %dl
movl -0x10(%rbp), %eax
addl $0x41e, %eax            # imm = 0x41E
movslq %eax, %rcx
leaq 0x959e(%rip), %rax      # 0xb1c0
movb %dl, (%rax,%rcx)
movslq -0x18(%rbp), %rcx
leaq 0x94c0(%rip), %rax      # 0xb0f0
movb (%rax,%rcx), %dl
movl -0x10(%rbp), %eax
addl $0x41f, %eax            # imm = 0x41F
movslq %eax, %rcx
leaq 0x957b(%rip), %rax      # 0xb1c0
movb %dl, (%rax,%rcx)
movl -0x14(%rbp), %eax
addl $0x1e, %eax
leaq 0x956b(%rip), %rdi      # 0xb1c0
addq $0x41c, %rdi            # imm = 0x41C
movzwl %ax, %esi
callq 0x6150
jmp 0x1b90
jmp 0x2384
movq 0x12958b(%rip), %rax    # 0x12b200
movb (%rax), %al
subb $0xe, %al
jne 0x1ca0
jmp 0x1c7d
movq 0x12955c(%rip), %rsi    # 0x12b1e0
movl $0x1, %edi
movl $0x1, %edx
callq 0x1030
cmpq $0x0, %rax
je 0x1c9b
jmp 0x1c9b
jmp 0x2384
jmp 0x2384
movq 0x1296dc(%rip), %rdx    # 0x12b388
movl $0x1, %eax
movl $0x41, %ecx
cmpq $0x0, %rdx
cmovnel %ecx, %eax
movw %ax, 0x12950c(%rip)     # 0x12b1d0
jmp 0x2384
movw $0x280, 0x1294fe(%rip)  # imm = 0x280
jmp 0x2384
movq 0x129512(%rip), %rax    # 0x12b1f0
movzbl (%rax), %eax
cmpl $0x1, %eax
jg 0x1d06
movq 0x129503(%rip), %rax    # 0x12b1f0
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x129677(%rip), %rax    # 0x12b370
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
jne 0x1d1c
movb $0x1, 0x12951b(%rip)    # 0x12b228
movq 0x1294ec(%rip), %rax    # 0x12b200
movb $0x1, (%rax)
jmp 0x2384
movq 0x1294cd(%rip), %rax    # 0x12b1f0
movzbl (%rax), %eax
leaq (%rax,%rax,2), %rcx
leaq 0x12963f(%rip), %rax    # 0x12b370
leaq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq 0x1294c8(%rip), %rax    # 0x12b208
movzbl (%rax), %ecx
movq 0x12949e(%rip), %rax    # 0x12b1e8
movzbl (%rax), %edx
andl $-0x40, %edx
movl %ecx, %eax
movl %edx, %ecx
leal (%rax,%rcx,4), %eax
movl %eax, -0x24(%rbp)
movq 0x129487(%rip), %rax    # 0x12b1e8
movzbl (%rax), %eax
andl $0x3f, %eax
decl %eax
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl 0x10(%rax), %ecx
movl 0x14(%rax), %eax
movl -0x24(%rbp), %edx
imull %edx, %ecx
movq 0x12948d(%rip), %rdx    # 0x12b210
movzbl (%rdx), %edx
addl %edx, %ecx
imull %ecx, %eax
movl -0x28(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x2c(%rbp)
movq 0x129466(%rip), %rax    # 0x12b200
movzbl (%rax), %eax
movq %rax, -0x58(%rbp)
subq $0x18, %rax
ja 0x205d
movq -0x58(%rbp), %rax
leaq 0x62da(%rip), %rcx      # 0x8090
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x0, 0x129462(%rip)    # 0x12b228
movq 0x129433(%rip), %rax    # 0x12b200
movb $0x0, (%rax)
jmp 0x2384
movl -0x24(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x1e06
movq 0x129428(%rip), %rax    # 0x12b210
movzbl (%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x1e06
cmpl $0x0, -0x28(%rbp)
jl 0x1e06
movl -0x28(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jl 0x1e1c
movb $0x1, 0x12941b(%rip)    # 0x12b228
movq 0x1293ec(%rip), %rax    # 0x12b200
movb $0x4, (%rax)
jmp 0x2384
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movl -0x2c(%rbp), %eax
shll $0x9, %eax
movslq %eax, %rsi
xorl %edx, %edx
callq 0x10c0
movq 0x1293c6(%rip), %rax    # 0x12b200
movzbl (%rax), %eax
cmpl $0x2, %eax
jne 0x1eaa
movzwl 0x12938d(%rip), %esi    # 0x12b1d6
leaq 0x1294e0(%rip), %rdi    # 0x12b330
callq 0x6110
movq %rax, %rdi
movq 0x129381(%rip), %rax    # 0x12b1e0
movzbl (%rax), %eax
movl %eax, %edx
movq -0x20(%rbp), %rax
movq (%rax), %rcx
movl $0x200, %esi            # imm = 0x200
callq 0x1160
cmpq $0x1, %rax
jae 0x1ea8
movzwl 0x129354(%rip), %esi    # 0x12b1d6
leaq 0x1294a7(%rip), %rdi    # 0x12b330
callq 0x6110
movq %rax, %rdi
movq 0x129348(%rip), %rax    # 0x12b1e0
movzbl (%rax), %eax
shll $0x9, %eax
movslq %eax, %rdx
xorl %esi, %esi
callq 0x1040
jmp 0x1edd
movzwl 0x129325(%rip), %esi    # 0x12b1d6
leaq 0x129478(%rip), %rdi    # 0x12b330
callq 0x6110
movq %rax, %rdi
movq 0x129319(%rip), %rax    # 0x12b1e0
movzbl (%rax), %eax
movl %eax, %edx
movq -0x20(%rbp), %rax
movq (%rax), %rcx
movl $0x200, %esi            # imm = 0x200
callq 0x1180
movb $0x0, 0x129344(%rip)    # 0x12b228
movq 0x129315(%rip), %rax    # 0x12b200
movb $0x0, (%rax)
jmp 0x2384
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movl -0x2c(%rbp), %eax
subl -0x28(%rbp), %eax
shll $0x9, %eax
movslq %eax, %rsi
xorl %edx, %edx
callq 0x10c0
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jge 0x1f48
movq -0x20(%rbp), %rax
movq (%rax), %rcx
leaq 0x129472(%rip), %rdi    # 0x12b3a0
movl $0x200, %esi            # imm = 0x200
movl $0x1, %edx
callq 0x1180
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x1f14
movb $0x0, 0x1292d9(%rip)    # 0x12b228
movq 0x1292aa(%rip), %rax    # 0x12b200
movb $0x0, (%rax)
jmp 0x2384
movw $0x0, 0x129269(%rip)    # 0x12b1d0
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
movb %al, %cl
movq 0x129281(%rip), %rax    # 0x12b1f8
movb %cl, (%rax)
movq -0x20(%rbp), %rax
movl 0xc(%rax), %eax
subl $0x1, %eax
movb %al, %cl
movq 0x12927c(%rip), %rax    # 0x12b208
movb %cl, (%rax)
movq -0x20(%rbp), %rax
movl 0x14(%rax), %eax
movq -0x20(%rbp), %rcx
movl 0xc(%rcx), %ecx
sarl $0x2, %ecx
andl $0xc0, %ecx
orl %ecx, %eax
movb %al, %cl
movq 0x129238(%rip), %rax    # 0x12b1e8
movb %cl, (%rax)
movq -0x20(%rbp), %rax
movl 0x10(%rax), %eax
subl $0x1, %eax
movb %al, %cl
movq 0x12924b(%rip), %rax    # 0x12b210
movb %cl, (%rax)
movq 0x129222(%rip), %rax    # 0x12b1f0
movb $0x1, (%rax)
movw $0x0, 0x129204(%rip)    # 0x12b1de
leaq 0x12934f(%rip), %rdi    # 0x12b330
xorl %esi, %esi
callq 0x6180
movb $0x0, 0x129239(%rip)    # 0x12b228
jmp 0x2384
movq 0x129205(%rip), %rax    # 0x12b200
movb $0x1, (%rax)
movb $0x0, 0x129223(%rip)    # 0x12b228
jmp 0x2384
movb $0x0, 0x129217(%rip)    # 0x12b228
jmp 0x2384
movl -0x24(%rbp), %ecx
addl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xc(%rax)
movl -0x28(%rbp), %ecx
addl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x14(%rax)
movw $0x0, 0x1291a5(%rip)    # 0x12b1de
leaq 0x1292f0(%rip), %rdi    # 0x12b330
xorl %esi, %esi
callq 0x6180
movb $0x0, 0x1291da(%rip)    # 0x12b228
movq 0x1291ab(%rip), %rax    # 0x12b200
movb $0x0, (%rax)
jmp 0x2384
movb $0x1, 0x1291c4(%rip)    # 0x12b228
jmp 0x2384
movq 0x129190(%rip), %rax    # 0x12b200
movb (%rax), %al
subb $-0x78, %al
jne 0x208d
jmp 0x2078
movb $0x0, 0x1291a9(%rip)    # 0x12b228
movw $0x0, 0x129148(%rip)    # 0x12b1d0
jmp 0x2384
jmp 0x2369
leaq 0x9541(%rip), %rdi      # 0xb5da
callq 0x6130
movzwl %ax, %eax
movl %eax, -0x34(%rbp)
leaq 0x9531(%rip), %rdi      # 0xb5dc
callq 0x6130
movzwl %ax, %eax
movl %eax, -0x38(%rbp)
movq 0x129143(%rip), %rax    # 0x12b200
movzbl (%rax), %eax
movl %eax, -0x5c(%rbp)
testl %eax, %eax
je 0x20d6
jmp 0x20c9
movl -0x5c(%rbp), %eax
subl $0x1, %eax
je 0x214c
jmp 0x2196
jmp 0x20d8
movl -0x34(%rbp), %eax
cmpl -0x38(%rbp), %eax
jne 0x2105
movl $0x9, %edi
callq 0x1aa0
leaq 0x90cf(%rip), %rdi      # 0xb1c0
addq $0x41c, %rdi            # imm = 0x41C
callq 0x6130
movzwl %ax, %eax
movl %eax, -0x38(%rbp)
jmp 0x20d8
movl -0x34(%rbp), %eax
addl $0x400, %eax            # imm = 0x400
cltq
leaq 0x90aa(%rip), %rdi      # 0xb1c0
addq %rax, %rdi
callq 0x6130
movw %ax, 0x1290ab(%rip)     # 0x12b1d0
movl -0x34(%rbp), %eax
subl $0x1c, %eax
andl $0x1f, %eax
addl $0x1e, %eax
leaq 0x9088(%rip), %rdi      # 0xb1c0
addq $0x41a, %rdi            # imm = 0x41A
movzwl %ax, %esi
callq 0x6150
jmp 0x2384
movl -0x34(%rbp), %eax
cmpl -0x38(%rbp), %eax
sete %al
movb %al, %cl
andb $0x1, %cl
movb %cl, 0x1290c5(%rip)     # 0x12b225
testb $0x1, %al
jne 0x2166
jmp 0x2171
movw $0x0, 0x129061(%rip)    # 0x12b1d0
jmp 0x2191
movl -0x34(%rbp), %eax
addl $0x400, %eax            # imm = 0x400
cltq
leaq 0x903e(%rip), %rdi      # 0xb1c0
addq %rax, %rdi
callq 0x6130
movw %ax, 0x12903f(%rip)     # 0x12b1d0
jmp 0x2384
jmp 0x2369
movq 0x12905e(%rip), %rax    # 0x12b200
movzbl (%rax), %eax
movq %rax, -0x68(%rbp)
subq $0x5, %rax
ja 0x2365
movq -0x68(%rbp), %rax
leaq 0x5eba(%rip), %rcx      # 0x8078
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb 0x9463(%rip), %cl       # 0xb630
movq 0x12900c(%rip), %rax    # 0x12b1e0
movb %cl, (%rax)
leaq 0x8fe3(%rip), %rdi      # 0xb1c0
addq $0x46e, %rdi            # imm = 0x46E
callq 0x6130
movw %ax, 0x128fe2(%rip)     # 0x12b1d2
leaq 0x8fc9(%rip), %rdi      # 0xb1c0
addq $0x46c, %rdi            # imm = 0x46C
callq 0x6130
movw %ax, 0x128fca(%rip)     # 0x12b1d4
movb $0x0, 0x941f(%rip)      # 0xb630
jmp 0x2384
leaq 0x8fa3(%rip), %rdi      # 0xb1c0
addq $0x46e, %rdi            # imm = 0x46E
movzwl 0x128fa7(%rip), %esi    # 0x12b1d2
callq 0x6150
leaq 0x8f89(%rip), %rdi      # 0xb1c0
addq $0x46c, %rdi            # imm = 0x46C
movzwl 0x128f8f(%rip), %esi    # 0x12b1d4
callq 0x6150
movb $0x0, 0x93df(%rip)      # 0xb630
jmp 0x2384
xorl %eax, %eax
movl %eax, %edi
callq 0x10a0
movq %rax, -0x40(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x1070
movq %rax, -0x48(%rbp)
movq 0x128f89(%rip), %rax    # 0x12b200
movzbl (%rax), %eax
cmpl $0x2, %eax
jne 0x22e4
movq -0x48(%rbp), %rax
movl 0x8(%rax), %edi
callq 0x61c0
movb %al, %cl
movq 0x128f74(%rip), %rax    # 0x12b208
movb %cl, (%rax)
movq -0x48(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x61c0
movb %al, %cl
movq 0x128f3d(%rip), %rax    # 0x12b1e8
movb %cl, (%rax)
movq -0x48(%rbp), %rax
movl (%rax), %edi
callq 0x61c0
movb %al, %cl
movq 0x128f4f(%rip), %rax    # 0x12b210
movb %cl, (%rax)
movq -0x48(%rbp), %rax
movl 0x20(%rax), %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x1, %edx
cmovel %ecx, %eax
movb %al, %cl
movq 0x128f10(%rip), %rax    # 0x12b1f0
movb %cl, (%rax)
jmp 0x235a
movq -0x48(%rbp), %rax
movl 0x14(%rax), %eax
movl $0x64, %ecx
cltd
idivl %ecx
movl %eax, %edi
addl $0x13, %edi
callq 0x61c0
movb %al, %cl
movq 0x128f02(%rip), %rax    # 0x12b208
movb %cl, (%rax)
movq -0x48(%rbp), %rax
movl 0x14(%rax), %eax
movl $0x64, %ecx
cltd
idivl %ecx
movl %edx, %edi
callq 0x61c0
movb %al, %cl
movq 0x128ec1(%rip), %rax    # 0x12b1e8
movb %cl, (%rax)
movq -0x48(%rbp), %rax
movl 0x10(%rax), %edi
addl $0x1, %edi
callq 0x61c0
movb %al, %cl
movq 0x128ecf(%rip), %rax    # 0x12b210
movb %cl, (%rax)
movq -0x48(%rbp), %rax
movl 0xc(%rax), %edi
callq 0x61c0
movb %al, %cl
movq 0x128e98(%rip), %rax    # 0x12b1f0
movb %cl, (%rax)
movb $0x0, 0x128ec7(%rip)    # 0x12b228
jmp 0x2384
jmp 0x2384
jmp 0x2369
jmp 0x2384
movl -0x4(%rbp), %esi
movq 0x128e8d(%rip), %rax    # 0x12b200
movzbl (%rax), %edx
leaq 0x6372(%rip), %rdi      # 0x86ef
movb $0x0, %al
callq 0x1840
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)