// File: /workspace/github_cpp_makefile_star2_O2/stacksmith[P]picoasm/cpicoblaze.cpp
// Function: CCode::Disassemble(unsigned int)
CInstruction * CCode::Disassemble( uint32_t code )
{
	uint32_t code_17_0  = (code & 0x3ffff) ;
	uint32_t code_17_12 = (code & 0x3f000) ;
	uint32_t code_17_10 = (code & 0x3fC00) ;
	uint32_t code_7_0   = (code & 0x000ff) ;

	switch( code_17_0 ) {
	case instrRETURN            : return new RETURN( m_cpu, code ) ;
	case instrRETURNC           : return new RETURNC( m_cpu, code ) ;
	case instrRETURNNC          : return new RETURNNC( m_cpu, code ) ;
	case instrRETURNNZ          : return new RETURNNZ( m_cpu, code ) ;
	case instrRETURNZ           : return new RETURNZ( m_cpu, code ) ;
	case instrRETURNI_DISABLE   : return new RETURNI_DISABLE( m_cpu, code ) ;
	case instrRETURNI_ENABLE    : return new RETURNI_ENABLE( m_cpu, code ) ;
	case instrDISABLE_INTERRUPT : return new DISABLE_INTERRUPT( m_cpu, code ) ;
	case instrENABLE_INTERRUPT  : return new ENABLE_INTERRUPT( m_cpu, code ) ;
	default:
		switch( code_17_10 ) {
		case instrCALL   : return new CALL( m_cpu, code ) ;
		case instrCALLC  : return new CALLC( m_cpu, code ) ;
		case instrCALLNC : return new CALLNC( m_cpu, code ) ;
		case instrCALLNZ : return new CALLNZ( m_cpu, code ) ;
		case instrCALLZ  : return new CALLZ( m_cpu, code ) ;
		case instrJUMP   : return new JUMP( m_cpu, code ) ;
		case instrJUMPC  : return new JUMPC( m_cpu, code ) ;
		case instrJUMPNC : return new JUMPNC( m_cpu, code ) ;
		case instrJUMPNZ : return new JUMPNZ( m_cpu, code ) ;
		case instrJUMPZ  : return new JUMPZ( m_cpu, code ) ;
		default:
			switch ( code_17_12 ) {
			case instrADD_SX_KK     : return new ADD_SX_KK( m_cpu, code ) ;
			case instrADD_SX_SY     : return new ADD_SX_SY( m_cpu, code ) ;
			case instrADDCY_SX_KK   : return new ADDCY_SX_KK( m_cpu, code ) ;
			case instrADDCY_SX_SY   : return new ADDCY_SX_SY( m_cpu, code ) ;
			case instrAND_SX_KK     : return new AND_SX_KK( m_cpu, code ) ;
			case instrAND_SX_SY     : return new AND_SX_SY( m_cpu, code ) ;
			case instrCOMPARE_SX_KK : return new COMPARE_SX_KK( m_cpu, code ) ;
			case instrCOMPARE_SX_SY : return new COMPARE_SX_SY( m_cpu, code ) ;
			case instrFETCH_SX_SS   : return new FETCH_SX_SS( m_cpu, code ) ;
			case instrFETCH_SX_SY   : return new FETCH_SX_SY( m_cpu, code ) ;
			case instrINPUT_SX_SY   : return new INPUT_SX_SY( m_cpu, code ) ;
			case instrINPUT_SX_PP   : return new INPUT_SX_PP( m_cpu, code ) ;
			case instrLOAD_SX_KK    : return new LOAD_SX_KK( m_cpu, code ) ;
			case instrLOAD_SX_SY    : return new LOAD_SX_SY( m_cpu, code ) ;
			case instrOR_SX_KK      : return new OR_SX_KK( m_cpu, code ) ;
			case instrOR_SX_SY      : return new OR_SX_SY( m_cpu, code ) ;
			case instrOUTPUT_SX_SY  : return new OUTPUT_SX_SY( m_cpu, code ) ;
			case instrOUTPUT_SX_PP  : return new OUTPUT_SX_PP( m_cpu, code ) ;
			case instrSTORE_SX_SS   : return new STORE_SX_SS( m_cpu, code ) ;	  
			case instrSTORE_SX_SY   : return new STORE_SX_SY( m_cpu, code ) ;	  
			case instrSUB_SX_KK     : return new SUB_SX_KK( m_cpu, code ) ;	  
			case instrSUB_SX_SY     : return new SUB_SX_SY( m_cpu, code ) ;	  
			case instrSUBCY_SX_KK   : return new SUBCY_SX_KK( m_cpu, code ) ;	  
			case instrSUBCY_SX_SY   : return new SUBCY_SX_SY( m_cpu, code ) ;	  
			case instrTEST_SX_KK    : return new TEST_SX_KK( m_cpu, code ) ;	  
			case instrTEST_SX_SY    : return new TEST_SX_SY( m_cpu, code ) ;	  
			case instrXOR_SX_KK		: return new XOR_SX_KK( m_cpu, code ) ;
			case instrXOR_SX_SY		: return new XOR_SX_SY( m_cpu, code ) ;
			
			case instrROTATE:
				switch( code_7_0 ) {
				case instrRL_SX  : return new RL_SX( m_cpu, code ) ;
				case instrRR_SX  : return new RR_SX( m_cpu, code ) ;
				case instrSL0_SX : return new SL0_SX( m_cpu, code ) ;
				case instrSL1_SX : return new SL1_SX( m_cpu, code ) ;
				case instrSLA_SX : return new SLA_SX( m_cpu, code ) ;
				case instrSLX_SX : return new SLX_SX( m_cpu, code ) ;
				case instrSR0_SX : return new SR0_SX( m_cpu, code ) ;
				case instrSR1_SX : return new SR1_SX( m_cpu, code ) ;
				case instrSRA_SX : return new SRA_SX( m_cpu, code ) ;
				case instrSRX_SX : return new SRX_SX( m_cpu, code ) ;
				}
			}
		}
	}

	cout << "Invalid code (" << code << endl ;
	
	return NULL ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %r15
movl %esi, %eax
andl $0x3ffff, %eax          # imm = 0x3FFFF
cmpl $0x3c001, %eax          # imm = 0x3C001
je 0x40a64a
cmpl $0x2b000, %eax          # imm = 0x2B000
je 0x40a6b6
cmpl $0x2b400, %eax          # imm = 0x2B400
je 0x40a69b
cmpl $0x2b800, %eax          # imm = 0x2B800
je 0x40a5f0
cmpl $0x2bc00, %eax          # imm = 0x2BC00
je 0x40a62c
cmpl $0x38000, %eax          # imm = 0x38000
je 0x40a680
cmpl $0x38001, %eax          # imm = 0x38001
je 0x40a665
cmpl $0x3c000, %eax          # imm = 0x3C000
je 0x40a60e
cmpl $0x2a000, %eax          # imm = 0x2A000
jne 0x40a6dd
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b3b0
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b3d4
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b4ac
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b3f8
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b4d0
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b488
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b464
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b41c
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b440
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %r14d, %eax
andl $0x3fc00, %eax          # imm = 0x3FC00
addl $0xfffd0000, %eax       # imm = 0xFFFD0000
shrl $0xa, %eax
cmpl $0x17, %eax
ja 0x40a7b4
leaq 0x17754f(%rip), %rcx    # 0x581c4c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b4f4
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b560
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b5a8
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b584
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b638
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b614
jmp 0x40a6cf
movl %r14d, %eax
shrl $0xc, %eax
andl $0x3f, %eax
cmpl $0x2f, %eax
ja 0x40aa2a
leaq 0x1774df(%rip), %rcx    # 0x581cac
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b80c
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b518
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b53c
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b5f0
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b5cc
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b6a4
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b950
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b9e0
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b8c0
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b998
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40ba04
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b908
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b974
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b9bc
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b6c8
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b7e8
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b7a0
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40ba28
jmp 0x40a6cf
cmpb $0xf, %r14b
ja 0x40aa2a
movzbl %r14b, %eax
leaq 0x177369(%rip), %rcx    # 0x581d6c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40badc
jmp 0x40a6cf
movq $0x5f5580, %rdi         # imm = 0x5F5580
leaq 0x1773a5(%rip), %rsi    # 0x581ddd
callq 0x4755f0
movl %r14d, %esi
movq %rax, %rdi
callq 0x4759c0
movq %rax, %rdi
callq 0x474ed0
xorl %ebx, %ebx
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b830
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b6ec
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b710
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b734
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b758
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b7c4
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b77c
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b878
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b854
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b680
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b65c
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b92c
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b8e4
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40b89c
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40bb00
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40bb6c
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40ba4c
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40bb90
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40ba70
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40ba94
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40bab8
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40bb48
jmp 0x40a6cf
pushq $0x28
popq %rdi
callq 0x40ce70
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x40bb24
jmp 0x40a6cf
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
jmp 0x40ad79
movq %rax, %r14
pushq $0x28
popq %rsi
movq %rbx, %rdi
callq 0x40bfd0
movq %r14, %rdi
callq 0x4ad3d0
nop