// File: /workspace/github_c_makefile_star2_O3/lucvoo[P]sparse-dev/linearize.c
// Function: linearize_statement
static pseudo_t linearize_statement(struct entrypoint *ep, struct statement *stmt)
{
	struct basic_block *bb;

	if (!stmt)
		return VOID;

	bb = ep->active;
	if (bb && !bb->insns)
		bb->pos = stmt->pos;
	current_pos = stmt->pos;

	switch (stmt->type) {
	case STMT_NONE:
		break;

	case STMT_DECLARATION:
		return linearize_declaration(ep, stmt);

	case STMT_CONTEXT:
		return linearize_context(ep, stmt);

	case STMT_RANGE:
		return linearize_range(ep, stmt);

	case STMT_EXPRESSION:
		return linearize_expression(ep, stmt->expression);

	case STMT_ASM:
		return linearize_asm_statement(ep, stmt);

	case STMT_RETURN:
		return linearize_return(ep, stmt);

	case STMT_CASE: {
		add_label(ep, stmt->case_label);
		linearize_statement(ep, stmt->case_statement);
		break;
	}

	case STMT_LABEL: {
		struct symbol *label = stmt->label_identifier;

		if (label->used) {
			add_label(ep, label);
		}
		return linearize_statement(ep, stmt->label_statement);
	}

	case STMT_GOTO: {
		struct symbol *sym;
		struct expression *expr;
		struct instruction *goto_ins;
		struct basic_block *active;
		pseudo_t pseudo;

		active = ep->active;
		if (!bb_reachable(active))
			break;

		if (stmt->goto_label) {
			add_goto(ep, get_bound_block(ep, stmt->goto_label));
			break;
		}

		expr = stmt->goto_expression;
		if (!expr)
			break;

		/* This can happen as part of simplification */
		if (expr->type == EXPR_LABEL) {
			add_goto(ep, get_bound_block(ep, expr->label_symbol));
			break;
		}

		pseudo = linearize_expression(ep, expr);
		goto_ins = alloc_instruction(OP_COMPUTEDGOTO, 0);
		use_pseudo(goto_ins, pseudo, &goto_ins->src);
		add_one_insn(ep, goto_ins);

		FOR_EACH_PTR(stmt->target_list, sym) {
			struct basic_block *bb_computed = get_bound_block(ep, sym);
			struct multijmp *jmp = alloc_multijmp(bb_computed, 1, 0);
			add_multijmp(&goto_ins->multijmp_list, jmp);
			add_bb(&bb_computed->parents, ep->active);
			add_bb(&active->children, bb_computed);
		} END_FOR_EACH_PTR(sym);

		finish_block(ep);
		break;
	}

	case STMT_COMPOUND:
		if (stmt->inline_fn)
			return linearize_inlined_call(ep, stmt);
		return linearize_compound_statement(ep, stmt);

	/*
	 * This could take 'likely/unlikely' into account, and
	 * switch the arms around appropriately..
	 */
	case STMT_IF: {
		struct basic_block *bb_true, *bb_false, *endif;
 		struct expression *cond = stmt->if_conditional;

		bb_true = alloc_basic_block(ep, stmt->pos);
		bb_false = endif = alloc_basic_block(ep, stmt->pos);

		// If the condition is invalid, the following
		// statement(s) are not evaluated.
		if (!cond || !valid_type(cond->ctype))
			return VOID;
 		linearize_cond_branch(ep, cond, bb_true, bb_false);

		set_activeblock(ep, bb_true);
 		linearize_statement(ep, stmt->if_true);
 
 		if (stmt->if_false) {
			endif = alloc_basic_block(ep, stmt->pos);
			add_goto(ep, endif);
			set_activeblock(ep, bb_false);
 			linearize_statement(ep, stmt->if_false);
		}
		set_activeblock(ep, endif);
		break;
	}

	case STMT_SWITCH:
		return linearize_switch(ep, stmt);

	case STMT_ITERATOR:
		return linearize_iterator(ep, stmt);

	default:
		break;
	}
	return VOID;
}

// Assembly:
testq %rsi, %rsi
je 0x156b5
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r13
movq %rdi, %rbx
xorl %ebp, %ebp
leaq 0x503a3(%rip), %rax     # 0x659d0
leaq 0x2b488(%rip), %r12     # 0x40abc
movq %rax, 0x10(%rsp)
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x15650
cmpq $0x0, 0x28(%rax)
jne 0x15650
movq 0x4(%r13), %rcx
movq %rcx, (%rax)
movq 0x4(%r13), %r15
movq %r15, 0x5170d(%rip)     # 0x66d68
movl (%r13), %eax
cmpl $0x9, %eax
jne 0x15684
movq 0x10(%r13), %rsi
testb $0x2, 0x2(%rsi)
je 0x15676
movq %rbx, %rdi
callq 0x16ed4
movq 0x20(%r13), %r13
testq %r13, %r13
jne 0x15639
jmp 0x15ff8
decl %eax
cmpl $0xc, %eax
ja 0x15ff8
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
movq 0x28(%r13), %rsi
movq %rbx, %rdi
callq 0x16ed4
movq 0x20(%r13), %r13
movb $0x1, %bpl
testq %r13, %r13
jne 0x15639
jmp 0x16008
leaq 0x50314(%rip), %rax     # 0x659d0
retq
movl %ebp, 0x8(%rsp)
movq 0x20(%r13), %r12
movq 0x28(%r13), %r15
movq 0x30(%r13), %rax
movq %rax, 0x28(%rsp)
movq 0x38(%r13), %rax
movq %rax, 0x30(%rsp)
movq 0x40(%r13), %rax
movq %rax, 0x18(%rsp)
movq 0x48(%r13), %rax
movq %rax, 0x10(%rsp)
testq %r12, %r12
je 0x15e19
movq %r13, %r14
movq %r12, %r13
movzwl (%r13), %eax
testb %al, %al
jle 0x15738
xorl %ebp, %ebp
movq 0x18(%r13,%rbp,8), %rsi
movzwl %ax, %ecx
cmpl $0x100, %ecx            # imm = 0x100
jb 0x1571c
testq %rsi, %rsi
je 0x15729
movq %rbx, %rdi
callq 0x15490
movzwl (%r13), %eax
incq %rbp
movzwl %ax, %ecx
movsbq %cl, %rcx
cmpq %rcx, %rbp
jl 0x15707
movq 0x10(%r13), %r13
cmpq %r12, %r13
jne 0x156fc
movq %r14, %r13
movq 0x20(%r14), %rdi
jmp 0x15e1b
movq %rbx, %rdi
movq %r13, %rsi
callq 0x140c0
jmp 0x15f9b
movq 0x10(%r13), %r12
movq 0x18(%r13), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x16f53
movq %rax, %r14
movq %rbx, %rdi
movq %r12, %rsi
callq 0x144d5
cmpq $0x0, 0x20(%rbx)
je 0x157ac
cmpb $0x3, (%r15)
movq %r15, %rcx
jne 0x15792
movq 0x60(%r15), %rcx
cmpq 0x4a7af(%rip), %rcx     # 0x5ff48
je 0x157ac
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rax, %rcx
callq 0x1727f
movq %rbx, %rdi
movq %r14, %rsi
jmp 0x15a92
xorl %edi, %edi
callq 0x2fca9
movq %rax, %r12
movl $0x80, %eax
andl (%r12), %eax
orl $0x50, %eax
movl %eax, (%r12)
movq 0x51590(%rip), %rax     # 0x66d68
movq %rax, 0x10(%r12)
movq %r13, %r15
movq 0x10(%r13), %rsi
movq %rbx, %rdi
callq 0x144d5
movq %rax, 0x30(%r12)
testq %rax, %rax
je 0x15837
movq %rax, %r13
movl 0x4(%rax), %eax
cmpl $0x6, %eax
ja 0x1580b
movl $0x43, %ecx
btl %eax, %ecx
jb 0x15837
leaq 0x30(%r12), %r14
leaq 0x4a999(%rip), %rdi     # 0x601b0
movl $0x10, %esi
callq 0x2f700
movq %r14, 0x8(%rax)
movq %r12, (%rax)
addq $0x8, %r13
movq %r13, %rdi
movq %rax, %rsi
callq 0x227b4
movl %ebp, 0x8(%rsp)
movq 0x18(%r15), %rsi
movq %rbx, %rdi
callq 0x144d5
movq %rax, 0x38(%r12)
testq %rax, %rax
je 0x15892
movq %rax, %r13
movl 0x4(%rax), %eax
cmpl $0x6, %eax
ja 0x15866
movl $0x43, %ecx
btl %eax, %ecx
jb 0x15892
leaq 0x38(%r12), %r14
leaq 0x4a93e(%rip), %rdi     # 0x601b0
movl $0x10, %esi
callq 0x2f700
movq %r14, 0x8(%rax)
movq %r12, (%rax)
addq $0x8, %r13
movq %r13, %rdi
movq %rax, %rsi
callq 0x227b4
movq 0x20(%r15), %rsi
movq %rbx, %rdi
callq 0x144d5
movq %rax, 0x40(%r12)
testq %rax, %rax
je 0x15add
movq %rax, %r14
movl 0x4(%rax), %eax
cmpl $0x6, %eax
ja 0x158c5
movl $0x43, %ecx
btl %eax, %ecx
jb 0x15add
movq %r12, %r15
addq $0x40, %r15
leaq 0x4a8dd(%rip), %rdi     # 0x601b0
movl $0x10, %esi
callq 0x2f700
movq %r15, 0x8(%rax)
movq %r12, (%rax)
addq $0x8, %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x227b4
jmp 0x15add
cmpq $0x0, 0x20(%r13)
je 0x15fa1
movl %ebp, 0x8(%rsp)
xorl %edi, %edi
callq 0x2fca9
movl $0x80, %ecx
andl (%rax), %ecx
orl $0x4b, %ecx
movl %ecx, (%rax)
movq 0x51447(%rip), %rcx     # 0x66d68
movq %rax, 0x18(%rsp)
movq %rcx, 0x10(%rax)
movq %r13, 0x20(%rsp)
movq 0x28(%r13), %r14
testq %r14, %r14
je 0x159a9
movq 0x10(%r14), %rdi
leaq 0x8(%rbx), %rsi
callq 0x22b14
movq 0x10(%r14), %r13
testq %r13, %r13
je 0x159a9
movq 0x18(%rsp), %r15
addq $0x38, %r15
movq %r13, %rbp
movzwl (%rbp), %eax
testb %al, %al
jle 0x159a0
xorl %r12d, %r12d
movq 0x18(%rbp,%r12,8), %rsi
movzwl %ax, %ecx
cmpl $0x100, %ecx            # imm = 0x100
jb 0x1597a
testq %rsi, %rsi
je 0x15991
movq %rbx, %rdi
callq 0x15490
movq %r15, %rdi
movq %rax, %rsi
callq 0x227b4
movzwl (%rbp), %eax
incq %r12
movzwl %ax, %ecx
movsbq %cl, %rcx
cmpq %rcx, %r12
jl 0x15965
movq 0x10(%rbp), %rbp
cmpq %r13, %rbp
jne 0x1595a
movq %rbx, %rdi
movq 0x20(%rsp), %r14
movq %r14, %rsi
callq 0x143a5
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %r15
movq %rax, 0x20(%r15)
movq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x167e4
movq %rax, 0x30(%r15)
movq 0x20(%rbx), %rdi
cmpq $0x0, 0x28(%rdi)
je 0x15fb4
movl 0x8(%rsp), %ebx
jmp 0x15fc8
movq 0x10(%r13), %rsi
movq %rbx, %rdi
callq 0x144d5
jmp 0x15fac
movl %ebp, 0x8(%rsp)
movq 0x10(%r13), %rdi
leaq 0x8(%rbx), %rsi
callq 0x22b14
movq 0x10(%r13), %r14
testq %r14, %r14
je 0x15ffc
movq %r14, %r15
movzwl (%r15), %eax
testb %al, %al
jle 0x15a5c
xorl %r12d, %r12d
movq 0x18(%r15,%r12,8), %rsi
movzwl %ax, %ecx
cmpl $0x100, %ecx            # imm = 0x100
jb 0x15a41
testq %rsi, %rsi
je 0x15a4d
movq %rbx, %rdi
callq 0x15490
movzwl (%r15), %eax
incq %r12
movzwl %ax, %ecx
movsbq %cl, %rcx
cmpq %rcx, %r12
jl 0x15a2c
movq 0x10(%r15), %r15
cmpq %r14, %r15
jne 0x15a21
jmp 0x15ffc
movq 0x20(%rbx), %r12
testq %r12, %r12
je 0x15ff8
movq 0x10(%r13), %rsi
testq %rsi, %rsi
je 0x15fdd
movq %rbx, %rdi
callq 0x16f53
movq %rbx, %rdi
movq %rax, %rsi
callq 0x14453
jmp 0x15f9b
movl %ebp, 0x8(%rsp)
xorl %edi, %edi
callq 0x2fca9
movq %rax, %r12
movl $0x80, %eax
andl (%r12), %eax
orl $0x4f, %eax
movl %eax, (%r12)
movq 0x512a7(%rip), %rax     # 0x66d68
movq %rax, 0x10(%r12)
movq 0x10(%r13), %rdi
callq 0xf401
movl %eax, 0x30(%r12)
movq 0x18(%r13), %rax
movq %rax, 0x38(%r12)
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x15ffc
movq %rdi, 0x8(%r12)
addq $0x28, %rdi
movq %r12, %rsi
callq 0x227b4
testb $0x1, 0x8(%rsp)
jmp 0x16008
movl %ebp, 0x8(%rsp)
xorl %edi, %edi
callq 0x2fbe3
movq %r15, (%rax)
movq %rbx, 0x10(%rax)
movl 0x51253(%rip), %edx     # 0x66d70
leal 0x1(%rdx), %ecx
movl %ecx, 0x5124a(%rip)     # 0x66d70
movl %edx, 0x38(%rax)
movq 0x10(%r13), %r12
testq %r12, %r12
je 0x15ffc
movq %r13, 0x20(%rsp)
cmpq $0x0, 0x10(%r12)
je 0x15ffc
movq %rax, 0x40(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x144d5
movq %rax, %r13
movq 0x20(%rbx), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
jne 0x15ba1
movq 0x20(%rsp), %rax
movq 0x4(%rax), %r14
xorl %edi, %edi
callq 0x2fbe3
movq %rax, %rsi
movq %r14, (%rax)
movq %rbx, 0x10(%rax)
movl 0x511e8(%rip), %eax     # 0x66d70
leal 0x1(%rax), %ecx
movl %ecx, 0x511df(%rip)     # 0x66d70
movl %eax, 0x38(%rsi)
movq %rbx, %rdi
movq %rsi, 0x8(%rsp)
callq 0x14060
movq 0x10(%r12), %rsi
movl $0x5, %edi
callq 0x13674
movq %rax, %r14
leaq 0x30(%rax), %rdx
movq %rax, %rdi
movq %r13, %rsi
callq 0x136c3
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x15bea
movq %rdi, 0x8(%r14)
addq $0x28, %rdi
movq %r14, %rsi
callq 0x227b4
cmpq $0x0, 0x20(%rbx)
je 0x15bea
movq $0x0, 0x20(%rbx)
movq 0x20(%rsp), %rax
movq 0x28(%rax), %rax
movq 0x98(%rax), %rcx
testq %rcx, %rcx
movq %r14, 0x38(%rsp)
je 0x1601e
leaq 0x38(%r14), %rax
movq %rax, 0x18(%rsp)
movq 0x8(%rsp), %rax
addq $0x20, %rax
movq %rax, 0x30(%rsp)
movq $0x0, 0x10(%rsp)
movq %rcx, %rbp
movq %rcx, 0x28(%rsp)
movzwl (%rbp), %eax
testb %al, %al
jle 0x15cfa
xorl %r13d, %r13d
movq 0x18(%rbp,%r13,8), %rsi
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
jb 0x15c57
testq %rsi, %rsi
je 0x15ce7
movq 0x90(%rsi), %r14
movq %rbx, %rdi
callq 0x16f53
movq %rax, %r12
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x15ca0
cmpb $0x1, (%rax)
jne 0x15ce7
movq 0x18(%r14), %rcx
movq 0x20(%rax), %r15
testq %rcx, %rcx
je 0x15ca7
cmpb $0x1, (%rcx)
jne 0x15ca7
movq 0x20(%rcx), %r14
cmpq %r14, %r15
movq %r14, %rax
cmovlq %r15, %rax
cmovgq %r15, %r14
movq %rax, %r15
jmp 0x15caa
movq %r12, 0x10(%rsp)
jmp 0x15ce7
movq %r15, %r14
xorl %edi, %edi
callq 0x2fd0c
movq %r12, (%rax)
movq %r15, 0x8(%rax)
movq %r14, 0x10(%rax)
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x227b4
movq %r12, %rdi
addq $0x18, %rdi
movq 0x8(%rsp), %rsi
callq 0x227b4
movq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0x227b4
incq %r13
movl (%rbp), %eax
movsbq %al, %rcx
cmpq %rcx, %r13
jl 0x15c3f
movq 0x10(%rbp), %rbp
movq 0x28(%rsp), %rcx
cmpq %rcx, %rbp
jne 0x15c30
jmp 0x16027
movl %ebp, 0x8(%rsp)
movq 0x10(%r13), %rbp
xorl %edi, %edi
callq 0x2fbe3
movq %r13, %rdx
movq %rax, %r13
movq %r15, (%rax)
movq %rbx, 0x10(%rax)
movl 0x5103d(%rip), %eax     # 0x66d70
leal 0x1(%rax), %ecx
movl %ecx, 0x51034(%rip)     # 0x66d70
movl %eax, 0x38(%r13)
movq %rdx, %r15
movq 0x4(%rdx), %r14
xorl %edi, %edi
callq 0x2fbe3
movq %rax, %r12
movq %r14, (%rax)
movq %rbx, 0x10(%rax)
movl 0x51012(%rip), %eax     # 0x66d70
leal 0x1(%rax), %ecx
movl %ecx, 0x51009(%rip)     # 0x66d70
movl %eax, 0x38(%r12)
testq %rbp, %rbp
je 0x15ffc
movq 0x10(%rbp), %rax
testq %rax, %rax
sete %cl
cmpq 0x4a1da(%rip), %rax     # 0x5ff60
sete %al
orb %cl, %al
jne 0x15ffc
movq %rbx, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r12, %rcx
callq 0x17013
movq %rbx, %rdi
movq %r13, %rsi
callq 0x14060
movq %r15, %r13
movq 0x18(%r15), %rsi
movq %rbx, %rdi
callq 0x15607
cmpq $0x0, 0x20(%r15)
je 0x15f8c
movq 0x4(%r13), %r14
xorl %edi, %edi
callq 0x2fbe3
movq %rax, %r15
movq %r14, (%rax)
movq %rbx, 0x10(%rax)
movl 0x50f8e(%rip), %eax     # 0x66d70
leal 0x1(%rax), %ecx
movl %ecx, 0x50f85(%rip)     # 0x66d70
movl %eax, 0x38(%r15)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x14453
movq %rbx, %rdi
movq %r12, %rsi
callq 0x14060
movq 0x20(%r13), %rsi
movq %rbx, %rdi
callq 0x15607
movq %r15, %r12
jmp 0x15f8c
xorl %edi, %edi
leaq 0x8(%rbx), %rsi
callq 0x22b14
movq %rbx, %rdi
movq %r15, %rsi
callq 0x15607
movq 0x4(%r13), %r14
xorl %edi, %edi
callq 0x2fbe3
movq %rax, %rbp
movq %r14, (%rax)
movq %rbx, 0x10(%rax)
movl 0x50f26(%rip), %eax     # 0x66d70
leal 0x1(%rax), %ecx
movl %ecx, 0x50f1d(%rip)     # 0x66d70
movl %eax, 0x38(%rbp)
movq 0x4(%r13), %r14
xorl %edi, %edi
callq 0x2fbe3
movq %r13, %rdx
movq %rax, %r13
movq %r14, (%rax)
movq %rbx, 0x10(%rax)
movl 0x50efc(%rip), %eax     # 0x66d70
leal 0x1(%rax), %ecx
movl %ecx, 0x50ef3(%rip)     # 0x66d70
movl %eax, 0x38(%r13)
movq %rdx, 0x20(%rsp)
movq 0x4(%rdx), %r14
xorl %edi, %edi
callq 0x2fbe3
movq %rax, %r12
movq %r14, (%rax)
movq %rbx, 0x10(%rax)
movl 0x50ecf(%rip), %eax     # 0x66d70
leal 0x1(%rax), %ecx
movl %ecx, 0x50ec6(%rip)     # 0x66d70
movl %eax, 0x38(%r12)
movq %rbp, %r15
cmpq $0x0, 0x10(%rsp)
jne 0x15ef2
movq 0x20(%rsp), %rax
movq 0x4(%rax), %r14
xorl %edi, %edi
callq 0x2fbe3
movq %rax, %r15
movq %r14, (%rax)
movq %rbx, 0x10(%rax)
movl 0x50e96(%rip), %eax     # 0x66d70
leal 0x1(%rax), %ecx
movl %ecx, 0x50e8d(%rip)     # 0x66d70
movl %eax, 0x38(%r15)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x14060
movq 0x28(%rsp), %rsi
testq %rsi, %rsi
je 0x15f0a
movq %rbx, %rdi
movq %rbp, %rdx
movq %r12, %rcx
callq 0x17013
movq 0x20(%rsp), %r14
movq 0x4(%r14), %rdx
movq 0x18(%r14), %rdi
movq %r13, %rsi
callq 0x174c0
movq 0x4(%r14), %rdx
movq 0x10(%r14), %rdi
movq %r12, %rsi
callq 0x174c0
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x14060
movq %rbx, %rdi
movq 0x30(%rsp), %rsi
callq 0x15607
movq %rbx, %rdi
movq %r13, %rsi
callq 0x14453
movq %rbx, %rdi
movq %r13, %rsi
callq 0x14060
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
callq 0x15607
movq 0x10(%rsp), %rsi
movq %rbx, %rdi
testq %rsi, %rsi
je 0x15f84
movq %r15, %rdx
movq %r12, %rcx
callq 0x17013
jmp 0x15f8c
movq %r15, %rsi
callq 0x14453
movl 0x8(%rsp), %ebp
movq %rbx, %rdi
movq %r12, %rsi
callq 0x14060
testb $0x1, %bpl
jmp 0x16008
movq %rbx, %rdi
movq %r13, %rsi
callq 0x16f9c
testb $0x1, %bpl
jne 0x16008
jmp 0x1600f
movq 0x4(%r14), %rax
movq %rax, (%rdi)
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
movl 0x8(%rsp), %ebx
je 0x15ffc
movq %rdi, 0x8(%r15)
addq $0x28, %rdi
movq %r15, %rsi
callq 0x227b4
testb $0x1, %bl
jmp 0x16001
movq 0x18(%r13), %rsi
testq %rsi, %rsi
je 0x15ff8
cmpb $0x17, (%rsi)
jne 0x160c6
movq 0x20(%rsi), %rsi
jmp 0x15a84
movl %ebp, 0x8(%rsp)
testb $0x1, 0x8(%rsp)
movq 0x10(%rsp), %rax
je 0x1600f
leaq 0x4f9c1(%rip), %rax     # 0x659d0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $0x0, 0x10(%rsp)
movq 0x20(%rsp), %r14
movq 0x4(%r14), %rdx
movq 0x20(%r14), %rdi
movq 0x40(%rsp), %r15
movq %r15, %rsi
callq 0x174c0
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0x15607
movq %rbx, %rdi
movq %r15, %rsi
callq 0x14060
movq 0x10(%rsp), %rax
testq %rax, %rax
cmovneq %rax, %r15
xorl %edi, %edi
callq 0x2fd0c
movq %r15, (%rax)
movq $0x1, 0x8(%rax)
movq $0x0, 0x10(%rax)
movq 0x38(%rsp), %r14
addq $0x38, %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x227b4
leaq 0x18(%r15), %rdi
movq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0x227b4
addq $0x20, %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x227b4
leaq 0x1449(%rip), %rsi      # 0x17502
movq %r14, %rdi
callq 0x29f40
jmp 0x16008
movq %r13, %r14
movl %ebp, 0x8(%rsp)
movq %rbx, %rdi
callq 0x144d5
movq %rax, %rbp
xorl %edi, %edi
callq 0x2fca9
movq %rax, %r13
movl $0x80, %eax
andl (%r13), %eax
orl $0x7, %eax
movl %eax, (%r13)
movq 0x50c6f(%rip), %rax     # 0x66d68
movq %rax, 0x10(%r13)
leaq 0x30(%r13), %rdx
movq %r13, %rdi
movq %rbp, %rsi
callq 0x136c3
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x16125
movq %rdi, 0x8(%r13)
addq $0x28, %rdi
movq %r13, %rsi
callq 0x227b4
movq 0x20(%r14), %rax
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0x161ce
addq $0x38, %r13
addq $0x20, %r12
movq 0x18(%rsp), %rbp
movzwl (%rbp), %eax
testb %al, %al
jle 0x161bf
xorl %r15d, %r15d
movq 0x18(%rbp,%r15,8), %rsi
movzwl %ax, %ecx
cmpl $0x100, %ecx            # imm = 0x100
jb 0x16164
testq %rsi, %rsi
je 0x161b0
movq %rbx, %rdi
callq 0x16f53
movq %rax, %r14
xorl %edi, %edi
callq 0x2fd0c
movq %r14, (%rax)
movq $0x1, 0x8(%rax)
movq $0x0, 0x10(%rax)
movq %r13, %rdi
movq %rax, %rsi
callq 0x227b4
leaq 0x18(%r14), %rdi
movq 0x20(%rbx), %rsi
callq 0x227b4
movq %r12, %rdi
movq %r14, %rsi
callq 0x227b4
movzwl (%rbp), %eax
incq %r15
movzwl %ax, %ecx
movsbq %cl, %rcx
cmpq %rcx, %r15
jl 0x1614f
movq 0x10(%rbp), %rbp
cmpq 0x18(%rsp), %rbp
jne 0x16144
cmpq $0x0, 0x20(%rbx)
je 0x15ffc
movq $0x0, 0x20(%rbx)
jmp 0x15afb