// File: /workspace/github_c_makefile_star2_O3/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, 0x18(%rsp)
movq %rdi, %rbx
leaq 0x11476(%rip), %rsi     # 0x381b0
leaq 0x20(%rsp), %rdi
movl $0x410, %edx            # imm = 0x410
callq 0x10c0
movq %rbx, %rdi
movl $0x8, %esi
callq 0x18ad7
movl %eax, %ebp
movq %rbx, %rdi
movl $0x8, %esi
callq 0x18ad7
movl %eax, %r13d
movq %rbx, %rdi
movl $0x8, %esi
callq 0x18ad7
movl %eax, 0x10(%rsp)
movq %rbx, %rdi
movl $0x1f, %esi
callq 0x25872
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x26e3d
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movslq %ebp, %rax
leaq 0x10ee2(%rip), %rcx     # 0x37c98
movslq (%rcx,%rax,4), %r8
addq %rcx, %r8
movl %r13d, %r9d
shrl $0x7, %r9d
movl %r13d, %r10d
shrl $0x6, %r10d
andl $0x1, %r10d
movl %r13d, %r11d
shrl $0x5, %r11d
andl $0x1, %r11d
movl %r13d, %r14d
shrl $0x4, %r14d
andl $0x1, %r14d
movl %r13d, %r15d
shrl $0x3, %r15d
andl $0x1, %r15d
movl %r13d, %r12d
shrl $0x2, %r12d
andl $0x1, %r12d
vcvtsi2ssl 0x10(%rsp), %xmm0, %xmm0
vdivss 0x12ac7(%rip), %xmm0, %xmm0 # 0x398d0
vcvtss2sd %xmm0, %xmm0, %xmm0
subq $0x8, %rsp
leaq 0x1329b(%rip), %rdx     # 0x3a0b3
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)
movl %r13d, 0xc(%rsp)
leal -0x42(%rbp), %ecx
cmpl $0x16, %ecx
movq %rbp, (%rsp)
ja 0x26e95
movl $0x400801, %edx         # imm = 0x400801
btl %ecx, %edx
jae 0x26e95
movzwl %ax, %eax
cmpl $0x2541, %eax           # imm = 0x2541
ja 0x270d9
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movzwl %cx, %esi
leaq 0x13334(%rip), %rdx     # 0x3a1b6
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
jmp 0x270d9
movq %rbx, %rdi
movl $0x3, %esi
callq 0x25872
movl %eax, %r13d
movb %r13b, 0x20(%rsp)
movb %r13b, 0x28(%rsp)
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x26f13
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movzwl %cx, %esi
movsbl %r13b, %ecx
movsbq %r13b, %rax
leaq 0x111b6(%rip), %rdx     # 0x38098
movslq (%rdx,%rax,4), %r8
addq %rdx, %r8
cmpb $0x1, %cl
leaq 0x13aec(%rip), %rax     # 0x3a9df
leaq 0x10800(%rip), %r9      # 0x376fa
cmoveq %rax, %r9
leaq 0x13204(%rip), %rdx     # 0x3a109
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
cmpb $0x3, %r13b
jne 0x26f69
movq %rbx, %rdi
callq 0x25dac
leal (%rax,%rax,2), %ecx
negl %ecx
addb $0x3, %cl
movb %cl, 0x28(%rsp)
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x26f69
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
leaq 0x131d0(%rip), %rdx     # 0x3a129
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
movl $0x6, %esi
callq 0x25872
movl %eax, %r14d
leal 0x8(%r14), %r15d
movb %r15b, 0x21(%rsp)
movq %rbx, %rdi
movl $0x6, %esi
callq 0x25872
movl %eax, %ebp
addb $0x8, %bpl
movb %bpl, 0x22(%rsp)
movq %rbx, %rdi
callq 0x25dac
movb %al, 0x29(%rsp)
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x27014
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 0x13a02(%rip), %rdx     # 0x3a9df
leaq 0x10716(%rip), %r10     # 0x376fa
movq %r10, %r9
cmoveq %rdx, %r9
movsbl %al, %r11d
testb $-0x1, %r11b
cmoveq %rdx, %r10
leaq 0x1314d(%rip), %rdx     # 0x3a14b
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x1070
addq $0x10, %rsp
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x25dac
testl %eax, %eax
je 0x270d9
leaq 0x250(%rsp), %r14
vmovaps 0xc56c(%rip), %xmm0     # 0x335a0
vmovaps %xmm0, (%r14)
vmovaps 0xc56f(%rip), %xmm0     # 0x335b0
vmovaps %xmm0, 0x30(%r14)
leaq 0x2b0(%rsp), %rbp
vmovups 0x11569(%rip), %ymm0    # 0x385c0
vmovups %ymm0, (%rbp)
vmovups 0x1157c(%rip), %ymm0    # 0x385e0
vmovups %ymm0, 0x20(%rbp)
vmovups 0x115af(%rip), %ymm0    # 0x38620
vmovups %ymm0, 0x60(%rbp)
vmovups 0x11582(%rip), %ymm0    # 0x38600
vmovups %ymm0, 0x40(%rbp)
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x270bf
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movzwl %cx, %esi
leaq 0x130f1(%rip), %rdx     # 0x3a19f
xorl %eax, %eax
vzeroupper
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movsbl %r13b, %r8d
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
movl $0x1, %ecx
vzeroupper
callq 0x2688b
movq %rbx, %rdi
movl $0xc, %esi
callq 0x25872
movl %eax, %r14d
addb $0x4, %r14b
movb %r14b, 0x2a(%rsp)
movq %rbx, %rdi
movl $0x2, %esi
callq 0x25872
movl %eax, %ebp
movb %bpl, 0x2b(%rsp)
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x27147
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 0x130cf(%rip), %rdx     # 0x3a208
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
cmpb $0x1, %bpl
je 0x271ab
movzbl %bpl, %eax
testl %eax, %eax
jne 0x272f7
movq %rbx, %rdi
movl $0xc, %esi
callq 0x25872
addb $0x4, %al
movb %al, 0x2c(%rsp)
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x272f7
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
movsbl %al, %ecx
leaq 0x1309c(%rip), %rdx     # 0x3a23b
xorl %eax, %eax
callq 0x1070
jmp 0x272f0
movq %rbx, %rdi
callq 0x25dac
movl %eax, %r14d
movb %r14b, 0x2d(%rsp)
movq %rbx, %rdi
movl $0xffff8000, %esi       # imm = 0xFFFF8000
movl $0x7fff, %edx           # imm = 0x7FFF
callq 0x25dec
movl %eax, %r13d
movw %r13w, 0x3c(%rsp)
movq %rbx, %rdi
movl $0xffff8000, %esi       # imm = 0xFFFF8000
movl $0x7fff, %edx           # imm = 0x7FFF
callq 0x25dec
movl %eax, %r12d
movw %r12w, 0x3e(%rsp)
movq %rbx, %rdi
movl $0xff, %esi
callq 0x25872
movl %eax, %ebp
movb %bpl, 0x2e(%rsp)
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x2724f
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movsbl %r14b, %ecx
movswl %r13w, %r8d
movswl %r12w, %r9d
leaq 0x13023(%rip), %rdx     # 0x3a25d
xorl %eax, %eax
callq 0x1070
addw 0x7cb0(%rbx), %ax
movw %ax, 0x7cb0(%rbx)
testb %bpl, %bpl
je 0x272c3
leaq 0x7cb2(%rbx), %r15
movzbl %bpl, %r12d
xorl %r13d, %r13d
xorl %r14d, %r14d
movq %rbx, %rdi
movl $0xffff0001, %esi       # imm = 0xFFFF0001
movl $0xffff, %edx           # imm = 0xFFFF
callq 0x25dec
movl %eax, %ebp
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x272b2
leaq (%r15,%rax), %rdi
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
leaq 0x13047(%rip), %rdx     # 0x3a2e2
movl %ebp, %ecx
xorl %eax, %eax
callq 0x1070
addw 0x7cb0(%rbx), %ax
movw %ax, 0x7cb0(%rbx)
addl %ebp, %r14d
movw %r14w, 0x4a(%rsp,%r13,2)
incq %r13
cmpq %r13, %r12
jne 0x27265
movzwl %ax, %eax
cmpl $0x2542, %eax           # imm = 0x2542
jae 0x272f7
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movzwl %cx, %esi
leaq 0x136e7(%rip), %rdx     # 0x3a9d0
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
movl $0x10, %esi
callq 0x25872
movl %eax, %r14d
movb %r14b, 0x2f(%rsp)
movq %rbx, %rdi
callq 0x25dac
movl %eax, 0x1c(%rsp)
movq %rbx, %rdi
movl $0x3fe, %esi            # imm = 0x3FE
callq 0x25872
movl %eax, %r12d
incl %r12d
movw %r12w, 0x24(%rsp)
movb 0x30(%rsp), %al
movl $0x20f, %ecx            # imm = 0x20F
shlxl %eax, %ecx, %esi
movq %rbx, %rdi
callq 0x25872
movl %eax, %r15d
movq %rbx, %rdi
callq 0x25dac
movl %eax, %r13d
movb %r13b, 0x30(%rsp)
leal 0x2(,%r15,2), %eax
sarxl %r13d, %eax, %r15d
movw %r15w, 0x26(%rsp)
movl 0x10(%rsp), %ecx
cmpl $0x3f, %ecx
movl $0x3f, %eax
cmovll %ecx, %eax
cltq
leaq 0x10d2b(%rip), %rcx     # 0x380b0
movl (%rcx,%rax,4), %eax
movzwl %r12w, %ebp
movswl %r15w, %r10d
movl %r10d, %ecx
imull %ebp, %ecx
xorl %edx, %edx
divl %ecx
movl $0x10, %edx
cmpl $0x10, %eax
cmovll %eax, %edx
movq (%rsp), %rax
addl $-0x56, %eax
cmpl $0x24, %eax
ja 0x273cc
movabsq $0x1001004001, %rcx     # imm = 0x1001004001
btq %rax, %rcx
jae 0x273cc
testb $0x10, 0xc(%rsp)
je 0x273db
xorl %edx, %edx
jmp 0x273db
cmpl $0xf4, (%rsp)
je 0x273c1
cmpl $0x2c, (%rsp)
je 0x273c1
movb %dl, 0x34(%rsp)
movl %edx, 0x10(%rsp)
movzbl %dl, %eax
movzbl %r14b, %ecx
cmpb %r14b, %al
cmovgl %eax, %ecx
incb %cl
movl %ecx, 0xc(%rsp)
movb %cl, 0x33(%rsp)
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x27466
movsbl %r13b, %r11d
movsbl %r14b, %ecx
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %eax, %edx
movzwl %dx, %esi
testb %r13b, %r13b
leaq 0x102ca(%rip), %rax     # 0x376fa
leaq 0x135a8(%rip), %r14     # 0x3a9df
cmoveq %rax, %r14
subq $0x8, %rsp
leaq 0x12ea0(%rip), %rdx     # 0x3a2e6
movl 0x24(%rsp), %r8d
movl %ebp, %r9d
xorl %eax, %eax
pushq %r14
pushq %r11
pushq %r10
callq 0x1070
addq $0x20, %rsp
addw %ax, 0x7cb0(%rbx)
testb %r13b, %r13b
jne 0x274b4
movq %rbx, %rdi
callq 0x25dac
movb %al, 0x31(%rsp)
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x274b4
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
movsbl %al, %ecx
leaq 0x12ecc(%rip), %rdx     # 0x3a372
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x25dac
movb %al, 0x32(%rsp)
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x274fd
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
movsbl %al, %ecx
leaq 0x12ea7(%rip), %rdx     # 0x3a396
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x25dac
testl %eax, %eax
je 0x2760d
movb 0x28(%rsp), %al
xorl %r12d, %r12d
cmpb $0x1, %al
sete %r12b
decb %al
cmpb $0x2, %al
movl %r15d, %eax
setb %r15b
subl %r13d, %r12d
shll $0x4, %ebp
shrxl %r15d, %ebp, %r14d
decl %r14d
cwtl
shll $0x4, %eax
incb %r12b
sarxl %r12d, %eax, %ebp
decl %ebp
movq %rbx, %rdi
movl %r14d, %esi
callq 0x25872
shlxl %r15d, %eax, %r13d
movw %r13w, 0x24e(%rsp)
movswl %r13w, %eax
sarxl %r15d, %eax, %eax
subl %eax, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x25872
shlxl %r15d, %eax, %r14d
movw %r14w, 0x24a(%rsp)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x25872
shlxl %r12d, %eax, %r15d
movw %r15w, 0x248(%rsp)
movswl %r15w, %eax
sarxl %r12d, %eax, %eax
subl %eax, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x25872
shlxl %r12d, %eax, %eax
movw %ax, 0x24c(%rsp)
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x2760d
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
movswl %r13w, %ecx
movswl %r14w, %r8d
movswl %r15w, %r9d
movswl %ax, %r10d
subq $0x8, %rsp
leaq 0x12dbe(%rip), %rdx     # 0x3a3b7
xorl %eax, %eax
pushq %r10
callq 0x1070
addq $0x10, %rsp
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x25dac
movzwl 0x7cb0(%rbx), %r12d
movzwl %r12w, %ecx
testl %eax, %eax
je 0x2768a
cmpl $0x2541, %ecx           # imm = 0x2541
ja 0x27655
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %esi           # imm = 0x2542
subq %rcx, %rsi
leaq 0x12db2(%rip), %rdx     # 0x3a3f9
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x25dac
testl %eax, %eax
je 0x2771e
movq %rbx, %rdi
movl $0x8, %esi
callq 0x18ad7
movl %eax, %ebp
cmpl $0xff, %eax
jne 0x276c3
movq %rbx, %rdi
movl $0x20, %esi
callq 0x18ad7
jmp 0x276d2
cmpl $0x2541, %ecx           # imm = 0x2541
ja 0x27d34
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %esi           # imm = 0x2542
subq %rcx, %rsi
movsbl 0x10(%rsp), %ecx
movsbl 0xc(%rsp), %r8d
decl %r8d
leaq 0x12d4e(%rip), %rdx     # 0x3a40c
jmp 0x27d1a
movl %ebp, %eax
andl $0x1f, %eax
leaq 0x12071(%rip), %rcx     # 0x39740
movl (%rcx,%rax,4), %eax
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x2771e
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 0x1392d(%rip), %rdx     # 0x3b038
movl %ebp, %ecx
movl %eax, %r8d
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x25dac
testl %eax, %eax
je 0x27734
movq %rbx, %rdi
callq 0x25dac
jmp 0x27739
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x27775
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
leaq 0x13907(%rip), %rdx     # 0x3b06c
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x25dac
testl %eax, %eax
je 0x278be
movq %rbx, %rdi
movl $0x3, %esi
callq 0x18ad7
movl %eax, %ebp
movq %rbx, %rdi
callq 0x25dac
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x277ec
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
movslq %ebp, %rcx
leaq 0x11ff5(%rip), %rdx     # 0x397c0
movslq (%rdx,%rcx,4), %r8
addq %rdx, %r8
leaq 0x138b6(%rip), %rdx     # 0x3b08f
movl %ebp, %ecx
movl %eax, %r9d
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x25dac
testl %eax, %eax
je 0x278be
movq %rbx, %rdi
movl $0x18, %esi
callq 0x18ad7
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x278be
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
movl $0x17, %ecx
cmovbl %eax, %ecx
leaq 0x11f84(%rip), %rdx     # 0x397e0
movslq (%rdx,%rcx,4), %r8
addq %rdx, %r8
cmpl $0x12, %r9d
movl $0x12, %ecx
cmovbl %r9d, %ecx
leaq 0x11fc9(%rip), %rdx     # 0x39840
movslq (%rdx,%rcx,4), %r11
addq %rdx, %r11
cmpl $0xc, %r10d
movl $0xc, %ecx
cmovbl %r10d, %ecx
leaq 0x11ffa(%rip), %rdx     # 0x3988c
movslq (%rdx,%rcx,4), %r14
addq %rdx, %r14
subq $0x8, %rsp
leaq 0x13824(%rip), %rdx     # 0x3b0c8
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 0x25dac
testl %eax, %eax
je 0x27925
movq %rbx, %rdi
movl $0x5, %esi
callq 0x25872
movl %eax, %ebp
movq %rbx, %rdi
movl $0x5, %esi
callq 0x25872
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x27925
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
leaq 0x1381c(%rip), %rdx     # 0x3b12e
movl %ebp, %ecx
movl %eax, %r8d
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x25dac
testl %eax, %eax
je 0x279b0
movq %rbx, %rdi
movl $0x20, %esi
callq 0x18ad7
movl %eax, %ebp
cmpl $0x1, %eax
adcl $0x0, %ebp
movl %ebp, 0x40(%rsp)
movq %rbx, %rdi
movl $0x20, %esi
callq 0x18ad7
movl %eax, %r14d
cmpl $0x1, %eax
adcl $0x0, %r14d
movl %r14d, 0x44(%rsp)
movq %rbx, %rdi
callq 0x25dac
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x279b0
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
leaq 0x137c2(%rip), %rdx     # 0x3b15c
movl %ebp, %ecx
movl %r14d, %r8d
movl %eax, %r9d
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x25dac
movl %eax, %ebp
testl %eax, %eax
je 0x27a10
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x279f7
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movzwl %cx, %esi
leaq 0x137bf(%rip), %rdx     # 0x3b1a8
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
leaq 0x35(%rsp), %rdx
leaq 0x13b79(%rip), %rcx     # 0x3b57c
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x327dd
movq %rbx, %rdi
callq 0x25dac
movl %eax, %r14d
testl %eax, %eax
je 0x27a71
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x27a58
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movzwl %cx, %esi
leaq 0x13777(%rip), %rdx     # 0x3b1c1
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
leaq 0x36(%rsp), %rdx
leaq 0x13b18(%rip), %rcx     # 0x3b57c
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x327dd
orl %ebp, %r14d
je 0x27aba
movq %rbx, %rdi
callq 0x25dac
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x27aba
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
leaq 0x13afe(%rip), %rdx     # 0x3b5a8
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x25dac
movb %al, 0x3b(%rsp)
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x27b03
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
movsbl %al, %ecx
leaq 0x13ad1(%rip), %rdx     # 0x3b5c6
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x25dac
testl %eax, %eax
je 0x27ce1
movq %rbx, %rdi
callq 0x25dac
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x27b57
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
leaq 0x13693(%rip), %rdx     # 0x3b1da
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movsbl 0x21(%rsp), %eax
shll $0x8, %eax
movb 0x20(%rsp), %cl
movl $0x40, %edx
shlxl %ecx, %edx, %ecx
andl $-0x80, %ecx
movsbl 0x22(%rsp), %ebp
imull %ecx, %ebp
addl %eax, %ebp
movq %rbx, %rdi
movl $0x10, %esi
callq 0x25872
testl %eax, %eax
je 0x27bde
movl %eax, %ecx
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x27bde
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 0x1363d(%rip), %rdx     # 0x3b20b
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
movl $0x10, %esi
callq 0x25872
testl %eax, %eax
je 0x27c34
movl %eax, %ecx
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x27c34
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 0x13602(%rip), %rdx     # 0x3b226
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
movl $0xf, %esi
callq 0x25872
movl %eax, %ebp
movq %rbx, %rdi
movl $0xf, %esi
callq 0x25872
movl %eax, %r14d
movq %rbx, %rdi
movl $0x10, %esi
callq 0x25872
movl %eax, %r15d
movb %r15b, 0x34(%rsp)
movq %rbx, %rdi
movl $0x10, %esi
callq 0x25872
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), %r12d
cmpq $0x2541, %r12           # imm = 0x2541
ja 0x27d34
movsbl %r15b, %r9d
leaq (%rbx,%r12), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %esi           # imm = 0x2542
subq %r12, %rsi
movsbl %cl, %r10d
decl %r10d
subq $0x8, %rsp
leaq 0x13572(%rip), %rdx     # 0x3b23f
movl %ebp, %ecx
movl %r14d, %r8d
xorl %eax, %eax
pushq %r10
callq 0x1070
addq $0x10, %rsp
jmp 0x27d21
movzwl 0x7cb0(%rbx), %r12d
cmpq $0x2541, %r12           # imm = 0x2541
ja 0x27d34
leaq (%rbx,%r12), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %esi           # imm = 0x2542
subq %r12, %rsi
movsbl 0x34(%rsp), %ecx
movsbl 0x33(%rsp), %r8d
decl %r8d
leaq 0x135af(%rip), %rdx     # 0x3b2c9
xorl %eax, %eax
callq 0x1070
movl %eax, %r12d
addw 0x7cb0(%rbx), %r12w
movw %r12w, 0x7cb0(%rbx)
cmpb $0xf, 0x22(%rbx)
jne 0x27e0d
movl $0x5f, %ebp
movq (%rsp), %r14
leal -0x76(%r14), %eax
cmpl $0x10, %eax
ja 0x28654
movl $0x10401, %ecx          # imm = 0x10401
btl %eax, %ecx
jae 0x28654
movq 0x20(%rsp), %rax
cmpq 0x530(%rbx), %rax
jne 0x28654
movq %rbx, %rdi
callq 0x25dac
testl %eax, %eax
je 0x28069
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x25872
leal 0x1(%rax), %ebp
cmpl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
jae 0x28073
leaq 0x7cb2(%rbx), %r14
leaq 0x1362b(%rip), %r15     # 0x3b3d8
leaq 0x12ebb(%rip), %r12     # 0x3ac6f
xorl %r13d, %r13d
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x25872
movl %eax, %ecx
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x27e00
leaq (%r14,%rax), %rdi
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
testl %r13d, %r13d
movq %r12, %rdx
cmoveq %r15, %rdx
xorl %eax, %eax
callq 0x1070
addw 0x7cb0(%rbx), %ax
movw %ax, 0x7cb0(%rbx)
incl %r13d
cmpl %r13d, %ebp
jne 0x27db7
jmp 0x2807a
movq 0x10(%rbx), %rcx
movq 0x18(%rbx), %rdx
movq %rdx, %rax
shrq $0x3f, %rax
shlxq %rax, %rdx, %rdx
blsrq %rcx, %rsi
movl $0x4a, %ebp
orq %rdx, %rsi
jne 0x28654
tzcntq %rcx, %rcx
movl (%rbx), %edx
subl 0x8(%rbx), %edx
addl %eax, %ecx
leal (%rcx,%rdx,8), %eax
addl $0xffffff78, %eax       # imm = 0xFFFFFF78
cmpl $-0x10, %eax
jb 0x28654
movzwl %r12w, %eax
movl $0x5f, %ebp
cmpl $0x2541, %eax           # imm = 0x2541
ja 0x28654
cmpb $0x1, 0x28(%rsp)
jne 0x28654
movsbl 0x21(%rsp), %eax
movsbl 0x22(%rsp), %ecx
addl %eax, %ecx
cmpl $0x10, %ecx
jne 0x28654
cmpb $0x0, 0x29(%rsp)
jne 0x28654
cmpb $0x0, 0x30(%rsp)
je 0x28654
movq 0x20(%rsp), %r13
cmpq 0x530(%rbx), %r13
jne 0x27ebe
movq 0x248(%rsp), %rax
cmpq 0x758(%rbx), %rax
je 0x286d7
movl 0x64(%rbx), %eax
testl %eax, %eax
je 0x27ee6
movl 0x58(%rbx), %ecx
movl %eax, %edx
movl %ecx, %esi
tzcntl %edx, %ecx
movl 0x3d0(%rbx,%rcx,4), %ecx
cmpl %ecx, %esi
cmovgl %esi, %ecx
blsrl %edx, %edx
jne 0x27eca
movl %ecx, 0x58(%rbx)
cmpw $0x0, 0x1648(%rbx)
je 0x27f26
movl $0xb, %ebp
cmpl $0x0, 0x18(%rsp)
jne 0x28654
leaq 0x1618(%rbx), %r14
leaq 0x1590(%rbx), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x1050
cmpw $0x0, 0x1648(%rbx)
jne 0x27f0e
movl 0x64(%rbx), %eax
movl $0x69, %ebp
orl 0x68(%rbx), %eax
jne 0x28654
movq %r13, %rax
shrq $0x20, %rax
movl %r13d, %edi
shrl $0x8, %edi
movq 0x248(%rsp), %r8
movq %r8, 0x520(%rbx)
movzwl %ax, %ecx
movl %ecx, %esi
shll $0x4, %esi
sarl $0x10, %eax
movl %eax, %edx
shll $0x4, %edx
cmpb $0x9, %dil
setge %dil
setge 0x508(%rbx)
movl %r8d, %r10d
movq %r8, %r11
shrq $0x20, %r11
addl %r8d, %r11d
shrq $0x30, %r8
shrl $0x10, %r10d
addl %r8d, %r10d
movl %esi, %r9d
subl %r10d, %r9d
movw %r9w, 0x50a(%rbx)
movl %edx, %r8d
subl %r11d, %r8d
movw %r8w, 0x50e(%rbx)
shlxl %edi, %esi, %r10d
leal 0x10(%rsi), %r11d
testl $0x7f0, %r10d           # imm = 0x7F0
shlxl %edi, %r11d, %edi
cmovnel %r10d, %edi
movw %di, 0x512(%rbx)
movswl %di, %edi
imull %edx, %edi
movl %edi, 0x2c(%rbx)
testb %r13b, %r13b
jle 0x28668
movl %r13d, %r10d
shrl $0x10, %r10d
cmpb $0x9, %r10b
setge %r10b
setge 0x509(%rbx)
movl %ecx, %r11d
shll $0x5, %r11d
xorl %r14d, %r14d
cmpb $0x3, %r13b
sete %r14b
setne %bpl
movswl %r9w, %r9d
sarxl %ebp, %r9d, %r9d
movw %r9w, 0x50c(%rbx)
cmovnel %esi, %r11d
shlxl %r10d, %r11d, %esi
testl $0xff0, %esi            # imm = 0xFF0
leal 0x8(%r11,%r14,8), %r9d
shlxl %r10d, %r9d, %r9d
cmovnel %esi, %r9d
movw %r9w, 0x514(%rbx)
leal (,%rax,8), %esi
cmpb $0x1, %r13b
sete %r10b
movswl %r8w, %r8d
sarxl %r10d, %r8d, %r8d
movw %r8w, 0x510(%rbx)
cmovel %esi, %edx
movswl %r9w, %esi
imull %edx, %esi
movl %esi, 0x30(%rbx)
jmp 0x2866b
movl $0x4a, %ebp
jmp 0x28654
movzwl 0x7cb0(%rbx), %eax
movzwl %ax, %eax
cmpl $0x2542, %eax           # imm = 0x2542
jae 0x280c3
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movzwl %cx, %esi
cmpl $0x2, %ebp
leaq 0x1293c(%rip), %rax     # 0x3a9df
leaq 0xf650(%rip), %rcx      # 0x376fa
cmoveq %rax, %rcx
leaq 0x13333(%rip), %rdx     # 0x3b3e8
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
cmpl $0x2, %ebp
jne 0x2864f
movq %rbx, %rdi
movl $0x1, %esi
callq 0x25872
movl %eax, %ebp
testl %eax, %eax
je 0x280ec
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x25872
movq %rbx, %rdi
movl $0x1, %esi
callq 0x25872
movl %eax, %r14d
testl %eax, %eax
je 0x2810d
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x25872
movq %rbx, %rdi
movl $0x1, %esi
callq 0x25872
movl %eax, %r12d
testl %eax, %eax
je 0x2812e
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x25872
movq %rbx, %rdi
movl $0x1, %esi
callq 0x25872
movl %eax, %r13d
testl %eax, %eax
je 0x2814f
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x25872
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x2819a
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movzwl %cx, %esi
subq $0x8, %rsp
leaq 0x1326f(%rip), %rdx     # 0x3b3ed
movl %ebp, %ecx
movl %r14d, %r8d
movl %r12d, %r9d
xorl %eax, %eax
pushq %r13
callq 0x1070
addq $0x10, %rsp
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
movl $0x3f, %esi
callq 0x25872
testl %eax, %eax
js 0x28352
leaq 0x7cb2(%rbx), %r15
leaq 0x132e3(%rip), %r12     # 0x3b4a0
leaq 0x1279b(%rip), %rbp     # 0x3a95f
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
movl $0x8, %esi
callq 0x18ad7
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x2821b
movq %rcx, %rdi
addq %r15, %rdi
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
vcvtsi2ss %eax, %xmm1, %xmm0
vdivss 0x116ce(%rip), %xmm0, %xmm0 # 0x398d0
vcvtss2sd %xmm0, %xmm0, %xmm0
leaq 0x13247(%rip), %rdx     # 0x3b454
movb $0x1, %al
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x25872
movl %eax, %r13d
testl %eax, %eax
js 0x28342
movq %rbx, %rdi
movl $0x3, %esi
callq 0x18ad7
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x28277
movq %rcx, %rdi
addq %r15, %rdi
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
leaq 0x13217(%rip), %rdx     # 0x3b47e
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x25872
testl %eax, %eax
js 0x282de
movl %eax, %r14d
incl %r14d
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x25872
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x282d6
movq %rcx, %rdi
addq %r15, %rdi
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
cmpl $0x1, %r14d
movq %rbp, %rdx
cmoveq %r12, %rdx
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
decl %r14d
testl %r14d, %r14d
jg 0x2828e
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x25872
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2542, %rcx           # imm = 0x2542
jae 0x28332
incl %eax
movq %rcx, %rdi
addq %r15, %rdi
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
testl %r13d, %r13d
leaq 0x1319a(%rip), %rdx     # 0x3b4b1
leaq 0x13198(%rip), %rcx     # 0x3b4b6
cmoveq %rcx, %rdx
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
leal -0x1(%r13), %eax
testl %r13d, %r13d
movl %eax, %r13d
jg 0x28233
movq 0x10(%rsp), %rcx
leal -0x1(%rcx), %eax
testl %ecx, %ecx
jg 0x281c4
cmpl $0x86, (%rsp)
movl $0x5f, %ebp
je 0x28654
movq %rbx, %rdi
callq 0x25dac
testl %eax, %eax
je 0x2863a
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x283ad
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movzwl %cx, %esi
leaq 0x1311d(%rip), %rdx     # 0x3b4bc
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x25872
testl %eax, %eax
js 0x2863a
leaq 0x7cb2(%rbx), %r13
leaq 0x12535(%rip), %r15     # 0x3a905
leaq 0x12588(%rip), %r14     # 0x3a95f
movq %rax, (%rsp)
movq %rbx, %rdi
movl $0x3, %esi
callq 0x18ad7
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x2841f
movq %rcx, %rdi
addq %r13, %rdi
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
leaq 0x130ca(%rip), %rdx     # 0x3b4d9
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x25872
testl %eax, %eax
js 0x28481
movl %eax, %ebp
incl %ebp
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x25872
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x2847b
movq %rcx, %rdi
addq %r13, %rdi
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
cmpl $0x1, %ebp
movq %r14, %rdx
cmoveq %r15, %rdx
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
decl %ebp
testl %ebp, %ebp
jg 0x28434
movq %rbx, %rdi
callq 0x25dac
testl %eax, %eax
je 0x284f1
movq %rbx, %rdi
movl $0x20, %esi
callq 0x18ad7
movl %eax, %ebp
movq %rbx, %rdi
movl $0x20, %esi
callq 0x18ad7
movl %eax, %r12d
movq %rbx, %rdi
callq 0x25dac
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x284f1
movq %rcx, %rdi
addq %r13, %rdi
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
leaq 0x1302a(%rip), %rdx     # 0x3b505
movl %ebp, %ecx
movl %r12d, %r8d
movl %eax, %r9d
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x25dac
movl %eax, %ebp
testl %eax, %eax
je 0x2854c
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x28533
movq %rax, %rdi
addq %r13, %rdi
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movzwl %cx, %esi
leaq 0x13032(%rip), %rdx     # 0x3b557
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
leaq 0x20(%rsp), %rsi
leaq 0x35(%rsp), %rdx
leaq 0x13033(%rip), %rcx     # 0x3b57a
callq 0x327dd
movq %rbx, %rdi
callq 0x25dac
movl %eax, %r12d
testl %eax, %eax
je 0x285a8
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x2858f
movq %rax, %rdi
addq %r13, %rdi
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movzwl %cx, %esi
leaq 0x13002(%rip), %rdx     # 0x3b583
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
leaq 0x20(%rsp), %rsi
leaq 0x36(%rsp), %rdx
leaq 0x12fd7(%rip), %rcx     # 0x3b57a
callq 0x327dd
orl %ebp, %r12d
je 0x285ec
movq %rbx, %rdi
callq 0x25dac
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x285ec
movq %rcx, %rdi
addq %r13, %rdi
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
leaq 0x12fca(%rip), %rdx     # 0x3b5a6
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
callq 0x25dac
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x2862b
movq %rcx, %rdi
addq %r13, %rdi
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
leaq 0x12fa9(%rip), %rdx     # 0x3b5c4
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq (%rsp), %rcx
leal -0x1(%rcx), %eax
testl %ecx, %ecx
jg 0x283d7
movq %rbx, %rdi
callq 0x25dac
movzwl 0x7cb0(%rbx), %r12d
jmp 0x27e51
movl $0x5f, %ebp
movl %ebp, %eax
addq $0x438, %rsp            # imm = 0x438
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x30(%rbx), %esi
incl %ecx
imull %ecx, %eax
imull $0x130, %eax, %eax      # imm = 0x130
addl %edi, %eax
addl %esi, %eax
addl $0xfffffed0, %eax       # imm = 0xFFFFFED0
movl %eax, 0x34(%rbx)
movb $-0x1, 0x24(%rbx)
movq $-0x1, 0x3c(%rbx)
xorl %r14d, %r14d
movq %r14, 0x48(%rbx)
movl %r14d, 0x78(%rbx)
movl %r14d, 0x6c(%rbx)
movq %r14, 0x5c(%rbx)
movq %r14, 0x940(%rbx)
movq 0x188(%rbx,%r14,8), %rdi
testq %rdi, %rdi
je 0x286c6
callq 0x1030
movq $0x0, 0x188(%rbx,%r14,8)
incq %r14
cmpq $0x20, %r14
jne 0x286a8
movzwl 0x7cb0(%rbx), %r12d
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
movw $0x0, 0x7cb0(%rbx)
movzwl %r12w, %eax
xorl %ebp, %ebp
cmpl $0x2541, %eax           # imm = 0x2541
ja 0x28654
leaq 0x7cb2(%rbx), %rdi
movq 0x7ca8(%rbx), %rsi
callq *0x7ca0(%rbx)
jmp 0x28654