// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cassembler.cpp
// Function: CAssembler::addInstruction(instrNumber, CSourceLine, int)
bool CAssembler::addInstruction( instrNumber instr, CSourceLine sourceLine, int offset )
{
	unsigned int address = sourceLine.m_address ;
	string s1 = sourceLine.getColumn( offset + 1 ) ;
	string s2 = sourceLine.getColumn( offset + 2 ) ;
	string s3 = sourceLine.getColumn( offset + 3 ) ;
	int line = sourceLine.m_lineNr ;
	
	uint32_t code ;
	string s ;
	bool b ;
	switch( instr ) {
		
	case ENABLE:
	case DISABLE:
		if ( toUpper( s1 ) != "INTERRUPT" ) {
			error( line , "'INTERRUPT' expected" ) ;
			return FALSE ;
		}
		if ( instr == ENABLE )
			code = instrENABLE_INTERRUPT ;
		else
			code = instrDISABLE_INTERRUPT ;
		
		break ;
	case RETURNI:
		if ( toUpper( s1 ) == "ENABLE" ) {
			code = instrRETURNI_ENABLE ;
		} else if ( toUpper( s1 ) == "DISABLE" ) {
			code = instrRETURNI_DISABLE ;
		} else {
			error( line , "'ENABLE' or 'DISABLE' expected" ) ;
		}
			
		break ;
	
	case CALL:
	case JUMP:
	case RETURN:
		b = TRUE ;
		if ( toUpper( s1 ) == "C" ) {
			switch( instr ) {
			case CALL    : code = instrCALLC ; break ;
			case JUMP    : code = instrJUMPC ; break ;
			case RETURN  : code = instrRETURNC ; break ;
			default: error( line , "'CALL', 'JUMP' or 'RETURN' expected" ) ; return FALSE ;
			}
		} else if ( toUpper( s1 ) == "NC" ) {
			switch( instr ) {
			case CALL    : code = instrCALLNC ; break ;
			case JUMP    : code = instrJUMPNC ; break ;
			case RETURN  : code = instrRETURNNC ; break ;
			default: error( line , "'CALL', 'JUMP' or 'RETURN' expected" ) ; return FALSE ;
			}
		} else if ( toUpper( s1 ) == "NZ" ) {
			switch( instr ) {
			case CALL    : code = instrCALLNZ ; break ;
			case JUMP    : code = instrJUMPNZ ; break ;
			case RETURN  : code = instrRETURNNZ ; break ;
			default: error( line , "'CALL', 'JUMP' or 'RETURN' expected" ) ; return FALSE ;
			}
		} else if ( toUpper( s1 ) == "Z" ) {
			switch( instr ) {
			case CALL    : code = instrCALLZ ; break ;
			case JUMP    : code = instrJUMPZ ; break ;
			case RETURN  : code = instrRETURNZ ; break ;
			default: error( line , "'CALL', 'JUMP' or 'RETURN' expected" ) ; return FALSE ;
			}
		} else {
			switch( instr ) {
			case CALL    : code = instrCALL ; break ;
			case JUMP    : code = instrJUMP ; break ;
			case RETURN  : code = instrRETURN ; break ;
			default: error( line , "'CALL', 'JUMP' or 'RETURN' expected" ) ; return FALSE ;
			}
			b = FALSE ;
		}
		
		
		if ( instr != RETURN ) {
			if ( b ) {
				if ( s2 != "," ) {
					error( line , "Comma expected" ) ;
					return FALSE ;
				}
				s = s3 ;
			} else
				s = s1 ;
		
			s = translateLabel( s )  ;
			int labelVal ;
		
			if ( sscanf( s.c_str(), "%d", &labelVal ) != 1 )  {
				error( line , "Invalid label" ) ;
				return FALSE ;
			}
		
			code |= labelVal ;
		}
		break ;
	default:
		int reg = getRegister( translateRegister( s1 ) ) ;
		if ( reg < 0 ) {
			error( line , "Registername expected" ) ;
			return FALSE ;
		}
		
		switch ( instr ) {
		case RL:	code = instrRL_SX | instrROTATE |( reg << 8 ) ; break ;
		case RR:	code = instrRR_SX | instrROTATE | ( reg << 8 ) ; break ;
		case SL0:	code = instrSL0_SX | instrROTATE | ( reg << 8 ) ; break ;
		case SL1:	code = instrSL1_SX | instrROTATE | ( reg << 8 ) ; break ;
		case SLA:	code = instrSLA_SX | instrROTATE | ( reg << 8 ) ; break ;
		case SLX:	code = instrSLX_SX | instrROTATE | ( reg << 8 ) ; break ;
		case SR0:	code = instrSR0_SX | instrROTATE | ( reg << 8 ) ; break ;
		case SR1:	code = instrSR1_SX | instrROTATE | ( reg << 8 ) ; break ;
		case SRA:	code = instrSRA_SX | instrROTATE | ( reg << 8 ) ; break ;
		case SRX:	code = instrSRX_SX | instrROTATE |( reg << 8 ) ; break ;
		default:
			if ( s2 != "," ) {
				error( line , "Comma expected" ) ;
				return FALSE ;
			}
			
			switch( instr ) {
			case STORE:
			case OUTPUT:
			case INPUT:
			case FETCH:
				if ( sourceLine.getColumn( offset + 3 ) == "(" ) {
					if ( !sourceLine.isColumn( offset + 5 ) || sourceLine.getColumn( offset + 5 ) != ")" ) {
						error( line , "')' expected" ) ;
						return FALSE ;
					}
				
					int reg2 = getRegister( translateRegister( sourceLine.getColumn( offset + 4 ) ) ) ;
					if ( reg2 < 0 ) {
						error( line , "Register expected" ) ;
						return FALSE ;
					}
					switch( instr ) {
						case STORE : code = instrSTORE_SX_SY | ( reg << 8 ) | (reg2 << 4) ; break ;
						case OUTPUT: code = instrOUTPUT_SX_SY | ( reg << 8 ) | (reg2 << 4) ; break ;
						case INPUT : code = instrINPUT_SX_SY | ( reg << 8 ) | (reg2 << 4) ; break ;
						case FETCH : code = instrFETCH_SX_SY | ( reg << 8 ) | (reg2 << 4) ; break ;
						default: error( line , "'STORE', 'OUTPUT', 'INPUT' or 'FETCH' expected" ) ; return FALSE ;
					}
				} else {
				
					unsigned int value ;
					if ( sscanf( translateConstant( s3 ).c_str(), "%X", &value ) != 1 ) {
						error( line , "Value expected" ) ;
						return FALSE ;
					}
					
					switch( instr ) {
						case STORE : code = instrSTORE_SX_SS | ( reg << 8 ) | value ; break ;
						case OUTPUT: code = instrOUTPUT_SX_PP | ( reg << 8 ) | value ; break ;
						case INPUT : code = instrINPUT_SX_PP | ( reg << 8 ) | value ; break ;
						case FETCH : code = instrFETCH_SX_SS | ( reg << 8 ) | value ; break ;
						default: error( line , "'STORE', 'OUTPUT', 'INPUT' or 'FETCH' expected" ) ; return FALSE ;
					}
				}
				break ;
			default:
				int reg2 = getRegister( translateRegister( s3 ) ) ;
		
				if ( reg2 < 0 ) {
					unsigned int value ;
					if ( sscanf( translateConstant( s3 ).c_str(), "%X", &value ) != 1 ) {
						error( line , "Value expected" ) ;
						return FALSE ;
					}
					switch( instr ) {
					case ADD     : code = instrADD_SX_KK | ( reg << 8 ) | ( value ) ; break ;
					case ADDCY   : code = instrADDCY_SX_KK | ( reg << 8 ) | ( value ) ; break ;
					case AND     : code = instrAND_SX_KK | ( reg << 8 ) | ( value ) ; break ;
					case COMPARE : code = instrCOMPARE_SX_KK | ( reg << 8 ) | ( value ) ; break ;
					case LOAD    : code = instrLOAD_SX_KK | ( reg << 8 ) | ( value ) ; break ;
					case OR      : code = instrOR_SX_KK | ( reg << 8 ) | ( value ) ; break ;
					case SUB     : code = instrSUB_SX_KK | ( reg << 8 ) | ( value ) ; break ;
					case SUBCY   : code = instrSUBCY_SX_KK | ( reg << 8 ) | ( value ) ; break ;
					case TEST    : code = instrTEST_SX_KK | ( reg << 8 ) | ( value ) ; break ;
					case XOR     : code = instrXOR_SX_KK | ( reg << 8 ) | ( value ) ; break ;
					default      : error( line , "Unknown instruction" )  ; return FALSE ;
					}
				} else {
				  
					switch( instr ) {
					case ADD    : code = instrADD_SX_SY | ( reg << 8 ) | ( reg2  << 4 ) ; break ;
					case ADDCY  : code = instrADDCY_SX_SY | ( reg << 8 ) | ( reg2 << 4 ) ; break ;
					case AND    : code = instrAND_SX_SY | ( reg << 8 ) | (  reg2 << 4 ) ; break  ;
					case COMPARE: code = instrCOMPARE_SX_SY | ( reg << 8 ) | ( reg2 << 4 ) ; break ;
					case LOAD   : code = instrLOAD_SX_SY | ( reg << 8 ) | ( reg2 << 4 ) ; break ;
					case OR     : code = instrOR_SX_SY | ( reg << 8 ) | ( reg2 << 4 ) ; break ;
					case SUB    : code = instrSUB_SX_SY | ( reg << 8 ) | ( reg2 << 4 ) ; break ;
					case SUBCY  : code = instrSUBCY_SX_SY | ( reg << 8 ) | ( reg2 << 4 ) ; break ;
					case TEST   : code = instrTEST_SX_SY | ( reg << 8 ) | ( reg2 << 4 ) ; break ;
					case XOR    : code = instrXOR_SX_SY | ( reg << 8 ) | ( reg2 << 4 ) ; break ;
					default     : error( line , "Unknown instruction" ) ; return FALSE ;
					}	
				}
			}
		}
	}

	
	m_code->setInstruction( address, code, line ) ;
	
	return TRUE ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2c8, %rsp            # imm = 0x2C8
movl %ecx, %r13d
movq %rdx, %r14
movl %esi, %r12d
movq %rdi, -0x60(%rbp)
movl 0x20(%rdx), %eax
movl %eax, -0x84(%rbp)
leal 0x1(%r13), %edx
leaq -0x80(%rbp), %rdi
movq %r14, %rsi
callq 0x408e9a
leal 0x2(%r13), %edx
leaq -0x268(%rbp), %rdi
movq %r14, %rsi
callq 0x408e9a
leal 0x3(%r13), %ebx
leaq -0xc8(%rbp), %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x408e9a
movl (%r14), %eax
movl %eax, -0x34(%rbp)
leaq -0x98(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
cmpl $0xe, %r12d
ja 0x406fd0
movl $0x2208, %eax           # imm = 0x2208
btl %r12d, %eax
jb 0x406c7c
movl $0x60, %eax
btl %r12d, %eax
jae 0x406e95
leaq -0x238(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
addq %rsi, %rdx
leaq -0x248(%rbp), %rdi
callq 0x40546e
leaq -0x58(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x4055ac
leaq 0x17ac6a(%rip), %rsi    # 0x581891
leaq -0x58(%rbp), %r14
movq %r14, %rdi
callq 0x47ec20
movl %eax, %ebx
movq (%r14), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x406c4d
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x40d020
movq -0x248(%rbp), %rdi
cmpq %r15, %rdi
je 0x406c68
movq -0x238(%rbp), %rsi
incq %rsi
callq 0x40d020
testl %ebx, %ebx
je 0x407097
leaq 0x17a9f3(%rip), %rdx    # 0x58166a
jmp 0x4071bd
leaq -0x1d8(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1e8(%rbp), %rdi
callq 0x40546e
leaq -0x58(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x4055ac
leaq 0x17ac35(%rip), %rsi    # 0x5818ea
leaq -0x58(%rbp), %r14
movq %r14, %rdi
callq 0x47ec20
movl %eax, %ebx
movq (%r14), %rdi
leaq -0x48(%rbp), %r15
cmpq %r15, %rdi
je 0x406cdb
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x40d020
movq -0x1e8(%rbp), %rdi
cmpq %r13, %rdi
je 0x406cf6
movq -0x1d8(%rbp), %rsi
incq %rsi
callq 0x40d020
testl %ebx, %ebx
je 0x406fb1
leaq -0x1b8(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1c8(%rbp), %rdi
callq 0x40546e
leaq -0x58(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x4055ac
leaq 0x17abbc(%rip), %rsi    # 0x5818f3
movq %r14, %rdi
callq 0x47ec20
movl %eax, %ebx
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x406d55
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x40d020
movq -0x1c8(%rbp), %rdi
cmpq %r13, %rdi
je 0x406d70
movq -0x1b8(%rbp), %rsi
incq %rsi
callq 0x40d020
testl %ebx, %ebx
je 0x4070ae
leaq -0x198(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1a8(%rbp), %rdi
callq 0x40546e
leaq -0x58(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
callq 0x4055ac
leaq 0x17ab4c(%rip), %rsi    # 0x5818fd
movq %r14, %rdi
callq 0x47ec20
movl %eax, %ebx
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x406dcf
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x40d020
movq -0x1a8(%rbp), %rdi
cmpq %r13, %rdi
je 0x406dea
movq -0x198(%rbp), %rsi
incq %rsi
callq 0x40d020
testl %ebx, %ebx
je 0x4070ca
leaq -0x178(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
addq %rsi, %rdx
leaq -0x188(%rbp), %rdi
callq 0x40546e
leaq -0x58(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x4055ac
leaq 0x17aadc(%rip), %rsi    # 0x581907
movq %r14, %rdi
callq 0x47ec20
movl %eax, %ebx
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x406e49
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x40d020
movq -0x188(%rbp), %rdi
cmpq %r13, %rdi
je 0x406e64
movq -0x178(%rbp), %rsi
incq %rsi
callq 0x40d020
testl %ebx, %ebx
je 0x40711e
cmpl $0x3, %r12d
je 0x407169
cmpl $0xd, %r12d
je 0x40715e
cmpl $0x9, %r12d
jne 0x40713a
movl $0x34000, %r12d         # imm = 0x34000
jmp 0x40716f
cmpl $0xe, %r12d
jne 0x406fd0
leaq -0x218(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
addq %rsi, %rdx
leaq -0x228(%rbp), %rdi
callq 0x40546e
leaq -0x58(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x4055ac
leaq 0x17aa48(%rip), %rsi    # 0x581921
leaq -0x58(%rbp), %r14
movq %r14, %rdi
callq 0x47ec20
movl %eax, %ebx
movq (%r14), %rdi
leaq -0x48(%rbp), %r15
cmpq %r15, %rdi
je 0x406eff
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x40d020
movq -0x228(%rbp), %rdi
cmpq %r12, %rdi
je 0x406f1a
movq -0x218(%rbp), %rsi
incq %rsi
callq 0x40d020
testl %ebx, %ebx
je 0x4070e6
leaq -0x1f8(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
addq %rsi, %rdx
leaq -0x208(%rbp), %rdi
callq 0x40546e
leaq -0x58(%rbp), %rdi
leaq -0x208(%rbp), %rsi
callq 0x4055ac
leaq 0x17a9b5(%rip), %rsi    # 0x581911
movq %r14, %rdi
callq 0x47ec20
movl %eax, %ebx
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x406f7a
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x40d020
movq -0x208(%rbp), %rdi
cmpq %r12, %rdi
je 0x406f95
movq -0x1f8(%rbp), %rsi
incq %rsi
callq 0x40d020
testl %ebx, %ebx
je 0x407143
leaq 0x17a6db(%rip), %rdx    # 0x58167f
movl -0x34(%rbp), %esi
callq 0x40574a
jmp 0x407286
cmpl $0x3, %r12d
je 0x407113
cmpl $0x9, %r12d
je 0x407108
movl $0x2b800, %r14d         # imm = 0x2B800
jmp 0x407130
leaq -0xd8(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
addq %rsi, %rdx
leaq -0xe8(%rbp), %rdi
callq 0x40546e
leaq -0x2e8(%rbp), %rdi
leaq -0xe8(%rbp), %rdx
movq -0x60(%rbp), %rsi
callq 0x4068f6
leaq -0x2e8(%rbp), %r15
movq %r15, %rsi
callq 0x405800
movl %eax, -0x2c(%rbp)
movq (%r15), %rdi
leaq -0x2d8(%rbp), %rax
cmpq %rax, %rdi
je 0x407039
movq -0x2d8(%rbp), %rsi
incq %rsi
callq 0x40d020
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0x40705b
movq -0xd8(%rbp), %rsi
incq %rsi
callq 0x40d020
cmpl $0x0, -0x2c(%rbp)
js 0x4070f1
leal -0x10(%r12), %eax
cmpl $0x9, %eax
ja 0x4073e6
leaq 0x17a36e(%rip), %rcx    # 0x5813e8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x2c(%rbp), %r14d
shll $0x8, %r14d
orl $0x20002, %r14d         # imm = 0x20002
jmp 0x407286
xorl %r14d, %r14d
cmpl $0x6, %r12d
sete %r14b
orl $0x3c000, %r14d         # imm = 0x3C000
jmp 0x407286
cmpl $0x3, %r12d
je 0x407156
cmpl $0x9, %r12d
je 0x40714e
movl $0x2bc00, %r14d         # imm = 0x2BC00
jmp 0x407130
cmpl $0x3, %r12d
je 0x407189
cmpl $0x9, %r12d
je 0x407181
movl $0x2b400, %r14d         # imm = 0x2B400
jmp 0x407130
movl $0x38001, %r14d         # imm = 0x38001
jmp 0x407286
leaq 0x17a5d8(%rip), %rbx    # 0x5816d0
movl -0x34(%rbp), %esi
movq %rbx, %rdx
callq 0x40574a
jmp 0x4071c5
movl $0x35800, %r12d         # imm = 0x35800
jmp 0x40719f
movl $0x31800, %r12d         # imm = 0x31800
jmp 0x40719f
cmpl $0x3, %r12d
je 0x407199
cmpl $0x9, %r12d
je 0x407191
movl $0x2b000, %r14d         # imm = 0x2B000
cmpl $0xd, %r12d
je 0x407286
leaq 0x17a55d(%rip), %rdx    # 0x58169e
jmp 0x4071bd
movl $0x38000, %r14d         # imm = 0x38000
jmp 0x407286
movl $0x35c00, %r12d         # imm = 0x35C00
jmp 0x40719f
movl $0x31c00, %r12d         # imm = 0x31C00
jmp 0x40719f
movl $0x2a000, %r14d         # imm = 0x2A000
jmp 0x407286
movl $0x30000, %r12d         # imm = 0x30000
leaq -0xa8(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x47c640
jmp 0x4071df
movl $0x35400, %r12d         # imm = 0x35400
jmp 0x40719f
movl $0x31400, %r12d         # imm = 0x31400
jmp 0x40719f
movl $0x35000, %r12d         # imm = 0x35000
jmp 0x40719f
movl $0x31000, %r12d         # imm = 0x31000
leaq 0x17a3aa(%rip), %rsi    # 0x581550
leaq -0x268(%rbp), %rdi
callq 0x47ec20
testl %eax, %eax
je 0x4071cc
leaq 0x17a395(%rip), %rdx    # 0x581552
movl -0x34(%rbp), %esi
callq 0x40574a
xorl %ebx, %ebx
jmp 0x4072a5
leaq -0xa8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x47c640
leaq -0x158(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
addq %rsi, %rdx
leaq -0x168(%rbp), %rdi
callq 0x40546e
leaq -0x58(%rbp), %rdi
leaq -0x168(%rbp), %rdx
movq -0x60(%rbp), %rsi
callq 0x406a82
leaq -0xa8(%rbp), %rdi
leaq -0x58(%rbp), %rbx
movq %rbx, %rsi
callq 0x47ca60
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x407242
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x40d020
movq -0x168(%rbp), %rdi
cmpq %r14, %rdi
je 0x40725d
movq -0x158(%rbp), %rsi
incq %rsi
callq 0x40d020
movq -0xa8(%rbp), %rdi
leaq 0x18ad09(%rip), %rsi    # 0x591f74
leaq -0x58(%rbp), %rdx
xorl %eax, %eax
callq 0x4d49a0
cmpl $0x1, %eax
jne 0x407332
movl %r12d, %r14d
orl -0x58(%rbp), %r14d
movq -0x60(%rbp), %rax
movq 0x80(%rax), %rdi
movb $0x1, %bl
movzwl -0x84(%rbp), %esi
movl %r14d, %edx
movl -0x34(%rbp), %ecx
callq 0x40c450
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x4072c7
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x40d020
leaq -0xb8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4072e6
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x40d020
leaq -0x258(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x407305
movq -0x258(%rbp), %rsi
incq %rsi
callq 0x40d020
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x40731e
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x40d020
movl %ebx, %eax
addq $0x2c8, %rsp            # imm = 0x2C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x17a389(%rip), %rdx    # 0x5816c2
movl -0x34(%rbp), %esi
callq 0x40574a
jmp 0x4071c5
movl -0x2c(%rbp), %r14d
shll $0x8, %r14d
orl $0x20000, %r14d         # imm = 0x20000
jmp 0x407286
movl -0x2c(%rbp), %r14d
shll $0x8, %r14d
orl $0x2000a, %r14d         # imm = 0x2000A
jmp 0x407286
movl -0x2c(%rbp), %r14d
shll $0x8, %r14d
orl $0x20006, %r14d         # imm = 0x20006
jmp 0x407286
movl -0x2c(%rbp), %r14d
shll $0x8, %r14d
orl $0x20007, %r14d         # imm = 0x20007
jmp 0x407286
movl -0x2c(%rbp), %r14d
shll $0x8, %r14d
orl $0x2000f, %r14d         # imm = 0x2000F
jmp 0x407286
movl -0x2c(%rbp), %r14d
shll $0x8, %r14d
orl $0x2000c, %r14d         # imm = 0x2000C
jmp 0x407286
movl -0x2c(%rbp), %r14d
shll $0x8, %r14d
orl $0x20004, %r14d         # imm = 0x20004
jmp 0x407286
movl -0x2c(%rbp), %r14d
shll $0x8, %r14d
orl $0x2000e, %r14d         # imm = 0x2000E
jmp 0x407286
leaq 0x17a163(%rip), %rsi    # 0x581550
leaq -0x268(%rbp), %rdi
callq 0x47ec20
testl %eax, %eax
je 0x40741d
leaq 0x17a14e(%rip), %rbx    # 0x581552
jmp 0x4070f8
movl -0x2c(%rbp), %r14d
shll $0x8, %r14d
orl $0x20008, %r14d         # imm = 0x20008
jmp 0x407286
cmpl $0x1a, %r12d
ja 0x407677
movl $0x4001180, %eax        # imm = 0x4001180
btl %r12d, %eax
jae 0x407677
leaq -0x58(%rbp), %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x408e9a
leaq 0x17a3c7(%rip), %rsi    # 0x581812
leaq -0x58(%rbp), %r15
movq %r15, %rdi
callq 0x47ec20
movl %eax, %ebx
movq (%r15), %rdi
leaq -0x48(%rbp), %r15
cmpq %r15, %rdi
je 0x407471
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x40d020
testl %ebx, %ebx
je 0x407543
leaq -0x138(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0xc8(%rbp), %rsi
movq -0xc0(%rbp), %rdx
addq %rsi, %rdx
leaq -0x148(%rbp), %rdi
callq 0x40546e
leaq -0x58(%rbp), %rdi
leaq -0x148(%rbp), %rdx
movq -0x60(%rbp), %rsi
callq 0x4069bc
movq -0x58(%rbp), %rdi
leaq 0x17a05a(%rip), %rsi    # 0x58151a
leaq -0x30(%rbp), %rdx
xorl %eax, %eax
callq 0x4d49a0
movl %eax, %ebx
movq -0x58(%rbp), %rdi
cmpq %r15, %rdi
je 0x4074e2
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x40d020
movq -0x148(%rbp), %rdi
cmpq %r14, %rdi
je 0x4074fd
movq -0x138(%rbp), %rsi
incq %rsi
callq 0x40d020
cmpl $0x1, %ebx
movl -0x2c(%rbp), %r14d
jne 0x407663
leaq 0x17a1f4(%rip), %rdx    # 0x581705
cmpl $0xb, %r12d
jg 0x40773c
cmpl $0x7, %r12d
je 0x407868
cmpl $0x8, %r12d
jne 0x40766a
shll $0x8, %r14d
orl -0x30(%rbp), %r14d
orl $0x4000, %r14d          # imm = 0x4000
jmp 0x407286
movq 0x10(%r14), %rax
subq 0x8(%r14), %rax
leal 0x5(%r13), %edx
sarq $0x5, %rax
leaq 0x17a18c(%rip), %rbx    # 0x5816e6
cmpq %rdx, %rax
jbe 0x4070f8
leaq -0x58(%rbp), %rdi
movq %r14, %rsi
callq 0x408e9a
leaq 0x19c61f(%rip), %rsi    # 0x5a3b95
leaq -0x58(%rbp), %rdi
callq 0x47ec20
leaq -0x58(%rbp), %rcx
movq (%rcx), %rdi
cmpq %r15, %rdi
je 0x40759d
movq -0x48(%rbp), %rsi
incq %rsi
movl %eax, %r15d
callq 0x40d020
movl %r15d, %eax
testl %eax, %eax
jne 0x4070f8
addl $0x4, %r13d
leaq -0x288(%rbp), %rdi
movq %r14, %rsi
movl %r13d, %edx
callq 0x408e9a
leaq -0x2c8(%rbp), %rdi
leaq -0x288(%rbp), %rdx
movq -0x60(%rbp), %rsi
callq 0x4068f6
leaq -0x2c8(%rbp), %r14
movq %r14, %rsi
callq 0x405800
movl %eax, %ebx
movq (%r14), %rdi
leaq -0x2b8(%rbp), %rax
cmpq %rax, %rdi
je 0x407601
movq -0x2b8(%rbp), %rsi
incq %rsi
callq 0x40d020
leaq -0x278(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x407620
movq -0x278(%rbp), %rsi
incq %rsi
callq 0x40d020
testl %ebx, %ebx
js 0x4078a4
leaq 0x17a0d6(%rip), %rdx    # 0x581705
cmpl $0xb, %r12d
jg 0x4078b8
cmpl $0x7, %r12d
je 0x4079ec
cmpl $0x8, %r12d
jne 0x4078ab
movl -0x2c(%rbp), %eax
shll $0x8, %eax
shll $0x4, %ebx
orl %eax, %ebx
orl $0x5000, %ebx           # imm = 0x5000
jmp 0x407a10
leaq 0x179fbd(%rip), %rdx    # 0x581627
movl -0x34(%rbp), %esi
callq 0x40574a
jmp 0x4071c5
leaq -0x118(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0xc8(%rbp), %rsi
movq -0xc0(%rbp), %rdx
addq %rsi, %rdx
leaq -0x128(%rbp), %rdi
callq 0x40546e
leaq -0x2a8(%rbp), %rdi
leaq -0x128(%rbp), %rdx
movq -0x60(%rbp), %rsi
callq 0x4068f6
leaq -0x2a8(%rbp), %rbx
movq %rbx, %rsi
callq 0x405800
movl %eax, %r14d
movq (%rbx), %rdi
leaq -0x298(%rbp), %rax
cmpq %rax, %rdi
je 0x4076e6
movq -0x298(%rbp), %rsi
incq %rsi
callq 0x40d020
movq -0x128(%rbp), %rdi
cmpq %r15, %rdi
je 0x407701
movq -0x118(%rbp), %rsi
incq %rsi
callq 0x40d020
testl %r14d, %r14d
js 0x407764
cmpl $0xb, %r12d
ja 0x407831
movl %r12d, %eax
leaq 0x179cf6(%rip), %rcx    # 0x581410
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x2c(%rbp), %eax
shll $0x8, %eax
shll $0x4, %r14d
orl %eax, %r14d
orl $0x19000, %r14d         # imm = 0x19000
jmp 0x407286
cmpl $0xc, %r12d
je 0x40787c
cmpl $0x1a, %r12d
jne 0x40766a
shll $0x8, %r14d
orl -0x30(%rbp), %r14d
orl $0x2e000, %r14d         # imm = 0x2E000
jmp 0x407286
leaq -0xf8(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0xc8(%rbp), %rsi
movq -0xc0(%rbp), %rdx
addq %rsi, %rdx
leaq -0x108(%rbp), %rdi
callq 0x40546e
leaq -0x58(%rbp), %rdi
leaq -0x108(%rbp), %rdx
movq -0x60(%rbp), %rsi
callq 0x4069bc
leaq -0x48(%rbp), %r15
movq -0x10(%r15), %rdi
leaq 0x179d6b(%rip), %rsi    # 0x58151a
leaq -0x30(%rbp), %rdx
xorl %eax, %eax
callq 0x4d49a0
movl %eax, %ebx
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x4077d1
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x40d020
movq -0x108(%rbp), %rdi
cmpq %r14, %rdi
je 0x4077ec
movq -0xf8(%rbp), %rsi
incq %rsi
callq 0x40d020
cmpl $0x1, %ebx
jne 0x407890
leaq 0x179f38(%rip), %rdx    # 0x581734
cmpl $0xb, %r12d
ja 0x4078de
movl %r12d, %eax
leaq 0x179c40(%rip), %rcx    # 0x581450
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x2c(%rbp), %r14d
shll $0x8, %r14d
orl -0x30(%rbp), %r14d
orl $0x18000, %r14d         # imm = 0x18000
jmp 0x407286
addl $-0x1b, %r12d
cmpl $0x3, %r12d
ja 0x407910
leaq 0x179bfa(%rip), %rax    # 0x581440
movslq (%rax,%r12,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl -0x2c(%rbp), %eax
shll $0x8, %eax
shll $0x4, %r14d
orl %eax, %r14d
orl $0x1d000, %r14d         # imm = 0x1D000
jmp 0x407286
shll $0x8, %r14d
orl -0x30(%rbp), %r14d
orl $0x6000, %r14d          # imm = 0x6000
jmp 0x407286
shll $0x8, %r14d
orl -0x30(%rbp), %r14d
orl $0x2c000, %r14d         # imm = 0x2C000
jmp 0x407286
leaq 0x179d90(%rip), %rdx    # 0x581627
movl -0x34(%rbp), %esi
callq 0x40574a
jmp 0x4071c5
leaq 0x179e48(%rip), %rdx    # 0x5816f3
movl -0x34(%rbp), %esi
callq 0x40574a
jmp 0x4071c5
cmpl $0xc, %r12d
je 0x4079ff
cmpl $0x1a, %r12d
jne 0x4078ab
movl -0x2c(%rbp), %eax
shll $0x8, %eax
shll $0x4, %ebx
orl %eax, %ebx
orl $0x2f000, %ebx          # imm = 0x2F000
jmp 0x407a10
addl $-0x1b, %r12d
cmpl $0x3, %r12d
ja 0x407897
leaq 0x179b91(%rip), %rax    # 0x581480
movslq (%rax,%r12,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl -0x2c(%rbp), %r14d
shll $0x8, %r14d
orl -0x30(%rbp), %r14d
orl $0x1c000, %r14d         # imm = 0x1C000
jmp 0x407286
leaq 0x179e1d(%rip), %rdx    # 0x581734
movl -0x34(%rbp), %esi
callq 0x40574a
jmp 0x4071c5
movl -0x2c(%rbp), %eax
shll $0x8, %eax
shll $0x4, %r14d
orl %eax, %r14d
orl $0x15000, %r14d         # imm = 0x15000
jmp 0x407286
movl -0x2c(%rbp), %eax
shll $0x8, %eax
shll $0x4, %r14d
orl %eax, %r14d
orl $0xb000, %r14d          # imm = 0xB000
jmp 0x407286
movl -0x2c(%rbp), %eax
shll $0x8, %eax
shll $0x4, %r14d
orl %eax, %r14d
orl $0x1000, %r14d          # imm = 0x1000
jmp 0x407286
movl -0x2c(%rbp), %eax
shll $0x8, %eax
shll $0x4, %r14d
orl %eax, %r14d
orl $0x1b000, %r14d         # imm = 0x1B000
jmp 0x407286
movl -0x2c(%rbp), %eax
shll $0x8, %eax
shll $0x4, %r14d
orl %eax, %r14d
orl $0xd000, %r14d          # imm = 0xD000
jmp 0x407286
movl -0x2c(%rbp), %eax
shll $0x8, %eax
shll $0x4, %r14d
orl %eax, %r14d
orl $0x13000, %r14d         # imm = 0x13000
jmp 0x407286
movl -0x2c(%rbp), %eax
shll $0x8, %eax
shll $0x4, %r14d
orl %eax, %r14d
orl $0xf000, %r14d          # imm = 0xF000
jmp 0x407286
movl -0x2c(%rbp), %eax
shll $0x8, %eax
shll $0x4, %r14d
orl %eax, %r14d
orl $0x1f000, %r14d         # imm = 0x1F000
jmp 0x407286
movl -0x2c(%rbp), %eax
shll $0x8, %eax
shll $0x4, %ebx
orl %eax, %ebx
orl $0x7000, %ebx           # imm = 0x7000
jmp 0x407a10
movl -0x2c(%rbp), %eax
shll $0x8, %eax
shll $0x4, %ebx
orl %eax, %ebx
orl $0x2d000, %ebx          # imm = 0x2D000
movl %ebx, %r14d
jmp 0x407286
movl -0x2c(%rbp), %r14d
shll $0x8, %r14d
orl -0x30(%rbp), %r14d
orl $0x14000, %r14d         # imm = 0x14000
jmp 0x407286
movl -0x2c(%rbp), %r14d
shll $0x8, %r14d
orl -0x30(%rbp), %r14d
orl $0xa000, %r14d          # imm = 0xA000
jmp 0x407286
movl -0x2c(%rbp), %r14d
shll $0x8, %r14d
orl -0x30(%rbp), %r14d
jmp 0x407286
movl -0x2c(%rbp), %r14d
shll $0x8, %r14d
orl -0x30(%rbp), %r14d
orl $0x1a000, %r14d         # imm = 0x1A000
jmp 0x407286
movl -0x2c(%rbp), %r14d
shll $0x8, %r14d
orl -0x30(%rbp), %r14d
orl $0xc000, %r14d          # imm = 0xC000
jmp 0x407286
movl -0x2c(%rbp), %r14d
shll $0x8, %r14d
orl -0x30(%rbp), %r14d
orl $0x12000, %r14d         # imm = 0x12000
jmp 0x407286
movl -0x2c(%rbp), %r14d
shll $0x8, %r14d
orl -0x30(%rbp), %r14d
orl $0xe000, %r14d          # imm = 0xE000
jmp 0x407286
movl -0x2c(%rbp), %r14d
shll $0x8, %r14d
orl -0x30(%rbp), %r14d
orl $0x1e000, %r14d         # imm = 0x1E000
jmp 0x407286
jmp 0x407caa
movq %rax, %rbx
leaq -0x278(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x407cad
movq -0x278(%rbp), %rsi
jmp 0x407c94
movq %rax, %rbx
movq -0x108(%rbp), %rdi
cmpq %r14, %rdi
je 0x407cad
movq -0xf8(%rbp), %rsi
jmp 0x407c94
jmp 0x407caa
jmp 0x407caa
jmp 0x407caa
movq %rax, %rbx
movq -0x128(%rbp), %rdi
cmpq %r15, %rdi
je 0x407cad
movq -0x118(%rbp), %rsi
jmp 0x407c94
jmp 0x407caa
jmp 0x407caa
movq %rax, %rbx
movq -0x148(%rbp), %rdi
cmpq %r14, %rdi
je 0x407cad
movq -0x138(%rbp), %rsi
jmp 0x407c94
jmp 0x407caa
jmp 0x407caa
jmp 0x407caa
movq %rax, %rbx
movq -0x208(%rbp), %rdi
cmpq %r12, %rdi
je 0x407cad
movq -0x1f8(%rbp), %rsi
jmp 0x407c94
jmp 0x407caa
movq %rax, %rbx
movq -0x168(%rbp), %rdi
cmpq %r14, %rdi
je 0x407cad
movq -0x158(%rbp), %rsi
jmp 0x407c94
jmp 0x407caa
movq %rax, %rbx
movq -0x188(%rbp), %rdi
cmpq %r13, %rdi
je 0x407cad
movq -0x178(%rbp), %rsi
jmp 0x407c94
jmp 0x407caa
movq %rax, %rbx
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0x407cad
movq -0xd8(%rbp), %rsi
jmp 0x407c94
movq %rax, %rbx
movq -0x228(%rbp), %rdi
cmpq %r12, %rdi
je 0x407cad
movq -0x218(%rbp), %rsi
jmp 0x407c94
jmp 0x407caa
movq %rax, %rbx
movq -0x1a8(%rbp), %rdi
cmpq %r13, %rdi
je 0x407cad
movq -0x198(%rbp), %rsi
jmp 0x407c94
jmp 0x407caa
jmp 0x407caa
movq %rax, %rbx
movq -0x1c8(%rbp), %rdi
cmpq %r13, %rdi
je 0x407cad
movq -0x1b8(%rbp), %rsi
jmp 0x407c94
jmp 0x407caa
movq %rax, %rbx
movq -0x248(%rbp), %rdi
cmpq %r15, %rdi
je 0x407cad
movq -0x238(%rbp), %rsi
jmp 0x407c94
jmp 0x407caa
movq %rax, %rbx
movq -0x1e8(%rbp), %rdi
cmpq %r13, %rdi
je 0x407cad
movq -0x1d8(%rbp), %rsi
incq %rsi
callq 0x40d020
jmp 0x407cad
jmp 0x407caa
movq %rax, %rbx
jmp 0x407cee
movq %rax, %rbx
jmp 0x407d0d
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x407ccf
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x40d020
leaq -0xb8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x407cee
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x40d020
leaq -0x258(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x407d0d
movq -0x258(%rbp), %rsi
incq %rsi
callq 0x40d020
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x407d26
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x40d020
movq %rbx, %rdi
callq 0x4ad8c0