// File: /workspace/github_c_makefile_star2_O1/lh3[P]minimap2/map.c
// Function: worker_pipeline
static void *worker_pipeline(void *shared, int step, void *in)
{
	int i, j, k;
    pipeline_t *p = (pipeline_t*)shared;
    if (step == 0) { // step 0: read sequences
		int with_qual = (!!(p->opt->flag & MM_F_OUT_SAM) && !(p->opt->flag & MM_F_NO_QUAL));
		int with_comment = !!(p->opt->flag & MM_F_COPY_COMMENT);
		int frag_mode = (p->n_fp > 1 || !!(p->opt->flag & MM_F_FRAG_MODE));
        step_t *s;
        s = (step_t*)calloc(1, sizeof(step_t));
		if (p->n_fp > 1) s->seq = mm_bseq_read_frag2(p->n_fp, p->fp, p->mini_batch_size, with_qual, with_comment, &s->n_seq);
		else s->seq = mm_bseq_read3(p->fp[0], p->mini_batch_size, with_qual, with_comment, frag_mode, &s->n_seq);
		if (s->seq) {
			s->p = p;
			for (i = 0; i < s->n_seq; ++i)
				s->seq[i].rid = p->n_processed++;
			s->buf = (mm_tbuf_t**)calloc(p->n_threads, sizeof(mm_tbuf_t*));
			for (i = 0; i < p->n_threads; ++i)
				s->buf[i] = mm_tbuf_init();
			s->n_reg = (int*)calloc(5 * s->n_seq, sizeof(int));
			s->seg_off = s->n_reg + s->n_seq; // seg_off, n_seg, rep_len and frag_gap are allocated together with n_reg
			s->n_seg = s->seg_off + s->n_seq;
			s->rep_len = s->n_seg + s->n_seq;
			s->frag_gap = s->rep_len + s->n_seq;
			s->reg = (mm_reg1_t**)calloc(s->n_seq, sizeof(mm_reg1_t*));
			for (i = 1, j = 0; i <= s->n_seq; ++i)
				if (i == s->n_seq || !frag_mode || !mm_qname_same(s->seq[i-1].name, s->seq[i].name)) {
					s->n_seg[s->n_frag] = i - j;
					s->seg_off[s->n_frag++] = j;
					j = i;
				}
			return s;
		} else free(s);
    } else if (step == 1) { // step 1: map
		if (p->n_parts > 0) merge_hits((step_t*)in);
		else kt_for(p->n_threads, worker_for, in, ((step_t*)in)->n_frag);
		return in;
    } else if (step == 2) { // step 2: output
		void *km = 0;
        step_t *s = (step_t*)in;
		const mm_idx_t *mi = p->mi;
		for (i = 0; i < p->n_threads; ++i) mm_tbuf_destroy(s->buf[i]);
		free(s->buf);
		if ((p->opt->flag & MM_F_OUT_CS) && !(mm_dbg_flag & MM_DBG_NO_KALLOC)) km = km_init();
		for (k = 0; k < s->n_frag; ++k) {
			int seg_st = s->seg_off[k], seg_en = s->seg_off[k] + s->n_seg[k];
			for (i = seg_st; i < seg_en; ++i) {
				mm_bseq1_t *t = &s->seq[i];
				if (p->opt->split_prefix && p->n_parts == 0) { // then write to temporary files
					mm_err_fwrite(&s->n_reg[i],    sizeof(int), 1, p->fp_split);
					mm_err_fwrite(&s->rep_len[i],  sizeof(int), 1, p->fp_split);
					mm_err_fwrite(&s->frag_gap[i], sizeof(int), 1, p->fp_split);
					for (j = 0; j < s->n_reg[i]; ++j) {
						mm_reg1_t *r = &s->reg[i][j];
						mm_err_fwrite(r, sizeof(mm_reg1_t), 1, p->fp_split);
						if (p->opt->flag & MM_F_CIGAR) {
							mm_err_fwrite(&r->p->capacity, 4, 1, p->fp_split);
							mm_err_fwrite(r->p, r->p->capacity, 4, p->fp_split);
						}
					}
				} else if (p->opt->flag & MM_F_OUT_JUNC) { // extra logic for --write-junc
					for (j = 0; j < s->n_reg[i]; ++j) {
						const mm_reg1_t *r = &s->reg[i][j];
						if (r->id != r->parent || r->mapq < 10) continue;
						mm_write_junc(&p->str, mi, t, r);
						if (p->str.l > 0) mm_err_puts(p->str.s);
					}
				} else if (s->n_reg[i] > 0) { // the query has at least one hit
					for (j = 0; j < s->n_reg[i]; ++j) {
						const mm_reg1_t *r = &s->reg[i][j];
						assert(!r->sam_pri || r->id == r->parent);
						if ((p->opt->flag & MM_F_NO_PRINT_2ND) && r->id != r->parent)
							continue;
						if (p->opt->flag & MM_F_OUT_SAM)
							mm_write_sam3(&p->str, mi, t, i - seg_st, j, s->n_seg[k], &s->n_reg[seg_st], (const mm_reg1_t*const*)&s->reg[seg_st], km, p->opt->flag, s->rep_len[i]);
						else
							mm_write_paf4(&p->str, mi, t, r, km, p->opt->flag, s->rep_len[i], s->n_seg[k], i - seg_st);
						mm_err_puts(p->str.s);
					}
				} else if ((p->opt->flag & MM_F_PAF_NO_HIT) || ((p->opt->flag & MM_F_OUT_SAM) && !(p->opt->flag & MM_F_SAM_HIT_ONLY))) { // output an empty hit, if requested
					if (p->opt->flag & MM_F_OUT_SAM)
						mm_write_sam3(&p->str, mi, t, i - seg_st, -1, s->n_seg[k], &s->n_reg[seg_st], (const mm_reg1_t*const*)&s->reg[seg_st], km, p->opt->flag, s->rep_len[i]);
					else
						mm_write_paf4(&p->str, mi, t, 0, 0, p->opt->flag, s->rep_len[i], s->n_seg[k], i - seg_st);
					mm_err_puts(p->str.s);
				}
			}
			for (i = seg_st; i < seg_en; ++i) {
				for (j = 0; j < s->n_reg[i]; ++j) free(s->reg[i][j].p);
				free(s->reg[i]);
				free(s->seq[i].seq); free(s->seq[i].name);
				if (s->seq[i].qual) free(s->seq[i].qual);
				if (s->seq[i].comment) free(s->seq[i].comment);
			}
		}
		free(s->reg); free(s->n_reg); free(s->seq); // seg_off, n_seg, rep_len and frag_gap were allocated with reg; no memory leak here
		km_destroy(km);
		if (mm_verbose >= 3)
			fprintf(stderr, "[M::%s::%.3f*%.2f] mapped %d sequences\n", __func__, realtime() - mm_realtime0, cputime() / (realtime() - mm_realtime0), s->n_seq);
		free(s);
	}
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %r13
movq %rdi, %rbx
cmpl $0x2, %esi
movq %rdx, (%rsp)
je 0xced0
cmpl $0x1, %esi
je 0xce7c
testl %esi, %esi
jne 0xd68d
movq 0x18(%rbx), %rax
movq (%rax), %r14
movl %r14d, %eax
andl $0x18, %eax
xorl %ebp, %ebp
cmpl $0x8, %eax
sete %bpl
movl %r14d, %r15d
shrl $0x19, %r15d
andl $0x1, %r15d
movl 0x8(%rbx), %r12d
cmpl $0x2, %r12d
setge %al
shrl $0xd, %r14d
andl $0x1, %r14d
orb %al, %r14b
movl $0x1, %edi
movl $0x50, %esi
callq 0x2230
movq %rax, %r13
cmpl $0x2, %r12d
movq %r14, 0x20(%rsp)
jl 0xd463
movq 0x10(%rbx), %rdx
movq 0x20(%rbx), %rsi
movq %r13, %r9
addq $0x8, %r9
movl %r12d, %edi
movl %ebp, %ecx
movl %r15d, %r8d
callq 0x135b9
jmp 0xd483
cmpl $0x0, 0x48(%rbx)
jle 0xd65a
movq (%r13), %rax
movq 0x18(%rax), %rcx
movq %rcx, 0x18(%rsp)
movq 0x60(%rax), %r14
callq 0x125bf
movq %rax, 0x60(%rsp)
movslq 0xc(%r13), %rbx
testq %rbx, %rbx
movq %r14, 0x10(%rsp)
jle 0xd695
movq 0x28(%r13), %rax
xorl %ecx, %ecx
xorl %ebp, %ebp
movl (%rax,%rcx,4), %edx
cmpl %edx, %ebp
cmovlel %edx, %ebp
incq %rcx
cmpq %rcx, %rbx
jne 0xcebb
jmp 0xd697
movq 0x28(%rbx), %rax
movq %rax, 0x18(%rsp)
cmpl $0x0, 0x4(%rbx)
movq %rbx, %r14
jle 0xcefd
xorl %ebx, %ebx
movq 0x48(%r13), %rax
movq (%rax,%rbx,8), %rdi
callq 0xae08
incq %rbx
movslq 0x4(%r14), %rax
cmpq %rax, %rbx
jl 0xcee4
movq 0x48(%r13), %rdi
callq 0x2040
movq 0x18(%r14), %rax
testb $0x40, (%rax)
movq %r14, %rbx
je 0xcf2a
leaq 0x28a0f(%rip), %rax     # 0x35928
testb $0x1, (%rax)
jne 0xcf2a
callq 0x125bf
movq %rax, 0x20(%rsp)
jmp 0xcf33
movq $0x0, 0x20(%rsp)
cmpl $0x0, 0xc(%r13)
jle 0xd421
leaq 0x30(%rbx), %rax
movq %rax, 0x28(%rsp)
xorl %ebp, %ebp
movq %rbx, 0x10(%rsp)
movq 0x20(%r13), %rax
movq 0x28(%r13), %rcx
movslq (%rax,%rbp,4), %r12
movq %rbp, 0x8(%rsp)
movslq (%rcx,%rbp,4), %rcx
leaq (%rcx,%r12), %rax
movq %rax, 0x40(%rsp)
movq %r12, %r13
movq %rcx, 0x50(%rsp)
testq %rcx, %rcx
jle 0xd34f
leaq (,%r13,4), %rbp
addq %r13, %rbp
shlq $0x3, %rbp
movq 0x18(%rbx), %rax
movq (%rsp), %rcx
addq 0x10(%rcx), %rbp
cmpq $0x0, 0x100(%rax)
je 0xcfac
cmpl $0x0, 0x48(%rbx)
je 0xd180
movq (%rax), %rax
btq $0x28, %rax
jb 0xd0fe
movq (%rsp), %rsi
movq 0x18(%rsi), %rcx
cmpl $0x0, (%rcx,%r13,4)
jle 0xd26a
movq 0x18(%rsi), %rdx
cmpl $0x0, (%rdx,%r13,4)
jle 0xd33c
movl %r13d, %eax
subl %r12d, %eax
movl %eax, 0x30(%rsp)
movl %r13d, %eax
subl %r12d, %eax
movq %rax, 0x48(%rsp)
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x40(%rsi), %rsi
movq (%rsi,%r13,8), %rcx
testb $0x10, 0x3d(%rcx,%r14)
je 0xd016
movl (%rcx,%r14), %eax
cmpl 0x20(%rcx,%r14), %eax
jne 0xdb8c
movq 0x10(%rsp), %rbx
movq 0x18(%rbx), %rax
movq (%rax), %rax
btl $0xe, %eax
jae 0xd037
movl (%rcx,%r14), %edi
cmpl 0x20(%rcx,%r14), %edi
jne 0xd0dd
testb $0x8, %al
jne 0xd083
addq %r14, %rcx
movq (%rsp), %rsi
movq 0x28(%rsi), %rdx
movq 0x30(%rsi), %rsi
movl (%rsi,%r13,4), %r10d
movq 0x8(%rsp), %rsi
movl (%rdx,%rsi,4), %r11d
subq $0x8, %rsp
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq %rbp, %rdx
movq 0x28(%rsp), %r8
movq %rax, %r9
pushq 0x50(%rsp)
pushq %r11
pushq %r10
callq 0xf9c6
addq $0x20, %rsp
jmp 0xd0d4
movq (%rsp), %rdi
movq 0x28(%rdi), %rcx
movq 0x30(%rdi), %rdi
movq 0x8(%rsp), %r8
movl (%rcx,%r8,4), %r9d
leaq (%rdx,%r12,4), %r10
leaq (%rsi,%r12,8), %r11
movl (%rdi,%r13,4), %ebx
subq $0x8, %rsp
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq %rbp, %rdx
movl 0x38(%rsp), %ecx
movl %r15d, %r8d
pushq %rbx
movq 0x20(%rsp), %rbx
pushq %rax
pushq 0x38(%rsp)
pushq %r11
pushq %r10
callq 0xfebd
addq $0x30, %rsp
movq 0x40(%rbx), %rdi
callq 0x589c
incq %r15
movq (%rsp), %rsi
movq 0x18(%rsi), %rdx
movslq (%rdx,%r13,4), %rax
addq $0x50, %r14
cmpq %rax, %r15
jl 0xcff7
jmp 0xd33c
movq (%rsp), %rcx
movq 0x18(%rcx), %rax
cmpl $0x0, (%rax,%r13,4)
jle 0xd33c
xorl %ebx, %ebx
xorl %r14d, %r14d
movq 0x40(%rcx), %rax
movq (%rax,%r13,8), %rcx
movl (%rcx,%rbx), %eax
cmpl 0x20(%rcx,%rbx), %eax
jne 0xd163
movl 0x3c(%rcx,%rbx), %eax
movl $0xfe, %edx
andl %edx, %eax
cmpl $0xa, %eax
jb 0xd163
addq %rbx, %rcx
movq 0x28(%rsp), %r15
movq %r15, %rdi
movq 0x18(%rsp), %rsi
movq %rbp, %rdx
callq 0xeb80
cmpq $0x0, (%r15)
je 0xd163
movq 0x10(%rsp), %rax
movq 0x40(%rax), %rdi
callq 0x589c
incq %r14
movq (%rsp), %rcx
movq 0x18(%rcx), %rax
movslq (%rax,%r13,4), %rax
addq $0x50, %rbx
cmpq %rax, %r14
jl 0xd116
jmp 0xd33c
leaq (,%r13,4), %r15
movq (%rsp), %rbp
movq 0x18(%rbp), %rdi
addq %r15, %rdi
movq 0x58(%rbx), %rcx
movl $0x4, %esi
movl $0x1, %edx
callq 0x58ae
movq 0x30(%rbp), %rdi
addq %r15, %rdi
movq 0x58(%rbx), %rcx
movl $0x4, %esi
movl $0x1, %edx
callq 0x58ae
addq 0x38(%rbp), %r15
movq 0x58(%rbx), %rcx
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rdi
callq 0x58ae
movq 0x18(%rbp), %rax
cmpl $0x0, (%rax,%r13,4)
jle 0xd33c
xorl %ebx, %ebx
xorl %r14d, %r14d
movq 0x40(%rbp), %rax
movq (%rax,%r13,8), %r15
leaq (%r15,%rbx), %rdi
movq 0x10(%rsp), %rbp
movq 0x58(%rbp), %rcx
movl $0x50, %esi
movl $0x1, %edx
callq 0x58ae
movq 0x18(%rbp), %rax
testb $0x4, (%rax)
je 0xd24d
movq 0x48(%r15,%rbx), %rdi
movq 0x10(%rsp), %rbp
movq 0x58(%rbp), %rcx
movl $0x4, %esi
movl $0x1, %edx
callq 0x58ae
movq 0x48(%r15,%rbx), %rdi
movl (%rdi), %esi
movq 0x58(%rbp), %rcx
movl $0x4, %edx
callq 0x58ae
incq %r14
movq (%rsp), %rbp
movq 0x18(%rbp), %rax
movslq (%rax,%r13,4), %rax
addq $0x50, %rbx
cmpq %rax, %r14
jl 0xd1ee
jmp 0xd33c
btl $0x1b, %eax
setae %dl
movl %eax, %esi
andl $0x40000008, %esi       # imm = 0x40000008
cmpl $0x8, %esi
setne %sil
testb %sil, %dl
jne 0xd33c
testb $0x8, %al
jne 0xd2d5
movq (%rsp), %rdx
movq 0x28(%rdx), %rcx
movq 0x30(%rdx), %rdx
movl (%rdx,%r13,4), %r10d
movq 0x8(%rsp), %rdx
movl (%rcx,%rdx,4), %r11d
movl %r13d, %ebx
subl %r12d, %ebx
subq $0x8, %rsp
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %rax, %r9
pushq %rbx
pushq %r11
pushq %r10
callq 0xf9c6
addq $0x20, %rsp
jmp 0xd32e
movq (%rsp), %rdi
movq 0x28(%rdi), %rdx
movq 0x30(%rdi), %rsi
movq 0x8(%rsp), %r8
movl (%rdx,%r8,4), %r9d
leaq (,%r12,8), %r10
addq 0x40(%rdi), %r10
leaq (%rcx,%r12,4), %r11
movl (%rsi,%r13,4), %ebx
movl %r13d, %ecx
subl %r12d, %ecx
subq $0x8, %rsp
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq %rbp, %rdx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
pushq %rbx
pushq %rax
pushq 0x38(%rsp)
pushq %r10
pushq %r11
callq 0xfebd
addq $0x30, %rsp
movq 0x10(%rsp), %rax
movq 0x40(%rax), %rdi
callq 0x589c
incq %r13
cmpq 0x40(%rsp), %r13
movq 0x10(%rsp), %rbx
jl 0xcf7d
cmpl $0x0, 0x50(%rsp)
movq (%rsp), %r13
movq 0x8(%rsp), %rbp
jle 0xd40c
movslq 0x40(%rsp), %rbx
movq 0x18(%r13), %rax
cmpl $0x0, (%rax,%r12,4)
jle 0xd3a1
movl $0x48, %r14d
xorl %r15d, %r15d
movq 0x40(%r13), %rax
movq (%rax,%r12,8), %rax
movq (%rax,%r14), %rdi
callq 0x2040
incq %r15
movq 0x18(%r13), %rax
movslq (%rax,%r12,4), %rax
addq $0x50, %r14
cmpq %rax, %r15
jl 0xd37c
movq 0x40(%r13), %rax
movq (%rax,%r12,8), %rdi
callq 0x2040
movq 0x10(%r13), %rax
leaq (,%r12,8), %rcx
leaq (%rcx,%rcx,4), %r14
movq 0x10(%rax,%r14), %rdi
callq 0x2040
movq 0x10(%r13), %rax
movq 0x8(%rax,%r14), %rdi
callq 0x2040
movq 0x10(%r13), %rax
movq 0x18(%rax,%r14), %rdi
testq %rdi, %rdi
je 0xd3e9
callq 0x2040
movq 0x10(%r13), %rax
leaq (%r12,%r12,4), %rcx
movq 0x20(%rax,%rcx,8), %rdi
testq %rdi, %rdi
je 0xd400
callq 0x2040
incq %r12
cmpq %rbx, %r12
jl 0xd368
incq %rbp
movslq 0xc(%r13), %rax
cmpq %rax, %rbp
movq 0x10(%rsp), %rbx
jl 0xcf4e
movq 0x40(%r13), %rdi
callq 0x2040
movq 0x18(%r13), %rdi
callq 0x2040
movq 0x10(%r13), %rdi
callq 0x2040
movq 0x20(%rsp), %rdi
callq 0x125e0
leaq 0x282b3(%rip), %rax     # 0x35700
cmpl $0x3, (%rax)
jge 0xdb7f
movq %r13, %rdi
callq 0x2040
jmp 0xd68d
movzbl %r14b, %r8d
movq 0x10(%rbx), %rsi
movq 0x20(%rbx), %rax
movq (%rax), %rdi
movq %r13, %r9
addq $0x8, %r9
movl %ebp, %edx
movl %r15d, %ecx
callq 0x13116
movq %rax, 0x10(%r13)
testq %rax, %rax
movq %r13, (%rsp)
movq %rax, 0x30(%rsp)
je 0xd675
movq %rbx, (%r13)
movslq 0x8(%r13), %rcx
testq %rcx, %rcx
jle 0xd4c3
movl (%rbx), %esi
shlq $0x3, %rcx
leaq (%rcx,%rcx,4), %rcx
xorl %edx, %edx
movl %esi, 0x4(%rax,%rdx)
incl %esi
addq $0x28, %rdx
cmpq %rdx, %rcx
jne 0xd4b2
movl %esi, (%rbx)
movslq 0x4(%rbx), %r12
movl $0x8, %esi
movq %r12, %rdi
callq 0x2230
movq %rax, 0x48(%r13)
testq %r12, %r12
jle 0xd4fb
movq %rbx, %r14
xorl %ebx, %ebx
callq 0xaddc
movq 0x48(%r13), %rcx
movq %rax, (%rcx,%rbx,8)
incq %rbx
movslq 0x4(%r14), %rax
cmpq %rax, %rbx
jl 0xd4e2
movslq 0x8(%r13), %r14
leaq (%r14,%r14,4), %rdi
movl $0x4, %esi
callq 0x2230
movq %rax, 0x18(%r13)
leaq (%rax,%r14,4), %rax
movq %rax, 0x20(%r13)
movq %rax, 0x28(%rsp)
leaq (%rax,%r14,4), %rax
movq %rax, 0x28(%r13)
movq %rax, 0x8(%rsp)
leaq (%rax,%r14,4), %rax
movq %rax, 0x30(%r13)
leaq (%rax,%r14,4), %rax
movq %rax, 0x38(%r13)
movq %r13, %rbx
movl $0x8, %r13d
movl $0x8, %esi
movq %r14, %rdi
callq 0x2230
movq %rax, 0x40(%rbx)
movslq 0x8(%rbx), %rax
movq %rax, 0x10(%rsp)
testq %rax, %rax
movq 0x20(%rsp), %rsi
jle 0xd67d
movq 0x10(%rsp), %rax
incl %eax
movq %rax, 0x18(%rsp)
xorl %ebp, %ebp
movl $0x1, %r15d
cmpq %r15, 0x10(%rsp)
setne %al
andb %sil, %al
cmpb $0x1, %al
jne 0xd620
movq (%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r13), %r14
movq 0x28(%rax,%r13), %r12
movq %r14, %rdi
callq 0x2130
cmpl $0x3, %eax
jl 0xd5d0
movl %eax, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
addl %edx, %ecx
movb (%r14,%rcx), %cl
addb $-0x30, %cl
cmpb $0x9, %cl
ja 0xd5d0
leal -0x2(%rax), %ebx
cmpb $0x2f, (%r14,%rbx)
je 0xd5d2
movl %eax, %ebx
movq %r12, %rdi
callq 0x2130
cmpl $0x3, %eax
jl 0xd5fe
movl %eax, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
addl %edx, %ecx
movb (%r12,%rcx), %cl
addb $-0x30, %cl
cmpb $0x9, %cl
ja 0xd5fe
leal -0x2(%rax), %ecx
cmpb $0x2f, (%r12,%rcx)
je 0xd600
movl %eax, %ecx
cmpl %ecx, %ebx
movq 0x20(%rsp), %rsi
jne 0xd620
movslq %ebx, %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x2080
movq 0x20(%rsp), %rsi
testl %eax, %eax
je 0xd646
movl %r15d, %eax
subl %ebp, %eax
movq (%rsp), %rdx
movslq 0xc(%rdx), %rcx
movq 0x8(%rsp), %rdi
movl %eax, (%rdi,%rcx,4)
leal 0x1(%rcx), %eax
movl %eax, 0xc(%rdx)
movq 0x28(%rsp), %rax
movl %ebp, (%rax,%rcx,4)
movl %r15d, %ebp
incq %r15
addq $0x28, %r13
cmpq %r15, 0x18(%rsp)
jne 0xd580
jmp 0xd67d
movl 0x4(%rbx), %edi
movslq 0xc(%r13), %rcx
leaq 0x780(%rip), %rsi       # 0xdde8
movq %r13, %rdx
callq 0x12138
jmp 0xdb6d
movq %r13, %rdi
callq 0x2040
cmpq $0x0, 0x30(%rsp)
movq (%rsp), %r13
jne 0xdb6d
xorl %r13d, %r13d
jmp 0xdb6d
xorl %ebp, %ebp
movq (%r13), %rax
movslq 0x48(%rax), %r15
leaq (%r15,%r15,2), %rax
movslq %ebp, %rdi
addq %rax, %rdi
movl $0x4, %esi
callq 0x2230
movq %rax, 0x38(%rsp)
testl %ebx, %ebx
movq 0x60(%rsp), %rbx
jle 0xdb5b
movl %ebp, %eax
movq 0x38(%rsp), %rcx
leaq (%rcx,%rax,4), %r12
leaq (%r12,%r15,4), %rax
movq %rax, 0x20(%rsp)
leaq (%rax,%r15,4), %r15
xorl %ecx, %ecx
xorl %r14d, %r14d
movq %r12, 0x28(%rsp)
movq %r15, 0x48(%rsp)
movl %r14d, %edx
movq 0x28(%r13), %rax
cmpl $0x0, (%rax,%rcx,4)
movl %r14d, 0x58(%rsp)
jle 0xdade
movslq %edx, %rbp
xorl %edx, %edx
movq %rcx, 0x68(%rsp)
movq 0x10(%r13), %rax
leaq (,%rbp,4), %rcx
addq %rbp, %rcx
movq %rcx, 0x70(%rsp)
movl (%rax,%rcx,8), %eax
movq 0x38(%rsp), %rcx
movq %rdx, 0x40(%rsp)
movl %eax, (%rcx,%rdx,4)
movq 0x18(%r13), %rax
movq %rbp, 0x8(%rsp)
movl $0x0, (%rax,%rbp,4)
movq (%r13), %rax
cmpl $0x0, 0x48(%rax)
jle 0xd7e0
xorl %ebx, %ebx
xorl %r15d, %r15d
xorl %ebp, %ebp
leaq (%r12,%rbx), %rdi
movq 0x10(%rsp), %r14
movq (%r14,%rbx,2), %rcx
movl $0x4, %esi
movl $0x1, %edx
callq 0x58c0
movq 0x20(%rsp), %rax
leaq (%rax,%rbx), %rdi
movq (%r14,%rbx,2), %rcx
movl $0x4, %esi
movl $0x1, %edx
callq 0x58c0
movq 0x48(%rsp), %rax
leaq (%rax,%rbx), %rdi
movq (%r14,%rbx,2), %rcx
movl $0x4, %esi
movl $0x1, %edx
callq 0x58c0
movl (%r12,%rbx), %eax
movq 0x18(%r13), %rcx
movq 0x8(%rsp), %rdx
addl %eax, (%rcx,%rdx,4)
movq 0x20(%rsp), %rax
movl (%rax,%rbx), %eax
cmpl %eax, %ebp
cmovlel %eax, %ebp
incq %r15
movq (%r13), %rax
movslq 0x48(%rax), %rax
addq $0x4, %rbx
cmpq %rax, %r15
jl 0xd755
jmp 0xd7e2
xorl %ebp, %ebp
movl %ebp, 0x50(%rsp)
movq 0x18(%r13), %rax
movq 0x8(%rsp), %rbx
movslq (%rax,%rbx,4), %rdi
movl $0x50, %esi
callq 0x2230
movq 0x40(%r13), %rcx
movq %rax, (%rcx,%rbx,8)
movq (%r13), %rax
cmpl $0x0, 0x48(%rax)
jle 0xd8fc
xorl %ebx, %ebx
xorl %ecx, %ecx
cmpl $0x0, (%r12,%rbx,4)
jle 0xd8e8
movl %ecx, 0x30(%rsp)
movslq %ecx, %rax
shlq $0x4, %rax
leaq (%rax,%rax,4), %rbp
xorl %r15d, %r15d
movq 0x8(%rsp), %r14
movq 0x40(%r13), %rax
movq (%rax,%r14,8), %r12
leaq (%r12,%rbp), %rdi
movq 0x10(%rsp), %rax
movq (%rax,%rbx,8), %rcx
movl $0x50, %esi
movl $0x1, %edx
callq 0x58c0
movq (%r13), %rax
movq 0x50(%rax), %rax
movl (%rax,%rbx,4), %eax
addl %eax, 0x8(%r12,%rbp)
movq 0x18(%rsp), %rax
testb $0x4, (%rax)
je 0xd8cb
movq 0x10(%rsp), %r14
movq (%r14,%rbx,8), %rcx
movl $0x4, %esi
movl $0x1, %edx
leaq 0x5c(%rsp), %rdi
callq 0x58c0
movl 0x5c(%rsp), %r13d
movl $0x4, %esi
movq %r13, %rdi
callq 0x2230
movq %rax, 0x48(%r12,%rbp)
movl %r13d, (%rax)
movq (%r14,%rbx,8), %rcx
movq 0x8(%rsp), %r14
movl $0x4, %edx
movq %rax, %rdi
movq %r13, %rsi
movq (%rsp), %r13
callq 0x58c0
incl %r15d
addq $0x50, %rbp
movq 0x28(%rsp), %r12
cmpl (%r12,%rbx,4), %r15d
jl 0xd839
movl 0x30(%rsp), %ecx
addl %r15d, %ecx
incq %rbx
movq (%r13), %rax
movslq 0x48(%rax), %rax
cmpq %rax, %rbx
jl 0xd817
movq 0x18(%rsp), %r8
testb $0x10, 0x1(%r8)
jne 0xd947
movq 0x10(%r13), %rax
movq 0x70(%rsp), %rcx
movl (%rax,%rcx,8), %edi
cmpl 0xb0(%r8), %edi
jl 0xd947
movq 0x18(%r13), %rax
movq 0x40(%r13), %rcx
movq 0x8(%rsp), %rdx
movl (%rax,%rdx,4), %esi
movq (%rcx,%rdx,8), %rdx
movss 0xb4(%r8), %xmm0
movl 0x64(%r8), %ecx
movl 0x68(%r8), %r8d
callq 0x17227
movq 0x18(%r13), %rax
movq 0x8(%rsp), %rcx
leaq (%rax,%rcx,4), %rsi
cmpl $0x0, (%rsi)
movq 0x60(%rsp), %rbx
movl $0x0, %edi
jle 0xd99a
movq 0x40(%r13), %rax
movq 0x8(%rsp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x48, %rax
xorl %ecx, %ecx
movq (%rax), %rdx
testq %rdx, %rdx
je 0xd985
movl $0x0, 0xc(%rdx)
movl %edi, -0x24(%rax)
movl %edi, -0x14(%rax)
incq %rcx
movslq (%rsi), %rdx
addq $0x50, %rax
cmpq %rdx, %rcx
jl 0xd976
movq 0x40(%r13), %rax
movq 0x8(%rsp), %rbp
movq (%rax,%rbp,8), %rdx
movq 0x18(%rsp), %r15
movss 0x60(%r15), %xmm0
movq %rbx, %rdi
callq 0x1c47b
movss 0x50(%r15), %xmm0
movl 0x54(%r15), %esi
movq 0x18(%r13), %rax
movq 0x40(%r13), %rcx
movl (%rax,%rbp,4), %edx
movl 0x64(%r15), %r8d
addl %r8d, %r8d
addl 0x68(%r15), %r8d
movq (%rcx,%rbp,8), %rcx
movl (%r15), %r9d
movl $0x20000000, %eax       # imm = 0x20000000
andl %eax, %r9d
movss 0x60(%r15), %xmm1
movq %rbx, %rdi
callq 0x1c006
testb $-0x80, 0x2(%r15)
jne 0xda65
movss 0x58(%r15), %xmm0
movq (%r13), %rax
movq 0x40(%r13), %r10
movq 0x28(%rax), %rax
movl 0x8(%rax), %esi
xorps %xmm1, %xmm1
cvtsi2sdl 0x1c(%r15), %xmm1
addl %esi, %esi
mulsd 0x1ed3a(%rip), %xmm1    # 0x2c760
cvttsd2si %xmm1, %r8d
movl 0x5c(%r15), %edx
leaq (,%rbp,4), %r9
addq 0x18(%r13), %r9
subq $0x8, %rsp
movq %rbx, %rdi
xorl %ecx, %ecx
pushq (%r10,%rbp,8)
callq 0x1c812
addq $0x10, %rsp
movq 0x18(%r13), %rax
movq 0x40(%r13), %rcx
movl (%rax,%rbp,4), %edi
movq (%rcx,%rbp,8), %rsi
callq 0x1c6c1
movq 0x18(%r13), %rax
movq 0x40(%r13), %rcx
movl (%rax,%rbp,4), %esi
movq (%rcx,%rbp,8), %rdx
movl 0x34(%r15), %ecx
movl 0x64(%r15), %r8d
movq (%r15), %rax
xorl %r10d, %r10d
movabsq $0x8000001000, %rdi     # imm = 0x8000001000
testq %rdi, %rax
setne %r10b
shrl $0x7, %eax
andl $0x1, %eax
movq %rbx, %rdi
movl 0x50(%rsp), %r9d
pushq %rax
pushq %r10
callq 0x1d098
addq $0x10, %rsp
movq 0x40(%rsp), %rdx
incq %rdx
incq %rbp
movq 0x28(%r13), %rax
movq 0x68(%rsp), %rcx
movslq (%rax,%rcx,4), %rax
cmpq %rax, %rdx
jl 0xd70c
movq %rbp, %r14
cmpl $0x2, %eax
sete %al
movq 0x48(%rsp), %r15
jmp 0xdae3
xorl %eax, %eax
movl %edx, %r14d
testb %al, %al
je 0xdb4b
movq 0x18(%rsp), %rax
cmpl $0x0, 0xb8(%rax)
js 0xdb4b
movq 0x18(%rsp), %rax
testb $0x4, (%rax)
je 0xdb4b
movl (%r15), %esi
movq 0x18(%rsp), %rdx
movl 0x64(%rdx), %r8d
movq %rcx, %rbp
leal (%r8,%r8), %ecx
addl 0x68(%rdx), %ecx
movslq 0x58(%rsp), %rax
leaq (,%rax,4), %r10
addq 0x18(%r13), %r10
movl 0xbc(%rdx), %edx
shlq $0x3, %rax
addq 0x40(%r13), %rax
movq %rbx, %rdi
movq 0x38(%rsp), %r9
pushq %rax
pushq %r10
callq 0x113db
movq %rbp, %rcx
addq $0x10, %rsp
incq %rcx
movslq 0xc(%r13), %rax
cmpq %rax, %rcx
jl 0xd6ec
movq 0x38(%rsp), %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x125e0
movq %r13, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
callq 0x2fc9
jmp 0xd456
leaq 0x1ed64(%rip), %rdi     # 0x2c8f7
leaq 0x1ec51(%rip), %rsi     # 0x2c7eb
leaq 0x1ea2b(%rip), %rcx     # 0x2c5cc
movl $0x263, %edx            # imm = 0x263
callq 0x21a0