// File: /workspace/github_c_makefile_star2_O0/lh3[P]minimap2/align.c
// Function: mm_seed_ext_score
static int mm_seed_ext_score(void *km, const mm_mapopt_t *opt, const mm_idx_t *mi, const int8_t mat[25], int qlen, uint8_t *qseq0[2], const mm128_t *a)
{
	uint8_t *qseq, *tseq;
	int q_span = a->y>>32&0xff, qs, qe, rs, re, rid, score, q_off, t_off, ext_len = opt->anchor_ext_len;
	void *qp;
	rid = a->x<<1>>33;
	re = (uint32_t)a->x + 1, rs = re - q_span;
	qe = (uint32_t)a->y + 1, qs = qe - q_span;
	rs = rs - ext_len > 0? rs - ext_len : 0;
	qs = qs - ext_len > 0? qs - ext_len : 0;
	re = re + ext_len < (int32_t)mi->seq[rid].len? re + ext_len : mi->seq[rid].len;
	qe = qe + ext_len < qlen? qe + ext_len : qlen;
	tseq = (uint8_t*)kmalloc(km, re - rs);
	if (opt->flag & MM_F_QSTRAND) {
		qseq = qseq0[0] + qs;
		mm_idx_getseq2(mi, a->x>>63, rid, rs, re, tseq);
	} else {
		qseq = qseq0[a->x>>63] + qs;
		mm_idx_getseq(mi, rid, rs, re, tseq);
	}
	qp = ksw_ll_qinit(km, 2, qe - qs, qseq, 5, mat);
	score = ksw_ll_i16(qp, re - rs, tseq, opt->q, opt->e, &q_off, &t_off);
	kfree(km, tseq);
	kfree(km, qp);
	return score;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq %r9, -0x30(%rbp)
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
andq $0xff, %rax
movl %eax, -0x44(%rbp)
movq -0x10(%rbp), %rax
movl 0xa4(%rax), %eax
movl %eax, -0x68(%rbp)
movq 0x10(%rbp), %rax
movq (%rax), %rax
shlq %rax
shrq $0x21, %rax
movl %eax, -0x58(%rbp)
movq 0x10(%rbp), %rax
movq (%rax), %rax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
subl -0x44(%rbp), %eax
movl %eax, -0x50(%rbp)
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
subl -0x44(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x50(%rbp), %eax
subl -0x68(%rbp), %eax
cmpl $0x0, %eax
jle 0x28b2d
movl -0x50(%rbp), %eax
subl -0x68(%rbp), %eax
movl %eax, -0x74(%rbp)
jmp 0x28b34
xorl %eax, %eax
movl %eax, -0x74(%rbp)
jmp 0x28b34
movl -0x74(%rbp), %eax
movl %eax, -0x50(%rbp)
movl -0x48(%rbp), %eax
subl -0x68(%rbp), %eax
cmpl $0x0, %eax
jle 0x28b50
movl -0x48(%rbp), %eax
subl -0x68(%rbp), %eax
movl %eax, -0x78(%rbp)
jmp 0x28b57
xorl %eax, %eax
movl %eax, -0x78(%rbp)
jmp 0x28b57
movl -0x78(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x54(%rbp), %eax
addl -0x68(%rbp), %eax
movq -0x18(%rbp), %rcx
movq 0x20(%rcx), %rcx
movslq -0x58(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x10(%rcx), %eax
jge 0x28b86
movl -0x54(%rbp), %eax
addl -0x68(%rbp), %eax
movl %eax, -0x7c(%rbp)
jmp 0x28b9f
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x58(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x4c(%rbp), %eax
addl -0x68(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x28bbb
movl -0x4c(%rbp), %eax
addl -0x68(%rbp), %eax
movl %eax, -0x80(%rbp)
jmp 0x28bc1
movl -0x24(%rbp), %eax
movl %eax, -0x80(%rbp)
movl -0x80(%rbp), %eax
movl %eax, -0x4c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x54(%rbp), %eax
subl -0x50(%rbp), %eax
movslq %eax, %rsi
callq 0x1aae0
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rcx
movabsq $0x100000000, %rax      # imm = 0x100000000
andq (%rcx), %rax
cmpq $0x0, %rax
je 0x28c2c
movq -0x30(%rbp), %rax
movq (%rax), %rax
movslq -0x48(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
movq 0x10(%rbp), %rax
movq (%rax), %rax
shrq $0x3f, %rax
movl %eax, %esi
movl -0x58(%rbp), %edx
movl -0x50(%rbp), %ecx
movl -0x54(%rbp), %r8d
movq -0x40(%rbp), %r9
callq 0x8d20
jmp 0x28c60
movq -0x30(%rbp), %rax
movq 0x10(%rbp), %rcx
movq (%rcx), %rcx
shrq $0x3f, %rcx
movq (%rax,%rcx,8), %rax
movslq -0x48(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
movl -0x58(%rbp), %esi
movl -0x50(%rbp), %edx
movl -0x54(%rbp), %ecx
movq -0x40(%rbp), %r8
callq 0x8ac0
movq -0x8(%rbp), %rdi
movl -0x4c(%rbp), %edx
subl -0x48(%rbp), %edx
movq -0x38(%rbp), %rcx
movq -0x20(%rbp), %r9
movl $0x2, %esi
movl $0x5, %r8d
callq 0x2e8f0
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
movl -0x54(%rbp), %esi
subl -0x50(%rbp), %esi
movq -0x40(%rbp), %rdx
movq -0x10(%rbp), %rax
movl 0x6c(%rax), %ecx
movq -0x10(%rbp), %rax
movl 0x70(%rax), %r8d
leaq -0x60(%rbp), %r9
leaq -0x64(%rbp), %rax
movq %rax, (%rsp)
callq 0x2eca0
movl %eax, -0x5c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x1a8c0
movq -0x8(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x1a8c0
movl -0x5c(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)