// File: /workspace/github_c_makefile_star2_O0/lh3[P]minimap2/align.c
// Function: mm_update_extra
static void mm_update_extra(mm_reg1_t *r, const uint8_t *qseq, const uint8_t *tseq, const int8_t *mat, int8_t q, int8_t e, int is_eqx, int log_gap)
{
	uint32_t k, l;
	int32_t qshift, tshift, toff = 0, qoff = 0;
	double s = 0.0, max = 0.0;
	mm_extra_t *p = r->p;
	if (p == 0) return;
	mm_fix_cigar(r, qseq, tseq, &qshift, &tshift);
	qseq += qshift, tseq += tshift; // qseq and tseq may be shifted due to the removal of leading I/D
	r->blen = r->mlen = 0, r->is_spliced = 0;
	for (k = 0; k < p->n_cigar; ++k) {
		uint32_t op = p->cigar[k]&0xf, len = p->cigar[k]>>4;
		if (op == MM_CIGAR_MATCH) {
			int n_ambi = 0, n_diff = 0;
			for (l = 0; l < len; ++l) {
				int cq = qseq[qoff + l], ct = tseq[toff + l];
				if (ct > 3 || cq > 3) ++n_ambi;
				else if (ct != cq) ++n_diff;
				s += mat[ct * 5 + cq];
				if (s < 0) s = 0;
				else max = max > s? max : s;
			}
			r->blen += len - n_ambi, r->mlen += len - (n_ambi + n_diff), p->n_ambi += n_ambi;
			toff += len, qoff += len;
		} else if (op == MM_CIGAR_INS) {
			int n_ambi = 0;
			for (l = 0; l < len; ++l)
				if (qseq[qoff + l] > 3) ++n_ambi;
			r->blen += len - n_ambi, p->n_ambi += n_ambi;
			if (log_gap) s -= q + (double)e * mg_log2(1.0 + len);
			else s -= q + e;
			if (s < 0) s = 0;
			qoff += len;
		} else if (op == MM_CIGAR_DEL) {
			int n_ambi = 0;
			for (l = 0; l < len; ++l)
				if (tseq[toff + l] > 3) ++n_ambi;
			r->blen += len - n_ambi, p->n_ambi += n_ambi;
			if (log_gap) s -= q + (double)e * mg_log2(1.0 + len);
			else s -= q + e;
			if (s < 0) s = 0;
			toff += len;
		} else if (op == MM_CIGAR_N_SKIP) {
			r->is_spliced = 1, toff += len;
		}
	}
	p->dp_max = p->dp_max0 = (int32_t)(max + .499);
	assert(qoff == r->qe - r->qs && toff == r->re - r->rs);
	if (is_eqx) mm_update_cigar_eqx(r, qseq, tseq); // NB: it has to be called here as changes to qseq and tseq are not returned
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movl %r8d, -0x94(%rbp)
movq %rcx, %rax
movl -0x94(%rbp), %ecx
movq %rax, -0x90(%rbp)
movq %rdx, %rax
movq -0x90(%rbp), %rdx
movq %rax, -0x88(%rbp)
movq %rsi, %rax
movq -0x88(%rbp), %rsi
movq %rax, -0x80(%rbp)
movq %rdi, %r8
movq -0x80(%rbp), %rdi
movb %r9b, %al
movl 0x18(%rbp), %r9d
movl 0x10(%rbp), %r9d
movq %r8, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movb %cl, -0x21(%rbp)
movb %al, -0x22(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0x2841f
jmp 0x28929
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x30(%rbp), %rcx
leaq -0x34(%rbp), %r8
callq 0x29080
movl -0x30(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movl -0x34(%rbp), %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, 0x2c(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x30(%rax)
movq -0x8(%rbp), %rax
movl 0x3c(%rax), %ecx
andl $0xf7ffffff, %ecx       # imm = 0xF7FFFFFF
orl $0x0, %ecx
movl %ecx, 0x3c(%rax)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movq -0x58(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jae 0x288a8
movq -0x58(%rbp), %rax
movl -0x28(%rbp), %ecx
movl 0x1c(%rax,%rcx,4), %eax
andl $0xf, %eax
movl %eax, -0x5c(%rbp)
movq -0x58(%rbp), %rax
movl -0x28(%rbp), %ecx
movl 0x1c(%rax,%rcx,4), %eax
shrl $0x4, %eax
movl %eax, -0x60(%rbp)
cmpl $0x0, -0x5c(%rbp)
jne 0x28612
movl $0x0, -0x64(%rbp)
movl $0x0, -0x68(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x60(%rbp), %eax
jae 0x285b0
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
addl -0x2c(%rbp), %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl %eax, -0x6c(%rbp)
movq -0x18(%rbp), %rax
movl -0x38(%rbp), %ecx
addl -0x2c(%rbp), %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl %eax, -0x70(%rbp)
cmpl $0x3, -0x70(%rbp)
jg 0x28519
cmpl $0x3, -0x6c(%rbp)
jle 0x28524
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x28537
movl -0x70(%rbp), %eax
cmpl -0x6c(%rbp), %eax
je 0x28535
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x28537
movq -0x20(%rbp), %rax
imull $0x5, -0x70(%rbp), %ecx
addl -0x6c(%rbp), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cvtsi2sd %eax, %xmm0
addsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x48(%rbp), %xmm0
jbe 0x2856b
xorps %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
jmp 0x285a0
movsd -0x50(%rbp), %xmm0
ucomisd -0x48(%rbp), %xmm0
jbe 0x28586
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0xa0(%rbp)
jmp 0x28593
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0xa0(%rbp)
movsd -0xa0(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
jmp 0x285a2
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x284db
movl -0x60(%rbp), %ecx
subl -0x64(%rbp), %ecx
movq -0x8(%rbp), %rax
addl 0x30(%rax), %ecx
movl %ecx, 0x30(%rax)
movl -0x60(%rbp), %ecx
movl -0x64(%rbp), %eax
addl -0x68(%rbp), %eax
subl %eax, %ecx
movq -0x8(%rbp), %rax
addl 0x2c(%rax), %ecx
movl %ecx, 0x2c(%rax)
movl -0x64(%rbp), %ecx
movq -0x58(%rbp), %rax
movl 0x14(%rax), %edx
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
addl %ecx, %edx
movl 0x14(%rax), %ecx
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
andl $0xc0000000, %ecx       # imm = 0xC0000000
orl %edx, %ecx
movl %ecx, 0x14(%rax)
movl -0x60(%rbp), %eax
addl -0x38(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x60(%rbp), %eax
addl -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
jmp 0x28898
cmpl $0x1, -0x5c(%rbp)
jne 0x28741
movl $0x0, -0x74(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x60(%rbp), %eax
jae 0x2865d
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
addl -0x2c(%rbp), %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x3, %eax
jle 0x28650
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x28652
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2862a
movl -0x60(%rbp), %ecx
subl -0x74(%rbp), %ecx
movq -0x8(%rbp), %rax
addl 0x30(%rax), %ecx
movl %ecx, 0x30(%rax)
movl -0x74(%rbp), %ecx
movq -0x58(%rbp), %rax
movl 0x14(%rax), %edx
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
addl %ecx, %edx
movl 0x14(%rax), %ecx
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
andl $0xc0000000, %ecx       # imm = 0xC0000000
orl %edx, %ecx
movl %ecx, 0x14(%rax)
cmpl $0x0, 0x18(%rbp)
je 0x28705
movsbl -0x21(%rbp), %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0xa8(%rbp)
movsbl -0x22(%rbp), %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0xb0(%rbp)
movl -0x60(%rbp), %eax
cvtsi2sd %rax, %xmm1
movsd 0x2c947(%rip), %xmm0    # 0x55010
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x26080
movsd -0xb0(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0xa8(%rbp), %xmm0
cvtss2sd %xmm2, %xmm2
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0x48(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
jmp 0x28721
movsbl -0x21(%rbp), %eax
movsbl -0x22(%rbp), %ecx
addl %ecx, %eax
cvtsi2sd %eax, %xmm1
movsd -0x48(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x48(%rbp), %xmm0
jbe 0x28733
xorps %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
movl -0x60(%rbp), %eax
addl -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
jmp 0x28896
cmpl $0x2, -0x5c(%rbp)
jne 0x2886d
movl $0x0, -0x78(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x60(%rbp), %eax
jae 0x2878c
movq -0x18(%rbp), %rax
movl -0x38(%rbp), %ecx
addl -0x2c(%rbp), %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x3, %eax
jle 0x2877f
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x28781
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x28759
movl -0x60(%rbp), %ecx
subl -0x78(%rbp), %ecx
movq -0x8(%rbp), %rax
addl 0x30(%rax), %ecx
movl %ecx, 0x30(%rax)
movl -0x78(%rbp), %ecx
movq -0x58(%rbp), %rax
movl 0x14(%rax), %edx
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
addl %ecx, %edx
movl 0x14(%rax), %ecx
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
andl $0xc0000000, %ecx       # imm = 0xC0000000
orl %edx, %ecx
movl %ecx, 0x14(%rax)
cmpl $0x0, 0x18(%rbp)
je 0x28834
movsbl -0x21(%rbp), %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0xb8(%rbp)
movsbl -0x22(%rbp), %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0xc0(%rbp)
movl -0x60(%rbp), %eax
cvtsi2sd %rax, %xmm1
movsd 0x2c818(%rip), %xmm0    # 0x55010
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x26080
movsd -0xc0(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0xb8(%rbp), %xmm0
cvtss2sd %xmm2, %xmm2
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0x48(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
jmp 0x28850
movsbl -0x21(%rbp), %eax
movsbl -0x22(%rbp), %ecx
addl %ecx, %eax
cvtsi2sd %eax, %xmm1
movsd -0x48(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x48(%rbp), %xmm0
jbe 0x28862
xorps %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
movl -0x60(%rbp), %eax
addl -0x38(%rbp), %eax
movl %eax, -0x38(%rbp)
jmp 0x28894
cmpl $0x3, -0x5c(%rbp)
jne 0x28892
movq -0x8(%rbp), %rax
movl 0x3c(%rax), %ecx
andl $0xf7ffffff, %ecx       # imm = 0xF7FFFFFF
orl $0x8000000, %ecx        # imm = 0x8000000
movl %ecx, 0x3c(%rax)
movl -0x60(%rbp), %eax
addl -0x38(%rbp), %eax
movl %eax, -0x38(%rbp)
jmp 0x28894
jmp 0x28896
jmp 0x28898
jmp 0x2889a
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x2848a
movsd 0x2c768(%rip), %xmm0    # 0x55018
addsd -0x50(%rbp), %xmm0
cvttsd2si %xmm0, %ecx
movq -0x58(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x58(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0x3c(%rbp), %eax
movq -0x8(%rbp), %rcx
movl 0x14(%rcx), %ecx
movq -0x8(%rbp), %rdx
subl 0x10(%rdx), %ecx
cmpl %ecx, %eax
jne 0x288f3
movl -0x38(%rbp), %eax
movq -0x8(%rbp), %rcx
movl 0x1c(%rcx), %ecx
movq -0x8(%rbp), %rdx
subl 0x18(%rdx), %ecx
cmpl %ecx, %eax
jne 0x288f3
jmp 0x28912
leaq 0x2fb52(%rip), %rdi     # 0x5844c
leaq 0x2f8ae(%rip), %rsi     # 0x581af
movl $0x12d, %edx            # imm = 0x12D
leaq 0x2fb6e(%rip), %rcx     # 0x5847b
callq 0x21a0
cmpl $0x0, 0x10(%rbp)
je 0x28929
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x296b0
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)