// File: exrd[P]neteruhsp/neteruhsp/neteruhsp.cc
// Function: neteruhsp::dump_code(neteruhsp::code_container_t const*)::_::dump(int, int const*, int)
static int dump( int indent, const code_t* codes, int pc )
		{
			for( int i=0; i<indent; ++i )
			{ printf( "  " ); }
			static const char* opnames[] =
			{
				"NOP",

				"PUSH_INT",
				"PUSH_DOUBLE",
				"PUSH_STRING",
				"PUSH_VARIABLE",
				"PUSH_SYSVAR",

				"ASSIGN",
				"ADD_ASSIGN",
				"SUB_ASSIGN",
				"MUL_ASSIGN",
				"DIV_ASSIGN",
				"MOD_ASSIGN",
				"BOR_ASSIGN",
				"BAND_ASSIGN",
				"BXOR_ASSIGN",

				"BOR",
				"BAND",
				"BXOR",

				"EQ",
				"NEQ",
				"GT",
				"GTOE",
				"LT",
				"LTOE",

				"ADD",
				"SUB",
				"MUL",
				"DIV",
				"MOD",

				"UNARY_MINUS",

				"IF",

				"REPEAT",
				"REPEAT_CHECK",
				"LOOP",
				"CONTINUE",
				"BREAK",

				"LABEL",

				"GOSUB",
				"GOTO",

				"COMMAND",
				"FUNCTION",

				"JUMP",
				"JUMP_RELATIVE",
				"RETURN",
				"END",
			};
			static_assert( sizeof(opnames) /sizeof(*opnames) == MAX_OPERATOR, "opnames size is not match with MAX_OPERATOR" );

			const auto op = codes[ pc ];
			assert( op>=0 && op<MAX_OPERATOR );
			printf( "%04d: %s[%d] ", pc, opnames[op], op );

			int offset =0;
			switch( op )
			{
				case OPERATOR_NOP:
					break;

				case OPERATOR_PUSH_INT:
					printf( ": VAL[%d]", codes[ pc +1 ] );
					++offset;
					break;

				case OPERATOR_PUSH_DOUBLE:
				{
					double v =0.0;
					const auto stride = code_get_block( v, codes, pc +1 );
					printf( ": VAL[%lf]", v );
					offset += stride;
					break;
				}

				case OPERATOR_PUSH_STRING:
				{
					const char* v =nullptr;
					const auto stride = code_get_block( v, codes, pc +1 );
					printf( ": VAL[%s]", v );
					offset += stride;
					break;
				}

				case OPERATOR_PUSH_VARIABLE:
				{
					variable_t* var =nullptr;
					const auto stride = code_get_block( var, codes, pc +1 );
					printf( ": VAR[%p=%s]", var, var->name_ );
					offset += stride;
					break;
				}

				case OPERATOR_PUSH_SYSVAR:
				{
					const auto sysvar = codes[ pc +1 ];
					printf( ": VAL[%d]", sysvar );
					++offset;
					break;
				}

				case OPERATOR_ASSIGN:
				case OPERATOR_ADD_ASSIGN:
				case OPERATOR_SUB_ASSIGN:
				case OPERATOR_MUL_ASSIGN:
				case OPERATOR_DIV_ASSIGN:
				case OPERATOR_MOD_ASSIGN:
				case OPERATOR_BOR_ASSIGN:
				case OPERATOR_BAND_ASSIGN:
				case OPERATOR_BXOR_ASSIGN:
					break;

				case OPERATOR_BOR:
				case OPERATOR_BAND:
				case OPERATOR_BXOR:
				case OPERATOR_EQ:
				case OPERATOR_NEQ:
				case OPERATOR_GT:
				case OPERATOR_GTOE:
				case OPERATOR_LT:
				case OPERATOR_LTOE:
				case OPERATOR_ADD:
				case OPERATOR_SUB:
				case OPERATOR_MUL:
				case OPERATOR_DIV:
				case OPERATOR_MOD:
					break;

				case OPERATOR_UNARY_MINUS:
					break;

				case OPERATOR_IF:
				{
					const auto false_head = codes[ pc +1 ];
					printf( ": FALSE[%d]", false_head );
					++offset;
					break;
				}

				case OPERATOR_REPEAT:
				{
					const auto end_position = codes[ pc +1 ];
					printf( ": END[%d]", end_position );
					++offset;
					break;
				}
				case OPERATOR_REPEAT_CHECK:
					break;

				case OPERATOR_LOOP:
				case OPERATOR_CONTINUE:
				case OPERATOR_BREAK:
					break;

				case OPERATOR_LABEL:
					break;

				case OPERATOR_GOSUB:
				case OPERATOR_GOTO:
				{
					label_node_t* label =nullptr;
					const auto stride = code_get_block( label, codes, pc +1 );
					assert( label != nullptr );
					printf( ": LABEL[%p=%s] POS[%d]", label, label->name_, label->position_ );
					offset += stride;
					break;
				}

				case OPERATOR_COMMAND:
				{
					const auto command = codes[ pc +1 ];
					assert( command >= 0 );
					const auto arg_num = codes[ pc +2 ];
					printf( ": COMMAND[%d] ARG[%d]", command, arg_num );
					offset += 2;
					break;
				}
				case OPERATOR_FUNCTION:
				{
					const auto function = codes[ pc +1 ];
					assert( function >= 0 );
					const auto arg_num = codes[ pc +2 ];
					printf( ": FUNCTION[%d] ARG[%d]", function, arg_num );
					offset += 2;
					break;
				}

				case OPERATOR_JUMP:
					printf( ": POS[%d]", codes[ pc +1 ] );
					++offset;
					break;
				case OPERATOR_JUMP_RELATIVE:
					printf( ": OFFSET[%d]", codes[ pc +1 ] );
					++offset;
					break;
				case OPERATOR_RETURN:
				{
					printf( ": ARG[%d]", codes[ pc +1 ] );
					++offset;
					break;
				}

				case OPERATOR_END:
					break;
			}
			printf( "\n" );
			return offset;
		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x10e7d
leaq 0x64f7(%rip), %rdi      # 0x17362
movb $0x0, %al
callq 0x3050
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x10e5c
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x1c(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x1c(%rbp)
movb %al, -0x75(%rbp)
jl 0x10ea0
cmpl $0x2d, -0x1c(%rbp)
setl %al
movb %al, -0x75(%rbp)
movb -0x75(%rbp), %al
testb $0x1, %al
jne 0x10ea9
jmp 0x10eab
jmp 0x10eca
leaq 0x66b7(%rip), %rdi      # 0x17569
leaq 0x1b98(%rip), %rsi      # 0x12a51
movl $0x1911, %edx           # imm = 0x1911
leaq 0x66bd(%rip), %rcx      # 0x17582
callq 0x30f0
movl -0x14(%rbp), %esi
movslq -0x1c(%rbp), %rdx
movl %edx, %ecx
leaq 0xb3e6(%rip), %rax      # 0x1c2c0
movq (%rax,%rdx,8), %rdx
leaq 0x66fa(%rip), %rdi      # 0x175df
xorl %eax, %eax
callq 0x3050
movl $0x0, -0x20(%rbp)
movl -0x1c(%rbp), %eax
movq %rax, -0x80(%rbp)
subq $0x2c, %rax
ja 0x1128b
movq -0x80(%rbp), %rax
leaq 0x1a55(%rip), %rcx      # 0x12964
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x1128b
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %esi
leaq 0x66b9(%rip), %rdi      # 0x175ed
movb $0x0, %al
callq 0x3050
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1128b
xorps %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
addl $0x1, %edx
leaq -0x28(%rbp), %rdi
callq 0xd600
movl %eax, -0x2c(%rbp)
movsd -0x28(%rbp), %xmm0
leaq 0x6684(%rip), %rdi      # 0x175f7
movb $0x1, %al
callq 0x3050
movl -0x2c(%rbp), %eax
addl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
jmp 0x1128b
movq $0x0, -0x38(%rbp)
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
addl $0x1, %edx
leaq -0x38(%rbp), %rdi
callq 0xd640
movl %eax, -0x3c(%rbp)
movq -0x38(%rbp), %rsi
leaq 0x6651(%rip), %rdi      # 0x17602
movb $0x0, %al
callq 0x3050
movl -0x3c(%rbp), %eax
addl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
jmp 0x1128b
movq $0x0, -0x48(%rbp)
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
addl $0x1, %edx
leaq -0x48(%rbp), %rdi
callq 0xd680
movl %eax, -0x4c(%rbp)
movq -0x48(%rbp), %rsi
movq -0x48(%rbp), %rax
movq (%rax), %rdx
leaq 0x6616(%rip), %rdi      # 0x1760c
movb $0x0, %al
callq 0x3050
movl -0x4c(%rbp), %eax
addl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
jmp 0x1128b
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %esi
leaq 0x65c5(%rip), %rdi      # 0x175ed
movb $0x0, %al
callq 0x3050
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1128b
jmp 0x1128b
jmp 0x1128b
jmp 0x1128b
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %esi
leaq 0x65b0(%rip), %rdi      # 0x17619
movb $0x0, %al
callq 0x3050
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1128b
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %esi
leaq 0x658a(%rip), %rdi      # 0x17625
movb $0x0, %al
callq 0x3050
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1128b
jmp 0x1128b
jmp 0x1128b
jmp 0x1128b
movq $0x0, -0x60(%rbp)
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
addl $0x1, %edx
leaq -0x60(%rbp), %rdi
callq 0xd6c0
movl %eax, -0x64(%rbp)
cmpq $0x0, -0x60(%rbp)
je 0x110e6
jmp 0x11105
leaq 0x4b05(%rip), %rdi      # 0x15bf2
leaq 0x195d(%rip), %rsi      # 0x12a51
movl $0x197f, %edx           # imm = 0x197F
leaq 0x6482(%rip), %rcx      # 0x17582
callq 0x30f0
movq -0x60(%rbp), %rsi
movq -0x60(%rbp), %rax
movq (%rax), %rdx
movq -0x60(%rbp), %rax
movl 0x8(%rax), %ecx
leaq 0x6511(%rip), %rdi      # 0x1762f
movb $0x0, %al
callq 0x3050
movl -0x64(%rbp), %eax
addl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
jmp 0x1128b
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x68(%rbp)
cmpl $0x0, -0x68(%rbp)
jl 0x1114e
jmp 0x1116d
leaq 0x4aae(%rip), %rdi      # 0x15c03
leaq 0x18f5(%rip), %rsi      # 0x12a51
movl $0x1988, %edx           # imm = 0x1988
leaq 0x641a(%rip), %rcx      # 0x17582
callq 0x30f0
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x6c(%rbp)
movl -0x68(%rbp), %esi
movl -0x6c(%rbp), %edx
leaq 0x64b9(%rip), %rdi      # 0x17646
movb $0x0, %al
callq 0x3050
movl -0x20(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x20(%rbp)
jmp 0x1128b
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x70(%rbp)
cmpl $0x0, -0x70(%rbp)
jl 0x111bd
jmp 0x111dc
leaq 0x4a80(%rip), %rdi      # 0x15c44
leaq 0x1886(%rip), %rsi      # 0x12a51
movl $0x1991, %edx           # imm = 0x1991
leaq 0x63ab(%rip), %rcx      # 0x17582
callq 0x30f0
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x74(%rbp)
movl -0x70(%rbp), %esi
movl -0x74(%rbp), %edx
leaq 0x6460(%rip), %rdi      # 0x1765c
movb $0x0, %al
callq 0x3050
movl -0x20(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x20(%rbp)
jmp 0x1128b
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %esi
leaq 0x644e(%rip), %rdi      # 0x17673
movb $0x0, %al
callq 0x3050
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1128b
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %esi
leaq 0x642f(%rip), %rdi      # 0x1767d
movb $0x0, %al
callq 0x3050
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1128b
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %esi
leaq 0x6413(%rip), %rdi      # 0x1768a
movb $0x0, %al
callq 0x3050
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1128b
jmp 0x1128b
leaq 0x4c99(%rip), %rdi      # 0x15f2b
movb $0x0, %al
callq 0x3050
movl -0x20(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)