// File: /workspace/github_c_makefile_star2_O2/tvlabs[P]edge264/edge264_headers.c
// Function: parse_seq_parameter_set_log
int ADD_VARIANT(parse_seq_parameter_set)(Edge264Decoder *dec, int non_blocking, void(*free_cb)(void*,int), void *free_arg)
{
	static const char * const profile_idc_names[256] = {
		[0 ... 255] = "Unknown",
		[44] = "CAVLC 4:4:4 Intra",
		[66] = "Baseline",
		[77] = "Main",
		[83] = "Scalable Baseline",
		[86] = "Scalable High",
		[88] = "Extended",
		[100] = "High",
		[110] = "High 10",
		[118] = "Multiview High",
		[122] = "High 4:2:2",
		[128] = "Stereo High",
		[134] = "MFC High",
		[135] = "MFC Depth High",
		[138] = "Multiview Depth High",
		[139] = "Enhanced Multiview Depth High",
		[244] = "High 4:4:4 Predictive",
	};
	static const char * const chroma_format_idc_names[4] = {"4:0:0", "4:2:0", "4:2:2", "4:4:4"};
	static const uint32_t MaxDpbMbs[64] = {
		396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, // level 1
		900, // levels 1b and 1.1
		2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376, // levels 1.2, 1.3 and 2
		4752, // level 2.1
		8100, 8100, 8100, 8100, 8100, 8100, 8100, 8100, 8100, // levels 2.2 and 3
		18000, // level 3.1
		20480, // level 3.2
		32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, // levels 4 and 4.1
		34816, // level 4.2
		110400, 110400, 110400, 110400, 110400, 110400, 110400, 110400, // level 5
		184320, 184320, // levels 5.1 and 5.2
		696320, 696320, 696320, 696320, 696320, 696320, 696320, 696320, 696320, 696320, // levels 6, 6.1 and 6.2
		UINT_MAX // no limit beyond
	};
	
	// temp storage, committed if entire NAL is correct
	Edge264SeqParameterSet sps = {
		.chroma_format_idc = 1,
		.ChromaArrayType = 1,
		.BitDepth_Y = 8,
		.BitDepth_C = 8,
		.log2_max_pic_order_cnt_lsb = 16,
		.initial_cpb_removal_delay_length = 24,
		.cpb_removal_delay_length = 24,
		.dpb_output_delay_length = 24,
		.time_offset_length = 24,
		.weightScale4x4_v = {[0 ... 5] = {16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16}},
		.weightScale8x8_v = {[0 ... 23] = {16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16}},
	};
	
	// Profiles are only useful to initialize max_num_reorder_frames/num_frame_buffers.
	int profile_idc = get_uv(&dec->_gb, 8);
	unsigned constraint_set_flags = get_uv(&dec->_gb, 8);
	int level_idc = get_uv(&dec->_gb, 8);
	get_ue16(&dec->_gb, 31); // seq_parameter_set_id is ignored until useful cases arise
	log_dec(dec, "  profile_idc: %u # %s\n"
		"  constraint_set_flags: [%u,%u,%u,%u,%u,%u]\n"
		"  level_idc: %.1f\n",
		profile_idc, profile_idc_names[profile_idc],
		constraint_set_flags >> 7, (constraint_set_flags >> 6) & 1, (constraint_set_flags >> 5) & 1, (constraint_set_flags >> 4) & 1, (constraint_set_flags >> 3) & 1, (constraint_set_flags >> 2) & 1,
		(float)level_idc / 10);
	
	int seq_scaling_matrix_present_flag = 0;
	if (profile_idc != 66 && profile_idc != 77 && profile_idc != 88) {
		sps.ChromaArrayType = sps.chroma_format_idc = get_ue16(&dec->_gb, 3);
		log_dec(dec, "  chroma_format_idc: %u # %s%s\n",
			sps.chroma_format_idc, chroma_format_idc_names[sps.chroma_format_idc], unsup_if(sps.ChromaArrayType != 1));
		if (sps.chroma_format_idc == 3) {
			int separate_colour_plane_flag = get_u1(&dec->_gb);
			sps.ChromaArrayType = 3 - separate_colour_plane_flag * 3;
			log_dec(dec, "  separate_colour_plane_flag: %u\n",
				separate_colour_plane_flag);
		}
		sps.BitDepth_Y = 8 + get_ue16(&dec->_gb, 6);
		sps.BitDepth_C = 8 + get_ue16(&dec->_gb, 6);
		sps.qpprime_y_zero_transform_bypass_flag = get_u1(&dec->_gb);
		log_dec(dec, "  bit_depth: {luma: %u, chroma: %u}%s\n"
			"  qpprime_y_zero_transform_bypass_flag: %u%s\n",
			sps.BitDepth_Y, sps.BitDepth_C, unsup_if(sps.BitDepth_Y + sps.BitDepth_Y != 16),
			sps.qpprime_y_zero_transform_bypass_flag, unsup_if(sps.qpprime_y_zero_transform_bypass_flag));
		seq_scaling_matrix_present_flag = get_u1(&dec->_gb);
		if (seq_scaling_matrix_present_flag) {
			sps.weightScale4x4_v[0] = Default_4x4_Intra;
			sps.weightScale4x4_v[3] = Default_4x4_Inter;
			for (int i = 0; i < 4; i++) {
				sps.weightScale8x8_v[i] = Default_8x8_Intra[i]; // scaling list 6
				sps.weightScale8x8_v[4 + i] = Default_8x8_Inter[i]; // scaling list 7
			}
			log_dec(dec, "  seq_scaling_matrix:\n");
			parse_scaling_lists(dec, sps.weightScale4x4_v, sps.weightScale8x8_v, 1, sps.chroma_format_idc);
		}
	} else {
		log_dec(dec, "  default_chroma_format_idc: 0 # 4:2:0\n"
			"  default_bit_depth: {luma: 8, chroma: 8}\n");
	}
	
	sps.log2_max_frame_num = get_ue16(&dec->_gb, 12) + 4;
	sps.pic_order_cnt_type = get_ue16(&dec->_gb, 2);
	log_dec(dec, "  log2_max_frame_num: %u\n"
		"  pic_order_cnt_type: %u\n",
		sps.log2_max_frame_num,
		sps.pic_order_cnt_type);
	
	if (sps.pic_order_cnt_type == 0) {
		sps.log2_max_pic_order_cnt_lsb = get_ue16(&dec->_gb, 12) + 4;
		log_dec(dec, "  log2_max_pic_order_cnt_lsb: %u\n",
			sps.log2_max_pic_order_cnt_lsb);
	
	// clearly one of the spec's useless bits (and a waste of time to implement)
	} else if (sps.pic_order_cnt_type == 1) {
		sps.delta_pic_order_always_zero_flag = get_u1(&dec->_gb);
		sps.offset_for_non_ref_pic = get_se32(&dec->_gb, -32768, 32767); // tighter than spec thanks to condition on DiffPicOrderCnt
		sps.offset_for_top_to_bottom_field = get_se32(&dec->_gb, -32768, 32767);
		sps.num_ref_frames_in_pic_order_cnt_cycle = get_ue16(&dec->_gb, 255);
		log_dec(dec, "  delta_pic_order_always_zero_flag: %u\n"
			"  offset_for_non_ref_pic: %d\n"
			"  offset_for_top_to_bottom_field: %d\n"
			"  offsets_for_ref_frames: [",
			sps.delta_pic_order_always_zero_flag,
			sps.offset_for_non_ref_pic,
			sps.offset_for_top_to_bottom_field);
		for (int i = 1, delta = 0; i <= sps.num_ref_frames_in_pic_order_cnt_cycle; i++) {
			int offset_for_ref_frame = get_se32(&dec->_gb, -65535, 65535);
			log_dec(dec, "%d,", offset_for_ref_frame);
			sps.PicOrderCntDeltas[i] = delta += offset_for_ref_frame;
		}
		log_dec(dec, "]\n");
	}
	
	// Max width is imposed by some int16 storage, wait for actual needs to push it.
	sps.max_num_ref_frames = get_ue16(&dec->_gb, 16);
	int gaps_in_frame_num_value_allowed_flag = get_u1(&dec->_gb);
	sps.pic_width_in_mbs = get_ue16(&dec->_gb, 1022) + 1;
	int pic_height_in_map_units = get_ue16(&dec->_gb, 527 << sps.frame_mbs_only_flag) + 1;
	sps.frame_mbs_only_flag = get_u1(&dec->_gb);
	sps.pic_height_in_mbs = pic_height_in_map_units << 1 >> sps.frame_mbs_only_flag;
	int MaxDpbFrames = min(MaxDpbMbs[min(level_idc, 63)] / (unsigned)(sps.pic_width_in_mbs * sps.pic_height_in_mbs), 16);
	sps.max_num_reorder_frames = ((profile_idc == 44 || profile_idc == 86 ||
		profile_idc == 100 || profile_idc == 110 || profile_idc == 122 ||
		profile_idc == 244) && (constraint_set_flags & 1 << 4)) ? 0 : MaxDpbFrames;
	sps.num_frame_buffers = max(sps.max_num_reorder_frames, sps.max_num_ref_frames) + 1;
	log_dec(dec, "  max_num_ref_frames: %u\n"
		"  gaps_in_frame_num_value_allowed_flag: %u\n"
		"  pic_size_in_mbs: {width: %u, height: %u}\n"
		"  frame_mbs_only_flag: %u%s\n",
		sps.max_num_ref_frames,
		gaps_in_frame_num_value_allowed_flag,
		sps.pic_width_in_mbs,
		sps.pic_height_in_mbs,
		sps.frame_mbs_only_flag, unsup_if(!sps.frame_mbs_only_flag));
	if (sps.frame_mbs_only_flag == 0) {
		sps.mb_adaptive_frame_field_flag = get_u1(&dec->_gb);
		log_dec(dec, "  mb_adaptive_frame_field_flag: %u\n",
			sps.mb_adaptive_frame_field_flag);
	}
	sps.direct_8x8_inference_flag = get_u1(&dec->_gb);
	log_dec(dec, "  direct_8x8_inference_flag: %u\n",
		sps.direct_8x8_inference_flag);
	
	// frame_cropping_flag
	if (get_u1(&dec->_gb)) {
		unsigned shiftX = ((sps.ChromaArrayType == 1) | (sps.ChromaArrayType == 2));
		unsigned shiftY = (sps.ChromaArrayType == 1) + 1 - sps.frame_mbs_only_flag;
		int limX = (sps.pic_width_in_mbs << 4 >> shiftX) - 1;
		int limY = (sps.pic_height_in_mbs << 4 >> shiftY) - 1;
		sps.frame_crop_offsets[3] = get_ue16(&dec->_gb, limX) << shiftX;
		sps.frame_crop_offsets[1] = get_ue16(&dec->_gb, limX - (sps.frame_crop_offsets[3] >> shiftX)) << shiftX;
		sps.frame_crop_offsets[0] = get_ue16(&dec->_gb, limY) << shiftY;
		sps.frame_crop_offsets[2] = get_ue16(&dec->_gb, limY - (sps.frame_crop_offsets[0] >> shiftY)) << shiftY;
		log_dec(dec, "  frame_crop_offsets: {left: %u, right: %u, top: %u, bottom: %u}\n",
			sps.frame_crop_offsets[3], sps.frame_crop_offsets[1], sps.frame_crop_offsets[0], sps.frame_crop_offsets[2]);
	}
	
	if (get_u1(&dec->_gb)) {
		log_dec(dec, "  vui_parameters:\n");
		parse_vui_parameters(dec, &sps);
	} else {
		log_dec(dec, "  default_max_num_reorder_frames: %u\n"
			"  default_max_dec_frame_buffering: %u\n",
			sps.max_num_reorder_frames,
			sps.num_frame_buffers - 1);
	}
	
	// additional stuff for subset_seq_parameter_set
	if (dec->nal_unit_type == 15) {
		if ((profile_idc != 118 && profile_idc != 128 && profile_idc != 134) ||
			sps.DPB_format != dec->sps.DPB_format)
			return ENOTSUP;
		if (!get_u1(&dec->_gb))
			return EBADMSG;
		if (parse_seq_parameter_set_mvc_extension(dec, profile_idc))
			return ENOTSUP;
		if (get_u1(&dec->_gb))
			parse_mvc_vui_parameters_extension(dec, &sps);
		get_u1(&dec->_gb);
		// rbsp_trailing_bits are ignored at the moment since some streams seem to get it wrong
	} else {
		if (!rbsp_end(&dec->_gb))
			return EBADMSG;
	}
	
	// check for unsupported features
	if (dec->log_pos >= sizeof(dec->log_buf) || sps.ChromaArrayType != 1 ||
		sps.BitDepth_Y + sps.BitDepth_C != 16 ||
		sps.qpprime_y_zero_transform_bypass_flag || !sps.frame_mbs_only_flag)
		return ENOTSUP;
	
	// apply the changes on the dependent variables if the frame format changed
	if (sps.DPB_format != dec->sps.DPB_format || sps.frame_crop_offsets_l != dec->sps.frame_crop_offsets_l) {
		for (unsigned o = dec->output_flags; o; o &= o - 1)
			dec->dispTopFieldOrderCnt = max(dec->dispTopFieldOrderCnt, dec->FieldOrderCnt[0][__builtin_ctz(o)]);
		if (dec->busy_tasks) {
			if (non_blocking)
				return EWOULDBLOCK;
			while (dec->busy_tasks)
				pthread_cond_wait(&dec->task_complete, &dec->lock);
		}
		if (dec->output_flags | dec->borrow_flags)
			return ENOBUFS;
		memcpy(dec->out.frame_crop_offsets, &sps.frame_crop_offsets_l, 8);
		int width = sps.pic_width_in_mbs << 4;
		int height = sps.pic_height_in_mbs << 4;
		dec->out.pixel_depth_Y = sps.BitDepth_Y > 8;
		dec->out.width_Y = width - dec->out.frame_crop_offsets[3] - dec->out.frame_crop_offsets[1];
		dec->out.height_Y = height - dec->out.frame_crop_offsets[0] - dec->out.frame_crop_offsets[2];
		dec->out.stride_Y = width << dec->out.pixel_depth_Y;
		if (!(dec->out.stride_Y & 2047)) // add an offset to stride if it is a multiple of 2048
			dec->out.stride_Y += 16 << dec->out.pixel_depth_Y;
		dec->plane_size_Y = dec->out.stride_Y * height;
		if (sps.chroma_format_idc > 0) {
			dec->out.pixel_depth_C = sps.BitDepth_C > 8;
			dec->out.width_C = sps.chroma_format_idc == 3 ? dec->out.width_Y : dec->out.width_Y >> 1;
			dec->out.stride_C = (sps.chroma_format_idc == 3 ? width << 1 : width) << dec->out.pixel_depth_C;
			if (!(dec->out.stride_C & 4095)) // add an offset to stride if it is a multiple of 4096
				dec->out.stride_C += (sps.chroma_format_idc == 3 ? 16 : 8) << dec->out.pixel_depth_C;
			dec->out.height_C = sps.chroma_format_idc == 1 ? dec->out.height_Y >> 1 : dec->out.height_Y;
			dec->plane_size_C = (sps.chroma_format_idc == 1 ? height >> 1 : height) * dec->out.stride_C;
		}
		int mbs = (sps.pic_width_in_mbs + 1) * sps.pic_height_in_mbs - 1;
		dec->frame_size = dec->plane_size_Y + dec->plane_size_C + mbs * sizeof(Edge264Macroblock);
		dec->currPic = -1;
		dec->PrevRefFrameNum[0] = dec->PrevRefFrameNum[1] = -1;
		dec->prevPicOrderCnt[0] = dec->prevPicOrderCnt[1] = 0;
		dec->reference_flags = dec->long_term_flags = dec->frame_flip_bits = dec->non_base_views = 0;
		dec->ssps.DPB_format = 0;
		for (int i = 0; i < 32; i++) {
			if (dec->frame_buffers[i] != NULL) {
				free(dec->frame_buffers[i]);
				dec->frame_buffers[i] = NULL;
			}
		}
	}
	*(dec->nal_unit_type == 7 ? &dec->sps : &dec->ssps) = sps;
	print_dec(dec);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x438, %rsp            # imm = 0x438
movl %esi, %r13d
movq %rdi, %rbx
leaq 0x11b52(%rip), %rsi     # 0x32070
leaq 0x20(%rsp), %rdi
movl $0x410, %edx            # imm = 0x410
callq 0x10c0
pushq $0x8
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1539a
movl %eax, %r14d
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1539a
movl %eax, 0x4(%rsp)
movq %rbx, %rdi
movl %ebp, %esi
movq %r14, %rbp
callq 0x1539a
movl %eax, (%rsp)
pushq $0x1f
popq %rsi
movq %rbx, %rdi
callq 0x1f4be
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x20620
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movslq %ebp, %rax
leaq 0x115c2(%rip), %rcx     # 0x31b58
movslq (%rcx,%rax,4), %r8
addq %rcx, %r8
movl 0x4(%rsp), %eax
movl %eax, %r9d
shrl $0x7, %r9d
movl %eax, %r10d
shrl $0x6, %r10d
andl $0x1, %r10d
movl %eax, %r11d
shrl $0x5, %r11d
andl $0x1, %r11d
movl %eax, %r14d
shrl $0x4, %r14d
andl $0x1, %r14d
movl %eax, %r15d
shrl $0x3, %r15d
andl $0x1, %r15d
movl %eax, %r12d
shrl $0x2, %r12d
andl $0x1, %r12d
vcvtsi2ssl (%rsp), %xmm0, %xmm0
vdivss 0x13194(%rip), %xmm0, %xmm0 # 0x33780
vcvtss2sd %xmm0, %xmm0, %xmm0
subq $0x8, %rsp
leaq 0x13968(%rip), %rdx     # 0x33f63
movl %ebp, %ecx
movb $0x1, %al
pushq %r12
pushq %r15
pushq %r14
pushq %r11
pushq %r10
callq 0x1070
addq $0x30, %rsp
addw 0x7cb0(%rbx), %ax
movw %ax, 0x7cb0(%rbx)
movq %rbp, 0x8(%rsp)
leal -0x42(%rbp), %ecx
cmpl $0x16, %ecx
ja 0x20673
movl $0x400801, %edx         # imm = 0x400801
btl %ecx, %edx
jae 0x20673
cmpw $0x2541, %ax            # imm = 0x2541
ja 0x208ab
movzwl %ax, %ecx
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movzwl %cx, %esi
leaq 0x13a06(%rip), %rdx     # 0x34066
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
jmp 0x208ab
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x1f4be
movl %eax, %ebp
movb %bpl, 0x20(%rsp)
movb %bpl, 0x28(%rsp)
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x206ee
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movzwl %cx, %esi
movsbl %bpl, %ecx
movsbq %bpl, %rax
leaq 0x1189b(%rip), %rdx     # 0x31f58
movslq (%rdx,%rax,4), %r8
addq %rdx, %r8
cmpb $0x1, %cl
leaq 0x141c1(%rip), %rax     # 0x3488f
leaq 0x10edd(%rip), %r9      # 0x315b2
cmoveq %rax, %r9
leaq 0x138d9(%rip), %rdx     # 0x33fb9
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
cmpb $0x3, %bpl
jne 0x20742
movq %rbx, %rdi
callq 0x1f662
imull $-0x3, %eax, %ecx
addb $0x3, %cl
movb %cl, 0x28(%rsp)
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x20742
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
leaq 0x138a7(%rip), %rdx     # 0x33fd9
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
pushq $0x6
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1f4be
movl %eax, %r14d
leal 0x8(%r14), %r15d
movb %r15b, 0x21(%rsp)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1f4be
movl %eax, %ebp
addb $0x8, %bpl
movb %bpl, 0x22(%rsp)
movq %rbx, %rdi
callq 0x1f662
movb %al, 0x29(%rsp)
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x207e8
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
movsbl %r15b, %ecx
movsbl %bpl, %r8d
testb %r14b, %r14b
leaq 0x140dc(%rip), %rdx     # 0x3488f
leaq 0x10df8(%rip), %r10     # 0x315b2
movq %r10, %r9
cmoveq %rdx, %r9
movsbl %al, %r11d
testb $-0x1, %r11b
cmoveq %rdx, %r10
leaq 0x13827(%rip), %rdx     # 0x33ffb
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x1070
popq %rcx
popq %rdx
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x1f662
testl %eax, %eax
je 0x208ab
leaq 0x250(%rsp), %r14
vmovaps 0xcc58(%rip), %xmm0     # 0x2d460
vmovaps %xmm0, (%r14)
vmovaps 0xcc5b(%rip), %xmm0     # 0x2d470
vmovaps %xmm0, 0x30(%r14)
leaq 0x2b0(%rsp), %r15
xorl %eax, %eax
leaq 0x11c54(%rip), %rcx     # 0x32480
leaq 0x11c8d(%rip), %rdx     # 0x324c0
cmpq $0x40, %rax
je 0x2085b
vmovaps (%rax,%rcx), %xmm0
vmovaps %xmm0, 0x2b0(%rsp,%rax)
vmovaps (%rax,%rdx), %xmm0
vmovaps %xmm0, 0x2f0(%rsp,%rax)
addq $0x10, %rax
jmp 0x20833
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0x20894
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movzwl %cx, %esi
leaq 0x137c9(%rip), %rdx     # 0x3404f
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movsbl 0x20(%rsp), %r8d
pushq $0x1
popq %rcx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x20068
pushq $0xc
popq %rsi
movq %rbx, %rdi
callq 0x1f4be
movl %eax, %r14d
addb $0x4, %r14b
movb %r14b, 0x2a(%rsp)
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x1f4be
movl %eax, %ebp
movb %bpl, 0x2b(%rsp)
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x20915
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movzwl %cx, %esi
movsbl %r14b, %ecx
movsbl %bpl, %r8d
leaq 0x137b1(%rip), %rdx     # 0x340b8
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
cmpb $0x1, %bpl
movl %r13d, 0x14(%rsp)
je 0x20981
movzbl %bpl, %eax
testl %eax, %eax
movq 0x8(%rsp), %rbp
jne 0x20ac9
pushq $0xc
popq %rsi
movq %rbx, %rdi
callq 0x1f4be
addb $0x4, %al
movb %al, 0x2c(%rsp)
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x20ac9
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
movsbl %al, %ecx
leaq 0x13776(%rip), %rdx     # 0x340eb
xorl %eax, %eax
callq 0x1070
jmp 0x20ac2
movq %rbx, %rdi
callq 0x1f662
movl %eax, %ebp
movb %bpl, 0x2d(%rsp)
movq %rbx, %rdi
movl $0xffff8000, %esi       # imm = 0xFFFF8000
movl $0x7fff, %edx           # imm = 0x7FFF
callq 0x1f6a0
movl %eax, %r14d
movw %r14w, 0x3c(%rsp)
movq %rbx, %rdi
movl $0xffff8000, %esi       # imm = 0xFFFF8000
movl $0x7fff, %edx           # imm = 0x7FFF
callq 0x1f6a0
movl %eax, %r12d
movw %r12w, 0x3e(%rsp)
movq %rbx, %rdi
movl $0xff, %esi
callq 0x1f4be
movl %eax, %r15d
movb %r15b, 0x2e(%rsp)
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x20a25
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movsbl %bpl, %ecx
movswl %r14w, %r8d
movswl %r12w, %r9d
leaq 0x136fd(%rip), %rdx     # 0x3410d
xorl %eax, %eax
callq 0x1070
addw 0x7cb0(%rbx), %ax
movw %ax, 0x7cb0(%rbx)
leaq 0x7cb2(%rbx), %r14
movzbl %r15b, %r12d
xorl %r13d, %r13d
xorl %r15d, %r15d
cmpq %r13, %r12
je 0x20a96
movq %rbx, %rdi
movl $0xffff0001, %esi       # imm = 0xFFFF0001
movl $0xffff, %edx           # imm = 0xFFFF
callq 0x1f6a0
movl %eax, %ebp
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x20a88
leaq (%r14,%rax), %rdi
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
leaq 0x13721(%rip), %rdx     # 0x34192
movl %ebp, %ecx
xorl %eax, %eax
callq 0x1070
addw 0x7cb0(%rbx), %ax
movw %ax, 0x7cb0(%rbx)
addl %ebp, %r15d
movw %r15w, 0x4a(%rsp,%r13,2)
incq %r13
jmp 0x20a36
cmpw $0x2542, %ax            # imm = 0x2542
movq 0x8(%rsp), %rbp
jae 0x20ac9
movzwl %ax, %ecx
addq %rcx, %r14
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movzwl %cx, %esi
leaq 0x13dc8(%rip), %rdx     # 0x34880
movq %r14, %rdi
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
pushq $0x10
popq %r14
movq %rbx, %rdi
movl %r14d, %esi
callq 0x1f4be
movl %eax, %r12d
movb %r12b, 0x2f(%rsp)
movq %rbx, %rdi
callq 0x1f662
movl %eax, 0x18(%rsp)
movq %rbx, %rdi
movl $0x3fe, %esi            # imm = 0x3FE
callq 0x1f4be
movl %eax, %r13d
incl %r13d
movw %r13w, 0x24(%rsp)
movb 0x30(%rsp), %al
movl $0x20f, %ecx            # imm = 0x20F
shlxl %eax, %ecx, %esi
movq %rbx, %rdi
callq 0x1f4be
movl %eax, %r15d
movq %rbx, %rdi
callq 0x1f662
movl %r14d, %esi
movl %eax, %r14d
movb %r14b, 0x30(%rsp)
leal 0x2(,%r15,2), %eax
sarxl %r14d, %eax, %edi
movw %di, 0x26(%rsp)
movl (%rsp), %ecx
cmpl $0x3f, %ecx
pushq $0x3f
popq %rax
cmovll %ecx, %eax
cltq
leaq 0x11418(%rip), %rcx     # 0x31f70
movl (%rcx,%rax,4), %eax
movzwl %r13w, %r13d
movswl %di, %r10d
movl %r10d, %ecx
imull %r13d, %ecx
xorl %edx, %edx
divl %ecx
cmpl $0x10, %eax
cmovll %eax, %esi
leal -0x56(%rbp), %eax
cmpl $0x24, %eax
movl %edi, 0x1c(%rsp)
ja 0x20b9b
movabsq $0x1001004001, %rcx     # imm = 0x1001004001
btq %rax, %rcx
jae 0x20b9b
testb $0x10, 0x4(%rsp)
je 0x20ba8
xorl %esi, %esi
jmp 0x20ba8
cmpl $0xf4, %ebp
je 0x20b90
cmpl $0x2c, %ebp
je 0x20b90
movb %sil, 0x34(%rsp)
movl %esi, (%rsp)
movzbl %sil, %eax
movzbl %r12b, %ecx
cmpb %r12b, %al
cmovgl %eax, %ecx
incb %cl
movl %ecx, 0x4(%rsp)
movb %cl, 0x33(%rsp)
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x20c34
movsbl %r14b, %r11d
movsbl %r12b, %ecx
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %eax, %edx
movzwl %dx, %esi
testb %r14b, %r14b
leaq 0x109b4(%rip), %rax     # 0x315b2
leaq 0x13c8a(%rip), %r15     # 0x3488f
cmoveq %rax, %r15
subq $0x8, %rsp
leaq 0x13582(%rip), %rdx     # 0x34196
movl 0x20(%rsp), %r8d
movl %r13d, %r9d
xorl %eax, %eax
pushq %r15
pushq %r11
pushq %r10
callq 0x1070
addq $0x20, %rsp
addw %ax, 0x7cb0(%rbx)
testb %r14b, %r14b
jne 0x20c82
movq %rbx, %rdi
callq 0x1f662
movb %al, 0x31(%rsp)
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x20c82
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
movsbl %al, %ecx
leaq 0x135ae(%rip), %rdx     # 0x34222
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x1f662
movb %al, 0x32(%rsp)
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x20ccb
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
movsbl %al, %ecx
leaq 0x13589(%rip), %rdx     # 0x34246
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x1f662
testl %eax, %eax
je 0x20ddd
movb 0x28(%rsp), %al
xorl %r12d, %r12d
cmpb $0x1, %al
sete %r12b
decb %al
cmpb $0x2, %al
setb %bpl
subl %r14d, %r12d
shll $0x4, %r13d
shrxl %ebp, %r13d, %r15d
decl %r15d
movswl 0x1c(%rsp), %eax
shll $0x4, %eax
incb %r12b
sarxl %r12d, %eax, %r14d
decl %r14d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x1f4be
shlxl %ebp, %eax, %r13d
movw %r13w, 0x24e(%rsp)
movswl %r13w, %eax
sarxl %ebp, %eax, %eax
subl %eax, %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x1f4be
shlxl %ebp, %eax, %r15d
movw %r15w, 0x24a(%rsp)
movq %rbx, %rdi
movl %r14d, %esi
callq 0x1f4be
shlxl %r12d, %eax, %ebp
movw %bp, 0x248(%rsp)
movswl %bp, %eax
sarxl %r12d, %eax, %eax
subl %eax, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x1f4be
shlxl %r12d, %eax, %eax
movw %ax, 0x24c(%rsp)
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x20ddd
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
movswl %r13w, %ecx
movswl %r15w, %r8d
movswl %bp, %r9d
movswl %ax, %r10d
subq $0x8, %rsp
leaq 0x1349c(%rip), %rdx     # 0x34267
xorl %eax, %eax
pushq %r10
callq 0x1070
popq %rcx
popq %rdx
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x1f662
movl %eax, %ecx
movzwl 0x7cb0(%rbx), %eax
movzwl %ax, %edx
testl %ecx, %ecx
je 0x20e54
cmpw $0x2541, %ax            # imm = 0x2541
ja 0x20e23
leaq (%rbx,%rdx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %esi           # imm = 0x2542
subq %rdx, %rsi
leaq 0x13494(%rip), %rdx     # 0x342a9
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x1f662
testl %eax, %eax
je 0x20ee5
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x1539a
movl %eax, %ebp
cmpl $0xff, %eax
jne 0x20e8a
pushq $0x20
popq %rsi
movq %rbx, %rdi
callq 0x1539a
jmp 0x20e99
cmpw $0x2541, %ax            # imm = 0x2541
ja 0x214e1
leaq (%rbx,%rdx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %esi           # imm = 0x2542
subq %rdx, %rsi
movsbl (%rsp), %ecx
movsbl 0x4(%rsp), %r8d
decl %r8d
leaq 0x13437(%rip), %rdx     # 0x342bc
jmp 0x214cc
movl %ebp, %eax
andl $0x1f, %eax
leaq 0x1276a(%rip), %rcx     # 0x33600
movl (%rcx,%rax,4), %eax
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x20ee5
movl $0xffff, %edx           # imm = 0xFFFF
movl %eax, %r9d
andl %edx, %r9d
shrl $0x10, %eax
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %esi           # imm = 0x2542
subl %ecx, %esi
andl %edx, %esi
leaq 0x14016(%rip), %rdx     # 0x34ee8
movl %ebp, %ecx
movl %eax, %r8d
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x1f662
testl %eax, %eax
je 0x20efb
movq %rbx, %rdi
callq 0x1f662
jmp 0x20efe
pushq $-0x1
popq %rax
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x20f3a
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
leaq 0x13ff2(%rip), %rdx     # 0x34f1c
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x1f662
testl %eax, %eax
je 0x2107c
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x1539a
movl %eax, %ebp
movq %rbx, %rdi
callq 0x1f662
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x20faf
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
movslq %ebp, %rcx
leaq 0x126f2(%rip), %rdx     # 0x33680
movslq (%rdx,%rcx,4), %r8
addq %rdx, %r8
leaq 0x13fa3(%rip), %rdx     # 0x34f3f
movl %ebp, %ecx
movl %eax, %r9d
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x1f662
testl %eax, %eax
je 0x2107c
pushq $0x18
popq %rsi
movq %rbx, %rdi
callq 0x1539a
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x2107c
movl $0xff, %edx
movl %eax, %r10d
andl %edx, %r10d
movl %eax, %r9d
shrl $0x8, %r9d
andl %edx, %r9d
shrl $0x10, %eax
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
cmpl $0x17, %eax
pushq $0x17
popq %rcx
cmovbl %eax, %ecx
leaq 0x12685(%rip), %rdx     # 0x336a0
movslq (%rdx,%rcx,4), %r8
addq %rdx, %r8
cmpl $0x12, %r9d
pushq $0x12
popq %rcx
cmovbl %r9d, %ecx
leaq 0x126cc(%rip), %rdx     # 0x33700
movslq (%rdx,%rcx,4), %r11
addq %rdx, %r11
cmpl $0xc, %r10d
pushq $0xc
popq %rcx
movq %rcx, %rdx
cmovbl %r10d, %edx
leaq 0x126fc(%rip), %rcx     # 0x3374c
movslq (%rcx,%rdx,4), %r14
addq %rcx, %r14
subq $0x8, %rsp
leaq 0x13f16(%rip), %rdx     # 0x34f78
movl %eax, %ecx
xorl %eax, %eax
pushq %r14
pushq %r10
pushq %r11
callq 0x1070
addq $0x20, %rsp
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x1f662
testl %eax, %eax
je 0x210e3
pushq $0x5
popq %r14
movq %rbx, %rdi
movl %r14d, %esi
callq 0x1f4be
movl %eax, %ebp
movq %rbx, %rdi
movl %r14d, %esi
callq 0x1f4be
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x210e3
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
leaq 0x13f0e(%rip), %rdx     # 0x34fde
movl %ebp, %ecx
movl %eax, %r8d
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x1f662
testl %eax, %eax
je 0x2116e
pushq $0x20
popq %r14
movq %rbx, %rdi
movl %r14d, %esi
callq 0x1539a
movl %eax, %ebp
cmpl $0x1, %eax
adcl $0x0, %ebp
movl %ebp, 0x40(%rsp)
movq %rbx, %rdi
movl %r14d, %esi
callq 0x1539a
movl %eax, %r14d
cmpl $0x1, %eax
adcl $0x0, %r14d
movl %r14d, 0x44(%rsp)
movq %rbx, %rdi
callq 0x1f662
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x2116e
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
leaq 0x13eb4(%rip), %rdx     # 0x3500c
movl %ebp, %ecx
movl %r14d, %r8d
movl %eax, %r9d
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x1f662
movl %eax, %ebp
testl %eax, %eax
je 0x211ce
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x211b5
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movzwl %cx, %esi
leaq 0x13eb1(%rip), %rdx     # 0x35058
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
leaq 0x35(%rsp), %rdx
leaq 0x1426b(%rip), %rcx     # 0x3542c
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x2bf47
movq %rbx, %rdi
callq 0x1f662
movl %eax, %r14d
testl %eax, %eax
je 0x2122f
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x21216
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movzwl %cx, %esi
leaq 0x13e69(%rip), %rdx     # 0x35071
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
leaq 0x36(%rsp), %rdx
leaq 0x1420a(%rip), %rcx     # 0x3542c
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x2bf47
orl %ebp, %r14d
je 0x21278
movq %rbx, %rdi
callq 0x1f662
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x21278
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
leaq 0x141f0(%rip), %rdx     # 0x35458
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x1f662
movb %al, 0x3b(%rsp)
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x212c1
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
movsbl %al, %ecx
leaq 0x141c3(%rip), %rdx     # 0x35476
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x1f662
testl %eax, %eax
je 0x21495
movq %rbx, %rdi
callq 0x1f662
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x21315
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
leaq 0x13d85(%rip), %rdx     # 0x3508a
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movsbl 0x21(%rsp), %eax
shll $0x8, %eax
movb 0x20(%rsp), %cl
pushq $0x40
popq %rdx
shlxl %ecx, %edx, %ecx
andl $-0x80, %ecx
movsbl 0x22(%rsp), %ebp
imull %ecx, %ebp
addl %eax, %ebp
pushq $0x10
popq %rsi
movq %rbx, %rdi
callq 0x1f4be
testl %eax, %eax
je 0x21398
movl %eax, %ecx
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x21398
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %eax, %edx
movzwl %dx, %esi
movzwl 0x24(%rsp), %edx
movswl 0x26(%rsp), %eax
imull %edx, %eax
imull %ebp, %eax
shll $0x3, %ecx
cltd
idivl %ecx
leaq 0x13d33(%rip), %rdx     # 0x350bb
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
pushq $0x10
popq %rsi
movq %rbx, %rdi
callq 0x1f4be
testl %eax, %eax
je 0x213ec
movl %eax, %ecx
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x213ec
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %eax, %edx
movzwl %dx, %esi
subl $-0x80, %ebp
movl %ebp, %eax
cltd
idivl %ecx
leaq 0x13cfa(%rip), %rdx     # 0x350d6
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
pushq $0xf
popq %r14
movq %rbx, %rdi
movl %r14d, %esi
callq 0x1f4be
movl %eax, %ebp
movq %rbx, %rdi
movl %r14d, %esi
callq 0x1f4be
movl %eax, %r14d
pushq $0x10
popq %r12
movq %rbx, %rdi
movl %r12d, %esi
callq 0x1f4be
movl %eax, %r15d
movb %r15b, 0x34(%rsp)
movq %rbx, %rdi
movl %r12d, %esi
callq 0x1f4be
movzbl 0x2f(%rsp), %ecx
cmpb %r15b, %cl
cmovlel %r15d, %ecx
movsbl %cl, %ecx
cmpl %ecx, %eax
cmovgl %eax, %ecx
incb %cl
movb %cl, 0x33(%rsp)
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x214e1
movsbl %r15b, %r9d
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movsbl %cl, %r10d
decl %r10d
subq $0x8, %rsp
leaq 0x13c6c(%rip), %rdx     # 0x350ef
movl %ebp, %ecx
movl %r14d, %r8d
xorl %eax, %eax
pushq %r10
callq 0x1070
popq %rcx
popq %rdx
jmp 0x214d3
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x214e1
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movsbl 0x34(%rsp), %ecx
movsbl 0x33(%rsp), %r8d
decl %r8d
leaq 0x13cad(%rip), %rdx     # 0x35179
xorl %eax, %eax
callq 0x1070
addw 0x7cb0(%rbx), %ax
movw %ax, 0x7cb0(%rbx)
cmpb $0xf, 0x22(%rbx)
pushq $0x5f
popq %r8
pushq $0x4a
popq %rbp
jne 0x215bc
movq 0x8(%rsp), %rax
addl $-0x76, %eax
cmpl $0x10, %eax
ja 0x21692
movl $0x10401, %ecx          # imm = 0x10401
btl %eax, %ecx
jae 0x21692
movq 0x20(%rsp), %rax
cmpq 0x530(%rbx), %rax
jne 0x21692
movq %rbx, %rdi
callq 0x1f662
testl %eax, %eax
je 0x2193a
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x1f4be
incl %eax
leaq 0x7cb2(%rbx), %rbp
movl %eax, %ecx
sarl $0x1f, %ecx
movl %eax, (%rsp)
andnl %eax, %ecx, %r15d
leaq 0x13d2b(%rip), %r12     # 0x35288
leaq 0x135bb(%rip), %r13     # 0x34b1f
xorl %r14d, %r14d
cmpl %r14d, %r15d
je 0x2169a
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x1f4be
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x215b7
movq %rcx, %rdi
addq %rbp, %rdi
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
testl %r14d, %r14d
movq %r13, %rdx
cmoveq %r12, %rdx
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
incl %r14d
jmp 0x21567
movq 0x10(%rbx), %rdx
movq 0x18(%rbx), %rsi
movq %rsi, %rcx
shrq $0x3f, %rcx
shlxq %rcx, %rsi, %rsi
blsrq %rdx, %rdi
orq %rsi, %rdi
jne 0x2193a
tzcntq %rdx, %rdx
movl (%rbx), %esi
subl 0x8(%rbx), %esi
addl %ecx, %edx
leal (%rdx,%rsi,8), %ecx
addl $0xffffff78, %ecx       # imm = 0xFFFFFF78
cmpl $-0x10, %ecx
jb 0x2193a
cmpw $0x2541, %ax            # imm = 0x2541
ja 0x21692
cmpb $0x1, 0x28(%rsp)
jne 0x21692
movsbl 0x21(%rsp), %eax
movsbl 0x22(%rsp), %ecx
addl %eax, %ecx
cmpl $0x10, %ecx
jne 0x21692
cmpb $0x0, 0x29(%rsp)
jne 0x21692
cmpb $0x0, 0x30(%rsp)
movl %r8d, %ebp
je 0x2193a
movq 0x20(%rsp), %r13
cmpq 0x530(%rbx), %r13
jne 0x21c2e
movq 0x248(%rsp), %rax
cmpq 0x758(%rbx), %rax
jne 0x21c2e
leaq 0x530(%rbx), %rax
leaq 0x940(%rbx), %rdi
cmpb $0x7, 0x22(%rbx)
cmoveq %rax, %rdi
leaq 0x20(%rsp), %rsi
movl $0x410, %edx            # imm = 0x410
callq 0x10c0
movq %rbx, %rdi
callq 0x15361
xorl %ebp, %ebp
jmp 0x2193a
movl %r8d, %ebp
jmp 0x2193a
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2542, %rax           # imm = 0x2542
movl (%rsp), %r14d
jae 0x216e8
movq %rax, %rdi
addq %rbp, %rdi
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movzwl %cx, %esi
cmpl $0x2, %r14d
leaq 0x131c7(%rip), %rax     # 0x3488f
leaq 0xfee3(%rip), %rcx      # 0x315b2
cmoveq %rax, %rcx
leaq 0x13bbe(%rip), %rdx     # 0x35298
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
cmpl $0x2, %r14d
jne 0x21937
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x1f4be
movl %eax, %r13d
testl %eax, %eax
je 0x21711
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x1f4be
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x1f4be
movl %eax, %r14d
testl %eax, %eax
je 0x21730
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x1f4be
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x1f4be
movl %eax, %r15d
testl %eax, %eax
je 0x2174f
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x1f4be
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x1f4be
movl %eax, %r12d
testl %eax, %eax
je 0x2176e
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x1f4be
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x217b3
movq %rax, %rdi
addq %rbp, %rdi
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movzwl %cx, %esi
subq $0x8, %rsp
leaq 0x13b05(%rip), %rdx     # 0x3529d
movl %r13d, %ecx
movl %r14d, %r8d
movl %r15d, %r9d
xorl %eax, %eax
pushq %r12
callq 0x1070
popq %rcx
popq %rdx
addw %ax, 0x7cb0(%rbx)
pushq $0x3f
popq %rsi
movq %rbx, %rdi
callq 0x1f4be
leaq 0x13b8b(%rip), %r12     # 0x35350
leaq 0x13043(%rip), %r13     # 0x3480f
testl %eax, %eax
js 0x2192d
movl %eax, (%rsp)
movq %rbx, %rdi
pushq $0x8
popq %rsi
callq 0x1539a
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x21827
movq %rcx, %rdi
addq %rbp, %rdi
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
vcvtsi2ss %eax, %xmm1, %xmm0
vdivss 0x11f72(%rip), %xmm0, %xmm0 # 0x33780
vcvtss2sd %xmm0, %xmm0, %xmm0
leaq 0x13aeb(%rip), %rdx     # 0x35304
movb $0x1, %al
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x1f4be
movl %eax, %r15d
testl %r15d, %r15d
js 0x21923
movq %rbx, %rdi
pushq $0x3
popq %rsi
callq 0x1539a
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x21882
movq %rcx, %rdi
addq %rbp, %rdi
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
leaq 0x13abc(%rip), %rdx     # 0x3532e
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x1f4be
movl %eax, %r14d
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x1f4be
movzwl 0x7cb0(%rbx), %ecx
testl %r14d, %r14d
js 0x218dd
cmpw $0x2541, %cx            # imm = 0x2541
ja 0x218d8
leaq (%rcx,%rbp), %rdi
movl $0x2542, %esi           # imm = 0x2542
subq %rcx, %rsi
testl %r14d, %r14d
movq %r13, %rdx
cmoveq %r12, %rdx
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
decl %r14d
jmp 0x21892
cmpw $0x2542, %cx            # imm = 0x2542
jae 0x2191b
incl %eax
movq %rcx, %rdi
addq %rbp, %rdi
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
testl %r15d, %r15d
leaq 0x13a61(%rip), %rdx     # 0x35361
leaq 0x13a5f(%rip), %rcx     # 0x35366
cmoveq %rcx, %rdx
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
decl %r15d
jmp 0x21837
movl (%rsp), %eax
decl %eax
jmp 0x217cc
cmpl $0x86, 0x8(%rsp)
jne 0x2194e
pushq $0x5f
popq %rbp
movl %ebp, %eax
addq $0x438, %rsp            # imm = 0x438
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x1f662
testl %eax, %eax
je 0x21c16
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x21992
movq %rax, %rdi
addq %rbp, %rdi
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movzwl %cx, %esi
leaq 0x139e8(%rip), %rdx     # 0x3536c
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x1f4be
movl %eax, %r15d
leaq 0x12e0c(%rip), %r14     # 0x347b5
testl %r15d, %r15d
js 0x21c16
movq %rbx, %rdi
pushq $0x3
popq %rsi
callq 0x1539a
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x219f4
movq %rcx, %rdi
addq %rbp, %rdi
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
leaq 0x139a5(%rip), %rdx     # 0x35389
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
decl %r15d
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x1f4be
movl %eax, %r12d
testl %r12d, %r12d
js 0x21a58
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x1f4be
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x21a53
movq %rcx, %rdi
addq %rbp, %rdi
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
testl %r12d, %r12d
movq %r13, %rdx
cmoveq %r14, %rdx
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
decl %r12d
jmp 0x21a07
movl %r15d, (%rsp)
movq %rbx, %rdi
callq 0x1f662
testl %eax, %eax
je 0x21ace
movq %rbx, %rdi
pushq $0x20
popq %r15
movl %r15d, %esi
callq 0x1539a
movl %eax, %r12d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x1539a
movl %eax, %r15d
movq %rbx, %rdi
callq 0x1f662
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x21ace
movq %rcx, %rdi
addq %rbp, %rdi
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
leaq 0x138fe(%rip), %rdx     # 0x353b5
movl %r12d, %ecx
movl %r15d, %r8d
movl %eax, %r9d
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x1f662
movl %eax, %r12d
testl %eax, %eax
je 0x21b2a
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x21b11
movq %rax, %rdi
addq %rbp, %rdi
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movzwl %cx, %esi
leaq 0x13904(%rip), %rdx     # 0x35407
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
leaq 0x20(%rsp), %rsi
leaq 0x35(%rsp), %rdx
leaq 0x13905(%rip), %rcx     # 0x3542a
callq 0x2bf47
movq %rbx, %rdi
callq 0x1f662
movl %eax, %r15d
testl %eax, %eax
je 0x21b86
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x21b6d
movq %rax, %rdi
addq %rbp, %rdi
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movzwl %cx, %esi
leaq 0x138d4(%rip), %rdx     # 0x35433
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
leaq 0x20(%rsp), %rsi
leaq 0x36(%rsp), %rdx
leaq 0x138a9(%rip), %rcx     # 0x3542a
callq 0x2bf47
orl %r12d, %r15d
je 0x21bca
movq %rbx, %rdi
callq 0x1f662
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x21bca
movq %rcx, %rdi
addq %rbp, %rdi
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
leaq 0x1389c(%rip), %rdx     # 0x35456
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x1f662
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
movl (%rsp), %r15d
ja 0x219a9
movq %rcx, %rdi
addq %rbp, %rdi
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
leaq 0x13873(%rip), %rdx     # 0x35474
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
jmp 0x219a9
movq %rbx, %rdi
callq 0x1f662
movzwl 0x7cb0(%rbx), %eax
pushq $0x5f
popq %r8
jmp 0x215fc
movq %r13, %r12
shrq $0x20, %r12
movl %r13d, %ebp
shrl $0x8, %ebp
movl %r13d, %r11d
shrl $0x10, %r11d
movl 0x64(%rbx), %eax
movl %eax, %ecx
testl %ecx, %ecx
je 0x21c68
movl 0x58(%rbx), %edx
tzcntl %ecx, %esi
movl 0x3d0(%rbx,%rsi,4), %esi
cmpl %esi, %edx
cmovgl %edx, %esi
movl %esi, 0x58(%rbx)
blsrl %ecx, %ecx
jmp 0x21c47
cmpw $0x0, 0x1648(%rbx)
je 0x21cb6
cmpl $0x0, 0x14(%rsp)
je 0x21c80
pushq $0xb
jmp 0x21939
movl %r11d, (%rsp)
leaq 0x1618(%rbx), %r14
leaq 0x1590(%rbx), %r15
movw $0x1, %ax
testw %ax, %ax
je 0x21caf
movq %r14, %rdi
movq %r15, %rsi
callq 0x1050
movzwl 0x1648(%rbx), %eax
jmp 0x21c96
movl 0x64(%rbx), %eax
movl (%rsp), %r11d
orl 0x68(%rbx), %eax
je 0x21cc2
pushq $0x69
jmp 0x21939
movq 0x248(%rsp), %rdi
movq %rdi, 0x520(%rbx)
movzwl %r12w, %eax
movl %eax, %edx
shll $0x4, %edx
sarl $0x10, %r12d
movl %r12d, %ecx
shll $0x4, %ecx
cmpb $0x9, %bpl
setge %sil
setge 0x508(%rbx)
movl %edi, %r9d
movq %rdi, %r10
shrq $0x20, %r10
addl %edi, %r10d
shrq $0x30, %rdi
shrl $0x10, %r9d
addl %edi, %r9d
movl %edx, %r8d
subl %r9d, %r8d
movw %r8w, 0x50a(%rbx)
movl %ecx, %edi
subl %r10d, %edi
movw %di, 0x50e(%rbx)
shlxl %esi, %edx, %r9d
leal 0x10(%rdx), %r10d
testw $0x7f0, %r9w            # imm = 0x7F0
shlxl %esi, %r10d, %esi
cmovnel %r9d, %esi
movw %si, 0x512(%rbx)
movswl %si, %esi
imull %ecx, %esi
movl %esi, 0x2c(%rbx)
testb %r13b, %r13b
jle 0x21dde
cmpb $0x9, %r11b
setge %r9b
setge 0x509(%rbx)
movl %eax, %r10d
shll $0x5, %r10d
xorl %r11d, %r11d
cmpb $0x3, %r13b
sete %r11b
setne %bpl
movswl %r8w, %r8d
sarxl %ebp, %r8d, %r8d
movw %r8w, 0x50c(%rbx)
cmovnel %edx, %r10d
shlxl %r9d, %r10d, %edx
testw $0xff0, %dx             # imm = 0xFF0
leal 0x8(%r10,%r11,8), %r8d
shlxl %r9d, %r8d, %r8d
cmovnel %edx, %r8d
movw %r8w, 0x514(%rbx)
leal (,%r12,8), %edx
cmpb $0x1, %r13b
sete %r9b
movswl %di, %edi
sarxl %r9d, %edi, %edi
movw %di, 0x510(%rbx)
cmovel %edx, %ecx
movswl %r8w, %edx
imull %ecx, %edx
movl %edx, 0x30(%rbx)
jmp 0x21de1
movl 0x30(%rbx), %edx
incl %eax
imull %eax, %r12d
imull $0x130, %r12d, %eax     # imm = 0x130
addl %esi, %eax
addl %edx, %eax
addl $0xfffffed0, %eax       # imm = 0xFFFFFED0
movl %eax, 0x34(%rbx)
movb $-0x1, 0x24(%rbx)
orq $-0x1, 0x3c(%rbx)
andq $0x0, 0x48(%rbx)
andl $0x0, 0x78(%rbx)
andl $0x0, 0x6c(%rbx)
andq $0x0, 0x5c(%rbx)
andq $0x0, 0x940(%rbx)
xorl %r14d, %r14d
cmpq $0x20, %r14
je 0x2165e
movq 0x188(%rbx,%r14,8), %rdi
testq %rdi, %rdi
je 0x21e45
callq 0x1030
andq $0x0, 0x188(%rbx,%r14,8)
incq %r14
jmp 0x21e20