// File: /workspace/github_c_makefile_star2_O3/lh3[P]minimap2/align.c
// Function: mm_align_skeleton
mm_reg1_t *mm_align_skeleton(void *km, const mm_mapopt_t *opt, const mm_idx_t *mi, int qlen, const char *qstr, int *n_regs_, mm_reg1_t *regs, mm128_t *a)
{
	extern unsigned char seq_nt4_table[256];
	int32_t i, n_regs = *n_regs_, n_a;
	uint8_t *qseq0[2];
	ksw_extz_t ez;

	// encode the query sequence
	qseq0[0] = (uint8_t*)kmalloc(km, qlen * 2);
	qseq0[1] = qseq0[0] + qlen;
	for (i = 0; i < qlen; ++i) {
		qseq0[0][i] = seq_nt4_table[(uint8_t)qstr[i]];
		qseq0[1][qlen - 1 - i] = qseq0[0][i] < 4? 3 - qseq0[0][i] : 4;
	}

	// align through seed hits
	n_a = mm_squeeze_a(km, n_regs, regs, a);
	memset(&ez, 0, sizeof(ksw_extz_t));
	for (i = 0; i < n_regs; ++i) {
		mm_reg1_t r2; // only used for inversion
		if ((opt->flag&MM_F_SPLICE) && (opt->flag&MM_F_SPLICE_FOR) && (opt->flag&MM_F_SPLICE_REV)) { // then do two rounds of alignments for both strands
			mm_reg1_t s[2], s2[2], *r;
			s[0] = s[1] = regs[i];
			mm_align1(km, opt, mi, qlen, qseq0, &s[0], &s2[0], n_a, a, &ez, MM_F_SPLICE_FOR); // assume the transcript is on the + strand of the genome
			if ((opt->flag&MM_F_SR_RNA) && regs[i].qe - regs[i].qs == regs[i].re - regs[i].rs && s[0].qe - s[0].qs == s[0].re - s[0].rs && s[0].qs == 0 && s[0].qe == qlen) {
				regs[i] = s[0], r2 = s2[0];
				regs[i].p->trans_strand = 0;
			} else {
				int which, trans_strand;
				mm_align1(km, opt, mi, qlen, qseq0, &s[1], &s2[1], n_a, a, &ez, MM_F_SPLICE_REV); // assume the transcript on the - strand
				if (s[0].p->dp_score > s[1].p->dp_score) which = 0, trans_strand = 1;
				else if (s[0].p->dp_score < s[1].p->dp_score) which = 1, trans_strand = 2;
				else trans_strand = 3, which = (qlen + s[0].p->dp_score) & 1; // randomly choose a strand, effectively
				if (which == 0) {
					regs[i] = s[0], r2 = s2[0];
					free(s[1].p);
				} else {
					regs[i] = s[1], r2 = s2[1];
					free(s[0].p);
				}
				r = &regs[i];
				r->p->trans_strand = trans_strand;
				if (r->is_spliced) {
					if (trans_strand == 1 || trans_strand == 2) // this is an *approximate* way to tell if there are splice signals.
						r->p->dp_max += (opt->a + opt->b) + ((opt->a + opt->b) >> 1);
					else if (trans_strand == 3)
						r->p->dp_max -= opt->a + opt->b;
				}
			}
		} else { // one round of alignment
			mm_align1(km, opt, mi, qlen, qseq0, &regs[i], &r2, n_a, a, &ez, opt->flag);
			if (opt->flag&MM_F_SPLICE)
				regs[i].p->trans_strand = opt->flag&MM_F_SPLICE_FOR? 1 : 2;
		}
		if (r2.cnt > 0) regs = mm_insert_reg(&r2, i, &n_regs, regs);
		if (i > 0 && regs[i].split_inv && !(opt->flag & MM_F_NO_INV)) {
			if (mm_align1_inv(km, opt, mi, qlen, qseq0, &regs[i-1], &regs[i], &r2, &ez)) {
				regs = mm_insert_reg(&r2, i, &n_regs, regs);
				++i; // skip the inserted INV alignment
			}
		}
	}
	*n_regs_ = n_regs;
	kfree(km, qseq0[0]);
	kfree(km, ez.cigar);
	mm_filter_regs(opt, qlen, n_regs_, regs);
	if (!(opt->flag&(MM_F_SR|MM_F_SR_RNA|MM_F_ALL_CHAINS)) && !opt->split_prefix && qlen >= opt->rank_min_len) {
		mm_update_dp_max(qlen, *n_regs_, regs, opt->rank_frac, opt->a, opt->b);
		mm_filter_regs(opt, qlen, n_regs_, regs);
	}
	mm_hit_sort(km, n_regs_, regs, opt->alt_drop);
	return regs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movq %r8, %r14
movl %ecx, %ebp
movq %rdx, 0x48(%rsp)
movq %rsi, %r13
movq %rdi, %r12
movq 0x2c0(%rsp), %r15
movq %r9, 0x130(%rsp)
movl (%r9), %eax
movl %eax, 0xc(%rsp)
leal (,%rbp,2), %eax
movslq %eax, %rsi
callq 0x1264d
movq %rax, %rbx
movq %rax, 0x50(%rsp)
movslq %ebp, %rcx
addq %rcx, %rax
movq %rax, 0x58(%rsp)
testl %ecx, %ecx
jle 0x17598
movl %ecx, %eax
leaq -0x1(,%rcx,2), %rcx
xorl %edx, %edx
leaq 0x1f2ab(%rip), %rsi     # 0x36810
movl $0x4, %edi
movzbl (%r14,%rdx), %r8d
movb (%rsi,%r8), %r8b
movb %r8b, (%rbx,%rdx)
movb $0x3, %r9b
subb %r8b, %r9b
cmpb $0x4, %r8b
movzbl %r9b, %r8d
cmovael %edi, %r8d
movb %r8b, (%rbx,%rcx)
incq %rdx
decq %rcx
cmpq %rdx, %rax
jne 0x1756a
movq %r12, %rdi
movl 0xc(%rsp), %r14d
movl %r14d, %esi
movq %r15, %rdx
movq 0x2c8(%rsp), %rcx
callq 0x1cbb0
movl %r14d, %r8d
movq %rax, 0x70(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0xe0(%rsp)
movapd %xmm0, 0xf0(%rsp)
movapd %xmm0, 0x100(%rsp)
movq $0x0, 0x110(%rsp)
testl %r14d, %r14d
jle 0x18004
xorl %r14d, %r14d
movq %r12, 0x138(%rsp)
movq %r13, 0x10(%rsp)
movq %rbp, 0x40(%rsp)
movq %r15, %r9
movl %r8d, 0xc(%rsp)
movq (%r13), %rax
movl %eax, %ecx
notl %ecx
movslq %r14d, %rdx
testl $0x380, %ecx            # imm = 0x380
movq %rdx, 0x18(%rsp)
leaq (%rdx,%rdx,4), %rbx
jne 0x17748
shlq $0x4, %rbx
movq %r9, 0x38(%rsp)
addq %r9, %rbx
movl $0xa, %ecx
leaq 0x190(%rsp), %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl $0x50, %edx
leaq 0x140(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2340
subq $0x8, %rsp
movq %r12, %rdi
movq %r13, %rsi
movq 0x50(%rsp), %rdx
movl %ebp, %ecx
leaq 0x58(%rsp), %r8
movq %r15, %r9
pushq $0x100                  # imm = 0x100
leaq 0xf0(%rsp), %rax
pushq %rax
pushq 0x2e0(%rsp)
pushq 0x90(%rsp)
leaq 0x208(%rsp), %rax
pushq %rax
callq 0x180ba
addq $0x30, %rsp
movabsq $0x8000000000, %rax     # imm = 0x8000000000
testq %rax, (%r13)
je 0x177d2
movl 0x14(%rbx), %eax
subl 0x10(%rbx), %eax
movl 0x1c(%rbx), %ecx
subl 0x18(%rbx), %ecx
cmpl %ecx, %eax
jne 0x177d2
movl 0x154(%rsp), %eax
cmpl %ebp, %eax
jne 0x177d2
movl 0x150(%rsp), %ecx
testl %ecx, %ecx
jne 0x177d2
subl %ecx, %eax
movl 0x15c(%rsp), %ecx
subl 0x158(%rsp), %ecx
cmpl %ecx, %eax
jne 0x177d2
movl $0xa, %ecx
movq %rbx, %rdi
leaq 0x140(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movl $0xa, %ecx
leaq 0x90(%rsp), %rdi
leaq 0x1e0(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq 0x48(%rbx), %rax
andl $0x3fffffff, 0x14(%rax) # imm = 0x3FFFFFFF
movl 0xc(%rsp), %r8d
jmp 0x1790d
shlq $0x4, %rbx
addq %r9, %rbx
subq $0x8, %rsp
movq %r12, %rdi
movq %r13, %rsi
movq 0x50(%rsp), %rdx
movl %ebp, %ecx
leaq 0x58(%rsp), %r8
movq %r9, %r15
movq %rbx, %r9
pushq %rax
leaq 0xf0(%rsp), %rax
pushq %rax
pushq 0x2e0(%rsp)
pushq 0x90(%rsp)
leaq 0xb8(%rsp), %rax
pushq %rax
callq 0x180ba
movq %r15, %r9
addq $0x30, %rsp
movq (%r13), %rax
testb %al, %al
movl 0xc(%rsp), %r8d
jns 0x1791f
btl $0x8, %eax
movl $0x40000000, %eax       # imm = 0x40000000
movl $0x80000000, %ecx       # imm = 0x80000000
cmovael %ecx, %eax
movq 0x48(%rbx), %rcx
movl 0x14(%rcx), %edx
movl $0x3fffffff, %esi       # imm = 0x3FFFFFFF
andl %esi, %edx
orl %eax, %edx
movl %edx, 0x14(%rcx)
jmp 0x1791f
subq $0x8, %rsp
movq %r12, %rdi
movq %r13, %rsi
movq 0x50(%rsp), %rdx
movl %ebp, %ecx
leaq 0x58(%rsp), %r8
leaq 0x198(%rsp), %r9
pushq $0x200                  # imm = 0x200
leaq 0xf0(%rsp), %rax
pushq %rax
pushq 0x2e0(%rsp)
pushq 0x90(%rsp)
leaq 0x258(%rsp), %rax
pushq %rax
callq 0x180ba
addq $0x30, %rsp
movq 0x188(%rsp), %rax
movq 0x1d8(%rsp), %rcx
movl 0x4(%rax), %ebp
movl 0x4(%rcx), %r15d
cmpl %r15d, %ebp
jle 0x1785d
movl $0x40000000, %r13d      # imm = 0x40000000
xorl %r12d, %r12d
leaq 0x140(%rsp), %rsi
leaq 0x1e0(%rsp), %rax
leaq 0x1d8(%rsp), %rdx
jmp 0x17892
setl %r12b
movl $0x80000000, %r13d      # imm = 0x80000000
jl 0x1787a
movq 0x40(%rsp), %rax
addl %ebp, %eax
movl $0xc0000000, %r13d      # imm = 0xC0000000
testb $0x1, %al
je 0x17840
leaq 0x190(%rsp), %rsi
leaq 0x230(%rsp), %rax
leaq 0x188(%rsp), %rdx
movl $0xa, %ecx
movq %rbx, %rdi
rep  movsq (%rsi), %es:(%rdi)
movl $0xa, %ecx
leaq 0x90(%rsp), %rdi
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq (%rdx), %rdi
callq 0x2040
movq 0x48(%rbx), %rax
movl 0x14(%rax), %ecx
movl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
andl %edx, %ecx
orl %r13d, %ecx
movl %ecx, 0x14(%rax)
testb $0x8, 0x3f(%rbx)
movq 0x10(%rsp), %r13
movl 0xc(%rsp), %r8d
je 0x1790d
cmpl %r15d, %ebp
setle %dl
xorb $0x1, %r12b
movl 0x64(%r13), %ecx
movl 0x68(%r13), %eax
testb %r12b, %dl
jne 0x17904
addl %ecx, %eax
movl %eax, %ecx
sarl %ecx
addl %eax, %ecx
movq 0x48(%rbx), %rax
addl %ecx, 0x8(%rax)
jmp 0x1790d
movq 0x48(%rbx), %rdx
addl %ecx, %eax
subl %eax, 0x8(%rdx)
movq 0x138(%rsp), %r12
movq 0x38(%rsp), %r9
movq 0x40(%rsp), %rbp
cmpl $0x0, 0x94(%rsp)
jle 0x179d0
movq %r12, %rbp
movslq %r8d, %rbx
movq %rbx, %rax
shlq $0x4, %rax
leaq (%rax,%rax,4), %rsi
addq $0x50, %rsi
movq %r9, %rdi
movl %r8d, %r12d
callq 0x2320
movq %rax, %r9
leal 0x1(%r14), %eax
cmpl %ebx, %eax
je 0x179a7
movq 0x18(%rsp), %rcx
leaq (%rcx,%rcx,4), %rcx
shlq $0x4, %rcx
leaq (%r9,%rcx), %rdi
addq $0xa0, %rdi
movslq %eax, %rbx
leaq (%rbx,%rbx,4), %rsi
shlq $0x4, %rsi
addq %r9, %rsi
movl %r14d, %eax
notl %eax
addl %r12d, %eax
cltq
shlq $0x4, %rax
leaq (%rax,%rax,4), %rdx
movq %r14, %r15
movq %r13, %r14
movq %r9, %r13
callq 0x2340
movq %r13, %r9
movq %r14, %r13
movq %r15, %r14
incl %r12d
leaq (%rbx,%rbx,4), %rdi
shlq $0x4, %rdi
addq %r9, %rdi
movl $0xa, %ecx
leaq 0x90(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movl %r12d, %r8d
movq %rbp, %r12
movq 0x40(%rsp), %rbp
testl %r14d, %r14d
jle 0x17b05
movl %r14d, %eax
leaq (%rax,%rax,4), %rbx
shlq $0x4, %rbx
testb $0x1, 0x3f(%r9,%rbx)
je 0x17b05
testb $0x2, 0x4(%r13)
jne 0x17b05
leal -0x1(%r14), %eax
leaq (%rax,%rax,4), %r13
shlq $0x4, %r13
xorpd %xmm0, %xmm0
movapd %xmm0, 0x90(%rsp)
movapd %xmm0, 0xa0(%rsp)
movapd %xmm0, 0xb0(%rsp)
movapd %xmm0, 0xc0(%rsp)
movapd %xmm0, 0xd0(%rsp)
movl 0x3c(%r9,%r13), %eax
btl $0x8, %eax
jae 0x17b00
leaq (%r9,%rbx), %rdi
movl 0x3c(%rdi), %ecx
btl $0x9, %ecx
jae 0x17b00
addq %r9, %r13
movl 0x20(%r13), %edx
cmpl %edx, (%r13)
setne %sil
cmpl $-0x2, %edx
setne %dl
testb %dl, %sil
jne 0x17b00
movl 0x20(%rdi), %edx
cmpl %edx, (%rdi)
setne %sil
cmpl $-0x2, %edx
setne %dl
testb %dl, %sil
jne 0x17b00
movl 0x8(%r13), %edx
cmpl 0x8(%rdi), %edx
jne 0x17b00
shrl $0xa, %eax
andl $0x1, %eax
btl $0xa, %ecx
movl %eax, %ecx
sbbl $0x0, %ecx
jne 0x17b00
testl %eax, %eax
movq %r13, %rax
cmoveq %rdi, %rax
movq %rdi, %rcx
cmoveq %r13, %rcx
movl 0x10(%rax), %r11d
movl 0x14(%rcx), %eax
movl %r11d, %edx
movq %rax, 0x18(%rsp)
subl %eax, %edx
movq 0x10(%rsp), %rax
movl 0x34(%rax), %eax
cmpl %eax, %edx
jl 0x17b00
movq 0x10(%rsp), %rcx
movl 0x1c(%rcx), %ecx
cmpl %ecx, %edx
jg 0x17b00
movl 0x18(%rdi), %r10d
movl 0x1c(%r13), %esi
movl %r10d, %r15d
movq %rsi, 0x30(%rsp)
subl %esi, %r15d
cmpl %eax, %r15d
setl %al
cmpl %ecx, %r15d
setg %cl
orb %al, %cl
je 0x17b16
movq 0x10(%rsp), %r13
incl %r14d
cmpl %r8d, %r14d
jl 0x17607
jmp 0x17ffc
movq %r11, 0x88(%rsp)
movq %r10, 0x80(%rsp)
movl %edx, 0x20(%rsp)
movq %r9, 0x38(%rsp)
movl %r8d, 0xc(%rsp)
movq 0x10(%rsp), %rax
movsbl 0x64(%rax), %esi
movsbl 0x68(%rax), %edx
movsbl 0x7c(%rax), %ecx
movsbl 0x80(%rax), %r8d
movq %rdi, 0x68(%rsp)
leaq 0x140(%rsp), %rdi
callq 0x1a8d5
movq %r15, 0x28(%rsp)
movslq %r15d, %rsi
movq 0x68(%rsp), %r15
movq %r12, %rdi
movq %rsi, 0x118(%rsp)
callq 0x1264d
movl 0x8(%r13), %esi
movl 0x1c(%r13), %edx
movl 0x18(%r15), %ecx
movq 0x48(%rsp), %rdi
movq %rax, 0x128(%rsp)
movq %rax, %r8
callq 0x71d0
testb $0x4, 0x3d(%r13)
jne 0x17bb1
movl %ebp, %eax
subl 0x10(%r15), %eax
leaq 0x58(%rsp), %rsi
jmp 0x17bba
movl 0x14(%r15), %eax
leaq 0x50(%rsp), %rsi
movl 0x20(%rsp), %edx
movq 0x18(%rsp), %rdi
movslq %eax, %rcx
addq (%rsi), %rcx
notl %edi
movq %rdi, 0x18(%rsp)
cmpl $0x2, %edx
movq 0x128(%rsp), %r15
movq 0x88(%rsp), %rdi
jb 0x17c13
movl %edx, %eax
shrl %eax
movq 0x18(%rsp), %rsi
leal (%rsi,%rdi), %r9d
xorl %r10d, %r10d
movb (%rcx,%r10), %sil
movl %r9d, %edi
movb (%rcx,%rdi), %r8b
movb %r8b, (%rcx,%r10)
movb %sil, (%rcx,%rdi)
incq %r10
decl %r9d
cmpq %r10, %rax
jne 0x17bf5
movq 0x30(%rsp), %rax
notl %eax
movq %rax, 0x30(%rsp)
cmpl $0x2, 0x28(%rsp)
jb 0x17c5f
movq 0x28(%rsp), %rax
shrl %eax
movq 0x30(%rsp), %rsi
movq 0x80(%rsp), %rdi
leal (%rsi,%rdi), %r9d
xorl %r10d, %r10d
movb (%r15,%r10), %sil
movl %r9d, %edi
movb (%r15,%rdi), %r8b
movb %r8b, (%r15,%r10)
movb %sil, (%r15,%rdi)
incq %r10
decl %r9d
cmpq %r10, %rax
jne 0x17c41
movq %r12, %rdi
movl $0x2, %esi
movl $0x5, %r8d
movq %rcx, 0x60(%rsp)
leaq 0x140(%rsp), %r9
callq 0x1e9d4
movq %rax, %rdi
movq %rax, 0x120(%rsp)
movq 0x10(%rsp), %rax
movl 0x6c(%rax), %ecx
movl 0x70(%rax), %r8d
subq $0x8, %rsp
movq 0x30(%rsp), %rsi
movq %r15, %rdx
leaq 0x1e8(%rsp), %r9
leaq 0x2c(%rsp), %rax
pushq %rax
callq 0x1ebc1
addq $0x10, %rsp
movl %eax, 0x7c(%rsp)
movq %r12, %rdi
movq 0x120(%rsp), %rsi
callq 0x12587
movl 0x20(%rsp), %r10d
movq 0x60(%rsp), %r11
cmpl $0x2, %r10d
movq 0x18(%rsp), %r8
jb 0x17d0f
movl %r10d, %eax
shrl %eax
addl 0x88(%rsp), %r8d
xorl %ecx, %ecx
movb (%r11,%rcx), %dl
movl %r8d, %esi
movb (%r11,%rsi), %dil
movb %dil, (%r11,%rcx)
movb %dl, (%r11,%rsi)
incq %rcx
decl %r8d
cmpq %rcx, %rax
jne 0x17cf1
movq 0x28(%rsp), %r8
cmpl $0x2, %r8d
movq 0x30(%rsp), %rdi
jb 0x17d47
shrl %r8d
addl 0x80(%rsp), %edi
xorl %eax, %eax
movb (%r15,%rax), %cl
movl %edi, %edx
movb (%r15,%rdx), %sil
movb %sil, (%r15,%rax)
movb %cl, (%r15,%rdx)
incq %rax
decl %edi
cmpq %rax, %r8
jne 0x17d2b
movq 0x10(%rsp), %rax
movl 0x7c(%rsp), %ecx
cmpl 0x9c(%rax), %ecx
jl 0x17e98
movl 0x1e0(%rsp), %eax
leal 0x1(%rax), %edx
notl %eax
addl %eax, %r10d
movl %r10d, 0x1e0(%rsp)
movslq 0x24(%rsp), %r8
incq %r8
movq 0x118(%rsp), %r9
subq %r8, %r9
movl %r9d, 0x24(%rsp)
movslq %r10d, %rcx
addq %r11, %rcx
addq %r15, %r9
movq 0x10(%rsp), %rsi
cvtsi2sdl 0x14(%rsi), %xmm0
mulsd 0x16802(%rip), %xmm0    # 0x2e5a8
cvttsd2si %xmm0, %eax
movl 0x90(%rsi), %r10d
subq $0x8, %rsp
movq %r12, %rdi
leaq 0xe8(%rsp), %r11
pushq %r11
pushq $0x40
pushq %r10
pushq $-0x1
pushq %rax
leaq 0x170(%rsp), %rax
pushq %rax
pushq $0x0
callq 0x1a9c0
addq $0x40, %rsp
movl 0x104(%rsp), %esi
testl %esi, %esi
je 0x17e98
movq 0x110(%rsp), %rdx
leaq 0x90(%rsp), %rdi
callq 0x1ad36
movl 0xe0(%rsp), %eax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %eax
movq 0xd8(%rsp), %rcx
movl %eax, 0x4(%rcx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x90(%rsp)
movl %eax, 0xb0(%rsp)
movl 0xcc(%rsp), %eax
movl $0x800, %ecx            # imm = 0x800
orl %ecx, %eax
movl %eax, 0xcc(%rsp)
movl 0x3c(%r13), %edx
movl $0x400, %ecx            # imm = 0x400
andl %ecx, %edx
andl $0xfffffbff, %eax       # imm = 0xFFFFFBFF
orl %edx, %eax
xorl %ecx, %eax
movl %eax, 0xcc(%rsp)
movl 0x8(%r13), %eax
movl %eax, 0x98(%rsp)
movl $0xbf800000, 0xd4(%rsp) # imm = 0xBF800000
movslq 0x1e0(%rsp), %rax
movl 0xe4(%rsp), %ecx
testl %edx, %edx
jne 0x17eb7
movq 0x68(%rsp), %rdx
movl 0x10(%rdx), %edx
subl %eax, %edx
notl %ecx
addl %edx, %ecx
movl %ecx, %esi
jmp 0x17ec6
movq %r12, %rdi
movq %r15, %rsi
callq 0x12587
movq 0x10(%rsp), %r13
movl 0xc(%rsp), %r8d
movq 0x38(%rsp), %r9
jmp 0x17b05
movq 0x68(%rsp), %rdx
movl 0x14(%rdx), %esi
addl %eax, %esi
leal (%rcx,%rsi), %edx
incl %edx
movq 0x60(%rsp), %rdi
movl %edx, 0xa4(%rsp)
movl %esi, 0xa0(%rsp)
movslq 0x24(%rsp), %rcx
movl 0x1c(%r13), %edx
addl %ecx, %edx
movl %edx, 0xa8(%rsp)
movl 0xe8(%rsp), %esi
addl %esi, %edx
incl %edx
movl %edx, 0xac(%rsp)
addq %rax, %rdi
movq %r15, %rdx
addq %rcx, %rdx
movq 0x10(%rsp), %r13
movsbl 0x6c(%r13), %r8d
movq %rdi, %rsi
movsbl 0x70(%r13), %r9d
movq (%r13), %rax
movl %eax, %r10d
andl $0x4000000, %r10d       # imm = 0x4000000
movabsq $0x8000000000, %rcx     # imm = 0x8000000000
addq $0x1000, %rcx           # imm = 0x1000
xorl %r11d, %r11d
testq %rcx, %rax
sete %r11b
leaq 0x90(%rsp), %rdi
leaq 0x140(%rsp), %rcx
pushq %r11
pushq %r10
callq 0x1adc1
addq $0x10, %rsp
movq %r12, %rdi
movq %r15, %rsi
callq 0x12587
movl 0xc(%rsp), %ebp
movslq %ebp, %rax
shlq $0x4, %rax
leaq (%rax,%rax,4), %rsi
addq $0x50, %rsi
movq 0x38(%rsp), %rdi
callq 0x2320
movl %ebp, %r8d
movq %rax, %r15
leal 0x1(%r14), %ebp
movl %ebp, %eax
cmpl %r8d, %ebp
je 0x17fce
leaq (%r15,%rbx), %rdi
addq $0xa0, %rdi
leaq (%rax,%rax,4), %rsi
shlq $0x4, %rsi
addq %r15, %rsi
notl %r14d
addl %r8d, %r14d
movq %rax, %rbx
movslq %r14d, %rax
shlq $0x4, %rax
leaq (%rax,%rax,4), %rdx
callq 0x2340
movq %rbx, %rax
movl 0xc(%rsp), %r8d
incl %r8d
leaq (%rax,%rax,4), %rdi
shlq $0x4, %rdi
addq %r15, %rdi
movl $0xa, %ecx
leaq 0x90(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movl %ebp, %r14d
movq %r15, %r9
movq 0x40(%rsp), %rbp
jmp 0x17b05
movq %r9, %r15
movq 0x50(%rsp), %rbx
movq 0x130(%rsp), %r14
movl %r8d, (%r14)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x12587
movq 0x110(%rsp), %rsi
movq %r12, %rdi
callq 0x12587
movq %r13, %rdi
movl %ebp, %esi
movq %r14, %rdx
movq %r15, %rcx
callq 0x1caa5
movabsq $0x8000000000, %rax     # imm = 0x8000000000
addq $0x801000, %rax         # imm = 0x801000
testq %rax, (%r13)
jne 0x18091
cmpq $0x0, 0x100(%r13)
jne 0x18091
cmpl %ebp, 0xb0(%r13)
jg 0x18091
movl (%r14), %esi
movss 0xb4(%r13), %xmm0
movl 0x64(%r13), %ecx
movl 0x68(%r13), %r8d
movl %ebp, %edi
movq %r15, %rdx
callq 0x17273
movq %r13, %rdi
movl %ebp, %esi
movq %r14, %rdx
movq %r15, %rcx
callq 0x1caa5
movss 0x60(%r13), %xmm0
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1c493
movq %r15, %rax
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq