// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::add_clock_cycles(unsigned char, unsigned short, addr_mode_t)
void Cpu::add_clock_cycles(uint8_t opcode, uint16_t address, addr_mode_t addr_mode) {
    //Add cycles depending on address mode and instruction
    switch (addr_mode) {
	case IMMEDIATE:
	    clock->cycles += 2;
	    break;
	case ZERO_PAGE:
	    clock->cycles += 3;
	    if (opcode == ASL1 ||
		opcode == ASL2 ||
		opcode == ASL3 ||
		opcode == ASL4 ||
		opcode == ASL5 ||
		opcode == DEC1 || 
		opcode == DEC2 || 
		opcode == DEC3 || 
		opcode == DEC4 || 
		opcode == INC1 || 
		opcode == INC2 || 
		opcode == INC3 || 
		opcode == INC4 || 
		opcode == LSR1 || 
		opcode == LSR2 || 
		opcode == LSR3 || 
		opcode == LSR4 || 
		opcode == LSR5 || 
		opcode == ROL1 ||
		opcode == ROL2 ||
		opcode == ROL3 ||
		opcode == ROL4 ||
		opcode == ROL5 ||
		opcode == ROR1 ||
		opcode == ROR2 ||
		opcode == ROR3 ||
		opcode == ROR4 ||
		opcode == ROR5) {
		    clock->cycles += 2;
	    }
	    break;
	case ZERO_PAGE_X:
	    clock->cycles += 4;
	    if (opcode == ASL1 ||
		opcode == ASL2 ||
		opcode == ASL3 ||
		opcode == ASL4 ||
		opcode == ASL5 ||
		opcode == DEC1 || 
		opcode == DEC2 || 
		opcode == DEC3 || 
		opcode == DEC4 || 
		opcode == INC1 || 
		opcode == INC2 || 
		opcode == INC3 || 
		opcode == INC4 || 
		opcode == LSR1 || 
		opcode == LSR2 || 
		opcode == LSR3 || 
		opcode == LSR4 || 
		opcode == LSR5 || 
		opcode == ROL1 ||
		opcode == ROL2 ||
		opcode == ROL3 ||
		opcode == ROL4 ||
		opcode == ROL5 ||
		opcode == ROR1 ||
		opcode == ROR2 ||
		opcode == ROR3 ||
		opcode == ROR4 ||
		opcode == ROR5) {
		    clock->cycles += 2;
	    }
	    break;
	case ABSOLUTE:
	    clock->cycles += 4;
	    if (opcode == ASL1 ||
		opcode == ASL2 ||
		opcode == ASL3 ||
		opcode == ASL4 ||
		opcode == ASL5 ||
		opcode == DEC1 || 
		opcode == DEC2 || 
		opcode == DEC3 || 
		opcode == DEC4 || 
		opcode == INC1 || 
		opcode == INC2 || 
		opcode == INC3 || 
		opcode == INC4 || 
		opcode == LSR1 || 
		opcode == LSR2 || 
		opcode == LSR3 || 
		opcode == LSR4 || 
		opcode == LSR5 || 
		opcode == JSR  ||
		opcode == ROL1 ||
		opcode == ROL2 ||
		opcode == ROL3 ||
		opcode == ROL4 ||
		opcode == ROL5 ||
		opcode == ROR1 ||
		opcode == ROR2 ||
		opcode == ROR3 ||
		opcode == ROR4 ||
		opcode == ROR5) {
		    clock->cycles += 2;
	    }
	    if (opcode == JMP1 || opcode == JMP2) {
		    clock->cycles -= 1;
	    }
	case ABSOLUTE_X:
	    clock->cycles += 4;
	    if (opcode == STA1 || opcode == STA2 ||
		opcode == STA3 || opcode == STA4 ||
		opcode == STA5 || opcode == STA6 ||
		opcode == STA7) {
		    clock->cycles += 1;
	    }
	    else if (opcode == ASL1 ||
		opcode == ASL2 ||
		opcode == ASL3 ||
		opcode == ASL4 ||
		opcode == ASL5 ||
		opcode == DEC1 || 
		opcode == DEC2 || 
		opcode == DEC3 || 
		opcode == DEC4 || 
		opcode == INC1 || 
		opcode == INC2 || 
		opcode == INC3 || 
		opcode == INC4 || 
		opcode == LSR1 || 
		opcode == LSR2 || 
		opcode == LSR3 || 
		opcode == LSR4 || 
		opcode == LSR5 || 
		opcode == JSR  ||
		opcode == ROL1 ||
		opcode == ROL2 ||
		opcode == ROL3 ||
		opcode == ROL4 ||
		opcode == ROL5 ||
		opcode == ROR1 ||
		opcode == ROR2 ||
		opcode == ROR3 ||
		opcode == ROR4 ||
		opcode == ROR5) {
		    clock->cycles += 3;
	    }
	    else if ((address & 0x00FF) == 0xFF) {
		    //Page crossing
		    clock->cycles += 1;
	    }
	    break;
	case ABSOLUTE_Y:
	    clock->cycles += 4;
	    if (opcode == STA1 || opcode == STA2 ||
		opcode == STA3 || opcode == STA4 ||
		opcode == STA5 || opcode == STA6 ||
		opcode == STA7) {
		    clock->cycles += 1;
	    }
	    else if ((address & 0x00FF) == 0xFF) {
		    //Page crossing
		    clock->cycles += 1;
	    }
	    break;
	case INDIRECT_X:
	    clock->cycles += 6;
	    break;
	case INDIRECT_Y:
	    clock->cycles += 5;
	    if (opcode == STA1 || opcode == STA2 ||
		opcode == STA3 || opcode == STA4 ||
		opcode == STA5 || opcode == STA6 ||
		opcode == STA7) {
		    clock->cycles += 1;
	    }
	    else if ((address & 0x00FF) == 0xFF) {
		    //Page crossing
		    clock->cycles += 1;
	    }
	    break;
	case RELATIVE:
	    clock->cycles += 2;
	    break;
	case INDIRECT:
	    clock->cycles += 5;
	    break;
	case IMPLIED:
	    clock->cycles += 2;
	    if (opcode == PHA || opcode == PHP) {
		    clock->cycles += 1;
	    }
	    else if (opcode == PLA || opcode == PLP) {
		    clock->cycles += 2;
	    }
	    else if (opcode == RTI || opcode == RTS) {
		    clock->cycles += 4;
	    }
	    else if (opcode == BRK) {
		    clock->cycles += 5;
	    }
	    break;
	default:
	    //SOMETHING WENT REALLY WRONG
	    clock->cycles += 1;
	    cout << "Timing unrecognized" << endl;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %dx, %ax
movb %sil, %dl
movq %rdi, -0x8(%rbp)
movb %dl, -0x9(%rbp)
movw %ax, -0xc(%rbp)
movl %ecx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0x10(%rbp), %eax
movq %rax, -0x18(%rbp)
subq $0xa, %rax
ja 0x3b97
movq -0x18(%rbp), %rax
leaq 0x412c(%rip), %rcx      # 0x747c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
addl $0x2, %ecx
movl %ecx, (%rax)
jmp 0x3bc7
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
addl $0x3, %ecx
movl %ecx, (%rax)
movzbl -0x9(%rbp), %eax
cmpl $0x6, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0xa, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0xe, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0x16, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0x1e, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0xc6, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0xce, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0xd6, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0xde, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0xe6, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0xee, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0xf6, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0xfe, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0x46, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0x4a, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0x4e, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0x56, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0x5e, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0x26, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0x2a, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0x2e, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0x36, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0x3e, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0x66, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0x6a, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0x6e, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0x76, %eax
je 0x34ba
movzbl -0x9(%rbp), %eax
cmpl $0x7e, %eax
jne 0x34c8
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
addl $0x2, %ecx
movl %ecx, (%rax)
jmp 0x3bc7
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
addl $0x4, %ecx
movl %ecx, (%rax)
movzbl -0x9(%rbp), %eax
cmpl $0x6, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0xa, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0xe, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0x16, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0x1e, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0xc6, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0xce, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0xd6, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0xde, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0xe6, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0xee, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0xf6, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0xfe, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0x46, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0x4a, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0x4e, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0x56, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0x5e, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0x26, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0x2a, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0x2e, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0x36, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0x3e, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0x66, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0x6a, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0x6e, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0x76, %eax
je 0x361b
movzbl -0x9(%rbp), %eax
cmpl $0x7e, %eax
jne 0x3629
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
addl $0x2, %ecx
movl %ecx, (%rax)
jmp 0x3bc7
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
addl $0x4, %ecx
movl %ecx, (%rax)
movzbl -0x9(%rbp), %eax
cmpl $0x6, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0xa, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0xe, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0x16, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0x1e, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0xc6, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0xce, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0xd6, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0xde, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0xe6, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0xee, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0xf6, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0xfe, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0x46, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0x4a, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0x4e, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0x56, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0x5e, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0x20, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0x26, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0x2a, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0x2e, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0x36, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0x3e, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0x66, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0x6a, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0x6e, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0x76, %eax
je 0x3789
movzbl -0x9(%rbp), %eax
cmpl $0x7e, %eax
jne 0x3797
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
addl $0x2, %ecx
movl %ecx, (%rax)
movzbl -0x9(%rbp), %eax
cmpl $0x4c, %eax
je 0x37a9
movzbl -0x9(%rbp), %eax
cmpl $0x6c, %eax
jne 0x37b7
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
subl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x37b9
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
addl $0x4, %ecx
movl %ecx, (%rax)
movzbl -0x9(%rbp), %eax
cmpl $0x81, %eax
je 0x3814
movzbl -0x9(%rbp), %eax
cmpl $0x85, %eax
je 0x3814
movzbl -0x9(%rbp), %eax
cmpl $0x8d, %eax
je 0x3814
movzbl -0x9(%rbp), %eax
cmpl $0x91, %eax
je 0x3814
movzbl -0x9(%rbp), %eax
cmpl $0x95, %eax
je 0x3814
movzbl -0x9(%rbp), %eax
cmpl $0x99, %eax
je 0x3814
movzbl -0x9(%rbp), %eax
cmpl $0x9d, %eax
jne 0x3827
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x39a6
movzbl -0x9(%rbp), %eax
cmpl $0x6, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0xa, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0xe, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0x16, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0x1e, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0xc6, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0xce, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0xd6, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0xde, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0xe6, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0xee, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0xf6, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0xfe, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0x46, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0x4a, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0x4e, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0x56, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0x5e, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0x20, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0x26, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0x2a, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0x2e, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0x36, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0x3e, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0x66, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0x6a, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0x6e, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0x76, %eax
je 0x3974
movzbl -0x9(%rbp), %eax
cmpl $0x7e, %eax
jne 0x3984
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
addl $0x3, %ecx
movl %ecx, (%rax)
jmp 0x39a4
movzwl -0xc(%rbp), %eax
andl $0xff, %eax
cmpl $0xff, %eax
jne 0x39a2
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x39a4
jmp 0x39a6
jmp 0x3bc7
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
addl $0x4, %ecx
movl %ecx, (%rax)
movzbl -0x9(%rbp), %eax
cmpl $0x81, %eax
je 0x3a06
movzbl -0x9(%rbp), %eax
cmpl $0x85, %eax
je 0x3a06
movzbl -0x9(%rbp), %eax
cmpl $0x8d, %eax
je 0x3a06
movzbl -0x9(%rbp), %eax
cmpl $0x91, %eax
je 0x3a06
movzbl -0x9(%rbp), %eax
cmpl $0x95, %eax
je 0x3a06
movzbl -0x9(%rbp), %eax
cmpl $0x99, %eax
je 0x3a06
movzbl -0x9(%rbp), %eax
cmpl $0x9d, %eax
jne 0x3a16
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x3a36
movzwl -0xc(%rbp), %eax
andl $0xff, %eax
cmpl $0xff, %eax
jne 0x3a34
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x3a36
jmp 0x3bc7
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
addl $0x6, %ecx
movl %ecx, (%rax)
jmp 0x3bc7
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
addl $0x5, %ecx
movl %ecx, (%rax)
movzbl -0x9(%rbp), %eax
cmpl $0x81, %eax
je 0x3aa9
movzbl -0x9(%rbp), %eax
cmpl $0x85, %eax
je 0x3aa9
movzbl -0x9(%rbp), %eax
cmpl $0x8d, %eax
je 0x3aa9
movzbl -0x9(%rbp), %eax
cmpl $0x91, %eax
je 0x3aa9
movzbl -0x9(%rbp), %eax
cmpl $0x95, %eax
je 0x3aa9
movzbl -0x9(%rbp), %eax
cmpl $0x99, %eax
je 0x3aa9
movzbl -0x9(%rbp), %eax
cmpl $0x9d, %eax
jne 0x3ab9
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x3ad9
movzwl -0xc(%rbp), %eax
andl $0xff, %eax
cmpl $0xff, %eax
jne 0x3ad7
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x3ad9
jmp 0x3bc7
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
addl $0x2, %ecx
movl %ecx, (%rax)
jmp 0x3bc7
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
addl $0x5, %ecx
movl %ecx, (%rax)
jmp 0x3bc7
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
addl $0x2, %ecx
movl %ecx, (%rax)
movzbl -0x9(%rbp), %eax
cmpl $0x48, %eax
je 0x3b24
movzbl -0x9(%rbp), %eax
cmpl $0x8, %eax
jne 0x3b34
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x3b95
movzbl -0x9(%rbp), %eax
cmpl $0x68, %eax
je 0x3b46
movzbl -0x9(%rbp), %eax
cmpl $0x28, %eax
jne 0x3b56
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
addl $0x2, %ecx
movl %ecx, (%rax)
jmp 0x3b93
movzbl -0x9(%rbp), %eax
cmpl $0x40, %eax
je 0x3b68
movzbl -0x9(%rbp), %eax
cmpl $0x60, %eax
jne 0x3b78
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
addl $0x4, %ecx
movl %ecx, (%rax)
jmp 0x3b91
movzbl -0x9(%rbp), %eax
cmpl $0x0, %eax
jne 0x3b8f
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
addl $0x5, %ecx
movl %ecx, (%rax)
jmp 0x3b91
jmp 0x3b93
jmp 0x3b95
jmp 0x3bc7
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq 0x642c(%rip), %rdi      # 0x9fd8
leaq 0x38f5(%rip), %rsi      # 0x74a8
callq 0x1100
movq %rax, %rdi
movq 0x6406(%rip), %rsi      # 0x9fc8
callq 0x1110
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)