// File: /workspace/github_c_makefile_star2_O0/tvlabs[P]edge264/edge264_headers.c
// Function: parse_pic_parameter_set_log
int ADD_VARIANT(parse_pic_parameter_set)(Edge264Decoder *dec, int non_blocking,  void(*free_cb)(void*,int), void *free_arg)
{
	static const char * const weighted_pred_names[3] = {"average", "explicit", "implicit"};
	
	// temp storage, committed if entire NAL is correct
	Edge264PicParameterSet pps = {
		.transform_8x8_mode_flag = 0,
		.weightScale4x4_v = {},
		.weightScale8x8_v = {},
	};
	
	// Actual streams never use more than 4 PPSs (I, P, B, b).
	int pic_parameter_set_id = get_ue16(&dec->_gb, 255);
	get_ue16(&dec->_gb, 31); // seq_parameter_set_id
	pps.entropy_coding_mode_flag = get_u1(&dec->_gb);
	pps.bottom_field_pic_order_in_frame_present_flag = get_u1(&dec->_gb);
	int num_slice_groups = get_ue16(&dec->_gb, 7) + 1;
	log_dec(dec, "  pic_parameter_set_id: %u%s\n"
		"  entropy_coding_mode_flag: %u # %s\n"
		"  bottom_field_pic_order_in_frame_present_flag: %u\n"
		"  num_slice_groups: %u%s\n",
		pic_parameter_set_id, unsup_if(pic_parameter_set_id >= 4),
		pps.entropy_coding_mode_flag, pps.entropy_coding_mode_flag ? "CABAC" : "CAVLC",
		pps.bottom_field_pic_order_in_frame_present_flag,
		num_slice_groups, unsup_if(num_slice_groups > 1));
	
	// Let's be nice enough to print the headers for unsupported stuff.
	if (num_slice_groups > 1) {
		int slice_group_map_type = get_ue16(&dec->_gb, 6);
		log_dec(dec, "  slice_group_map_type: %u\n", slice_group_map_type);
		if (slice_group_map_type == 0) {
			log_dec(dec, "  run_lengths: [");
			for (int i = num_slice_groups; i-- > 0; ) {
				int run_length = get_ue32(&dec->_gb, 139263) + 1; // level 6.2
				log_dec(dec, i ? "%u," : "%u]\n", run_length);
			}
		} else if (slice_group_map_type == 2) {
			log_dec(dec, "  top_lefts_bottom_rights: [");
			for (int i = num_slice_groups - 1; i-- > 0; ) {
				int top_left = get_ue32(&dec->_gb, 139264);
				int bottom_right = get_ue32(&dec->_gb, 139264);
				log_dec(dec, i ? "%u-%u," : "%u-%u]\n", top_left, bottom_right);
			}
		} else if (0b111000 & 1 << slice_group_map_type) { // 3, 4 or 5
			int slice_group_change_direction_flag = get_u1(&dec->_gb);
			int slice_group_change_rate = get_ue32(&dec->_gb, 139263) + 1;
			log_dec(dec, "  slice_group_change_direction_flag: %u\n"
				"  slice_group_change_rate: %u\n",
				slice_group_change_direction_flag,
				slice_group_change_rate);
		} else if (slice_group_map_type == 6) {
			int PicSizeInMapUnits = get_ue32(&dec->_gb, 139263) + 1;
			log_dec(dec, "  slice_group_ids: [");
			int bits = WORD_BIT - __builtin_clz(num_slice_groups - 1);
			for (int i = PicSizeInMapUnits; i-- > 0; ) {
				int slice_group_id = get_uv(&dec->_gb, bits);
				log_dec(dec, i ? "%u" : "%u]\n", slice_group_id);
			}
		}
	}
	
	// (num_ref_idx_active[0] != 0) is used as indicator that the PPS is initialised.
	pps.num_ref_idx_active[0] = get_ue16(&dec->_gb, 31) + 1;
	pps.num_ref_idx_active[1] = get_ue16(&dec->_gb, 31) + 1;
	pps.weighted_pred_flag = get_u1(&dec->_gb);
	pps.weighted_bipred_idc = get_uv(&dec->_gb, 2);
	pps.QPprime_Y = get_se16(&dec->_gb, -26, 25) + 26; // FIXME QpBdOffset
	get_se16(&dec->_gb, -26, 25) + 26; // pic_init_qs
	pps.second_chroma_qp_index_offset = pps.chroma_qp_index_offset = get_se16(&dec->_gb, -12, 12);
	pps.deblocking_filter_control_present_flag = get_u1(&dec->_gb);
	pps.constrained_intra_pred_flag = get_u1(&dec->_gb);
	int redundant_pic_cnt_present_flag = get_u1(&dec->_gb);
	log_dec(dec, "  num_ref_idx_default_active: {l0: %u, l1: %u}\n"
		"  weighted_pred_flag: %u # %s\n"
		"  weighted_bipred_idc: %u # %s\n"
		"  pic_init_qp: %u\n"
		"  chroma_qp_index_offset: %d\n"
		"  deblocking_filter_control_present_flag: %u\n"
		"  constrained_intra_pred_flag: %u%s\n"
		"  redundant_pic_cnt_present_flag: %u%s\n",
		pps.num_ref_idx_active[0], pps.num_ref_idx_active[1],
		pps.weighted_pred_flag, weighted_pred_names[pps.weighted_pred_flag],
		pps.weighted_bipred_idc, weighted_pred_names[pps.weighted_bipred_idc],
		pps.QPprime_Y,
		pps.chroma_qp_index_offset,
		pps.deblocking_filter_control_present_flag,
		pps.constrained_intra_pred_flag, unsup_if(pps.constrained_intra_pred_flag),
		redundant_pic_cnt_present_flag, unsup_if(redundant_pic_cnt_present_flag));
	
	if (!rbsp_end(&dec->_gb)) {
		pps.transform_8x8_mode_flag = get_u1(&dec->_gb);
		log_dec(dec, "  transform_8x8_mode_flag: %u\n",
			pps.transform_8x8_mode_flag);
		pps.pic_scaling_matrix_present_flag = get_u1(&dec->_gb);
		if (pps.pic_scaling_matrix_present_flag) {
			log_dec(dec, "  pic_scaling_matrix:\n");
			parse_scaling_lists(dec, pps.weightScale4x4_v, pps.weightScale8x8_v, pps.transform_8x8_mode_flag, dec->sps.chroma_format_idc);
		}
		pps.second_chroma_qp_index_offset = get_se16(&dec->_gb, -12, 12);
		log_dec(dec, "  second_chroma_qp_index_offset: %d\n",
			pps.second_chroma_qp_index_offset);
	}
	
	// check for trailing_bits before unsupported features (in case errors enabled them)
	if (!rbsp_end(&dec->_gb))
		return EBADMSG;
	if (print_dec(dec) || pic_parameter_set_id >= 4 ||
		num_slice_groups > 1 || pps.constrained_intra_pred_flag ||
		redundant_pic_cnt_present_flag)
		return ENOTSUP;
	dec->PPS[pic_parameter_set_id] = pps;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x308, %rsp            # imm = 0x308
movq %rdi, -0x68(%rbp)
movl %esi, -0x6c(%rbp)
movq %rdx, -0x78(%rbp)
movq %rcx, -0x80(%rbp)
leaq -0x270(%rbp), %rdi
xorl %esi, %esi
movl $0x1f0, %edx            # imm = 0x1F0
callq 0x7090
movq -0x68(%rbp), %rdi
movl $0xff, %esi
callq 0x76d10
movl %eax, -0x274(%rbp)
movq -0x68(%rbp), %rdi
movl $0x1f, %esi
callq 0x76d10
movq -0x68(%rbp), %rdi
callq 0x77060
movb %al, -0x270(%rbp)
movq -0x68(%rbp), %rdi
callq 0x77060
movb %al, -0x26f(%rbp)
movq -0x68(%rbp), %rdi
movl $0x7, %esi
callq 0x76d10
addl $0x1, %eax
movl %eax, -0x278(%rbp)
movq -0x68(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0x7990a
movq -0x68(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x68(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x68(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movl -0x274(%rbp), %ecx
cmpl $0x4, -0x274(%rbp)
setge %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %edx
leaq 0x56fcc(%rip), %r8      # 0xd0832
leaq 0x54513(%rip), %rax     # 0xcdd80
cmpl $0x0, %edx
cmovneq %rax, %r8
movsbl -0x270(%rbp), %r9d
movsbl -0x270(%rbp), %edx
leaq 0x567eb(%rip), %rbx     # 0xd0075
leaq 0x567de(%rip), %rax     # 0xd006f
cmpl $0x0, %edx
cmovneq %rax, %rbx
movsbl -0x26f(%rbp), %r11d
movl -0x278(%rbp), %r10d
cmpl $0x1, -0x278(%rbp)
setg %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %r14d
leaq 0x56f6e(%rip), %rax     # 0xd0832
leaq 0x544b5(%rip), %rdx     # 0xcdd80
cmpl $0x0, %r14d
cmovneq %rdx, %rax
leaq 0x56707(%rip), %rdx     # 0xcffe1
movq %rbx, (%rsp)
movl %r11d, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x68(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
cmpl $0x1, -0x278(%rbp)
jle 0x79e53
movq -0x68(%rbp), %rdi
movl $0x6, %esi
callq 0x76d10
movl %eax, -0x27c(%rbp)
movq -0x68(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0x79998
movq -0x68(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x68(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x68(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movl -0x27c(%rbp), %ecx
leaq 0x56700(%rip), %rdx     # 0xd007b
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x68(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
cmpl $0x0, -0x27c(%rbp)
jne 0x79ad4
movq -0x68(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0x79a0c
movq -0x68(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x68(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x68(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
leaq 0x566a8(%rip), %rdx     # 0xd0097
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x68(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
movl -0x278(%rbp), %eax
movl %eax, -0x280(%rbp)
movl -0x280(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x280(%rbp)
cmpl $0x0, %eax
jle 0x79acf
movq -0x68(%rbp), %rdi
movl $0x21fff, %esi          # imm = 0x21FFF
callq 0x76d10
addl $0x1, %eax
movl %eax, -0x284(%rbp)
movq -0x68(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0x79aca
movq -0x68(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x68(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x68(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movl -0x280(%rbp), %ecx
leaq 0x57054(%rip), %rdx     # 0xd0aed
leaq 0x570a7(%rip), %rax     # 0xd0b47
cmpl $0x0, %ecx
cmovneq %rax, %rdx
movl -0x284(%rbp), %ecx
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x68(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
jmp 0x79a18
jmp 0x79e51
cmpl $0x2, -0x27c(%rbp)
jne 0x79c2b
movq -0x68(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0x79b48
movq -0x68(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x68(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x68(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
leaq 0x5657d(%rip), %rdx     # 0xd00a8
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x68(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
movl -0x278(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x288(%rbp)
movl -0x288(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x288(%rbp)
cmpl $0x0, %eax
jle 0x79c26
movq -0x68(%rbp), %rdi
movl $0x22000, %esi          # imm = 0x22000
callq 0x76d10
movl %eax, -0x28c(%rbp)
movq -0x68(%rbp), %rdi
movl $0x22000, %esi          # imm = 0x22000
callq 0x76d10
movl %eax, -0x290(%rbp)
movq -0x68(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0x79c21
movq -0x68(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x68(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x68(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movl -0x288(%rbp), %ecx
leaq 0x564e3(%rip), %rdx     # 0xd00cc
leaq 0x564d5(%rip), %rax     # 0xd00c5
cmpl $0x0, %ecx
cmovneq %rax, %rdx
movl -0x28c(%rbp), %ecx
movl -0x290(%rbp), %r8d
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x68(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
jmp 0x79b57
jmp 0x79e4f
movl -0x27c(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
andl $0x38, %eax
cmpl $0x0, %eax
je 0x79ce3
movq -0x68(%rbp), %rdi
callq 0x77060
movl %eax, -0x294(%rbp)
movq -0x68(%rbp), %rdi
movl $0x21fff, %esi          # imm = 0x21FFF
callq 0x76d10
addl $0x1, %eax
movl %eax, -0x298(%rbp)
movq -0x68(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0x79cde
movq -0x68(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x68(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x68(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movl -0x294(%rbp), %ecx
movl -0x298(%rbp), %r8d
leaq 0x56413(%rip), %rdx     # 0xd00d4
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x68(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
jmp 0x79e4d
cmpl $0x6, -0x27c(%rbp)
jne 0x79e4b
movq -0x68(%rbp), %rdi
movl $0x21fff, %esi          # imm = 0x21FFF
callq 0x76d10
addl $0x1, %eax
movl %eax, -0x29c(%rbp)
movq -0x68(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0x79d6e
movq -0x68(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x68(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x68(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
leaq 0x563ca(%rip), %rdx     # 0xd011b
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x68(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
movl -0x278(%rbp), %eax
subl $0x1, %eax
lzcntl %eax, %ecx
movl $0x20, %eax
subl %ecx, %eax
movl %eax, -0x2a0(%rbp)
movl -0x29c(%rbp), %eax
movl %eax, -0x2a4(%rbp)
movl -0x2a4(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x2a4(%rbp)
cmpl $0x0, %eax
jle 0x79e49
movq -0x68(%rbp), %rdi
movl -0x2a0(%rbp), %esi
callq 0x65e90
movl %eax, -0x2a8(%rbp)
movq -0x68(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0x79e44
movq -0x68(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x68(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x68(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movl -0x2a4(%rbp), %ecx
leaq 0x56cda(%rip), %rdx     # 0xd0aed
leaq 0x560e2(%rip), %rax     # 0xcfefc
cmpl $0x0, %ecx
cmovneq %rax, %rdx
movl -0x2a8(%rbp), %ecx
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x68(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
jmp 0x79d94
jmp 0x79e4b
jmp 0x79e4d
jmp 0x79e4f
jmp 0x79e51
jmp 0x79e53
movq -0x68(%rbp), %rdi
movl $0x1f, %esi
callq 0x76d10
addl $0x1, %eax
movb %al, -0x26e(%rbp)
movq -0x68(%rbp), %rdi
movl $0x1f, %esi
callq 0x76d10
addl $0x1, %eax
movb %al, -0x26d(%rbp)
movq -0x68(%rbp), %rdi
callq 0x77060
movb %al, -0x26c(%rbp)
movq -0x68(%rbp), %rdi
movl $0x2, %esi
callq 0x65e90
movb %al, -0x26b(%rbp)
movq -0x68(%rbp), %rdi
movl $0xffffffe6, %esi       # imm = 0xFFFFFFE6
movl $0x19, %edx
callq 0x770f0
addl $0x1a, %eax
movb %al, -0x26a(%rbp)
movq -0x68(%rbp), %rdi
movl $0xffffffe6, %esi       # imm = 0xFFFFFFE6
movl $0x19, %edx
callq 0x770f0
movq -0x68(%rbp), %rdi
movl $0xfffffff4, %esi       # imm = 0xFFFFFFF4
movl $0xc, %edx
callq 0x770f0
movb %al, -0x269(%rbp)
movb %al, -0x264(%rbp)
movq -0x68(%rbp), %rdi
callq 0x77060
movb %al, -0x268(%rbp)
movq -0x68(%rbp), %rdi
callq 0x77060
movb %al, -0x267(%rbp)
movq -0x68(%rbp), %rdi
callq 0x77060
movl %eax, -0x2ac(%rbp)
movq -0x68(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0x7a0a8
movq -0x68(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x68(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x68(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movsbl -0x26e(%rbp), %ecx
movsbl -0x26d(%rbp), %r8d
movsbl -0x26c(%rbp), %r9d
movsbq -0x26c(%rbp), %rdx
leaq 0x5c2e4(%rip), %rax     # 0xd6270
movq (%rax,%rdx,8), %rax
movq %rax, -0x2c8(%rbp)
movsbl -0x26b(%rbp), %eax
movl %eax, -0x2bc(%rbp)
movsbq -0x26b(%rbp), %rdx
leaq 0x5c2bd(%rip), %rax     # 0xd6270
movq (%rax,%rdx,8), %r13
movsbl -0x26a(%rbp), %r12d
movsbl -0x269(%rbp), %r15d
movsbl -0x268(%rbp), %r14d
movsbl -0x267(%rbp), %ebx
movsbl -0x267(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %edx
leaq 0x56848(%rip), %r11     # 0xd0832
leaq 0x53d8f(%rip), %rax     # 0xcdd80
cmpl $0x0, %edx
cmovneq %rax, %r11
movl -0x2ac(%rbp), %r10d
movl -0x2ac(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x2d4(%rbp)
leaq 0x5681a(%rip), %rdx     # 0xd0832
leaq 0x53d61(%rip), %rax     # 0xcdd80
movq %rax, -0x2d0(%rbp)
movl -0x2d4(%rbp), %eax
cmpl $0x0, %eax
movq -0x2d0(%rbp), %rax
cmovneq %rax, %rdx
movq -0x2c8(%rbp), %rax
movq %rdx, -0x2b8(%rbp)
leaq 0x560e1(%rip), %rdx     # 0xd0130
movq %rax, (%rsp)
movl -0x2bc(%rbp), %eax
movl %eax, 0x8(%rsp)
movq -0x2b8(%rbp), %rax
movq %r13, 0x10(%rsp)
movl %r12d, 0x18(%rsp)
movl %r15d, 0x20(%rsp)
movl %r14d, 0x28(%rsp)
movl %ebx, 0x30(%rsp)
movq %r11, 0x38(%rsp)
movl %r10d, 0x40(%rsp)
movq %rax, 0x48(%rsp)
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x68(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
movq -0x68(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0x3f, %rax
movl %eax, -0x44(%rbp)
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
tzcntq %rax, %rax
movl %eax, %ecx
movl $0x7f, %eax
subl %ecx, %eax
subl -0x44(%rbp), %eax
movl %eax, -0x48(%rbp)
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x44(%rbp), %ecx
shlq %cl, %rax
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0x2d5(%rbp)
jne 0x7a149
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
subq $0x1, %rax
andq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0x2d5(%rbp)
jne 0x7a149
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rcx), %rcx
subq %rcx, %rax
movl -0x48(%rbp), %ecx
shrl $0x3, %ecx
movl %ecx, %ecx
addq %rcx, %rax
cmpq $0x0, %rax
sete %al
movb %al, -0x2d5(%rbp)
movb -0x2d5(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x7a318
movq -0x68(%rbp), %rdi
callq 0x77060
movb %al, -0x266(%rbp)
movq -0x68(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0x7a1da
movq -0x68(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x68(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x68(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movsbl -0x266(%rbp), %ecx
leaq 0x56087(%rip), %rdx     # 0xd0244
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x68(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
movq -0x68(%rbp), %rdi
callq 0x77060
movb %al, -0x265(%rbp)
cmpb $0x0, -0x265(%rbp)
je 0x7a28f
movq -0x68(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0x7a25d
movq -0x68(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x68(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x68(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
leaq 0x56023(%rip), %rdx     # 0xd0263
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x68(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
movq -0x68(%rbp), %rdi
leaq -0x270(%rbp), %rsi
addq $0x10, %rsi
leaq -0x270(%rbp), %rdx
addq $0x70, %rdx
movsbl -0x266(%rbp), %ecx
movq -0x68(%rbp), %rax
movsbl 0x520(%rax), %r8d
callq 0x7a460
movq -0x68(%rbp), %rdi
movl $0xfffffff4, %esi       # imm = 0xFFFFFFF4
movl $0xc, %edx
callq 0x770f0
movb %al, -0x264(%rbp)
movq -0x68(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0x7a316
movq -0x68(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x68(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x68(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movsbl -0x264(%rbp), %ecx
leaq 0x55f81(%rip), %rdx     # 0xd027a
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x68(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
jmp 0x7a318
movq -0x68(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0x3f, %rax
movl %eax, -0x54(%rbp)
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
tzcntq %rax, %rax
movl %eax, %ecx
movl $0x7f, %eax
subl %ecx, %eax
subl -0x54(%rbp), %eax
movl %eax, -0x58(%rbp)
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x54(%rbp), %ecx
shlq %cl, %rax
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0x2d6(%rbp)
jne 0x7a3b9
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
subq $0x1, %rax
andq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0x2d6(%rbp)
jne 0x7a3b9
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x50(%rbp), %rcx
movq (%rcx), %rcx
subq %rcx, %rax
movl -0x58(%rbp), %ecx
shrl $0x3, %ecx
movl %ecx, %ecx
addq %rcx, %rax
cmpq $0x0, %rax
sete %al
movb %al, -0x2d6(%rbp)
movb -0x2d6(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x7a3d2
movl $0x4a, -0x5c(%rbp)
jmp 0x7a444
movq -0x68(%rbp), %rdi
callq 0x65e20
cmpl $0x0, %eax
jne 0x7a407
cmpl $0x4, -0x274(%rbp)
jge 0x7a407
cmpl $0x1, -0x278(%rbp)
jg 0x7a407
movsbl -0x267(%rbp), %eax
cmpl $0x0, %eax
jne 0x7a407
cmpl $0x0, -0x2ac(%rbp)
je 0x7a410
movl $0x5f, -0x5c(%rbp)
jmp 0x7a444
movq -0x68(%rbp), %rdi
addq $0xd40, %rdi            # imm = 0xD40
movslq -0x274(%rbp), %rax
imulq $0x1f0, %rax, %rax      # imm = 0x1F0
addq %rax, %rdi
leaq -0x270(%rbp), %rsi
movl $0x1f0, %edx            # imm = 0x1F0
callq 0x70c0
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)