// File: exrd[P]neteruhsp/neteruhsp/neteruhsp.cc
// Function: neteruhsp::execute_inner(neteruhsp::execute_environment_t*, neteruhsp::execute_status_t*)
void execute_inner( execute_environment_t* e, execute_status_t* s )
{
	const code_t* codes =e->execute_code_->code_;
	const auto code_size = static_cast<int>(e->execute_code_->code_size_);

	auto& pc = s->pc_;

	for( ; ; )
	{

		// もう実行おわってる
		if ( s->is_end_ )
		{ break; }

		// 末尾に到達してる
		if ( code_size <= pc )
		{ break; }

		const auto op = codes[ pc ];
		switch( op )
		{
			case OPERATOR_NOP:
				break;

			case OPERATOR_PUSH_INT:
				stack_push( s->stack_, create_value( codes[ pc +1 ] ) );
				++pc;
				break;

			case OPERATOR_PUSH_DOUBLE:
			{
				double v =0.0;
				const auto stride = code_get_block( v, codes, pc +1 );
				stack_push( s->stack_, create_value( v ) );
				pc += stride;
				break;
			}

			case OPERATOR_PUSH_STRING:
			{
				const char* v =nullptr;
				const auto stride = code_get_block( v, codes, pc +1 );
				stack_push( s->stack_, create_value( v ) );
				pc += stride;
				break;
			}

			case OPERATOR_PUSH_VARIABLE:
			{
				variable_t* var =nullptr;
				const auto stride = code_get_block( var, codes, pc +1 );

				assert( s->stack_->top_ >= 1 );
				const auto i = stack_peek( s->stack_ );
				const auto idx = value_calc_int( *i );
				stack_pop( s->stack_, 1 );
				stack_push( s->stack_, create_value( var, idx ) );

				pc += stride;
				break;
			}

			case OPERATOR_PUSH_SYSVAR:
			{
				const auto sysvar = codes[ pc +1 ];
				switch( sysvar )
				{
					case SYSVAR_CNT:
						if ( s->current_loop_frame_ <= 0 )
						{
							raise_error( "システム変数cnt：repeat-loop中でないのに参照しました" );
						}
						stack_push( s->stack_, create_value( s->loop_frame_[s->current_loop_frame_ -1].cnt_ ) );
						break;
					case SYSVAR_STAT:
						stack_push( s->stack_, create_value( s->stat_ ) );
						break;
					case SYSVAR_REFDVAL:
						stack_push( s->stack_, create_value( s->refdval_ ) );
						break;
					case SYSVAR_REFSTR:
						stack_push( s->stack_, create_value( s->refstr_ ) );
						break;
					case SYSVAR_STRSIZE:
						stack_push( s->stack_, create_value( s->strsize_ ) );
						break;
					case SYSVAR_LOOPLEV:
						stack_push( s->stack_, create_value( s->current_loop_frame_ ) );
						break;
					default:
						assert( false );
						stack_push( s->stack_, create_value( 0 ) );
						break;
				}
				++pc;
				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:
			{
				assert( s->stack_->top_ >= 2 );

				const auto var =stack_peek( s->stack_, -2 );
				if ( var->type_ != VALUE_VARIABLE )
				{
					raise_error( "変数代入：代入先が変数ではありませんでした" );
				}

				const auto v =stack_peek( s->stack_, -1 );
				value_isolate( *v );
				auto* t = ( op == OPERATOR_ASSIGN ? nullptr : value_convert_type( value_get_primitive_tag( *var ), *v ) );
				switch( op )
				{
				case OPERATOR_ASSIGN:		variable_set( var->variable_, *v, var->index_ ); break;
				case OPERATOR_ADD_ASSIGN:	variable_add( var->variable_, *t, var->index_ ); break;
				case OPERATOR_SUB_ASSIGN:	variable_sub( var->variable_, *t, var->index_ ); break;
				case OPERATOR_MUL_ASSIGN:	variable_mul( var->variable_, *t, var->index_ ); break;
				case OPERATOR_DIV_ASSIGN:	variable_div( var->variable_, *t, var->index_ ); break;
				case OPERATOR_MOD_ASSIGN:	variable_mod( var->variable_, *t, var->index_ ); break;
				case OPERATOR_BOR_ASSIGN:	variable_bor( var->variable_, *t, var->index_ ); break;
				case OPERATOR_BAND_ASSIGN:	variable_band( var->variable_, *t, var->index_ ); break;
				case OPERATOR_BXOR_ASSIGN:	variable_bxor( var->variable_, *t, var->index_ ); break;
				default: assert( false ); break;
				}
				if ( t != nullptr )
				{
					destroy_value( t );
					t = nullptr;
				}
				stack_pop( s->stack_, 2 );
				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:
			{
				assert( s->stack_->top_ >= 2 );
				value_t* l =stack_peek( s->stack_, -2 );
				value_t* r =stack_peek( s->stack_, -1 );
				value_isolate( *l );

				switch( op )
				{
					case OPERATOR_BOR:		value_bor( l, *r ); break;
					case OPERATOR_BAND:		value_band( l, *r ); break;
					case OPERATOR_BXOR:		value_bxor( l, *r ); break;
					case OPERATOR_EQ:		value_eq( l, *r ); break;
					case OPERATOR_NEQ:		value_neq( l, *r ); break;
					case OPERATOR_GT:		value_gt( l, *r ); break;
					case OPERATOR_GTOE:		value_gtoe( l, *r ); break;
					case OPERATOR_LT:		value_lt( l, *r ); break;
					case OPERATOR_LTOE:		value_ltoe( l, *r ); break;
					case OPERATOR_ADD:		value_add( l, *r ); break;
					case OPERATOR_SUB:		value_sub( l, *r ); break;
					case OPERATOR_MUL:		value_mul( l, *r ); break;
					case OPERATOR_DIV:		value_div( l, *r ); break;
					case OPERATOR_MOD:		value_mod( l, *r ); break;
					default: assert( false ); break;
				}
				stack_pop( s->stack_ );
				break;
			}

			case OPERATOR_UNARY_MINUS:
			{
				assert( s->stack_->top_ >= 1 );
				value_t* v =stack_peek( s->stack_ );
				value_isolate( *v );
				value_unary_minus( v );
				break;
			}

			case OPERATOR_IF:
			{
				const auto cond = stack_peek( s->stack_ );
				const auto is_cond = value_calc_boolean( *cond );
				stack_pop( s->stack_ );
				if ( is_cond )
				{
					++pc;
				}
				else
				{
					const auto false_head = codes[ pc +1 ];
					pc += false_head -1;
				}
				break;
			}

			case OPERATOR_REPEAT:
			{
				if ( s->current_loop_frame_ +1 >= MAX_LOOP_FRAME )
				{
					raise_error( "repeat：ネストが深すぎます" );
				}

				const auto end_position = codes[ pc +1 ];

				auto& frame = s->loop_frame_[s->current_loop_frame_];
				++s->current_loop_frame_;
				frame.start_position_ = pc +2;
				frame.end_position_ = end_position;
				frame.cnt_ = 0;
				frame.counter_ = 0;
				frame.max_ = 0;

				int loop_num =-1;
				const auto v = stack_peek( s->stack_ );
				loop_num = value_calc_int( *v );
				stack_pop( s->stack_ );

				frame.max_ = loop_num;
				++pc;
				break;
			}
			case OPERATOR_REPEAT_CHECK:
			{
				assert( s->current_loop_frame_ > 0 );
				auto& frame = s->loop_frame_[ s->current_loop_frame_ -1 ];
				if ( frame.max_>=0 && frame.counter_>=frame.max_ )
				{
					pc = frame.end_position_;
					--s->current_loop_frame_;
				}
				break;
			}

			case OPERATOR_LOOP:
			case OPERATOR_CONTINUE:
			{
				if ( s->current_loop_frame_ <= 0 )
				{
					raise_error( "loop,continue：repeat-loopの中にありません" );
				}

				auto& frame = s->loop_frame_[ s->current_loop_frame_ -1 ];
				++frame.counter_;
				++frame.cnt_;
				pc = frame.start_position_ -1;
				break;
			}
			case OPERATOR_BREAK:
			{
				if ( s->current_loop_frame_ <= 0 )
				{
					raise_error( "break：repeat-loopの中にありません" );
				}

				auto& frame = s->loop_frame_[ s->current_loop_frame_ -1 ];
				pc = frame.end_position_;

				--s->current_loop_frame_;
				break;
			}

			case OPERATOR_LABEL:
				break;

			case OPERATOR_GOSUB:
			{
				if ( (s->current_call_frame_ +1) >= MAX_CALL_FRAME )
				{
					raise_error( "gosub：ネストが深すぎます" );
				}

				label_node_t* label =nullptr;
				const auto stride = code_get_block( label, codes, pc +1 );
				assert( label != nullptr );

				auto& frame = s->call_frame_[s->current_call_frame_];
				++s->current_call_frame_;
				frame.caller_poisition_ = pc +stride;

				pc = label->position_ -1;
				break;
			}
			case OPERATOR_GOTO:
			{
				label_node_t* label =nullptr;
				code_get_block( label, codes, pc +1 );
				assert( label != nullptr );
				pc = label->position_ -1;
				break;
			}

			case OPERATOR_COMMAND:
			{
				const auto command = codes[ pc +1 ];
				assert( command >= 0 );
				const auto arg_num = codes[ pc +2 ];

					// コマンド呼び出し
				const auto delegate = get_command_delegate( static_cast<builtin_command_tag>( command ) );
				assert( delegate != nullptr );
				const auto top = s->stack_->top_;
				delegate( e, s, arg_num );
				assert( s->stack_->top_ == top -arg_num );// 戻り値がないことを確認

				pc += 2;
				break;
			}
			case OPERATOR_FUNCTION:
			{
				const auto function = codes[ pc +1 ];
				assert( function >= 0 );
				const auto arg_num = codes[ pc +2 ];

					// 関数呼び出し
				const auto delegate = get_function_delegate( static_cast<builtin_function_tag>( function ) );
				assert( delegate != nullptr );
				const auto top = s->stack_->top_;
				delegate( e, s, arg_num );
				assert( s->stack_->top_ == top -arg_num +1 );// 戻り値が入っていることを確認する

				 pc += 2;
				break;
			}

			case OPERATOR_JUMP:
			{
				pc = codes[ pc +1 ] -1;
				break;
			}
			case OPERATOR_JUMP_RELATIVE:
			{
				pc += codes[ pc +1 ] -1;
				break;
			}
			case OPERATOR_RETURN:
			{
				if ( s->current_call_frame_ <= 0 )
				{
					raise_error( "サブルーチン外からのreturnは無効です" );
				}

				const auto arg_num = codes[ pc +1 ];
				if ( arg_num > 0 )
				{
					assert( arg_num == 1 );
					const auto res = stack_peek( s->stack_ );
					switch( value_get_primitive_tag(*res) )
					{
						case VALUE_INT:		s->stat_ = value_calc_int(*res); break;
						case VALUE_DOUBLE:	s->refdval_ = value_calc_double(*res); break;
						case VALUE_STRING:	destroy_string( s->refstr_ ); s->refstr_ = value_calc_string(*res); break;
						default: assert( false ); break;
					}
					stack_pop( s->stack_ );
				}

				--s->current_call_frame_;
				const auto& frame =s->call_frame_[ s->current_call_frame_ ];
				pc = frame.caller_poisition_;
				break;
			}

			case OPERATOR_END:
				s->is_end_ =true;
				break;

			default: assert( false ); break;
		}

		++pc;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rax), %rax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
testb $0x1, 0x194(%rax)
je 0xc4ff
jmp 0xd5ed
movl -0x1c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl (%rcx), %eax
jg 0xc50f
jmp 0xd5ed
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
movslq (%rcx), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq %rax, -0x150(%rbp)
subq $0x2c, %rax
ja 0xd5be
movq -0x150(%rbp), %rax
leaq 0x612a(%rip), %rcx      # 0x1266c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0xd5dd
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x158(%rbp)
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edi
callq 0xa5f0
movq -0x158(%rbp), %rdi
movq %rax, %rsi
callq 0xbbf0
movq -0x28(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0xd5dd
xorps %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rax
movl (%rax), %edx
addl $0x1, %edx
leaq -0x38(%rbp), %rdi
callq 0xd600
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x160(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0xa680
movq -0x160(%rbp), %rdi
movq %rax, %rsi
callq 0xbbf0
movl -0x3c(%rbp), %ecx
movq -0x28(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
jmp 0xd5dd
movq $0x0, -0x48(%rbp)
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rax
movl (%rax), %edx
addl $0x1, %edx
leaq -0x48(%rbp), %rdi
callq 0xd640
movl %eax, -0x4c(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x168(%rbp)
movq -0x48(%rbp), %rdi
callq 0xa6c0
movq -0x168(%rbp), %rdi
movq %rax, %rsi
callq 0xbbf0
movl -0x4c(%rbp), %ecx
movq -0x28(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
jmp 0xd5dd
movq $0x0, -0x58(%rbp)
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rax
movl (%rax), %edx
addl $0x1, %edx
leaq -0x58(%rbp), %rdi
callq 0xd680
movl %eax, -0x5c(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpl $0x1, 0x8(%rax)
jl 0xc674
jmp 0xc693
leaq 0x93b6(%rip), %rdi      # 0x15a31
leaq 0x63cf(%rip), %rsi      # 0x12a51
movl $0x145e, %edx           # imm = 0x145E
leaq 0x93b8(%rip), %rcx      # 0x15a46
callq 0x30f0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xbca0
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
callq 0x79c0
movl %eax, -0x6c(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x1, %esi
callq 0xbb10
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x170(%rbp)
movq -0x58(%rbp), %rdi
movl -0x6c(%rbp), %esi
callq 0xa700
movq -0x170(%rbp), %rdi
movq %rax, %rsi
callq 0xbbf0
movl -0x5c(%rbp), %ecx
movq -0x28(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
jmp 0xd5dd
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
movslq (%rcx), %rcx
movl 0x4(%rax,%rcx,4), %eax
movl %eax, -0x70(%rbp)
movl -0x70(%rbp), %eax
movq %rax, -0x178(%rbp)
subq $0x5, %rax
ja 0xc88e
movq -0x178(%rbp), %rax
leaq 0x604a(%rip), %rcx      # 0x1277c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rax
cmpl $0x0, 0x190(%rax)
jg 0xc756
leaq 0x9342(%rip), %rdi      # 0x15a91
movb $0x0, %al
callq 0x4cd0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x180(%rbp)
movq -0x10(%rbp), %rax
addq $0x50, %rax
movq -0x10(%rbp), %rcx
movl 0x190(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %edi
callq 0xa5f0
movq -0x180(%rbp), %rdi
movq %rax, %rsi
callq 0xbbf0
jmp 0xc8ad
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x188(%rbp)
movq -0x10(%rbp), %rax
movl 0x198(%rax), %edi
callq 0xa5f0
movq -0x188(%rbp), %rdi
movq %rax, %rsi
callq 0xbbf0
jmp 0xc8ad
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x190(%rbp)
movq -0x10(%rbp), %rax
movsd 0x1a0(%rax), %xmm0
callq 0xa680
movq -0x190(%rbp), %rdi
movq %rax, %rsi
callq 0xbbf0
jmp 0xc8ad
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x198(%rbp)
movq -0x10(%rbp), %rax
movq 0x1a8(%rax), %rdi
callq 0xa6c0
movq -0x198(%rbp), %rdi
movq %rax, %rsi
callq 0xbbf0
jmp 0xc8ad
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x1a0(%rbp)
movq -0x10(%rbp), %rax
movl 0x1b0(%rax), %edi
callq 0xa5f0
movq -0x1a0(%rbp), %rdi
movq %rax, %rsi
callq 0xbbf0
jmp 0xc8ad
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x1a8(%rbp)
movq -0x10(%rbp), %rax
movl 0x190(%rax), %edi
callq 0xa5f0
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
callq 0xbbf0
jmp 0xc8ad
leaq 0x70da(%rip), %rdi      # 0x1396f
leaq 0x61b5(%rip), %rsi      # 0x12a51
movl $0x1484, %edx           # imm = 0x1484
leaq 0x919e(%rip), %rcx      # 0x15a46
callq 0x30f0
movq -0x28(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0xd5dd
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpl $0x2, 0x8(%rax)
jl 0xc8cc
jmp 0xc8eb
leaq 0x9206(%rip), %rdi      # 0x15ad9
leaq 0x6177(%rip), %rsi      # 0x12a51
movl $0x1496, %edx           # imm = 0x1496
leaq 0x9160(%rip), %rcx      # 0x15a46
callq 0x30f0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xbca0
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
cmpl $0x4, (%rax)
je 0xc917
leaq 0x91de(%rip), %rdi      # 0x15aee
movb $0x0, %al
callq 0x4cd0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xbca0
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rdi
callq 0x78a0
cmpl $0x6, -0x2c(%rbp)
jne 0xc946
xorl %eax, %eax
movq %rax, -0x1b0(%rbp)
jmp 0xc961
movq -0x78(%rbp), %rdi
callq 0x7990
movl %eax, %edi
movq -0x80(%rbp), %rsi
callq 0xac20
movq %rax, -0x1b0(%rbp)
movq -0x1b0(%rbp), %rax
movq %rax, -0x88(%rbp)
movl -0x2c(%rbp), %eax
addl $-0x6, %eax
movl %eax, %ecx
movq %rcx, -0x1b8(%rbp)
subl $0x8, %eax
ja 0xcaaf
movq -0x1b8(%rbp), %rax
leaq 0x5dc3(%rip), %rcx      # 0x12758
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rax
movl 0x10(%rax), %edx
callq 0x9520
jmp 0xcace
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x88(%rbp), %rsi
movq -0x78(%rbp), %rax
movl 0x10(%rax), %edx
callq 0x97e0
jmp 0xcace
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x88(%rbp), %rsi
movq -0x78(%rbp), %rax
movl 0x10(%rax), %edx
callq 0x99c0
jmp 0xcace
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x88(%rbp), %rsi
movq -0x78(%rbp), %rax
movl 0x10(%rax), %edx
callq 0x9b00
jmp 0xcace
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x88(%rbp), %rsi
movq -0x78(%rbp), %rax
movl 0x10(%rax), %edx
callq 0x9c40
jmp 0xcace
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x88(%rbp), %rsi
movq -0x78(%rbp), %rax
movl 0x10(%rax), %edx
callq 0x9df0
jmp 0xcace
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x88(%rbp), %rsi
movq -0x78(%rbp), %rax
movl 0x10(%rax), %edx
callq 0x9fa0
jmp 0xcace
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x88(%rbp), %rsi
movq -0x78(%rbp), %rax
movl 0x10(%rax), %edx
callq 0xa0e0
jmp 0xcace
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x88(%rbp), %rsi
movq -0x78(%rbp), %rax
movl 0x10(%rax), %edx
callq 0xa220
jmp 0xcace
leaq 0x6eb9(%rip), %rdi      # 0x1396f
leaq 0x5f94(%rip), %rsi      # 0x12a51
movl $0x14ac, %edx           # imm = 0x14AC
leaq 0x8f7d(%rip), %rcx      # 0x15a46
callq 0x30f0
cmpq $0x0, -0x88(%rbp)
je 0xcaef
movq -0x88(%rbp), %rdi
callq 0x77f0
movq $0x0, -0x88(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x2, %esi
callq 0xbb10
jmp 0xd5dd
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpl $0x2, 0x8(%rax)
jl 0xcb14
jmp 0xcb33
leaq 0x8fbe(%rip), %rdi      # 0x15ad9
leaq 0x5f2f(%rip), %rsi      # 0x12a51
movl $0x14c6, %edx           # imm = 0x14C6
leaq 0x8f18(%rip), %rcx      # 0x15a46
callq 0x30f0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xbca0
movq %rax, -0x90(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xbca0
movq %rax, -0x98(%rbp)
movq -0x90(%rbp), %rdi
callq 0x78a0
movl -0x2c(%rbp), %eax
addl $-0xf, %eax
movl %eax, %ecx
movq %rcx, -0x1c0(%rbp)
subl $0xd, %eax
ja 0xccdf
movq -0x1c0(%rbp), %rax
leaq 0x5b8b(%rip), %rcx      # 0x12720
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0xacf0
jmp 0xccfe
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0xada0
jmp 0xccfe
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0xae50
jmp 0xccfe
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0xaf00
jmp 0xccfe
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0xb010
jmp 0xccfe
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0xb120
jmp 0xccfe
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0xb200
jmp 0xccfe
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0xb2e0
jmp 0xccfe
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0xb3c0
jmp 0xccfe
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0xb4a0
jmp 0xccfe
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0xb5c0
jmp 0xccfe
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0xb680
jmp 0xccfe
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0xb740
jmp 0xccfe
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0xb850
jmp 0xccfe
leaq 0x6c89(%rip), %rdi      # 0x1396f
leaq 0x5d64(%rip), %rsi      # 0x12a51
movl $0x14db, %edx           # imm = 0x14DB
leaq 0x8d4d(%rip), %rcx      # 0x15a46
callq 0x30f0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x1, %esi
callq 0xbb10
jmp 0xd5dd
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpl $0x1, 0x8(%rax)
jl 0xcd23
jmp 0xcd42
leaq 0x8d07(%rip), %rdi      # 0x15a31
leaq 0x5d20(%rip), %rsi      # 0x12a51
movl $0x14e3, %edx           # imm = 0x14E3
leaq 0x8d09(%rip), %rcx      # 0x15a46
callq 0x30f0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xbca0
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rdi
callq 0x78a0
movq -0xa0(%rbp), %rdi
callq 0xb960
jmp 0xd5dd
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xbca0
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rdi
callq 0x76c0
andb $0x1, %al
movb %al, -0xa9(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x1, %esi
callq 0xbb10
testb $0x1, -0xa9(%rbp)
je 0xcdca
movq -0x28(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0xcdf4
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0xb0(%rbp)
movl -0xb0(%rbp), %ecx
subl $0x1, %ecx
movq -0x28(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
jmp 0xd5dd
movq -0x10(%rbp), %rax
movl 0x190(%rax), %eax
addl $0x1, %eax
cltq
cmpq $0x10, %rax
jb 0xce1c
leaq 0x8d19(%rip), %rdi      # 0x15b2e
movb $0x0, %al
callq 0x4cd0
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0xb4(%rbp)
movq -0x10(%rbp), %rax
addq $0x50, %rax
movq -0x10(%rbp), %rcx
movslq 0x190(%rcx), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xc0(%rbp)
movq -0x10(%rbp), %rax
movl 0x190(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x190(%rax)
movq -0x28(%rbp), %rax
movl (%rax), %ecx
addl $0x2, %ecx
movq -0xc0(%rbp), %rax
movl %ecx, (%rax)
movl -0xb4(%rbp), %ecx
movq -0xc0(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0xc0(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0xc0(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0xc0(%rbp), %rax
movl $0x0, 0xc(%rax)
movl $0xffffffff, -0xc4(%rbp) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xbca0
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rdi
callq 0x79c0
movl %eax, -0xc4(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x1, %esi
callq 0xbb10
movl -0xc4(%rbp), %ecx
movq -0xc0(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x28(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0xd5dd
movq -0x10(%rbp), %rax
cmpl $0x0, 0x190(%rax)
jle 0xcf29
jmp 0xcf48
leaq 0x8c23(%rip), %rdi      # 0x15b53
leaq 0x5b1a(%rip), %rsi      # 0x12a51
movl $0x1517, %edx           # imm = 0x1517
leaq 0x8b03(%rip), %rcx      # 0x15a46
callq 0x30f0
movq -0x10(%rbp), %rax
addq $0x50, %rax
movq -0x10(%rbp), %rcx
movl 0x190(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jl 0xcfb4
movq -0xd8(%rbp), %rax
movl 0x8(%rax), %eax
movq -0xd8(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jl 0xcfb4
movq -0xd8(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movl 0x190(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x190(%rax)
jmp 0xd5dd
movq -0x10(%rbp), %rax
cmpl $0x0, 0x190(%rax)
jg 0xcfd4
leaq 0x8ba1(%rip), %rdi      # 0x15b6e
movb $0x0, %al
callq 0x4cd0
movq -0x10(%rbp), %rax
addq $0x50, %rax
movq -0x10(%rbp), %rcx
movl 0x190(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movq -0xe0(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0xe0(%rbp), %rax
movl (%rax), %ecx
subl $0x1, %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
jmp 0xd5dd
movq -0x10(%rbp), %rax
cmpl $0x0, 0x190(%rax)
jg 0xd04c
leaq 0x8b5d(%rip), %rdi      # 0x15ba2
movb $0x0, %al
callq 0x4cd0
movq -0x10(%rbp), %rax
addq $0x50, %rax
movq -0x10(%rbp), %rcx
movl 0x190(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xe8(%rbp)
movq -0xe8(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movl 0x190(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x190(%rax)
jmp 0xd5dd
jmp 0xd5dd
movq -0x10(%rbp), %rax
movl 0x4c(%rax), %eax
addl $0x1, %eax
cltq
cmpq $0x10, %rax
jb 0xd0bf
leaq 0x8b16(%rip), %rdi      # 0x15bce
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0xf0(%rbp)
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rax
movl (%rax), %edx
addl $0x1, %edx
leaq -0xf0(%rbp), %rdi
callq 0xd6c0
movl %eax, -0xf4(%rbp)
cmpq $0x0, -0xf0(%rbp)
je 0xd0f5
jmp 0xd114
leaq 0x8af6(%rip), %rdi      # 0x15bf2
leaq 0x594e(%rip), %rsi      # 0x12a51
movl $0x1549, %edx           # imm = 0x1549
leaq 0x8937(%rip), %rcx      # 0x15a46
callq 0x30f0
movq -0x10(%rbp), %rax
addq $0xc, %rax
movq -0x10(%rbp), %rcx
movslq 0x4c(%rcx), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x100(%rbp)
movq -0x10(%rbp), %rax
movl 0x4c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4c(%rax)
movq -0x28(%rbp), %rax
movl (%rax), %ecx
addl -0xf4(%rbp), %ecx
movq -0x100(%rbp), %rax
movl %ecx, (%rax)
movq -0xf0(%rbp), %rax
movl 0x8(%rax), %ecx
subl $0x1, %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
jmp 0xd5dd
movq $0x0, -0x108(%rbp)
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rax
movl (%rax), %edx
addl $0x1, %edx
leaq -0x108(%rbp), %rdi
callq 0xd6c0
cmpq $0x0, -0x108(%rbp)
je 0xd19c
jmp 0xd1bb
leaq 0x8a4f(%rip), %rdi      # 0x15bf2
leaq 0x58a7(%rip), %rsi      # 0x12a51
movl $0x1556, %edx           # imm = 0x1556
leaq 0x8890(%rip), %rcx      # 0x15a46
callq 0x30f0
movq -0x108(%rbp), %rax
movl 0x8(%rax), %ecx
subl $0x1, %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
jmp 0xd5dd
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x10c(%rbp)
cmpl $0x0, -0x10c(%rbp)
jl 0xd1f7
jmp 0xd216
leaq 0x8a05(%rip), %rdi      # 0x15c03
leaq 0x584c(%rip), %rsi      # 0x12a51
movl $0x155e, %edx           # imm = 0x155E
leaq 0x8835(%rip), %rcx      # 0x15a46
callq 0x30f0
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x110(%rbp)
movl -0x10c(%rbp), %edi
callq 0xd700
movq %rax, -0x118(%rbp)
cmpq $0x0, -0x118(%rbp)
je 0xd24d
jmp 0xd26c
leaq 0x89bc(%rip), %rdi      # 0x15c10
leaq 0x57f6(%rip), %rsi      # 0x12a51
movl $0x1563, %edx           # imm = 0x1563
leaq 0x87df(%rip), %rcx      # 0x15a46
callq 0x30f0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x11c(%rbp)
movq -0x118(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x110(%rbp), %edx
callq *%rax
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x8(%rax), %eax
movl -0x11c(%rbp), %ecx
subl -0x110(%rbp), %ecx
cmpl %ecx, %eax
jne 0xd2af
jmp 0xd2ce
leaq 0x896e(%rip), %rdi      # 0x15c24
leaq 0x5794(%rip), %rsi      # 0x12a51
movl $0x1566, %edx           # imm = 0x1566
leaq 0x877d(%rip), %rcx      # 0x15a46
callq 0x30f0
movq -0x28(%rbp), %rax
movl (%rax), %ecx
addl $0x2, %ecx
movl %ecx, (%rax)
jmp 0xd5dd
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x120(%rbp)
cmpl $0x0, -0x120(%rbp)
jl 0xd302
jmp 0xd321
leaq 0x893b(%rip), %rdi      # 0x15c44
leaq 0x5741(%rip), %rsi      # 0x12a51
movl $0x156e, %edx           # imm = 0x156E
leaq 0x872a(%rip), %rcx      # 0x15a46
callq 0x30f0
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x124(%rbp)
movl -0x120(%rbp), %edi
callq 0xd720
movq %rax, -0x130(%rbp)
cmpq $0x0, -0x130(%rbp)
je 0xd358
jmp 0xd377
leaq 0x88b1(%rip), %rdi      # 0x15c10
leaq 0x56eb(%rip), %rsi      # 0x12a51
movl $0x1573, %edx           # imm = 0x1573
leaq 0x86d4(%rip), %rcx      # 0x15a46
callq 0x30f0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x134(%rbp)
movq -0x130(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x124(%rbp), %edx
callq *%rax
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x8(%rax), %eax
movl -0x134(%rbp), %ecx
subl -0x124(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jne 0xd3bd
jmp 0xd3dc
leaq 0x888e(%rip), %rdi      # 0x15c52
leaq 0x5686(%rip), %rsi      # 0x12a51
movl $0x1576, %edx           # imm = 0x1576
leaq 0x866f(%rip), %rcx      # 0x15a46
callq 0x30f0
movq -0x28(%rbp), %rax
movl (%rax), %ecx
addl $0x2, %ecx
movl %ecx, (%rax)
jmp 0xd5dd
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %ecx
subl $0x1, %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
jmp 0xd5dd
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %ecx
subl $0x1, %ecx
movq -0x28(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
jmp 0xd5dd
movq -0x10(%rbp), %rax
cmpl $0x0, 0x4c(%rax)
jg 0xd448
leaq 0x8834(%rip), %rdi      # 0x15c75
movb $0x0, %al
callq 0x4cd0
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x138(%rbp)
cmpl $0x0, -0x138(%rbp)
jle 0xd575
cmpl $0x1, -0x138(%rbp)
jne 0xd479
jmp 0xd498
leaq 0x8829(%rip), %rdi      # 0x15ca9
leaq 0x55ca(%rip), %rsi      # 0x12a51
movl $0x1590, %edx           # imm = 0x1590
leaq 0x85b3(%rip), %rcx      # 0x15a46
callq 0x30f0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xbca0
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rdi
callq 0x7990
movl %eax, %ecx
movl %ecx, -0x1c4(%rbp)
subl $0x1, %eax
je 0xd4e5
jmp 0xd4cb
movl -0x1c4(%rbp), %eax
subl $0x2, %eax
je 0xd4ff
jmp 0xd4d8
movl -0x1c4(%rbp), %eax
subl $0x3, %eax
je 0xd519
jmp 0xd545
movq -0x140(%rbp), %rdi
callq 0x79c0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x198(%rax)
jmp 0xd564
movq -0x140(%rbp), %rdi
callq 0xaa40
movq -0x10(%rbp), %rax
movsd %xmm0, 0x1a0(%rax)
jmp 0xd564
movq -0x10(%rbp), %rax
movq 0x1a8(%rax), %rdi
callq 0x5030
movq -0x140(%rbp), %rdi
callq 0xab60
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x1a8(%rax)
jmp 0xd564
leaq 0x6423(%rip), %rdi      # 0x1396f
leaq 0x54fe(%rip), %rsi      # 0x12a51
movl $0x1597, %edx           # imm = 0x1597
leaq 0x84e7(%rip), %rcx      # 0x15a46
callq 0x30f0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x1, %esi
callq 0xbb10
movq -0x10(%rbp), %rax
movl 0x4c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4c(%rax)
movq -0x10(%rbp), %rax
addq $0xc, %rax
movq -0x10(%rbp), %rcx
movslq 0x4c(%rcx), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x148(%rbp)
movq -0x148(%rbp), %rax
movl (%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
jmp 0xd5dd
movq -0x10(%rbp), %rax
movb $0x1, 0x194(%rax)
jmp 0xd5dd
leaq 0x63aa(%rip), %rdi      # 0x1396f
leaq 0x5485(%rip), %rsi      # 0x12a51
movl $0x15a6, %edx           # imm = 0x15A6
leaq 0x846e(%rip), %rcx      # 0x15a46
callq 0x30f0
movq -0x28(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0xc4ed
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
nopw %cs:(%rax,%rax)