// File: /workspace/github_c_makefile_star2_O0/tvlabs[P]edge264/./edge264_headers.c
// Function: initialize_context
static void initialize_context(Edge264Context *ctx, int currPic)
{
	static const int8_t QP_Y2C[88] = {
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
		0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 34, 35, 35, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 39, 39,
		39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39};
	
	union { int8_t q[32]; i8x16 v[2]; } tb, td;
	ctx->FrameId = ctx->d->FrameIds[currPic];
	ctx->CurrMbAddr = ctx->t.first_mb_in_slice;
	ctx->mby = (unsigned)ctx->t.first_mb_in_slice / (unsigned)ctx->t.pic_width_in_mbs;
	ctx->mbx = (unsigned)ctx->t.first_mb_in_slice % (unsigned)ctx->t.pic_width_in_mbs;
	ctx->samples_mb[0] = ctx->t.samples_base + (ctx->mbx + ctx->mby * ctx->t.stride[0]) * 16;
	ctx->samples_mb[1] = ctx->t.samples_base + ctx->t.plane_size_Y + (ctx->mbx + ctx->mby * ctx->t.stride[1]) * 8;
	ctx->samples_mb[2] = ctx->samples_mb[1] + (ctx->t.stride[1] >> 1);
	int mb_offset = ctx->t.plane_size_Y + ctx->t.plane_size_C + sizeof(Edge264Macroblock) * (ctx->mbx + ctx->mby * (ctx->t.pic_width_in_mbs + 1));
	ctx->mbCol = ctx->_mb = (Edge264Macroblock *)(ctx->t.samples_base + mb_offset);
	ctx->A4x4_int8_v = (i16x16){0, 0, 2, 2, 1, 4, 3, 6, 8, 8, 10, 10, 9, 12, 11, 14};
	ctx->B4x4_int8_v = (i32x16){0, 1, 0, 1, 4, 5, 4, 5, 2, 3, 8, 9, 6, 7, 12, 13};
	if (ctx->t.ChromaArrayType == 1) {
		ctx->ACbCr_int8_v[0] = (i16x8){0, 0, 2, 2, 4, 4, 6, 6};
		ctx->BCbCr_int8_v[0] = (i32x8){0, 1, 0, 1, 4, 5, 4, 5};
	}
	
	ctx->QP_C_v[0] = load128(QP_Y2C + 12 + ctx->t.pps.chroma_qp_index_offset);
	ctx->QP_C_v[1] = load128(QP_Y2C + 28 + ctx->t.pps.chroma_qp_index_offset);
	ctx->QP_C_v[2] = load128(QP_Y2C + 44 + ctx->t.pps.chroma_qp_index_offset);
	ctx->QP_C_v[3] = load128(QP_Y2C + 60 + ctx->t.pps.chroma_qp_index_offset);
	ctx->QP_C_v[4] = load128(QP_Y2C + 12 + ctx->t.pps.second_chroma_qp_index_offset);
	ctx->QP_C_v[5] = load128(QP_Y2C + 28 + ctx->t.pps.second_chroma_qp_index_offset);
	ctx->QP_C_v[6] = load128(QP_Y2C + 44 + ctx->t.pps.second_chroma_qp_index_offset);
	ctx->QP_C_v[7] = load128(QP_Y2C + 60 + ctx->t.pps.second_chroma_qp_index_offset);
	ctx->t.QP[1] = ctx->QP_C[0][ctx->t.QP[0]];
	ctx->t.QP[2] = ctx->QP_C[1][ctx->t.QP[0]];
	for (int i = 1; i < 4; i++) {
		ctx->sig_inc_v[i] = sig_inc_8x8[0][i];
		ctx->last_inc_v[i] = last_inc_8x8[i];
		ctx->scan_v[i] = scan_8x8_cabac[0][i];
	}
	for (int i = 0; i < 16; i++)
		ctx->c_v[i] = (i8x16){};
	
	// P/B slices
	if (ctx->t.slice_type < 2) {
		ctx->refIdx4x4_C_v = (i8x16){2, 3, 12, -1, 3, 6, 13, -1, 12, 13, 14, -1, 13, -1, 15, -1};
		ctx->absMvd_A_v = (i16x16){0, 0, 4, 4, 2, 8, 6, 12, 16, 16, 20, 20, 18, 24, 22, 28};
		ctx->absMvd_B_v = (i32x16){0, 2, 0, 2, 8, 10, 8, 10, 4, 6, 16, 18, 12, 14, 24, 26};
		ctx->mvs_A_v = (i16x16){0, 0, 2, 2, 1, 4, 3, 6, 8, 8, 10, 10, 9, 12, 11, 14};
		ctx->mvs_B_v = (i32x16){0, 1, 0, 1, 4, 5, 4, 5, 2, 3, 8, 9, 6, 7, 12, 13};
		ctx->mvs_C_v = (i32x16){0, 1, 1, -1, 4, 5, 5, -1, 3, 6, 9, -1, 7, -1, 13, -1};
		ctx->mvs_D_v = (i32x16){0, 1, 2, 0, 4, 5, 1, 4, 8, 2, 10, 8, 3, 6, 9, 12};
		ctx->num_ref_idx_mask = (ctx->t.pps.num_ref_idx_active[0] > 1) * 0x0f + (ctx->t.pps.num_ref_idx_active[1] > 1) * 0xf0;
		ctx->transform_8x8_mode_flag = ctx->t.pps.transform_8x8_mode_flag; // for P slices this value is constant
		int max0 = ctx->t.pps.num_ref_idx_active[0] - 1;
		int max1 = ctx->t.slice_type == 0 ? -1 : ctx->t.pps.num_ref_idx_active[1] - 1;
		ctx->clip_ref_idx_v = (i8x8){max0, max0, max0, max0, max1, max1, max1, max1};
		
		// B slides
		if (ctx->t.slice_type == 1) {
			ctx->mbCol = (Edge264Macroblock *)(ctx->t.frame_buffers[ctx->t.RefPicList[1][0]] + mb_offset);
			ctx->col_short_term = 1 & ~(ctx->t.long_term_flags >> ctx->t.RefPicList[1][0]);
			
			// initializations for temporal prediction and implicit weights
			int rangeL1 = ctx->t.pps.num_ref_idx_active[1];
			if (ctx->t.pps.weighted_bipred_idc == 2 || (rangeL1 = 1, !ctx->t.direct_spatial_mv_pred_flag)) {
				tb.v[0] = packs16(ctx->t.diff_poc_v[0], ctx->t.diff_poc_v[1]);
				tb.v[1] = packs16(ctx->t.diff_poc_v[2], ctx->t.diff_poc_v[3]);
				ctx->MapPicToList0_v[0] = ctx->MapPicToList0_v[1] = (i8x16){}; // FIXME pictures not found in RefPicList0 should point to self
				for (int refIdxL0 = ctx->t.pps.num_ref_idx_active[0], DistScaleFactor; refIdxL0-- > 0; ) {
					int pic0 = ctx->t.RefPicList[0][refIdxL0];
					ctx->MapPicToList0[pic0] = refIdxL0;
					i16x8 diff0 = set16(ctx->t.diff_poc[pic0]);
					td.v[0] = packs16(diff0 - ctx->t.diff_poc_v[0], diff0 - ctx->t.diff_poc_v[1]);
					td.v[1] = packs16(diff0 - ctx->t.diff_poc_v[2], diff0 - ctx->t.diff_poc_v[3]);
					for (int refIdxL1 = rangeL1, implicit_weight; refIdxL1-- > 0; ) {
						int pic1 = ctx->t.RefPicList[1][refIdxL1];
						if (td.q[pic1] != 0 && !(ctx->t.long_term_flags & 1 << pic0)) {
							int tx = (16384 + abs(td.q[pic1] / 2)) / td.q[pic1];
							DistScaleFactor = min(max((tb.q[pic0] * tx + 32) >> 6, -1024), 1023);
							implicit_weight = (!(ctx->t.long_term_flags & 1 << pic1) && DistScaleFactor >= -256 && DistScaleFactor <= 515) ? DistScaleFactor >> 2 : 32;
						} else {
							DistScaleFactor = 256;
							implicit_weight = 32;
						}
						ctx->implicit_weights[refIdxL0][refIdxL1] = implicit_weight + 64;
					}
					ctx->DistScaleFactor[refIdxL0] = DistScaleFactor;
				}
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
andq $-0x40, %rsp
subq $0x4c0, %rsp            # imm = 0x4C0
movq %rdi, 0x3a8(%rsp)
movl %esi, 0x3a4(%rsp)
movq 0x3a8(%rsp), %rax
movq 0x6b0(%rax), %rcx
movslq 0x3a4(%rsp), %rdx
movl 0xec(%rcx,%rdx,4), %ecx
movl %ecx, 0x65c(%rax)
movq 0x3a8(%rsp), %rax
movl 0x48(%rax), %ecx
movl %ecx, 0x658(%rax)
movq 0x3a8(%rsp), %rcx
movq %rcx, 0x50(%rsp)
movl 0x48(%rcx), %eax
movswl 0x30(%rcx), %ecx
xorl %edx, %edx
movl %edx, 0x4c(%rsp)
divl %ecx
movl 0x4c(%rsp), %edx
movl %eax, %ecx
movq 0x50(%rsp), %rax
movw %cx, 0x656(%rax)
movq 0x3a8(%rsp), %rcx
movq %rcx, 0x58(%rsp)
movl 0x48(%rcx), %eax
movswl 0x30(%rcx), %ecx
divl %ecx
movq 0x58(%rsp), %rax
movw %dx, %cx
movw %cx, 0x654(%rax)
movq 0x3a8(%rsp), %rax
movq 0x58(%rax), %rcx
movswl 0x654(%rax), %edx
movswl 0x656(%rax), %esi
movzwl 0x34(%rax), %edi
imull %edi, %esi
addl %esi, %edx
shll $0x4, %edx
movslq %edx, %rdx
addq %rdx, %rcx
movq %rcx, 0x668(%rax)
movq 0x3a8(%rsp), %rax
movq 0x58(%rax), %rcx
movslq 0x3c(%rax), %rdx
addq %rdx, %rcx
movswl 0x654(%rax), %edx
movswl 0x656(%rax), %esi
movzwl 0x36(%rax), %edi
imull %edi, %esi
addl %esi, %edx
shll $0x3, %edx
movslq %edx, %rdx
addq %rdx, %rcx
movq %rcx, 0x670(%rax)
movq 0x3a8(%rsp), %rax
movq 0x670(%rax), %rcx
movzwl 0x36(%rax), %edx
shrl %edx
addq %rdx, %rcx
movq %rcx, 0x678(%rax)
movq 0x3a8(%rsp), %rsi
movl 0x3c(%rsi), %eax
movl 0x40(%rsi), %ecx
addl %ecx, %eax
movswl 0x654(%rsi), %ecx
movswl 0x656(%rsi), %edx
movswl 0x30(%rsi), %esi
incl %esi
imull %esi, %edx
addl %edx, %ecx
imull $0x130, %ecx, %ecx      # imm = 0x130
addl %ecx, %eax
movl %eax, 0x35c(%rsp)
movq 0x3a8(%rsp), %rax
movq 0x58(%rax), %rcx
movslq 0x35c(%rsp), %rdx
addq %rdx, %rcx
movq %rcx, 0x680(%rax)
movq 0x3a8(%rsp), %rax
movq %rcx, 0x6a8(%rax)
vmovdqa 0xbfd81(%rip), %ymm0    # 0xc9000
vmovdqa %ymm0, 0x320(%rsp)
vmovdqa 0x320(%rsp), %ymm0
movq 0x3a8(%rsp), %rax
vmovdqa %ymm0, 0xb40(%rax)
vmovdqa 0xbfd77(%rip), %ymm0    # 0xc9020
vmovdqa %ymm0, 0x2e0(%rsp)
vmovdqa 0xbfd86(%rip), %ymm0    # 0xc9040
vmovdqa %ymm0, 0x2c0(%rsp)
vmovdqa 0x2c0(%rsp), %ymm0
vmovdqa 0x2e0(%rsp), %ymm1
movq 0x3a8(%rsp), %rax
vmovdqa %ymm1, 0xba0(%rax)
vmovdqa %ymm0, 0xb80(%rax)
movq 0x3a8(%rsp), %rax
movsbl 0x2a(%rax), %eax
cmpl $0x1, %eax
jne 0x9352
vmovdqa 0xbfe3a(%rip), %xmm0    # 0xc9140
vmovdqa %xmm0, 0x2b0(%rsp)
vmovdqa 0x2b0(%rsp), %xmm0
movq 0x3a8(%rsp), %rax
vmovdqa %xmm0, 0xbc0(%rax)
vmovdqa 0xbfd10(%rip), %ymm0    # 0xc9040
vmovdqa %ymm0, 0x280(%rsp)
vmovdqa 0x280(%rsp), %ymm0
movq 0x3a8(%rsp), %rax
vmovdqa %ymm0, 0xbe0(%rax)
movq 0x3a8(%rsp), %rax
movsbl 0x227(%rax), %eax
movslq %eax, %rcx
leaq 0xc29f5(%rip), %rax     # 0xcbd60
addq $0xc, %rax
addq %rcx, %rax
movq %rax, 0x3f8(%rsp)
movq 0x3f8(%rsp), %rax
vmovdqu (%rax), %xmm0
movq 0x3a8(%rsp), %rax
vmovdqa %xmm0, 0x1ae0(%rax)
movq 0x3a8(%rsp), %rax
movsbl 0x227(%rax), %eax
movslq %eax, %rcx
leaq 0xc29b1(%rip), %rax     # 0xcbd60
addq $0x1c, %rax
addq %rcx, %rax
movq %rax, 0x3f0(%rsp)
movq 0x3f0(%rsp), %rax
vmovdqu (%rax), %xmm0
movq 0x3a8(%rsp), %rax
vmovdqa %xmm0, 0x1af0(%rax)
movq 0x3a8(%rsp), %rax
movsbl 0x227(%rax), %eax
movslq %eax, %rcx
leaq 0xc296d(%rip), %rax     # 0xcbd60
addq $0x2c, %rax
addq %rcx, %rax
movq %rax, 0x3e8(%rsp)
movq 0x3e8(%rsp), %rax
vmovdqu (%rax), %xmm0
movq 0x3a8(%rsp), %rax
vmovdqa %xmm0, 0x1b00(%rax)
movq 0x3a8(%rsp), %rax
movsbl 0x227(%rax), %eax
movslq %eax, %rcx
leaq 0xc2929(%rip), %rax     # 0xcbd60
addq $0x3c, %rax
addq %rcx, %rax
movq %rax, 0x3e0(%rsp)
movq 0x3e0(%rsp), %rax
vmovdqu (%rax), %xmm0
movq 0x3a8(%rsp), %rax
vmovdqa %xmm0, 0x1b10(%rax)
movq 0x3a8(%rsp), %rax
movsbl 0x22c(%rax), %eax
movslq %eax, %rcx
leaq 0xc28e5(%rip), %rax     # 0xcbd60
addq $0xc, %rax
addq %rcx, %rax
movq %rax, 0x3d8(%rsp)
movq 0x3d8(%rsp), %rax
vmovdqu (%rax), %xmm0
movq 0x3a8(%rsp), %rax
vmovdqa %xmm0, 0x1b20(%rax)
movq 0x3a8(%rsp), %rax
movsbl 0x22c(%rax), %eax
movslq %eax, %rcx
leaq 0xc28a1(%rip), %rax     # 0xcbd60
addq $0x1c, %rax
addq %rcx, %rax
movq %rax, 0x3d0(%rsp)
movq 0x3d0(%rsp), %rax
vmovdqu (%rax), %xmm0
movq 0x3a8(%rsp), %rax
vmovdqa %xmm0, 0x1b30(%rax)
movq 0x3a8(%rsp), %rax
movsbl 0x22c(%rax), %eax
movslq %eax, %rcx
leaq 0xc285d(%rip), %rax     # 0xcbd60
addq $0x2c, %rax
addq %rcx, %rax
movq %rax, 0x3c8(%rsp)
movq 0x3c8(%rsp), %rax
vmovdqu (%rax), %xmm0
movq 0x3a8(%rsp), %rax
vmovdqa %xmm0, 0x1b40(%rax)
movq 0x3a8(%rsp), %rax
movsbl 0x22c(%rax), %eax
movslq %eax, %rcx
leaq 0xc2819(%rip), %rax     # 0xcbd60
addq $0x3c, %rax
addq %rcx, %rax
movq %rax, 0x3c0(%rsp)
movq 0x3c0(%rsp), %rax
vmovdqu (%rax), %xmm0
movq 0x3a8(%rsp), %rax
vmovdqa %xmm0, 0x1b50(%rax)
movq 0x3a8(%rsp), %rax
movq 0x3a8(%rsp), %rcx
movsbq 0x50(%rcx), %rcx
movb 0x1ae0(%rax,%rcx), %cl
movq 0x3a8(%rsp), %rax
movb %cl, 0x51(%rax)
movq 0x3a8(%rsp), %rax
movq 0x3a8(%rsp), %rcx
movsbq 0x50(%rcx), %rcx
movb 0x1b20(%rax,%rcx), %cl
movq 0x3a8(%rsp), %rax
movb %cl, 0x52(%rax)
movl $0x1, 0x27c(%rsp)
cmpl $0x4, 0x27c(%rsp)
jge 0x96a0
movslq 0x27c(%rsp), %rcx
leaq 0xc27d8(%rip), %rax     # 0xcbdc0
shlq $0x4, %rcx
addq %rcx, %rax
vmovdqa (%rax), %xmm0
movq 0x3a8(%rsp), %rax
addq $0x1a20, %rax           # imm = 0x1A20
movslq 0x27c(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
vmovdqa %xmm0, (%rax)
movslq 0x27c(%rsp), %rcx
leaq 0xc281d(%rip), %rax     # 0xcbe40
shlq $0x4, %rcx
addq %rcx, %rax
vmovdqa (%rax), %xmm0
movq 0x3a8(%rsp), %rax
addq $0x1a60, %rax           # imm = 0x1A60
movslq 0x27c(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
vmovdqa %xmm0, (%rax)
movslq 0x27c(%rsp), %rcx
leaq 0xc2822(%rip), %rax     # 0xcbe80
shlq $0x4, %rcx
addq %rcx, %rax
vmovdqa (%rax), %xmm0
movq 0x3a8(%rsp), %rax
addq $0x1aa0, %rax           # imm = 0x1AA0
movslq 0x27c(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
vmovdqa %xmm0, (%rax)
movl 0x27c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x27c(%rsp)
jmp 0x95cb
movl $0x0, 0x278(%rsp)
cmpl $0x10, 0x278(%rsp)
jge 0x96ff
vpxor %xmm0, %xmm0, %xmm0
vmovdqa %xmm0, 0x260(%rsp)
vmovdqa 0x260(%rsp), %xmm0
movq 0x3a8(%rsp), %rax
addq $0x1b60, %rax           # imm = 0x1B60
movslq 0x278(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
vmovdqa %xmm0, (%rax)
movl 0x278(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x278(%rsp)
jmp 0x96ab
movq 0x3a8(%rsp), %rax
movsbl 0x20(%rax), %eax
cmpl $0x2, %eax
jge 0x9fa4
vmovdqa 0xbfa34(%rip), %xmm0    # 0xc9150
vmovdqa %xmm0, 0x250(%rsp)
vmovdqa 0x250(%rsp), %xmm0
movq 0x3a8(%rsp), %rax
vmovdqa %xmm0, 0xc20(%rax)
vmovdqa 0xbf91a(%rip), %ymm0    # 0xc9060
vmovdqa %ymm0, 0x220(%rsp)
vmovdqa 0x220(%rsp), %ymm0
movq 0x3a8(%rsp), %rax
vmovdqa %ymm0, 0xc40(%rax)
vmovdqa 0xbf910(%rip), %ymm0    # 0xc9080
vmovdqa %ymm0, 0x1e0(%rsp)
vmovdqa 0xbf91f(%rip), %ymm0    # 0xc90a0
vmovdqa %ymm0, 0x1c0(%rsp)
vmovdqa 0x1c0(%rsp), %ymm0
vmovdqa 0x1e0(%rsp), %ymm1
movq 0x3a8(%rsp), %rax
vmovdqa %ymm1, 0xca0(%rax)
vmovdqa %ymm0, 0xc80(%rax)
vmovdqa 0xbf844(%rip), %ymm0    # 0xc9000
vmovdqa %ymm0, 0x1a0(%rsp)
vmovdqa 0x1a0(%rsp), %ymm0
movq 0x3a8(%rsp), %rax
vmovdqa %ymm0, 0xcc0(%rax)
vmovdqa 0xbf83a(%rip), %ymm0    # 0xc9020
vmovdqa %ymm0, 0x160(%rsp)
vmovdqa 0xbf849(%rip), %ymm0    # 0xc9040
vmovdqa %ymm0, 0x140(%rsp)
vmovdqa 0x140(%rsp), %ymm0
vmovdqa 0x160(%rsp), %ymm1
movq 0x3a8(%rsp), %rax
vmovdqa %ymm1, 0xd20(%rax)
vmovdqa %ymm0, 0xd00(%rax)
vmovdqa 0xbf88e(%rip), %ymm0    # 0xc90c0
vmovdqa %ymm0, 0x120(%rsp)
vmovdqa 0xbf89d(%rip), %ymm0    # 0xc90e0
vmovdqa %ymm0, 0x100(%rsp)
vmovdqa 0x100(%rsp), %ymm0
vmovdqa 0x120(%rsp), %ymm1
movq 0x3a8(%rsp), %rax
vmovdqa %ymm1, 0xd60(%rax)
vmovdqa %ymm0, 0xd40(%rax)
vmovdqa 0xbf882(%rip), %ymm0    # 0xc9100
vmovdqa %ymm0, 0xe0(%rsp)
vmovdqa 0xbf891(%rip), %ymm0    # 0xc9120
vmovdqa %ymm0, 0xc0(%rsp)
vmovdqa 0xc0(%rsp), %ymm0
vmovdqa 0xe0(%rsp), %ymm1
movq 0x3a8(%rsp), %rax
vmovdqa %ymm1, 0xda0(%rax)
vmovdqa %ymm0, 0xd80(%rax)
movq 0x3a8(%rsp), %rax
movsbl 0x222(%rax), %eax
cmpl $0x1, %eax
setg %al
andb $0x1, %al
movzbl %al, %eax
imull $0xf, %eax, %eax
movq 0x3a8(%rsp), %rcx
movsbl 0x223(%rcx), %ecx
cmpl $0x1, %ecx
setg %cl
andb $0x1, %cl
movzbl %cl, %ecx
imull $0xf0, %ecx, %ecx
addl %ecx, %eax
movb %al, %cl
movq 0x3a8(%rsp), %rax
movb %cl, 0xdc1(%rax)
movq 0x3a8(%rsp), %rax
movb 0x22a(%rax), %cl
movq 0x3a8(%rsp), %rax
movb %cl, 0xdc0(%rax)
movq 0x3a8(%rsp), %rax
movsbl 0x222(%rax), %eax
subl $0x1, %eax
movl %eax, 0xbc(%rsp)
movq 0x3a8(%rsp), %rax
movsbl 0x20(%rax), %eax
cmpl $0x0, %eax
jne 0x9963
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x48(%rsp)
jmp 0x9979
movq 0x3a8(%rsp), %rax
movsbl 0x223(%rax), %eax
subl $0x1, %eax
movl %eax, 0x48(%rsp)
movl 0x48(%rsp), %eax
movl %eax, 0xb8(%rsp)
movl 0xbc(%rsp), %eax
vmovd %eax, %xmm0
vpinsrb $0x1, %eax, %xmm0, %xmm0
vpinsrb $0x2, %eax, %xmm0, %xmm0
vpinsrb $0x3, %eax, %xmm0, %xmm0
movl 0xb8(%rsp), %eax
vpinsrb $0x4, %eax, %xmm0, %xmm0
vpinsrb $0x5, %eax, %xmm0, %xmm0
vpinsrb $0x6, %eax, %xmm0, %xmm0
vpinsrb $0x7, %eax, %xmm0, %xmm0
vmovq %xmm0, 0xb0(%rsp)
movq 0xb0(%rsp), %rcx
movq 0x3a8(%rsp), %rax
movq %rcx, 0xe08(%rax)
movq 0x3a8(%rsp), %rax
movsbl 0x20(%rax), %eax
cmpl $0x1, %eax
jne 0x9fa2
movq 0x3a8(%rsp), %rax
movq 0x3a8(%rsp), %rcx
movsbq 0x1c0(%rcx), %rcx
movq 0x60(%rax,%rcx,8), %rcx
movslq 0x35c(%rsp), %rax
addq %rax, %rcx
movq 0x3a8(%rsp), %rax
movq %rcx, 0x6a8(%rax)
movq 0x3a8(%rsp), %rax
movl 0x4c(%rax), %eax
movq 0x3a8(%rsp), %rcx
movsbl 0x1c0(%rcx), %ecx
shrl %cl, %eax
xorl $-0x1, %eax
andl $0x1, %eax
movb %al, %cl
movq 0x3a8(%rsp), %rax
movb %cl, 0x652(%rax)
movq 0x3a8(%rsp), %rax
movsbl 0x223(%rax), %eax
movl %eax, 0xac(%rsp)
movq 0x3a8(%rsp), %rax
movsbl 0x225(%rax), %eax
cmpl $0x2, %eax
je 0x9aad
movl $0x1, 0xac(%rsp)
movq 0x3a8(%rsp), %rax
cmpb $0x0, 0x24(%rax)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x9aad
jmp 0x9fa0
movq 0x3a8(%rsp), %rax
vmovdqa 0x1e0(%rax), %xmm1
vmovdqa 0x1f0(%rax), %xmm0
vmovdqa %xmm1, 0x470(%rsp)
vmovdqa %xmm0, 0x460(%rsp)
vmovdqa 0x470(%rsp), %xmm0
vmovdqa 0x460(%rsp), %xmm1
vpacksswb %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, 0x380(%rsp)
movq 0x3a8(%rsp), %rax
vmovdqa 0x200(%rax), %xmm1
vmovdqa 0x210(%rax), %xmm0
vmovdqa %xmm1, 0x450(%rsp)
vmovdqa %xmm0, 0x440(%rsp)
vmovdqa 0x450(%rsp), %xmm0
vmovdqa 0x440(%rsp), %xmm1
vpacksswb %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, 0x390(%rsp)
vpxor %xmm0, %xmm0, %xmm0
vmovdqa %xmm0, 0x90(%rsp)
vmovdqa 0x90(%rsp), %xmm0
movq 0x3a8(%rsp), %rax
vmovdqa %xmm0, 0xe20(%rax)
movq 0x3a8(%rsp), %rax
vmovdqa %xmm0, 0xe10(%rax)
movq 0x3a8(%rsp), %rax
movsbl 0x222(%rax), %eax
movl %eax, 0x8c(%rsp)
movl 0x8c(%rsp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, 0x8c(%rsp)
cmpl $0x0, %eax
jle 0x9f9e
movq 0x3a8(%rsp), %rax
movslq 0x8c(%rsp), %rcx
movsbl 0x1a0(%rax,%rcx), %eax
movl %eax, 0x84(%rsp)
movb 0x8c(%rsp), %dl
movq 0x3a8(%rsp), %rax
movslq 0x84(%rsp), %rcx
movb %dl, 0xe10(%rax,%rcx)
movq 0x3a8(%rsp), %rax
movslq 0x84(%rsp), %rcx
movw 0x1e0(%rax,%rcx,2), %ax
movw %ax, 0x48e(%rsp)
movw 0x48e(%rsp), %ax
movw %ax, 0x46(%rsp)
movw %ax, 0x4ae(%rsp)
movw %ax, 0x4ac(%rsp)
movw %ax, 0x4aa(%rsp)
movw %ax, 0x4a8(%rsp)
movw %ax, 0x4a6(%rsp)
movw %ax, 0x4a4(%rsp)
movw %ax, 0x4a2(%rsp)
movw %ax, 0x4a0(%rsp)
movzwl 0x4a0(%rsp), %eax
vmovd %eax, %xmm0
movzwl 0x4a2(%rsp), %eax
vpinsrw $0x1, %eax, %xmm0, %xmm0
movzwl 0x4a4(%rsp), %eax
vpinsrw $0x2, %eax, %xmm0, %xmm0
movzwl 0x4a6(%rsp), %eax
vpinsrw $0x3, %eax, %xmm0, %xmm0
movzwl 0x4a8(%rsp), %eax
vpinsrw $0x4, %eax, %xmm0, %xmm0
movzwl 0x4aa(%rsp), %eax
vpinsrw $0x5, %eax, %xmm0, %xmm0
movzwl 0x4ac(%rsp), %eax
vpinsrw $0x6, %eax, %xmm0, %xmm0
movzwl 0x4ae(%rsp), %eax
vpinsrw $0x7, %eax, %xmm0, %xmm0
vmovdqa %xmm0, 0x490(%rsp)
vmovdqa 0x490(%rsp), %xmm0
vmovdqa %xmm0, 0x70(%rsp)
vmovdqa 0x70(%rsp), %xmm0
movq 0x3a8(%rsp), %rax
vpsubw 0x1e0(%rax), %xmm0, %xmm1
vmovdqa 0x70(%rsp), %xmm0
movq 0x3a8(%rsp), %rax
vpsubw 0x1f0(%rax), %xmm0, %xmm0
vmovdqa %xmm1, 0x430(%rsp)
vmovdqa %xmm0, 0x420(%rsp)
vmovdqa 0x430(%rsp), %xmm0
vmovdqa 0x420(%rsp), %xmm1
vpacksswb %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, 0x360(%rsp)
vmovdqa 0x70(%rsp), %xmm0
movq 0x3a8(%rsp), %rax
vpsubw 0x200(%rax), %xmm0, %xmm1
vmovdqa 0x70(%rsp), %xmm0
movq 0x3a8(%rsp), %rax
vpsubw 0x210(%rax), %xmm0, %xmm0
vmovdqa %xmm1, 0x410(%rsp)
vmovdqa %xmm0, 0x400(%rsp)
vmovdqa 0x410(%rsp), %xmm0
vmovdqa 0x400(%rsp), %xmm1
vpacksswb %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, 0x370(%rsp)
movl 0xac(%rsp), %eax
movl %eax, 0x6c(%rsp)
movl 0x6c(%rsp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, 0x6c(%rsp)
cmpl $0x0, %eax
jle 0x9f77
movq 0x3a8(%rsp), %rax
movslq 0x6c(%rsp), %rcx
movsbl 0x1c0(%rax,%rcx), %eax
movl %eax, 0x64(%rsp)
movslq 0x64(%rsp), %rax
movsbl 0x360(%rsp,%rax), %eax
cmpl $0x0, %eax
je 0x9f31
movq 0x3a8(%rsp), %rax
movl 0x4c(%rax), %eax
movl 0x84(%rsp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
jne 0x9f31
movslq 0x64(%rsp), %rax
movsbl 0x360(%rsp,%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
addl $0x4000, %eax           # imm = 0x4000
movslq 0x64(%rsp), %rcx
movsbl 0x360(%rsp,%rcx), %ecx
cltd
idivl %ecx
movl %eax, 0x60(%rsp)
movslq 0x84(%rsp), %rax
movsbl 0x380(%rsp,%rax), %eax
imull 0x60(%rsp), %eax
addl $0x20, %eax
sarl $0x6, %eax
movl %eax, 0x3b4(%rsp)
movl $0xfffffc00, 0x3b0(%rsp) # imm = 0xFFFFFC00
movl 0x3b4(%rsp), %eax
cmpl 0x3b0(%rsp), %eax
jle 0x9e7f
movl 0x3b4(%rsp), %eax
movl %eax, 0x40(%rsp)
jmp 0x9e8a
movl 0x3b0(%rsp), %eax
movl %eax, 0x40(%rsp)
movl 0x40(%rsp), %eax
movl %eax, 0x3bc(%rsp)
movl $0x3ff, 0x3b8(%rsp) # imm = 0x3FF
movl 0x3bc(%rsp), %eax
cmpl 0x3b8(%rsp), %eax
jge 0x9ebd
movl 0x3bc(%rsp), %eax
movl %eax, 0x3c(%rsp)
jmp 0x9ec8
movl 0x3b8(%rsp), %eax
movl %eax, 0x3c(%rsp)
movl 0x3c(%rsp), %eax
movl %eax, 0x88(%rsp)
movq 0x3a8(%rsp), %rax
movl 0x4c(%rax), %eax
movl 0x64(%rsp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
jne 0x9f1c
cmpl $0xffffff00, 0x88(%rsp) # imm = 0xFFFFFF00
jl 0x9f1c
cmpl $0x203, 0x88(%rsp) # imm = 0x203
jg 0x9f1c
movl 0x88(%rsp), %eax
sarl $0x2, %eax
movl %eax, 0x38(%rsp)
jmp 0x9f27
movl $0x20, %eax
movl %eax, 0x38(%rsp)
jmp 0x9f27
movl 0x38(%rsp), %eax
movl %eax, 0x68(%rsp)
jmp 0x9f44
movl $0x100, 0x88(%rsp) # imm = 0x100
movl $0x20, 0x68(%rsp)
movl 0x68(%rsp), %eax
addl $0x40, %eax
movb %al, %dl
movq 0x3a8(%rsp), %rax
addq $0xe30, %rax            # imm = 0xE30
movslq 0x8c(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq 0x6c(%rsp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x9d95
movl 0x88(%rsp), %eax
movw %ax, %dx
movq 0x3a8(%rsp), %rax
movslq 0x8c(%rsp), %rcx
movw %dx, 0xdc2(%rax,%rcx,2)
jmp 0x9b8b
jmp 0x9fa0
jmp 0x9fa2
jmp 0x9fa4
movq %rbp, %rsp
popq %rbp
vzeroupper
retq
nopl (%rax)