// File: exrd[P]neteruhsp/neteruhsp/neteruhsp.cc
// Function: neteruhsp::prepro_line(neteruhsp::prepro_context_t*, char const*, bool)
char* prepro_line( prepro_context_t* pctx, const char* line, bool enable_preprocessor )
{
	// 最初の空白をスキップ
	while ( line[0] == ' ' || line[0] == '\t' )
	{ ++line; }

	// 普通の行なら展開
	if ( !enable_preprocessor || line[0] != '#' )
	{
		static constexpr int MAX_REPLACE_LOOP = 256;
		int replaced_loop = 0;

		char* res = nullptr;
		char* holded = nullptr;

		// 展開があるならずっとループ
		for ( ; ; )
		{
			bool is_replaced = false;
			res = prepro_line_expand( pctx, line, &is_replaced );
			if ( !is_replaced )
			{
				break;
			}
			if ( holded != nullptr )
			{
				destroy_string( holded );
				holded = nullptr;
			}
			holded = res;
			line = res;

			++replaced_loop;
			if ( replaced_loop > MAX_REPLACE_LOOP )
			{
				raise_error( "マクロの再起展開が上限数（%d）を突破しました、マクロが無限ループしてる可能性があります@@ %d行目", replaced_loop, pctx->line_ + 1 );
				return nullptr;
			}
		}

		if ( holded != nullptr )
		{
			destroy_string( holded );
			holded = nullptr;
		}
		return res;
	}

	// 最初の#はスキップ
	++line;

	tokenize_context_t tokenize_ctx{};
	parse_context_t parse_ctx{};
	initialize_tokenize_context( &tokenize_ctx, line );
	initialize_parse_context( &parse_ctx, tokenize_ctx );

	{
		auto* const st = read_token( parse_ctx );

		if ( st->tag_ != TOKEN_IDENTIFIER )
		{
			raise_error( "プリプロセス：# の後に識別子でないトークンが検出されました@@ %d行目", pctx->line_ + 1 );
			return nullptr;
		}

		const auto pptag = query_preprocessor( st->content_ );
		if ( pptag == PREPRO_UNKNOWN )
		{
			raise_error( "プリプロセス：想定外のプリプロセッサ（%s）@@ %d行目", st->content_, pctx->line_ + 1 );
			return nullptr;
		}

		switch ( pptag )
		{
			case PREPRO_DEFINE:
			{
				if ( pctx->is_current_region_valid_ )
				{
					bool is_ctype = false;
					{
						const auto* const it = read_token( parse_ctx );
						if ( it->tag_ == TOKEN_IDENTIFIER && query_keyword( it->content_ ) == KEYWORD_CTYPE )
						{
							is_ctype = true;
						}
						else
						{
							unread_token( parse_ctx );
						}
					}

					const auto* const nit = read_token( parse_ctx );
					if ( nit->tag_ != TOKEN_IDENTIFIER )
					{
						raise_error( "プリプロセス：define に失敗：識別子名が見つかりません@@ %d行目", pctx->line_ + 1 );
						return nullptr;
					}

					auto* const nmacro = create_macro();
					nmacro->name_ = create_string( nit->content_ );
					nmacro->is_ctype_ = is_ctype;

					const auto* const rt = read_token( parse_ctx );
					if ( rt->tag_ == TOKEN_LPARENTHESIS )
					{
						// パラメータあり
						bool is_break = false;

						for ( ; ; )
						{
							const auto* const ct = read_token( parse_ctx );
							if ( ct->tag_ == TOKEN_EOF )
							{
								raise_error( "プリプロセス：define に失敗：パラメータのパース中に行末に到達しました@@ %d行目", pctx->line_ + 1 );
								return nullptr;
							}
							if ( ct->tag_ == TOKEN_RPARENTHESIS )
							{
								// 何もパラメータがない、おわり
								unread_token( parse_ctx );
								break;
							}
							if ( ct->tag_ != TOKEN_PP_ARG_INDICATOR )
							{
								raise_error( "プリプロセス：define に失敗：パラメータは%%から始まる必要があります@@ %d行目", pctx->line_ + 1 );
								return nullptr;
							}

							const auto* const it = read_token( parse_ctx );
							if ( it->tag_ != TOKEN_INTEGER || it->left_space_ )
							{
								raise_error( "プリプロセス：define に失敗：パラメータ%%のあと、スペースなしで数値を入れる必要があります@@ %d行目", pctx->line_ + 1 );
								return nullptr;
							}

							const auto itidx = atoi( it->content_ );
							if ( itidx != nmacro->param_num_ + 1 )
							{
								raise_error( "プリプロセス：define に失敗：パラメータ%%は順番に定義する必要があります@@ %d行目", pctx->line_ + 1 );
								return nullptr;
							}

							if ( nmacro->param_num_ > MACRO_PARAM_MAX )
							{
								raise_error( "プリプロセス：define に失敗：パラメータ%%の数が多すぎます@@ %d行目", pctx->line_ + 1 );
								return nullptr;
							}

							auto& nparam = nmacro->params_[nmacro->param_num_];
							++nmacro->param_num_;

							const auto* const at = read_token( parse_ctx );
							if ( at->tag_ == TOKEN_ASSIGN )
							{
								// デフォルト値あり
								int parenthesis_depth = 0;
								for ( ; ; )
								{
									const auto* const nt = read_token( parse_ctx );
									if ( parenthesis_depth == 0 && ( nt->tag_ == TOKEN_RPARENTHESIS || nt->tag_ == TOKEN_COMMA ) )
									{
										// ここまで食って終わり
										nparam.default_param_ = create_string( parse_ctx.tokenize_context_->script_ + at->cursor_end_, nt->cursor_begin_ - at->cursor_end_ );

										if ( nt->tag_ == TOKEN_RPARENTHESIS )
										{
											is_break = true;
											unread_token( parse_ctx );
										}
										break;
									}
									if ( nt->tag_ == TOKEN_LPARENTHESIS )
									{
										++parenthesis_depth;
									}
									if ( nt->tag_ == TOKEN_RPARENTHESIS )
									{
										--parenthesis_depth;
									}
									if ( nt->tag_ == TOKEN_EOF )
									{
										raise_error( "プリプロセス：define に失敗：パラメータ%%のデフォルト値を取得中、文末まで到達しました@@ %d行目", pctx->line_ + 1 );
										return nullptr;
									}
								}
							}
							else
							{
								// デフォルト値なし
								if ( at->tag_ == TOKEN_RPARENTHESIS )
								{
									unread_token( parse_ctx );
									break;
								}
								if ( at->tag_ != TOKEN_COMMA )
								{
									raise_error( "プリプロセス：define に失敗：パラメータ%%の定義の後に不明なトークンを読み込みました（%s）@@ %d行目", at->content_, pctx->line_ + 1 );
									return nullptr;
								}
							}

							if ( is_break )
							{ break; }
						}

						// 残り
						const auto* const lrt = read_token( parse_ctx );
						if ( lrt->tag_ != TOKEN_RPARENTHESIS )
						{
							raise_error( "プリプロセス：define に失敗：パラメータ%%の定義の後に不明なトークンを読み込みました（%s）@@ %d行目", lrt->content_, pctx->line_ + 1 );
							return nullptr;
						}
						nmacro->replacing_ = create_string( parse_ctx.tokenize_context_->script_ + lrt->cursor_end_ );
					}
					else
					{
						// パラメータなし
						nmacro->replacing_ = create_string( parse_ctx.tokenize_context_->script_ + rt->cursor_begin_ );
					}

					prepro_register_macro( pctx, nmacro );
				}
				break;
			}
			case PREPRO_UNDEF:
			{
				if ( pctx->is_current_region_valid_ )
				{
					auto* const it = read_token( parse_ctx );
					auto* const et = read_token( parse_ctx );
					if ( it->tag_ != TOKEN_IDENTIFIER || et->tag_ != TOKEN_EOF )
					{
						raise_error( "プリプロセス：undef に失敗：構文が間違っています@@ %d行目", pctx->line_ + 1 );
						return nullptr;
					}
					if ( !prepro_erase_macro( pctx, it->content_ ) )
					{
						raise_error( "プリプロセス：undef に失敗：（%s）が見つかりません@@ %d行目", it->content_, pctx->line_ + 1 );
						return nullptr;
					}
				}
				break;
			}
			case PREPRO_IF:
			{
				bool is_valid = false;
				if ( pctx->is_current_region_valid_ )
				{
					const auto* const rest_top = line + st->cursor_end_;
					auto* rest_pp = prepro_line( pctx, rest_top, false );
					if ( rest_pp == nullptr )
					{
						raise_error( "プリプロセス：if に失敗：式のプリプロセスに失敗@@ %d行目", pctx->line_ + 1 );
						return nullptr;
					}

					tokenize_context_t etoken_ctx{};
					parse_context_t eparse_ctx{};
					initialize_tokenize_context( &etoken_ctx, rest_pp );
					initialize_parse_context( &eparse_ctx, etoken_ctx );

					etoken_ctx.line_ = pctx->line_;// ラインを同期

					auto* east = parse_expression( eparse_ctx );
					if ( east == nullptr )
					{
						raise_error( "プリプロセス：if に失敗：式のパースに失敗@@ %d行目", pctx->line_ + 1 );
						return nullptr;
					}

					auto* ev = evaluate_ast_immediate( east );
					if ( ev == nullptr )
					{
						raise_error( "プリプロセス：if に失敗：式の評価に失敗@@ %d行目", pctx->line_ + 1 );
						return nullptr;
					}

					is_valid = value_calc_boolean( *ev );

					destroy_ast_node( east );
					destroy_value( ev );

					uninitialize_parse_context( &eparse_ctx );
					uninitialize_tokenize_context( &etoken_ctx );
					destroy_string( rest_pp );
				}
				else
				{
					// 何も食わずに判断
					is_valid = false;
				}

				if ( pctx->pp_region_idx_ >= PP_DIRECTIVE_MAX )
				{
					raise_error( "プリプロセス：ifdef に失敗：if ネストが深すぎます@@ %d行目", pctx->line_ + 1 );
					return nullptr;
				}
				++pctx->pp_region_idx_;
				auto& directive = pctx->pp_region_[pctx->pp_region_idx_];
				directive.is_valid_ = ( pctx->is_current_region_valid_ && is_valid );
				directive.line_ = pctx->line_;
				pctx->is_current_region_valid_ = directive.is_valid_;
				break;
			}
			case PREPRO_IFDEF:
			{
				auto* const it = read_token( parse_ctx );
				auto* const et = read_token( parse_ctx );
				if ( it->tag_ != TOKEN_IDENTIFIER || et->tag_ != TOKEN_EOF )
				{
					raise_error( "プリプロセス：ifdef に失敗：構文が間違っています@@ %d行目", pctx->line_ + 1 );
					return nullptr;
				}
				const bool has_macro = ( prepro_find_macro( pctx, it->content_ ) != nullptr );
				if ( pctx->pp_region_idx_ >= PP_DIRECTIVE_MAX )
				{
					raise_error( "プリプロセス：ifdef に失敗：if ネストが深すぎます@@ %d行目", pctx->line_ + 1 );
					return nullptr;
				}
				++pctx->pp_region_idx_;
				auto& directive = pctx->pp_region_[pctx->pp_region_idx_];
				directive.is_valid_ = ( pctx->is_current_region_valid_ && has_macro );
				directive.line_ = pctx->line_;
				pctx->is_current_region_valid_ = directive.is_valid_;
				break;
			}
			case PREPRO_ENDIF:
			{
				auto* const et = read_token( parse_ctx );
				if ( et->tag_ != TOKEN_EOF )
				{
					raise_error( "プリプロセス：endif に失敗：endif後に余計なトークンを検出@@ %d行目", pctx->line_ + 1 );
					return nullptr;
				}
				if ( pctx->pp_region_idx_ <= 0 )
				{
					raise_error( "プリプロセス：endif に失敗：if ネストがされいてません@@ %d行目", pctx->line_ + 1 );
					return nullptr;
				}
				--pctx->pp_region_idx_;
				pctx->is_current_region_valid_ = pctx->pp_region_[pctx->pp_region_idx_].is_valid_;
				break;
			}
			case PREPRO_ENUM:
			{
				if ( pctx->is_current_region_valid_ )
				{
					auto* const it = read_token( parse_ctx );
					if ( it->tag_ != TOKEN_IDENTIFIER )
					{
						raise_error( "プリプロセス：enum に失敗：構文が間違っています@@ %d行目", pctx->line_ + 1 );
						return nullptr;
					}
					auto* const at = read_token( parse_ctx );
					if ( at->tag_ == TOKEN_ASSIGN )
					{
						const auto* const rest_top = line + at->cursor_end_;
						auto* rest_pp = prepro_line( pctx, rest_top, false );
						if ( rest_pp == nullptr )
						{
							raise_error( "プリプロセス：enum に失敗：式のプリプロセスに失敗@@ %d行目", pctx->line_ + 1 );
							return nullptr;
						}

						tokenize_context_t etoken_ctx{};
						parse_context_t eparse_ctx{};
						initialize_tokenize_context( &etoken_ctx, rest_pp );
						initialize_parse_context( &eparse_ctx, etoken_ctx );

						etoken_ctx.line_ = pctx->line_;// ラインを同期

						auto* east = parse_expression( eparse_ctx );
						if ( east == nullptr )
						{
							raise_error( "プリプロセス：enum に失敗：式のパースに失敗@@ %d行目", pctx->line_ + 1 );
							return nullptr;
						}

						auto* ev = evaluate_ast_immediate( east );
						if ( ev == nullptr )
						{
							raise_error( "プリプロセス：enum に失敗：式の評価に失敗@@ %d行目", pctx->line_ + 1 );
							return nullptr;
						}

						value_isolate( *ev );
						if ( value_get_primitive_tag( *ev ) != VALUE_INT )
						{
							raise_error( "プリプロセス：enum に失敗：評価後の値がintではありません@@ %d行目", pctx->line_ + 1 );
							return nullptr;
						}

						pctx->enum_next_ = value_calc_int( *ev );

						destroy_ast_node( east );
						destroy_value( ev );

						uninitialize_parse_context( &eparse_ctx );
						uninitialize_tokenize_context( &etoken_ctx );
						destroy_string( rest_pp );
					}
					else
					{
						if ( at->tag_ != TOKEN_EOF )
						{
							raise_error( "プリプロセス：enum に失敗：enum後に余計なトークンを検出@@ %d行目", pctx->line_ + 1 );
							return nullptr;
						}
					}

					// 登録
					auto* const nm = create_macro();
					nm->name_ = create_string( it->content_ );
					nm->replacing_ = create_string_from( pctx->enum_next_ );
					prepro_register_macro( pctx, nm );
					++pctx->enum_next_;
				}
				break;
			}
			default: assert( false ); break;
		}
	}

	uninitialize_parse_context( &parse_ctx );
	uninitialize_tokenize_context( &tokenize_ctx );

	return create_string( "" );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x200, %rsp            # imm = 0x200
movb %dl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x1e1(%rbp)
je 0x5b21
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x9, %eax
sete %al
movb %al, -0x1e1(%rbp)
movb -0x1e1(%rbp), %al
testb $0x1, %al
jne 0x5b2d
jmp 0x5b3b
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x5afa
testb $0x1, -0x19(%rbp)
je 0x5b51
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
je 0x5c15
movl $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movb $0x0, -0x31(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x31(%rbp), %rdx
callq 0x6a00
movq %rax, -0x28(%rbp)
testb $0x1, -0x31(%rbp)
jne 0x5b89
jmp 0x5bf0
cmpq $0x0, -0x30(%rbp)
je 0x5ba1
movq -0x30(%rbp), %rdi
callq 0x5030
movq $0x0, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x18(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
cmpl $0x100, -0x20(%rbp)     # imm = 0x100
jle 0x5beb
movl -0x20(%rbp), %esi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %edx
addl $0x1, %edx
leaq 0xd3fc(%rip), %rdi      # 0x12fd3
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
jmp 0x5b68
cmpq $0x0, -0x30(%rbp)
je 0x5c08
movq -0x30(%rbp), %rdi
callq 0x5030
movq $0x0, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x69e6
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x30d0
leaq -0x68(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x30d0
movq -0x18(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x4300
leaq -0x68(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x5090
leaq -0x68(%rbp), %rdi
callq 0x5160
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
cmpl $0x23, (%rax)
je 0x5c96
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
addl $0x1, %esi
leaq 0xd3dd(%rip), %rdi      # 0x1305f
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
movq -0x70(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x53a0
movl %eax, -0x74(%rbp)
cmpl $-0x1, -0x74(%rbp)
jne 0x5cd9
movq -0x70(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %edx
addl $0x1, %edx
leaq 0xd3fc(%rip), %rdi      # 0x130c1
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
movl -0x74(%rbp), %eax
movq %rax, -0x1f0(%rbp)
subq $0x5, %rax
ja 0x69a5
movq -0x1f0(%rbp), %rax
leaq 0xc845(%rip), %rcx      # 0x12540
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rax
testb $0x1, 0x14(%rax)
je 0x61d0
movb $0x0, -0x75(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x5160
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
cmpl $0x23, (%rax)
jne 0x5d44
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x4100
cmpl $0x1, %eax
jne 0x5d44
movb $0x1, -0x75(%rbp)
jmp 0x5d52
leaq -0x68(%rbp), %rdi
movl $0x1, %esi
callq 0x5260
leaq -0x68(%rbp), %rdi
callq 0x5160
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
cmpl $0x23, (%rax)
je 0x5d93
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
addl $0x1, %esi
leaq 0xd38c(%rip), %rdi      # 0x1310b
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
callq 0x5490
movq %rax, -0x90(%rbp)
movq -0x88(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x57d0
movq %rax, %rcx
movq -0x90(%rbp), %rax
movq %rcx, (%rax)
movb -0x75(%rbp), %cl
movq -0x90(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x8(%rax)
leaq -0x68(%rbp), %rdi
callq 0x5160
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
cmpl $0x6, (%rax)
jne 0x6198
movb $0x0, -0x99(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x5160
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x5e34
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
addl $0x1, %esi
leaq 0xd343(%rip), %rdi      # 0x13163
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
movq -0xa8(%rbp), %rax
cmpl $0x7, (%rax)
jne 0x5e53
leaq -0x68(%rbp), %rdi
movl $0x1, %esi
callq 0x5260
jmp 0x6122
movq -0xa8(%rbp), %rax
cmpl $0x3, (%rax)
je 0x5e84
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
addl $0x1, %esi
leaq 0xd363(%rip), %rdi      # 0x131d3
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
leaq -0x68(%rbp), %rdi
callq 0x5160
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
cmpl $0x9, (%rax)
jne 0x5ead
movq -0xb0(%rbp), %rax
testb $0x1, 0x1c(%rax)
je 0x5ed2
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
addl $0x1, %esi
leaq 0xd381(%rip), %rdi      # 0x1323f
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
movq -0xb0(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3230
movl %eax, -0xb4(%rbp)
movl -0xb4(%rbp), %eax
movq -0x90(%rbp), %rcx
movl 0x18(%rcx), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
je 0x5f24
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
addl $0x1, %esi
leaq 0xd3bc(%rip), %rdi      # 0x132cc
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
movq -0x90(%rbp), %rax
movslq 0x18(%rax), %rax
cmpq $0x10, %rax
jbe 0x5f5a
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
addl $0x1, %esi
leaq 0xd3f8(%rip), %rdi      # 0x1333e
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
movq -0x90(%rbp), %rax
addq $0x20, %rax
movq -0x90(%rbp), %rcx
movslq 0x18(%rcx), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0xc0(%rbp)
movq -0x90(%rbp), %rax
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
leaq -0x68(%rbp), %rdi
callq 0x5160
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
cmpl $0x1a, (%rax)
jne 0x60b8
movl $0x0, -0xcc(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x5160
movq %rax, -0xd8(%rbp)
cmpl $0x0, -0xcc(%rbp)
jne 0x604a
movq -0xd8(%rbp), %rax
cmpl $0x7, (%rax)
je 0x5fe9
movq -0xd8(%rbp), %rax
cmpl $0x8, (%rax)
jne 0x604a
movq -0x58(%rbp), %rax
movq (%rax), %rdi
movq -0xc8(%rbp), %rax
movslq 0x14(%rax), %rax
addq %rax, %rdi
movq -0xd8(%rbp), %rax
movl 0x10(%rax), %eax
movq -0xc8(%rbp), %rcx
subl 0x14(%rcx), %eax
movslq %eax, %rsi
callq 0x7530
movq %rax, %rcx
movq -0xc0(%rbp), %rax
movq %rcx, (%rax)
movq -0xd8(%rbp), %rax
cmpl $0x7, (%rax)
jne 0x6048
movb $0x1, -0x99(%rbp)
leaq -0x68(%rbp), %rdi
movl $0x1, %esi
callq 0x5260
jmp 0x60b6
movq -0xd8(%rbp), %rax
cmpl $0x6, (%rax)
jne 0x6065
movl -0xcc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xcc(%rbp)
movq -0xd8(%rbp), %rax
cmpl $0x7, (%rax)
jne 0x6080
movl -0xcc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xcc(%rbp)
movq -0xd8(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x60b1
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
addl $0x1, %esi
leaq 0xd2fe(%rip), %rdi      # 0x1339b
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
jmp 0x5fb8
jmp 0x6112
movq -0xc8(%rbp), %rax
cmpl $0x7, (%rax)
jne 0x60d4
leaq -0x68(%rbp), %rdi
movl $0x1, %esi
callq 0x5260
jmp 0x6122
movq -0xc8(%rbp), %rax
cmpl $0x8, (%rax)
je 0x6110
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %edx
addl $0x1, %edx
leaq 0xd326(%rip), %rdi      # 0x13422
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
jmp 0x6112
testb $0x1, -0x99(%rbp)
je 0x611d
jmp 0x6122
jmp 0x5df3
leaq -0x68(%rbp), %rdi
callq 0x5160
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rax
cmpl $0x7, (%rax)
je 0x616e
movq -0xe0(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %edx
addl $0x1, %edx
leaq 0xd2c8(%rip), %rdi      # 0x13422
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
movq -0x58(%rbp), %rax
movq (%rax), %rdi
movq -0xe0(%rbp), %rax
movslq 0x14(%rax), %rax
addq %rax, %rdi
callq 0x57d0
movq %rax, %rcx
movq -0x90(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x61c0
movq -0x58(%rbp), %rax
movq (%rax), %rdi
movq -0x98(%rbp), %rax
movslq 0x10(%rax), %rax
addq %rax, %rdi
callq 0x57d0
movq %rax, %rcx
movq -0x90(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rdi
movq -0x90(%rbp), %rsi
callq 0x5800
jmp 0x69c4
movq -0x10(%rbp), %rax
testb $0x1, 0x14(%rax)
je 0x628a
leaq -0x68(%rbp), %rdi
callq 0x5160
movq %rax, -0xe8(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x5160
movq %rax, -0xf0(%rbp)
movq -0xe8(%rbp), %rax
cmpl $0x23, (%rax)
jne 0x621b
movq -0xf0(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6240
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
addl $0x1, %esi
leaq 0xd282(%rip), %rdi      # 0x134ae
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
movq -0x10(%rbp), %rdi
movq -0xe8(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x7580
testb $0x1, %al
jne 0x6288
movq -0xe8(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %edx
addl $0x1, %edx
leaq 0xd28b(%rip), %rdi      # 0x134ff
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
jmp 0x628a
jmp 0x69c4
movb $0x0, -0xf1(%rbp)
movq -0x10(%rbp), %rax
testb $0x1, 0x14(%rax)
je 0x6431
movq -0x18(%rbp), %rax
movq -0x70(%rbp), %rcx
movslq 0x14(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x100(%rbp)
movq -0x10(%rbp), %rdi
movq -0x100(%rbp), %rsi
xorl %edx, %edx
callq 0x5ae0
movq %rax, -0x108(%rbp)
cmpq $0x0, -0x108(%rbp)
jne 0x6302
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
addl $0x1, %esi
leaq 0xd264(%rip), %rdi      # 0x13552
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
leaq -0x120(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x30d0
leaq -0x138(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x30d0
movq -0x108(%rbp), %rsi
leaq -0x120(%rbp), %rdi
callq 0x4300
leaq -0x138(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x5090
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x114(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x7620
movq %rax, -0x140(%rbp)
cmpq $0x0, -0x140(%rbp)
jne 0x639d
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
addl $0x1, %esi
leaq 0xd21a(%rip), %rdi      # 0x135a3
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
movq -0x140(%rbp), %rdi
callq 0x7640
movq %rax, -0x148(%rbp)
cmpq $0x0, -0x148(%rbp)
jne 0x63df
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
addl $0x1, %esi
leaq 0xd220(%rip), %rdi      # 0x135eb
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
movq -0x148(%rbp), %rdi
callq 0x76c0
andb $0x1, %al
movb %al, -0xf1(%rbp)
movq -0x140(%rbp), %rdi
callq 0x7770
movq -0x148(%rbp), %rdi
callq 0x77f0
leaq -0x138(%rbp), %rdi
callq 0x50d0
leaq -0x120(%rbp), %rdi
callq 0x4340
movq -0x108(%rbp), %rdi
callq 0x5030
jmp 0x6438
movb $0x0, -0xf1(%rbp)
movq -0x10(%rbp), %rax
movslq 0x18(%rax), %rax
cmpq $0x10, %rax
jb 0x646b
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
addl $0x1, %esi
leaq 0xd1d9(%rip), %rdi      # 0x13630
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
movq -0x10(%rbp), %rax
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
movq -0x10(%rbp), %rax
addq $0x1c, %rax
movq -0x10(%rbp), %rcx
movslq 0x18(%rcx), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x150(%rbp)
movq -0x10(%rbp), %rcx
xorl %eax, %eax
testb $0x1, 0x14(%rcx)
movb %al, -0x1f1(%rbp)
je 0x64b4
movb -0xf1(%rbp), %al
movb %al, -0x1f1(%rbp)
movb -0x1f1(%rbp), %cl
movq -0x150(%rbp), %rax
andb $0x1, %cl
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x150(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x150(%rbp), %rax
movb (%rax), %cl
movq -0x10(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x14(%rax)
jmp 0x69c4
leaq -0x68(%rbp), %rdi
callq 0x5160
movq %rax, -0x158(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x5160
movq %rax, -0x160(%rbp)
movq -0x158(%rbp), %rax
cmpl $0x23, (%rax)
jne 0x6527
movq -0x160(%rbp), %rax
cmpl $0x0, (%rax)
je 0x654c
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
addl $0x1, %esi
leaq 0xd149(%rip), %rdi      # 0x13681
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
movq -0x10(%rbp), %rdi
movq -0x158(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x7820
cmpq $0x0, %rax
setne %al
andb $0x1, %al
movb %al, -0x161(%rbp)
movq -0x10(%rbp), %rax
movslq 0x18(%rax), %rax
cmpq $0x10, %rax
jb 0x65a2
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
addl $0x1, %esi
leaq 0xd0a2(%rip), %rdi      # 0x13630
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
movq -0x10(%rbp), %rax
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
movq -0x10(%rbp), %rax
addq $0x1c, %rax
movq -0x10(%rbp), %rcx
movslq 0x18(%rcx), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x170(%rbp)
movq -0x10(%rbp), %rcx
xorl %eax, %eax
testb $0x1, 0x14(%rcx)
movb %al, -0x1f2(%rbp)
je 0x65eb
movb -0x161(%rbp), %al
movb %al, -0x1f2(%rbp)
movb -0x1f2(%rbp), %cl
movq -0x170(%rbp), %rax
andb $0x1, %cl
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x170(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x170(%rbp), %rax
movb (%rax), %cl
movq -0x10(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x14(%rax)
jmp 0x69c4
leaq -0x68(%rbp), %rdi
callq 0x5160
movq %rax, -0x178(%rbp)
movq -0x178(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6667
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
addl $0x1, %esi
leaq 0xd07f(%rip), %rdi      # 0x136d2
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
movq -0x10(%rbp), %rax
cmpl $0x0, 0x18(%rax)
jg 0x6696
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
addl $0x1, %esi
leaq 0xd0ac(%rip), %rdi      # 0x1372e
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
movq -0x10(%rbp), %rax
movl 0x18(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x18(%rcx), %rcx
movb 0x1c(%rax,%rcx,8), %cl
movq -0x10(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x14(%rax)
jmp 0x69c4
movq -0x10(%rbp), %rax
testb $0x1, 0x14(%rax)
je 0x69a3
leaq -0x68(%rbp), %rdi
callq 0x5160
movq %rax, -0x180(%rbp)
movq -0x180(%rbp), %rax
cmpl $0x23, (%rax)
je 0x6711
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
addl $0x1, %esi
leaq 0xd088(%rip), %rdi      # 0x13785
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
leaq -0x68(%rbp), %rdi
callq 0x5160
movq %rax, -0x188(%rbp)
movq -0x188(%rbp), %rax
cmpl $0x1a, (%rax)
jne 0x6907
movq -0x18(%rbp), %rax
movq -0x188(%rbp), %rcx
movslq 0x14(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x190(%rbp)
movq -0x10(%rbp), %rdi
movq -0x190(%rbp), %rsi
xorl %edx, %edx
callq 0x5ae0
movq %rax, -0x198(%rbp)
cmpq $0x0, -0x198(%rbp)
jne 0x6792
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
addl $0x1, %esi
leaq 0xd057(%rip), %rdi      # 0x137d5
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
leaq -0x1b0(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x30d0
leaq -0x1c8(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x30d0
movq -0x198(%rbp), %rsi
leaq -0x1b0(%rbp), %rdi
callq 0x4300
leaq -0x1c8(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x5090
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x1a4(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x7620
movq %rax, -0x1d0(%rbp)
cmpq $0x0, -0x1d0(%rbp)
jne 0x682d
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
addl $0x1, %esi
leaq 0xd00f(%rip), %rdi      # 0x13828
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
movq -0x1d0(%rbp), %rdi
callq 0x7640
movq %rax, -0x1d8(%rbp)
cmpq $0x0, -0x1d8(%rbp)
jne 0x686f
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
addl $0x1, %esi
leaq 0xd017(%rip), %rdi      # 0x13872
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
movq -0x1d8(%rbp), %rdi
callq 0x78a0
movq -0x1d8(%rbp), %rdi
callq 0x7990
cmpl $0x1, %eax
je 0x68b1
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
addl $0x1, %esi
leaq 0xd01c(%rip), %rdi      # 0x138b9
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
movq -0x1d8(%rbp), %rdi
callq 0x79c0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x9c(%rax)
movq -0x1d0(%rbp), %rdi
callq 0x7770
movq -0x1d8(%rbp), %rdi
callq 0x77f0
leaq -0x1c8(%rbp), %rdi
callq 0x50d0
leaq -0x1b0(%rbp), %rdi
callq 0x4340
movq -0x198(%rbp), %rdi
callq 0x5030
jmp 0x693a
movq -0x188(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6938
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
addl $0x1, %esi
leaq 0xcff1(%rip), %rdi      # 0x13915
movb $0x0, %al
callq 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x69e6
jmp 0x693a
callq 0x5490
movq %rax, -0x1e0(%rbp)
movq -0x180(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x57d0
movq %rax, %rcx
movq -0x1e0(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movl 0x9c(%rax), %edi
callq 0x7a60
movq %rax, %rcx
movq -0x1e0(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rdi
movq -0x1e0(%rbp), %rsi
callq 0x5800
movq -0x10(%rbp), %rax
movl 0x9c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x9c(%rax)
jmp 0x69c4
leaq 0xcfc3(%rip), %rdi      # 0x1396f
leaq 0xc09e(%rip), %rsi      # 0x12a51
movl $0xa4c, %edx            # imm = 0xA4C
leaq 0xcfb6(%rip), %rcx      # 0x13975
callq 0x30f0
leaq -0x68(%rbp), %rdi
callq 0x50d0
leaq -0x50(%rbp), %rdi
callq 0x4340
leaq 0xf54f(%rip), %rdi      # 0x15f2c
callq 0x57d0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x200, %rsp            # imm = 0x200
popq %rbp
retq
nopw %cs:(%rax,%rax)