// File: /workspace/github_cpp_makefile_star2_O1/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, %ebx
movq %rdx, %r15
movl %esi, %r12d
movq %rdi, -0x60(%rbp)
movl 0x20(%rdx), %eax
movl %eax, -0x84(%rbp)
leal 0x1(%rbx), %edx
leaq -0x80(%rbp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x408edc
leal 0x2(%rbx), %edx
leaq -0x268(%rbp), %rdi
movq %r15, %rsi
callq 0x408edc
leal 0x3(%rbx), %r14d
leaq -0xc8(%rbp), %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0x408edc
movl (%r15), %eax
movl %eax, -0x34(%rbp)
leaq -0x98(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
cmpl $0xe, %r12d
ja 0x40701f
movl $0x2208, %eax           # imm = 0x2208
btl %r12d, %eax
jb 0x406cb3
movl $0x60, %eax
btl %r12d, %eax
jae 0x406ed8
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 0x4055a4
leaq 0x17ac33(%rip), %rsi    # 0x581891
leaq -0x58(%rbp), %r14
movq %r14, %rdi
callq 0x47ecc0
movl %eax, %ebx
movq (%r14), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x406c84
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x40d0c0
movq -0x248(%rbp), %rdi
cmpq %r15, %rdi
je 0x406c9f
movq -0x238(%rbp), %rsi
incq %rsi
callq 0x40d0c0
testl %ebx, %ebx
je 0x4070e7
leaq 0x17a9bc(%rip), %rdx    # 0x58166a
jmp 0x407220
leaq -0x1d8(%rbp), %r15
movq %r15, -0x10(%r15)
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 0x4055a4
leaq 0x17abfe(%rip), %rsi    # 0x5818ea
leaq -0x58(%rbp), %r14
movq %r14, %rdi
callq 0x47ecc0
movl %eax, %ebx
movq (%r14), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x406d12
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x40d0c0
movq -0x1e8(%rbp), %rdi
cmpq %r15, %rdi
je 0x406d2d
movq -0x1d8(%rbp), %rsi
incq %rsi
callq 0x40d0c0
testl %ebx, %ebx
je 0x406ff4
leaq -0x1b8(%rbp), %r15
movq %r15, -0x10(%r15)
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 0x4055a4
leaq 0x17ab85(%rip), %rsi    # 0x5818f3
movq %r14, %rdi
callq 0x47ecc0
movl %eax, %ebx
movq (%r14), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x406d90
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x40d0c0
movq -0x1c8(%rbp), %rdi
cmpq %r15, %rdi
je 0x406dab
movq -0x1b8(%rbp), %rsi
incq %rsi
callq 0x40d0c0
testl %ebx, %ebx
je 0x4070fe
leaq -0x198(%rbp), %r15
movq %r15, -0x10(%r15)
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 0x4055a4
leaq 0x17ab11(%rip), %rsi    # 0x5818fd
movq %r14, %rdi
callq 0x47ecc0
movl %eax, %ebx
movq (%r14), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x406e0e
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x40d0c0
movq -0x1a8(%rbp), %rdi
cmpq %r15, %rdi
je 0x406e29
movq -0x198(%rbp), %rsi
incq %rsi
callq 0x40d0c0
testl %ebx, %ebx
je 0x407125
leaq -0x178(%rbp), %r15
movq %r15, -0x10(%r15)
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 0x4055a4
leaq 0x17aa9d(%rip), %rsi    # 0x581907
movq %r14, %rdi
callq 0x47ecc0
movl %eax, %ebx
movq (%r14), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x406e8c
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x40d0c0
movq -0x188(%rbp), %rdi
cmpq %r15, %rdi
je 0x406ea7
movq -0x178(%rbp), %rsi
incq %rsi
callq 0x40d0c0
testl %ebx, %ebx
je 0x40717d
cmpl $0x3, %r12d
je 0x4071c5
cmpl $0xd, %r12d
je 0x4071bd
cmpl $0x9, %r12d
jne 0x407199
movl $0x34000, %r15d         # imm = 0x34000
jmp 0x4071cb
cmpl $0xe, %r12d
jne 0x40701f
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 0x4055a4
leaq 0x17aa05(%rip), %rsi    # 0x581921
leaq -0x58(%rbp), %r14
movq %r14, %rdi
callq 0x47ecc0
movl %eax, %ebx
movq (%r14), %rdi
leaq -0x48(%rbp), %r15
cmpq %r15, %rdi
je 0x406f42
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x40d0c0
movq -0x228(%rbp), %rdi
cmpq %r12, %rdi
je 0x406f5d
movq -0x218(%rbp), %rsi
incq %rsi
callq 0x40d0c0
testl %ebx, %ebx
je 0x40714c
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 0x4055a4
leaq 0x17a972(%rip), %rsi    # 0x581911
movq %r14, %rdi
callq 0x47ecc0
movl %eax, %ebx
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x406fbd
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x40d0c0
movq -0x208(%rbp), %rdi
cmpq %r12, %rdi
je 0x406fd8
movq -0x1f8(%rbp), %rsi
incq %rsi
callq 0x40d0c0
testl %ebx, %ebx
je 0x4071a2
leaq 0x17a698(%rip), %rdx    # 0x58167f
movl -0x34(%rbp), %esi
callq 0x405742
jmp 0x4073d4
movb $0x1, %al
cmpl $0x3, %r12d
je 0x407175
cmpl $0x9, %r12d
je 0x40716d
cmpl $0xd, %r12d
jne 0x407199
movl $0x2b800, %r15d         # imm = 0x2B800
jmp 0x4071ed
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 0x406926
leaq -0x2e8(%rbp), %r13
movq %r13, %rsi
callq 0x4057f8
movl %eax, -0x2c(%rbp)
movq (%r13), %rdi
leaq -0x2d8(%rbp), %rax
cmpq %rax, %rdi
je 0x407089
movq -0x2d8(%rbp), %rsi
incq %rsi
callq 0x40d0c0
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0x4070ab
movq -0xd8(%rbp), %rsi
incq %rsi
callq 0x40d0c0
cmpl $0x0, -0x2c(%rbp)
js 0x407157
leal -0x10(%r12), %eax
cmpl $0x9, %eax
ja 0x407394
leaq 0x17a31e(%rip), %rcx    # 0x5813e8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x2c(%rbp), %r15d
shll $0x8, %r15d
orl $0x20002, %r15d         # imm = 0x20002
jmp 0x4073ca
xorl %r15d, %r15d
cmpl $0x6, %r12d
sete %r15b
orl $0x3c000, %r15d         # imm = 0x3C000
jmp 0x4073d4
movb $0x1, %al
cmpl $0x3, %r12d
je 0x4071b5
cmpl $0x9, %r12d
je 0x4071ad
cmpl $0xd, %r12d
jne 0x407199
movl $0x2bc00, %r15d         # imm = 0x2BC00
jmp 0x4071ed
movb $0x1, %al
cmpl $0x3, %r12d
je 0x4071d7
cmpl $0x9, %r12d
je 0x4071cf
cmpl $0xd, %r12d
jne 0x407199
movl $0x2b400, %r15d         # imm = 0x2B400
jmp 0x4071ed
movl $0x38001, %r15d         # imm = 0x38001
jmp 0x4073d4
leaq 0x17a572(%rip), %rdx    # 0x5816d0
movl -0x34(%rbp), %esi
callq 0x405742
xorl %eax, %eax
jmp 0x4073cc
movl $0x35800, %r15d         # imm = 0x35800
jmp 0x4071ed
movl $0x31800, %r15d         # imm = 0x31800
jmp 0x4071ed
movb $0x1, %al
cmpl $0x3, %r12d
je 0x4071e7
cmpl $0x9, %r12d
je 0x4071df
cmpl $0xd, %r12d
jne 0x407199
movl $0x2b000, %r15d         # imm = 0x2B000
jmp 0x4071ed
leaq 0x17a4fe(%rip), %rdx    # 0x58169e
jmp 0x407220
movl $0x38000, %r15d         # imm = 0x38000
jmp 0x4073d4
movl $0x35c00, %r15d         # imm = 0x35C00
jmp 0x4071ed
movl $0x31c00, %r15d         # imm = 0x31C00
jmp 0x4071ed
movl $0x2a000, %r15d         # imm = 0x2A000
jmp 0x4071cb
movl $0x30000, %r15d         # imm = 0x30000
xorl %eax, %eax
jmp 0x4071ed
movl $0x35400, %r15d         # imm = 0x35400
jmp 0x4071ed
movl $0x31400, %r15d         # imm = 0x31400
jmp 0x4071ed
movl $0x35000, %r15d         # imm = 0x35000
jmp 0x4071ed
movl $0x31000, %r15d         # imm = 0x31000
cmpl $0xd, %r12d
je 0x4073d4
testb %al, %al
je 0x40722f
leaq 0x17a34e(%rip), %rsi    # 0x581550
leaq -0x268(%rbp), %rdi
callq 0x47ecc0
leaq -0xc8(%rbp), %r13
testl %eax, %eax
je 0x40722f
leaq 0x17a332(%rip), %rdx    # 0x581552
movl -0x34(%rbp), %esi
callq 0x405742
xorl %ebx, %ebx
jmp 0x4073f3
leaq -0xa8(%rbp), %rdi
movq %r13, %rsi
callq 0x47c6e0
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 0x406ab6
leaq -0xa8(%rbp), %rdi
leaq -0x58(%rbp), %rbx
movq %rbx, %rsi
callq 0x47cb00
movq (%rbx), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x4072a5
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x40d0c0
movq -0x168(%rbp), %rdi
cmpq %r14, %rdi
je 0x4072c0
movq -0x158(%rbp), %rsi
incq %rsi
callq 0x40d0c0
movq -0xa8(%rbp), %rdi
leaq 0x18aca6(%rip), %rsi    # 0x591f74
leaq -0x58(%rbp), %rdx
xorl %eax, %eax
callq 0x4d4a40
movl %eax, %ebx
cmpl $0x1, %eax
jne 0x4072e6
orl -0x58(%rbp), %r15d
jmp 0x4072f5
leaq 0x17a3d5(%rip), %rdx    # 0x5816c2
movl -0x34(%rbp), %esi
callq 0x405742
cmpl $0x1, %ebx
jne 0x407228
jmp 0x4073d4
movl -0x2c(%rbp), %r15d
shll $0x8, %r15d
orl $0x20000, %r15d         # imm = 0x20000
jmp 0x4073ca
movl -0x2c(%rbp), %r15d
shll $0x8, %r15d
orl $0x2000a, %r15d         # imm = 0x2000A
jmp 0x4073ca
movl -0x2c(%rbp), %r15d
shll $0x8, %r15d
orl $0x20006, %r15d         # imm = 0x20006
jmp 0x4073ca
movl -0x2c(%rbp), %r15d
shll $0x8, %r15d
orl $0x20007, %r15d         # imm = 0x20007
jmp 0x4073ca
movl -0x2c(%rbp), %r15d
shll $0x8, %r15d
orl $0x2000f, %r15d         # imm = 0x2000F
jmp 0x4073ca
movl -0x2c(%rbp), %r15d
shll $0x8, %r15d
orl $0x2000c, %r15d         # imm = 0x2000C
jmp 0x4073ca
movl -0x2c(%rbp), %r15d
shll $0x8, %r15d
orl $0x20004, %r15d         # imm = 0x20004
jmp 0x4073ca
movl -0x2c(%rbp), %r15d
shll $0x8, %r15d
orl $0x2000e, %r15d         # imm = 0x2000E
jmp 0x4073ca
leaq 0x17a1b5(%rip), %rsi    # 0x581550
leaq -0x268(%rbp), %rdi
callq 0x47ecc0
testl %eax, %eax
je 0x407480
leaq 0x17a19c(%rip), %rdx    # 0x581552
jmp 0x40715e
movl -0x2c(%rbp), %r15d
shll $0x8, %r15d
orl $0x20008, %r15d         # imm = 0x20008
movb $0x1, %al
testb %al, %al
je 0x407228
movq -0x60(%rbp), %rax
movq 0x80(%rax), %rdi
movb $0x1, %bl
movzwl -0x84(%rbp), %esi
movl %r15d, %edx
movl -0x34(%rbp), %ecx
callq 0x40c4c2
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x407415
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x40d0c0
leaq -0xb8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x407434
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x40d0c0
leaq -0x258(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x407453
movq -0x258(%rbp), %rsi
incq %rsi
callq 0x40d0c0
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x40746c
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x40d0c0
movl %ebx, %eax
addq $0x2c8, %rsp            # imm = 0x2C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x1a, %r12d
ja 0x407633
movl $0x4001180, %eax        # imm = 0x4001180
btl %r12d, %eax
jae 0x407633
leaq -0x58(%rbp), %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0x408edc
leaq 0x17a363(%rip), %rsi    # 0x581812
leaq -0x58(%rbp), %r13
movq %r13, %rdi
callq 0x47ecc0
movl %eax, %r14d
movq (%r13), %rdi
leaq -0x48(%rbp), %r13
cmpq %r13, %rdi
je 0x4074d7
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x40d0c0
testl %r14d, %r14d
je 0x4075aa
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 0x4069ee
movl -0x2c(%rbp), %r15d
movq -0x58(%rbp), %rdi
leaq 0x179fef(%rip), %rsi    # 0x58151a
leaq -0x30(%rbp), %rdx
xorl %eax, %eax
callq 0x4d4a40
movl %eax, %ebx
movq -0x58(%rbp), %rdi
cmpq %r13, %rdi
je 0x40754d
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x40d0c0
movq -0x148(%rbp), %rdi
cmpq %r14, %rdi
je 0x407568
movq -0x138(%rbp), %rsi
incq %rsi
callq 0x40d0c0
cmpl $0x1, %ebx
jne 0x40761d
leaq 0x17a18d(%rip), %rdx    # 0x581705
cmpl $0xb, %r12d
jg 0x4077b8
cmpl $0x7, %r12d
je 0x4078f2
cmpl $0x8, %r12d
jne 0x407624
shll $0x8, %r15d
orl -0x30(%rbp), %r15d
orl $0x4000, %r15d          # imm = 0x4000
jmp 0x407974
movq 0x10(%r15), %r13
subq 0x8(%r15), %r13
leal 0x5(%rbx), %r14d
sarq $0x5, %r13
movb $0x1, %cl
cmpq %r14, %r13
jbe 0x4075e5
leaq -0x58(%rbp), %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0x408edc
leaq 0x19c5be(%rip), %rsi    # 0x5a3b95
leaq -0x58(%rbp), %rdi
callq 0x47ecc0
testl %eax, %eax
setne %cl
cmpq %r14, %r13
jbe 0x407609
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x407609
movq -0x48(%rbp), %rsi
incq %rsi
movl %ecx, %r14d
callq 0x40d0c0
movl %r14d, %ecx
testb %cl, %cl
je 0x4076f7
leaq 0x17a0ce(%rip), %rdx    # 0x5816e6
jmp 0x40715e
leaq 0x17a003(%rip), %rdx    # 0x581627
movl -0x34(%rbp), %esi
callq 0x405742
xorl %eax, %eax
jmp 0x407a41
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 0x406926
leaq -0x2a8(%rbp), %r14
movq %r14, %rsi
callq 0x4057f8
movl %eax, %ebx
movq (%r14), %rdi
leaq -0x298(%rbp), %rax
cmpq %rax, %rdi
je 0x4076a1
movq -0x298(%rbp), %rsi
incq %rsi
callq 0x40d0c0
movq -0x128(%rbp), %rdi
cmpq %r15, %rdi
je 0x4076bc
movq -0x118(%rbp), %rsi
incq %rsi
callq 0x40d0c0
testl %ebx, %ebx
movl -0x2c(%rbp), %edx
js 0x4077e0
cmpl $0xb, %r12d
ja 0x4078c1
movl %r12d, %eax
leaq 0x179d35(%rip), %rcx    # 0x581410
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shll $0x8, %edx
shll $0x4, %ebx
orl %edx, %ebx
orl $0x19000, %ebx          # imm = 0x19000
jmp 0x407a3c
addl $0x4, %ebx
leaq -0x288(%rbp), %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x408edc
leaq -0x2c8(%rbp), %rdi
leaq -0x288(%rbp), %rdx
movq -0x60(%rbp), %rsi
callq 0x406926
leaq -0x2c8(%rbp), %r14
movq %r14, %rsi
callq 0x4057f8
movl %eax, %r15d
movq (%r14), %rdi
leaq -0x2b8(%rbp), %rax
cmpq %rax, %rdi
je 0x407752
movq -0x2b8(%rbp), %rsi
incq %rsi
callq 0x40d0c0
leaq -0x278(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x407771
movq -0x278(%rbp), %rsi
incq %rsi
callq 0x40d0c0
testl %r15d, %r15d
js 0x4078ad
leaq 0x179f84(%rip), %rdx    # 0x581705
cmpl $0xb, %r12d
jg 0x407914
cmpl $0x7, %r12d
je 0x40794a
cmpl $0x8, %r12d
jne 0x4078b4
movl -0x2c(%rbp), %eax
shll $0x8, %eax
shll $0x4, %r15d
orl %eax, %r15d
orl $0x5000, %r15d          # imm = 0x5000
jmp 0x407974
cmpl $0xc, %r12d
je 0x407903
cmpl $0x1a, %r12d
jne 0x407624
shll $0x8, %r15d
orl -0x30(%rbp), %r15d
orl $0x2e000, %r15d         # imm = 0x2E000
jmp 0x407974
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 0x4069ee
leaq -0x48(%rbp), %r15
movq -0x10(%r15), %rdi
leaq 0x179cef(%rip), %rsi    # 0x58151a
leaq -0x30(%rbp), %rdx
xorl %eax, %eax
callq 0x4d4a40
movl %eax, %ebx
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x40784d
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x40d0c0
movq -0x108(%rbp), %rdi
cmpq %r14, %rdi
je 0x407868
movq -0xf8(%rbp), %rsi
incq %rsi
callq 0x40d0c0
cmpl $0x1, %ebx
jne 0x407936
leaq 0x179ebc(%rip), %rdx    # 0x581734
cmpl $0xb, %r12d
ja 0x40797b
movl %r12d, %eax
leaq 0x179bc4(%rip), %rcx    # 0x581450
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x2c(%rbp), %r15d
shll $0x8, %r15d
orl -0x30(%rbp), %r15d
orl $0x18000, %r15d         # imm = 0x18000
jmp 0x407974
leaq 0x179e3f(%rip), %rdx    # 0x5816f3
movl -0x34(%rbp), %esi
callq 0x405742
jmp 0x40762c
addl $-0x1b, %r12d
cmpl $0x3, %r12d
ja 0x4079aa
leaq 0x179b6a(%rip), %rax    # 0x581440
movslq (%rax,%r12,4), %rcx
addq %rax, %rcx
jmpq *%rcx
shll $0x8, %edx
shll $0x4, %ebx
orl %edx, %ebx
orl $0x1d000, %ebx          # imm = 0x1D000
jmp 0x407a3c
shll $0x8, %r15d
orl -0x30(%rbp), %r15d
orl $0x6000, %r15d          # imm = 0x6000
jmp 0x407974
shll $0x8, %r15d
orl -0x30(%rbp), %r15d
orl $0x2c000, %r15d         # imm = 0x2C000
jmp 0x407974
cmpl $0xc, %r12d
je 0x407960
cmpl $0x1a, %r12d
jne 0x4078b4
movl -0x2c(%rbp), %eax
shll $0x8, %eax
shll $0x4, %r15d
orl %eax, %r15d
orl $0x2f000, %r15d         # imm = 0x2F000
jmp 0x407974
leaq 0x179cea(%rip), %rdx    # 0x581627
movl -0x34(%rbp), %esi
callq 0x405742
jmp 0x40762c
movl -0x2c(%rbp), %eax
shll $0x8, %eax
shll $0x4, %r15d
orl %eax, %r15d
orl $0x7000, %r15d          # imm = 0x7000
jmp 0x407974
movl -0x2c(%rbp), %eax
shll $0x8, %eax
shll $0x4, %r15d
orl %eax, %r15d
orl $0x2d000, %r15d         # imm = 0x2D000
movb $0x1, %al
jmp 0x407a41
addl $-0x1b, %r12d
cmpl $0x3, %r12d
ja 0x40793d
leaq 0x179af4(%rip), %rax    # 0x581480
movslq (%rax,%r12,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl -0x2c(%rbp), %r15d
shll $0x8, %r15d
orl -0x30(%rbp), %r15d
orl $0x1c000, %r15d         # imm = 0x1C000
jmp 0x407974
leaq 0x179d83(%rip), %rdx    # 0x581734
movl -0x34(%rbp), %esi
callq 0x405742
jmp 0x40762c
shll $0x8, %edx
shll $0x4, %ebx
orl %edx, %ebx
orl $0x15000, %ebx          # imm = 0x15000
jmp 0x407a3c
shll $0x8, %edx
shll $0x4, %ebx
orl %edx, %ebx
orl $0xb000, %ebx           # imm = 0xB000
jmp 0x407a3c
shll $0x8, %edx
shll $0x4, %ebx
orl %edx, %ebx
orl $0x1000, %ebx           # imm = 0x1000
jmp 0x407a3c
shll $0x8, %edx
shll $0x4, %ebx
orl %edx, %ebx
orl $0x1b000, %ebx          # imm = 0x1B000
jmp 0x407a3c
shll $0x8, %edx
shll $0x4, %ebx
orl %edx, %ebx
orl $0xd000, %ebx           # imm = 0xD000
jmp 0x407a3c
shll $0x8, %edx
shll $0x4, %ebx
orl %edx, %ebx
orl $0x13000, %ebx          # imm = 0x13000
jmp 0x407a3c
shll $0x8, %edx
shll $0x4, %ebx
orl %edx, %ebx
orl $0xf000, %ebx           # imm = 0xF000
jmp 0x407a3c
shll $0x8, %edx
shll $0x4, %ebx
orl %edx, %ebx
orl $0x1f000, %ebx          # imm = 0x1F000
movb $0x1, %al
movl %ebx, %r15d
testb %al, %al
jne 0x4073ca
xorl %eax, %eax
jmp 0x4073cc
movl -0x2c(%rbp), %r15d
shll $0x8, %r15d
orl -0x30(%rbp), %r15d
orl $0x14000, %r15d         # imm = 0x14000
jmp 0x407974
movl -0x2c(%rbp), %r15d
shll $0x8, %r15d
orl -0x30(%rbp), %r15d
orl $0xa000, %r15d          # imm = 0xA000
jmp 0x407974
movl -0x2c(%rbp), %r15d
shll $0x8, %r15d
orl -0x30(%rbp), %r15d
jmp 0x407974
movl -0x2c(%rbp), %r15d
shll $0x8, %r15d
orl -0x30(%rbp), %r15d
orl $0x1a000, %r15d         # imm = 0x1A000
jmp 0x407974
movl -0x2c(%rbp), %r15d
shll $0x8, %r15d
orl -0x30(%rbp), %r15d
orl $0xc000, %r15d          # imm = 0xC000
jmp 0x407974
movl -0x2c(%rbp), %r15d
shll $0x8, %r15d
orl -0x30(%rbp), %r15d
orl $0x12000, %r15d         # imm = 0x12000
jmp 0x407974
movl -0x2c(%rbp), %r15d
shll $0x8, %r15d
orl -0x30(%rbp), %r15d
orl $0xe000, %r15d          # imm = 0xE000
jmp 0x407974
movl -0x2c(%rbp), %r15d
shll $0x8, %r15d
orl -0x30(%rbp), %r15d
orl $0x1e000, %r15d         # imm = 0x1E000
jmp 0x407974
jmp 0x407ce2
movq %rax, %rbx
movq -0x108(%rbp), %rdi
cmpq %r14, %rdi
je 0x407ce5
movq -0xf8(%rbp), %rsi
jmp 0x407ccc
jmp 0x407ce2
movq %rax, %rbx
leaq -0x278(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x407ce5
movq -0x278(%rbp), %rsi
jmp 0x407ccc
jmp 0x407ce2
movq %rax, %rbx
movq -0x128(%rbp), %rdi
cmpq %r15, %rdi
je 0x407ce5
movq -0x118(%rbp), %rsi
jmp 0x407ccc
jmp 0x407ce2
jmp 0x407ce2
jmp 0x407ce2
movq %rax, %rbx
movq -0x148(%rbp), %rdi
cmpq %r14, %rdi
je 0x407ce5
movq -0x138(%rbp), %rsi
jmp 0x407ccc
jmp 0x407ce2
jmp 0x407ce2
jmp 0x407ce2
movq %rax, %rbx
movq -0x208(%rbp), %rdi
cmpq %r12, %rdi
je 0x407ce5
movq -0x1f8(%rbp), %rsi
jmp 0x407ccc
jmp 0x407ce2
movq %rax, %rbx
movq -0x188(%rbp), %rdi
cmpq %r15, %rdi
je 0x407ce5
movq -0x178(%rbp), %rsi
jmp 0x407ccc
jmp 0x407ce2
movq %rax, %rbx
movq -0x168(%rbp), %rdi
cmpq %r14, %rdi
je 0x407ce5
movq -0x158(%rbp), %rsi
jmp 0x407ccc
jmp 0x407ce2
movq %rax, %rbx
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0x407ce5
movq -0xd8(%rbp), %rsi
jmp 0x407ccc
movq %rax, %rbx
movq -0x228(%rbp), %rdi
cmpq %r12, %rdi
je 0x407ce5
movq -0x218(%rbp), %rsi
jmp 0x407ccc
jmp 0x407ce2
movq %rax, %rbx
movq -0x1a8(%rbp), %rdi
cmpq %r15, %rdi
je 0x407ce5
movq -0x198(%rbp), %rsi
jmp 0x407ccc
jmp 0x407ce2
jmp 0x407ce2
movq %rax, %rbx
movq -0x1c8(%rbp), %rdi
cmpq %r15, %rdi
je 0x407ce5
movq -0x1b8(%rbp), %rsi
jmp 0x407ccc
jmp 0x407ce2
movq %rax, %rbx
movq -0x248(%rbp), %rdi
cmpq %r15, %rdi
je 0x407ce5
movq -0x238(%rbp), %rsi
jmp 0x407ccc
jmp 0x407ce2
movq %rax, %rbx
movq -0x1e8(%rbp), %rdi
cmpq %r15, %rdi
je 0x407ce5
movq -0x1d8(%rbp), %rsi
incq %rsi
callq 0x40d0c0
jmp 0x407ce5
jmp 0x407ce2
movq %rax, %rbx
jmp 0x407d26
movq %rax, %rbx
jmp 0x407d45
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x407d07
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x40d0c0
leaq -0xb8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x407d26
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x40d0c0
leaq -0x258(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x407d45
movq -0x258(%rbp), %rsi
incq %rsi
callq 0x40d0c0
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x407d5e
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x40d0c0
movq %rbx, %rdi
callq 0x4ad960