// File: /workspace/github_c_makefile_star2_O0/lh3[P]minimap2/pe.c
// Function: mm_pair
void mm_pair(void *km, int max_gap_ref, int pe_bonus, int sub_diff, int match_sc, const int *qlens, int *n_regs, mm_reg1_t **regs)
{
	int i, j, s, n, last[2], dp_thres, segs = 0, max_idx[2];
	int64_t max;
	pair_arr_t *a;
	kvec_t(uint64_t) sc = {0,0,0};

	a = (pair_arr_t*)kmalloc(km, (n_regs[0] + n_regs[1]) * sizeof(pair_arr_t));
	for (s = n = 0, dp_thres = 0; s < 2; ++s) {
		int max = 0;
		for (i = 0; i < n_regs[s]; ++i) {
			a[n].s = s;
			a[n].r = &regs[s][i];
			a[n].rev = a[n].r->rev;
			a[n].key = (uint64_t)a[n].r->rid << 32 | a[n].r->rs<<1 | (s^a[n].rev);
			max = max > a[n].r->p->dp_max? max : a[n].r->p->dp_max;
			++n;
			segs |= 1<<s;
		}
		dp_thres += max;
	}
	if (segs != 3) {
		kfree(km, a); // only one end is mapped
		return;
	}
	dp_thres -= pe_bonus;
	if (dp_thres < 0) dp_thres = 0;
	radix_sort_pair(a, a + n);

	max = -1;
	max_idx[0] = max_idx[1] = -1;
	last[0] = last[1] = -1;
	kv_resize(uint64_t, km, sc, (size_t)n);
	for (i = 0; i < n; ++i) {
		if (a[i].key & 1) { // reverse first read or forward second read
			mm_reg1_t *q, *r;
			if (last[a[i].rev] < 0) continue;
			r = a[i].r;
			q = a[last[a[i].rev]].r;
			if (r->rid != q->rid || r->rs - q->re > max_gap_ref) continue;
			for (j = last[a[i].rev]; j >= 0; --j) {
				int64_t score;
				if (a[j].rev != a[i].rev || a[j].s == a[i].s) continue;
				q = a[j].r;
				if (r->rid != q->rid || r->rs - q->re > max_gap_ref) break;
				if (r->p->dp_max + q->p->dp_max < dp_thres) continue;
				score = (int64_t)(r->p->dp_max + q->p->dp_max) << 32 | (r->hash + q->hash);
				if (score > max)
					max = score, max_idx[a[j].s] = j, max_idx[a[i].s] = i;
				kv_push(uint64_t, km, sc, score);
			}
		} else { // forward first read or reverse second read
			last[a[i].rev] = i;
		}
	}
	if (sc.n > 1)
		radix_sort_64(sc.a, sc.a + sc.n);

	if (sc.n > 0 && max > 0) { // found at least one pair
		int n_sub = 0, mapq_pe;
		mm_reg1_t *r[2];
		r[0] = a[max_idx[0]].r, r[1] = a[max_idx[1]].r;
		r[0]->proper_frag = r[1]->proper_frag = 1;
		for (s = 0; s < 2; ++s) {
			if (r[s]->id != r[s]->parent) { // then lift to primary and update parent
				mm_reg1_t *p = &regs[s][r[s]->parent];
				for (i = 0; i < n_regs[s]; ++i)
					if (regs[s][i].parent == p->id)
						regs[s][i].parent = r[s]->id;
				p->mapq = 0;
			}
			if (!r[s]->sam_pri) { // then sync sam_pri
				for (i = 0; i < n_regs[s]; ++i)
					regs[s][i].sam_pri = 0;
				r[s]->sam_pri = 1;
			}
		}
		mapq_pe = r[0]->mapq > r[1]->mapq? r[0]->mapq : r[1]->mapq;
		for (i = 0; i < (int)sc.n; ++i)
			if ((sc.a[i]>>32) + sub_diff >= (uint64_t)max>>32)
				++n_sub;
		if (sc.n > 1) {
			int mapq_pe_alt;
			mapq_pe_alt = (int)(6.02f * ((max>>32) - (sc.a[sc.n - 2]>>32)) / match_sc - 4.343f * logf(n_sub)); // n_sub > 0 because it counts the optimal, too
			mapq_pe = mapq_pe < mapq_pe_alt? mapq_pe : mapq_pe_alt;
		}
		if (r[0]->mapq < mapq_pe) r[0]->mapq = (int)(.2f * r[0]->mapq + .8f * mapq_pe + .499f);
		if (r[1]->mapq < mapq_pe) r[1]->mapq = (int)(.2f * r[1]->mapq + .8f * mapq_pe + .499f);
		if (sc.n == 1) {
			if (r[0]->mapq < 2) r[0]->mapq = 2;
			if (r[1]->mapq < 2) r[1]->mapq = 2;
		} else if ((uint64_t)max>>32 > sc.a[sc.n - 2]>>32) {
			if (r[0]->mapq < 1) r[0]->mapq = 1;
			if (r[1]->mapq < 1) r[1]->mapq = 1;
		}
	}

	kfree(km, a);
	kfree(km, sc.a);

	mm_set_pe_thru(qlens, n_regs, regs);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
movq %r9, -0x20(%rbp)
movl $0x0, -0x40(%rbp)
leaq -0x70(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x21b0
movq -0x8(%rbp), %rdi
movq 0x10(%rbp), %rax
movl (%rax), %eax
movq 0x10(%rbp), %rcx
addl 0x4(%rcx), %eax
cltq
imulq $0x18, %rax, %rsi
callq 0x1aae0
movq %rax, -0x58(%rbp)
movl $0x0, -0x30(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x3c(%rbp)
cmpl $0x2, -0x2c(%rbp)
jge 0x18c62
movl $0x0, -0x74(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq 0x10(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x18c4b
movl -0x2c(%rbp), %ecx
movq -0x58(%rbp), %rax
movslq -0x30(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movq 0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movslq -0x24(%rbp), %rax
imulq $0x50, %rax, %rax
addq %rax, %rcx
movq -0x58(%rbp), %rax
movslq -0x30(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq -0x58(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl 0x3c(%rax), %ecx
shrl $0xa, %ecx
andl $0x1, %ecx
movq -0x58(%rbp), %rax
movslq -0x30(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movq -0x58(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movslq 0x8(%rax), %rcx
shlq $0x20, %rcx
movq -0x58(%rbp), %rax
movslq -0x30(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq 0x10(%rax), %rax
movl 0x18(%rax), %eax
shll %eax
cltq
orq %rax, %rcx
movl -0x2c(%rbp), %eax
movq -0x58(%rbp), %rdx
movslq -0x30(%rbp), %rsi
imulq $0x18, %rsi, %rsi
addq %rsi, %rdx
xorl 0x4(%rdx), %eax
cltq
orq %rax, %rcx
movq -0x58(%rbp), %rax
movslq -0x30(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movl -0x74(%rbp), %eax
movq -0x58(%rbp), %rcx
movslq -0x30(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movq 0x10(%rcx), %rcx
movq 0x48(%rcx), %rcx
cmpl 0x8(%rcx), %eax
jle 0x18bfb
movl -0x74(%rbp), %eax
movl %eax, -0xc0(%rbp)
jmp 0x18c1b
movq -0x58(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq 0x48(%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0xc0(%rbp)
movl -0xc0(%rbp), %eax
movl %eax, -0x74(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x2c(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
orl -0x40(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x18aec
movl -0x74(%rbp), %eax
addl -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x18ad4
cmpl $0x3, -0x40(%rbp)
je 0x18c7a
movq -0x8(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x1a8c0
jmp 0x195e2
movl -0x10(%rbp), %ecx
movl -0x3c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jge 0x18c92
movl $0x0, -0x3c(%rbp)
movq -0x58(%rbp), %rdi
movq -0x58(%rbp), %rsi
movslq -0x30(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rsi
callq 0x18a00
movq $-0x1, -0x50(%rbp)
movl $0xffffffff, -0x44(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x48(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x34(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x38(%rbp) # imm = 0xFFFFFFFF
movq -0x68(%rbp), %rax
movslq -0x30(%rbp), %rcx
cmpq %rcx, %rax
jae 0x18d67
movslq -0x30(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
shrq %rax
orq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
shrq $0x2, %rax
orq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
shrq $0x4, %rax
orq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
shrq $0x8, %rax
orq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
shrq $0x10, %rax
orq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x68(%rbp), %rdx
shlq $0x3, %rdx
callq 0x1ad30
movq %rax, -0x60(%rbp)
jmp 0x18d69
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x1903f
movq -0x58(%rbp), %rax
movslq -0x24(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x19015
movq -0x58(%rbp), %rax
movslq -0x24(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq 0x4(%rax), %rax
cmpl $0x0, -0x38(%rbp,%rax,4)
jge 0x18dbc
jmp 0x19031
movq -0x58(%rbp), %rax
movslq -0x24(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x58(%rbp), %rax
movq -0x58(%rbp), %rcx
movslq -0x24(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movslq 0x4(%rcx), %rcx
movslq -0x38(%rbp,%rcx,4), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x88(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x80(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x18e2a
movq -0x88(%rbp), %rax
movl 0x18(%rax), %eax
movq -0x80(%rbp), %rcx
subl 0x1c(%rcx), %eax
cmpl -0xc(%rbp), %eax
jle 0x18e2f
jmp 0x19031
movq -0x58(%rbp), %rax
movslq -0x24(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq 0x4(%rax), %rax
movl -0x38(%rbp,%rax,4), %eax
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
jl 0x19013
movq -0x58(%rbp), %rax
movslq -0x28(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq -0x58(%rbp), %rcx
movslq -0x24(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x4(%rcx), %eax
jne 0x18e9d
movq -0x58(%rbp), %rax
movslq -0x28(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x58(%rbp), %rcx
movslq -0x24(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jne 0x18ea2
jmp 0x19005
movq -0x58(%rbp), %rax
movslq -0x28(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x88(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x80(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x18ee2
movq -0x88(%rbp), %rax
movl 0x18(%rax), %eax
movq -0x80(%rbp), %rcx
subl 0x1c(%rcx), %eax
cmpl -0xc(%rbp), %eax
jle 0x18ee7
jmp 0x19013
movq -0x88(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x8(%rax), %eax
movq -0x80(%rbp), %rcx
movq 0x48(%rcx), %rcx
addl 0x8(%rcx), %eax
cmpl -0x3c(%rbp), %eax
jge 0x18f0a
jmp 0x19005
movq -0x88(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x8(%rax), %eax
movq -0x80(%rbp), %rcx
movq 0x48(%rcx), %rcx
addl 0x8(%rcx), %eax
cltq
shlq $0x20, %rax
movq -0x88(%rbp), %rcx
movl 0x40(%rcx), %ecx
movq -0x80(%rbp), %rdx
addl 0x40(%rdx), %ecx
movl %ecx, %ecx
orq %rcx, %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
cmpq -0x50(%rbp), %rax
jle 0x18f90
movq -0x90(%rbp), %rax
movq %rax, -0x50(%rbp)
movl -0x28(%rbp), %ecx
movq -0x58(%rbp), %rax
movslq -0x28(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movslq (%rax), %rax
movl %ecx, -0x48(%rbp,%rax,4)
movl -0x24(%rbp), %ecx
movq -0x58(%rbp), %rax
movslq -0x24(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movslq (%rax), %rax
movl %ecx, -0x48(%rbp,%rax,4)
jmp 0x18f92
movq -0x70(%rbp), %rax
cmpq -0x68(%rbp), %rax
jne 0x18fe5
cmpq $0x0, -0x68(%rbp)
je 0x18fb3
movq -0x68(%rbp), %rax
shlq %rax
movq %rax, -0xc8(%rbp)
jmp 0x18fc1
movl $0x2, %eax
movq %rax, -0xc8(%rbp)
jmp 0x18fc1
movq -0xc8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x68(%rbp), %rdx
shlq $0x3, %rdx
callq 0x1ad30
movq %rax, -0x60(%rbp)
movq -0x90(%rbp), %rdx
movq -0x60(%rbp), %rax
movq -0x70(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x70(%rbp)
movq %rdx, (%rax,%rcx,8)
jmp 0x19005
movl -0x28(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x18e49
jmp 0x1902f
movl -0x24(%rbp), %ecx
movq -0x58(%rbp), %rax
movslq -0x24(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movslq 0x4(%rax), %rax
movl %ecx, -0x38(%rbp,%rax,4)
jmp 0x19031
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x18d70
cmpq $0x1, -0x70(%rbp)
jbe 0x1905e
movq -0x60(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x70(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x5f90
cmpq $0x0, -0x70(%rbp)
jbe 0x195b7
cmpq $0x0, -0x50(%rbp)
jle 0x195b7
movl $0x0, -0x94(%rbp)
movq -0x58(%rbp), %rax
movslq -0x48(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, -0xb0(%rbp)
movq -0x58(%rbp), %rax
movslq -0x44(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movl 0x3c(%rax), %ecx
andl $0xffffdfff, %ecx       # imm = 0xFFFFDFFF
orl $0x2000, %ecx           # imm = 0x2000
movl %ecx, 0x3c(%rax)
movq -0xb0(%rbp), %rax
movl 0x3c(%rax), %ecx
andl $0xffffdfff, %ecx       # imm = 0xFFFFDFFF
orl $0x2000, %ecx           # imm = 0x2000
movl %ecx, 0x3c(%rax)
movl $0x0, -0x2c(%rbp)
cmpl $0x2, -0x2c(%rbp)
jge 0x19259
movslq -0x2c(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rax
movl (%rax), %eax
movslq -0x2c(%rbp), %rcx
movq -0xb0(%rbp,%rcx,8), %rcx
cmpl 0x20(%rcx), %eax
je 0x191c9
movq 0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
movq -0xb0(%rbp,%rcx,8), %rcx
movslq 0x20(%rcx), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xb8(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq 0x10(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x191b3
movq 0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x24(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movl 0x20(%rax), %eax
movq -0xb8(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x191a6
movslq -0x2c(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rax
movl (%rax), %ecx
movq 0x18(%rbp), %rax
movslq -0x2c(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movslq -0x24(%rbp), %rdx
imulq $0x50, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x20(%rax)
jmp 0x191a8
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x19149
movq -0xb8(%rbp), %rax
movl 0x3c(%rax), %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
orl $0x0, %ecx
movl %ecx, 0x3c(%rax)
movslq -0x2c(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rax
movl 0x3c(%rax), %eax
shrl $0xc, %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x19249
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq 0x10(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x1922b
movq 0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x24(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movl 0x3c(%rax), %ecx
andl $0xffffefff, %ecx       # imm = 0xFFFFEFFF
orl $0x0, %ecx
movl %ecx, 0x3c(%rax)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x191ea
movslq -0x2c(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rax
movl 0x3c(%rax), %ecx
andl $0xffffefff, %ecx       # imm = 0xFFFFEFFF
orl $0x1000, %ecx           # imm = 0x1000
movl %ecx, 0x3c(%rax)
jmp 0x1924b
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x190eb
movq -0xb0(%rbp), %rax
movl 0x3c(%rax), %eax
andl $0xff, %eax
movq -0xa8(%rbp), %rcx
movl 0x3c(%rcx), %ecx
andl $0xff, %ecx
cmpl %ecx, %eax
jle 0x19293
movq -0xb0(%rbp), %rax
movl 0x3c(%rax), %eax
andl $0xff, %eax
movl %eax, -0xcc(%rbp)
jmp 0x192a8
movq -0xa8(%rbp), %rax
movl 0x3c(%rax), %eax
andl $0xff, %eax
movl %eax, -0xcc(%rbp)
movl -0xcc(%rbp), %eax
movl %eax, -0x98(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x70(%rbp), %rcx
cmpl %ecx, %eax
jge 0x19306
movq -0x60(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movslq -0x14(%rbp), %rcx
addq %rcx, %rax
movq -0x50(%rbp), %rcx
shrq $0x20, %rcx
cmpq %rcx, %rax
jb 0x192f9
movl -0x94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x94(%rbp)
jmp 0x192fb
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x192bb
cmpq $0x1, -0x70(%rbp)
jbe 0x193ed
movslq -0x4c(%rbp), %rax
movq -0x70(%rbp), %rdx
movq -0x60(%rbp), %rcx
movl -0xc(%rcx,%rdx,8), %ecx
subq %rcx, %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0xd4(%rbp)
testq %rax, %rax
movss %xmm0, -0xd0(%rbp)
js 0x19365
movss -0xd4(%rbp), %xmm0
movss %xmm0, -0xd0(%rbp)
movss -0xd0(%rbp), %xmm1
movss 0x3e7db(%rip), %xmm0    # 0x57b50
mulss %xmm1, %xmm0
cvtsi2ssl -0x18(%rbp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0xd8(%rbp)
cvtsi2ssl -0x94(%rbp), %xmm0
callq 0x2200
movss -0xd8(%rbp), %xmm1
movss 0x3e7a5(%rip), %xmm2    # 0x57b4c
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0xbc(%rbp)
movl -0x98(%rbp), %eax
cmpl -0xbc(%rbp), %eax
jge 0x193d5
movl -0x98(%rbp), %eax
movl %eax, -0xdc(%rbp)
jmp 0x193e1
movl -0xbc(%rbp), %eax
movl %eax, -0xdc(%rbp)
movl -0xdc(%rbp), %eax
movl %eax, -0x98(%rbp)
movq -0xb0(%rbp), %rax
movl 0x3c(%rax), %eax
andl $0xff, %eax
cmpl -0x98(%rbp), %eax
jge 0x19466
movq -0xb0(%rbp), %rax
movl 0x3c(%rax), %eax
andl $0xff, %eax
cvtsi2ss %eax, %xmm0
cvtsi2ssl -0x98(%rbp), %xmm2
movss 0x3d3f1(%rip), %xmm1    # 0x56818
mulss %xmm2, %xmm1
movss 0x3df3d(%rip), %xmm2    # 0x57370
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss 0x3e711(%rip), %xmm1    # 0x57b54
addss %xmm1, %xmm0
cvttss2si %xmm0, %edx
movq -0xb0(%rbp), %rax
movl 0x3c(%rax), %ecx
andl $0xff, %edx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
orl %edx, %ecx
movl %ecx, 0x3c(%rax)
movq -0xa8(%rbp), %rax
movl 0x3c(%rax), %eax
andl $0xff, %eax
cmpl -0x98(%rbp), %eax
jge 0x194df
movq -0xa8(%rbp), %rax
movl 0x3c(%rax), %eax
andl $0xff, %eax
cvtsi2ss %eax, %xmm0
cvtsi2ssl -0x98(%rbp), %xmm2
movss 0x3d378(%rip), %xmm1    # 0x56818
mulss %xmm2, %xmm1
movss 0x3dec4(%rip), %xmm2    # 0x57370
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss 0x3e698(%rip), %xmm1    # 0x57b54
addss %xmm1, %xmm0
cvttss2si %xmm0, %edx
movq -0xa8(%rbp), %rax
movl 0x3c(%rax), %ecx
andl $0xff, %edx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
orl %edx, %ecx
movl %ecx, 0x3c(%rax)
cmpq $0x1, -0x70(%rbp)
jne 0x1953c
movq -0xb0(%rbp), %rax
movl 0x3c(%rax), %eax
andl $0xff, %eax
cmpl $0x2, %eax
jge 0x19510
movq -0xb0(%rbp), %rax
movl 0x3c(%rax), %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
orl $0x2, %ecx
movl %ecx, 0x3c(%rax)
movq -0xa8(%rbp), %rax
movl 0x3c(%rax), %eax
andl $0xff, %eax
cmpl $0x2, %eax
jge 0x1953a
movq -0xa8(%rbp), %rax
movl 0x3c(%rax), %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
orl $0x2, %ecx
movl %ecx, 0x3c(%rax)
jmp 0x195b5
movq -0x50(%rbp), %rax
shrq $0x20, %rax
movq -0x60(%rbp), %rcx
movq -0x70(%rbp), %rdx
subq $0x2, %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
cmpq %rcx, %rax
jbe 0x195b3
movq -0xb0(%rbp), %rax
movl 0x3c(%rax), %eax
andl $0xff, %eax
cmpl $0x1, %eax
jge 0x19587
movq -0xb0(%rbp), %rax
movl 0x3c(%rax), %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
orl $0x1, %ecx
movl %ecx, 0x3c(%rax)
movq -0xa8(%rbp), %rax
movl 0x3c(%rax), %eax
andl $0xff, %eax
cmpl $0x1, %eax
jge 0x195b1
movq -0xa8(%rbp), %rax
movl 0x3c(%rax), %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
orl $0x1, %ecx
movl %ecx, 0x3c(%rax)
jmp 0x195b3
jmp 0x195b5
jmp 0x195b7
movq -0x8(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x1a8c0
movq -0x8(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x1a8c0
movq -0x20(%rbp), %rdi
movq 0x10(%rbp), %rsi
movq 0x18(%rbp), %rdx
callq 0x182f0
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax,%rax)