// File: /workspace/github_c_makefile_star2_O0/lh3[P]minimap2/align.c
// Function: mm_align_pair
static void mm_align_pair(void *km, const mm_mapopt_t *opt, int qlen, const uint8_t *qseq, int tlen, const uint8_t *tseq, const uint8_t *junc,
						  const int8_t *mat, int w, int end_bonus, int zdrop, int ksw_flag, ksw_extz_t *ez)
{
	if (mm_dbg_flag & MM_DBG_PRINT_ALN_SEQ) {
		int i;
		fprintf(stderr, "===> q=(%d,%d), e=(%d,%d), bw=%d, ksw_flag=%d, zdrop=%d, end_bonus=%d <===\n", opt->q, opt->q2, opt->e, opt->e2, w, ksw_flag, opt->zdrop, end_bonus);
		for (i = 0; i < tlen; ++i) fputc("ACGTN"[tseq[i]], stderr);
		fputc('\n', stderr);
		for (i = 0; i < qlen; ++i) fputc("ACGTN"[qseq[i]], stderr);
		fputc('\n', stderr);
	}
	if (opt->transition != 0 && opt->b != opt->transition)
		ksw_flag |= KSW_EZ_GENERIC_SC;
	if (opt->max_sw_mat > 0 && (int64_t)tlen * qlen > opt->max_sw_mat) { // too much memory; skip alignment
		ksw_reset_extz(ez);
		ez->zdropped = 1;
	} else if (opt->flag & MM_F_SPLICE) { // spliced alignment
		assert((ksw_flag & KSW_EZ_SPLICE_FOR) == 0 || (ksw_flag & KSW_EZ_SPLICE_REV) == 0);
		if (!(opt->flag & MM_F_SPLICE_OLD)) ksw_flag |= KSW_EZ_SPLICE_CMPLX;
		ksw_exts2_sse(km, qlen, qseq, tlen, tseq, 5, mat, opt->q, opt->e, opt->q2, opt->noncan, zdrop, end_bonus, opt->junc_bonus, opt->junc_pen, ksw_flag, junc, ez);
	} else if (opt->q == opt->q2 && opt->e == opt->e2) { // affine gap
		ksw_extz2_sse(km, qlen, qseq, tlen, tseq, 5, mat, opt->q, opt->e, w, zdrop, end_bonus, ksw_flag, ez);
	} else { // dual affine gap
		ksw_extd2_sse(km, qlen, qseq, tlen, tseq, 5, mat, opt->q, opt->e, opt->q2, opt->e2, w, zdrop, end_bonus, ksw_flag, ez);
	}
	if (mm_dbg_flag & MM_DBG_PRINT_ALN_SEQ) {
		int i;
		fprintf(stderr, "score=%d, cigar=", ez->score);
		for (i = 0; i < ez->n_cigar; ++i)
			fprintf(stderr, "%d%c", ez->cigar[i]>>4, MM_CIGAR_STR[ez->cigar[i]&0xf]);
		fprintf(stderr, "\n");
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq 0x40(%rbp), %rax
movl 0x38(%rbp), %eax
movl 0x30(%rbp), %eax
movl 0x28(%rbp), %eax
movl 0x20(%rbp), %eax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movl %edx, -0x3c(%rbp)
movq %rcx, -0x48(%rbp)
movl %r8d, -0x4c(%rbp)
movq %r9, -0x58(%rbp)
leaq 0x375ae(%rip), %rax     # 0x5e938
movl (%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x274a0
movq 0x36c59(%rip), %rax     # 0x5dff8
movq (%rax), %rdi
movq -0x38(%rbp), %rax
movl 0x6c(%rax), %edx
movq -0x38(%rbp), %rax
movl 0x74(%rax), %ecx
movq -0x38(%rbp), %rax
movl 0x70(%rax), %r8d
movq -0x38(%rbp), %rax
movl 0x78(%rax), %r9d
movl 0x20(%rbp), %ebx
movl 0x38(%rbp), %r11d
movq -0x38(%rbp), %rax
movl 0x90(%rax), %r10d
movl 0x28(%rbp), %eax
leaq 0x30f29(%rip), %rsi     # 0x58305
movl %ebx, (%rsp)
movl %r11d, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movl %eax, 0x18(%rsp)
movb $0x0, %al
callq 0x2250
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jge 0x27436
movq -0x58(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, %ecx
leaq 0x3051f(%rip), %rax     # 0x57937
movsbl (%rax,%rcx), %edi
movq 0x36bd5(%rip), %rax     # 0x5dff8
movq (%rax), %rsi
callq 0x21f0
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x273fb
movq 0x36bbb(%rip), %rax     # 0x5dff8
movq (%rax), %rsi
movl $0xa, %edi
callq 0x21f0
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x2748c
movq -0x48(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, %ecx
leaq 0x304c9(%rip), %rax     # 0x57937
movsbl (%rax,%rcx), %edi
movq 0x36b7f(%rip), %rax     # 0x5dff8
movq (%rax), %rsi
callq 0x21f0
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x27451
movq 0x36b65(%rip), %rax     # 0x5dff8
movq (%rax), %rsi
movl $0xa, %edi
callq 0x21f0
movq -0x38(%rbp), %rax
cmpl $0x0, 0x7c(%rax)
je 0x274c3
movq -0x38(%rbp), %rax
movl 0x68(%rax), %eax
movq -0x38(%rbp), %rcx
cmpl 0x7c(%rcx), %eax
je 0x274c3
movl 0x38(%rbp), %eax
orl $0x4, %eax
movl %eax, 0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq $0x0, 0xf0(%rax)
jle 0x2750c
movslq -0x4c(%rbp), %rax
movslq -0x3c(%rbp), %rcx
imulq %rcx, %rax
movq -0x38(%rbp), %rcx
cmpq 0xf0(%rcx), %rax
jle 0x2750c
movq 0x40(%rbp), %rdi
callq 0x27990
movq 0x40(%rbp), %rax
movl (%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, (%rax)
jmp 0x277b1
movq -0x38(%rbp), %rax
movq (%rax), %rax
andq $0x80, %rax
cmpq $0x0, %rax
je 0x27664
movl 0x38(%rbp), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x2753d
movl 0x38(%rbp), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
jne 0x2753f
jmp 0x2755e
leaq 0x30e0b(%rip), %rdi     # 0x58351
leaq 0x30c62(%rip), %rsi     # 0x581af
movl $0x161, %edx            # imm = 0x161
leaq 0x30e43(%rip), %rcx     # 0x5839c
callq 0x21a0
movq -0x38(%rbp), %rcx
movabsq $0x800000000, %rax      # imm = 0x800000000
andq (%rcx), %rax
cmpq $0x0, %rax
jne 0x27580
movl 0x38(%rbp), %eax
orl $0x800, %eax            # imm = 0x800
movl %eax, 0x38(%rbp)
movq -0x30(%rbp), %rdi
movl -0x3c(%rbp), %esi
movq -0x48(%rbp), %rdx
movl -0x4c(%rbp), %ecx
movq -0x58(%rbp), %r8
movq 0x18(%rbp), %rax
movq -0x38(%rbp), %r9
movl 0x6c(%r9), %r9d
movb %r9b, -0x6b(%rbp)
movq -0x38(%rbp), %r9
movl 0x70(%r9), %r9d
movb %r9b, -0x6a(%rbp)
movq -0x38(%rbp), %r9
movl 0x74(%r9), %r9d
movb %r9b, -0x69(%rbp)
movq -0x38(%rbp), %r9
movl 0x84(%r9), %r9d
movb %r9b, %r13b
movl 0x30(%rbp), %r12d
movl 0x28(%rbp), %r15d
movq -0x38(%rbp), %r9
movl 0x88(%r9), %r9d
movb %r9b, %r14b
movq -0x38(%rbp), %r9
movl 0x8c(%r9), %r9d
movb %r9b, %bl
movl 0x38(%rbp), %r11d
movq 0x10(%rbp), %r10
movq 0x40(%rbp), %r9
movq %r9, -0x68(%rbp)
movl $0x5, %r9d
movq %rax, (%rsp)
movb -0x6b(%rbp), %al
movsbl %al, %eax
movl %eax, 0x8(%rsp)
movb -0x6a(%rbp), %al
movsbl %al, %eax
movl %eax, 0x10(%rsp)
movb -0x69(%rbp), %al
movsbl %al, %eax
movl %eax, 0x18(%rsp)
movq -0x68(%rbp), %rax
movsbl %r13b, %r13d
movl %r13d, 0x20(%rsp)
movl %r12d, 0x28(%rsp)
movl %r15d, 0x30(%rsp)
movsbl %r14b, %r14d
movl %r14d, 0x38(%rsp)
movsbl %bl, %ebx
movl %ebx, 0x40(%rsp)
movl %r11d, 0x48(%rsp)
movq %r10, 0x50(%rsp)
movq %rax, 0x58(%rsp)
callq 0x2fbf0
jmp 0x277af
movq -0x38(%rbp), %rax
movl 0x6c(%rax), %eax
movq -0x38(%rbp), %rcx
cmpl 0x74(%rcx), %eax
jne 0x27703
movq -0x38(%rbp), %rax
movl 0x70(%rax), %eax
movq -0x38(%rbp), %rcx
cmpl 0x78(%rcx), %eax
jne 0x27703
movq -0x30(%rbp), %rdi
movl -0x3c(%rbp), %esi
movq -0x48(%rbp), %rdx
movl -0x4c(%rbp), %ecx
movq -0x58(%rbp), %r8
movq 0x18(%rbp), %r13
movq -0x38(%rbp), %rax
movl 0x6c(%rax), %eax
movb %al, %r12b
movq -0x38(%rbp), %rax
movl 0x70(%rax), %eax
movb %al, %r15b
movl 0x20(%rbp), %r14d
movl 0x30(%rbp), %ebx
movl 0x28(%rbp), %r11d
movl 0x38(%rbp), %r10d
movq 0x40(%rbp), %rax
movl $0x5, %r9d
movq %r13, (%rsp)
movsbl %r12b, %r12d
movl %r12d, 0x8(%rsp)
movsbl %r15b, %r15d
movl %r15d, 0x10(%rsp)
movl %r14d, 0x18(%rsp)
movl %ebx, 0x20(%rsp)
movl %r11d, 0x28(%rsp)
movl %r10d, 0x30(%rsp)
movq %rax, 0x38(%rsp)
callq 0x2f750
jmp 0x277ad
movq -0x30(%rbp), %rdi
movl -0x3c(%rbp), %esi
movq -0x48(%rbp), %rdx
movl -0x4c(%rbp), %ecx
movq -0x58(%rbp), %r8
movq 0x18(%rbp), %rax
movq -0x38(%rbp), %r9
movl 0x6c(%r9), %r9d
movb %r9b, -0x79(%rbp)
movq -0x38(%rbp), %r9
movl 0x70(%r9), %r9d
movb %r9b, %r13b
movq -0x38(%rbp), %r9
movl 0x74(%r9), %r9d
movb %r9b, %r12b
movq -0x38(%rbp), %r9
movl 0x78(%r9), %r9d
movb %r9b, %r15b
movl 0x20(%rbp), %r14d
movl 0x30(%rbp), %ebx
movl 0x28(%rbp), %r11d
movl 0x38(%rbp), %r10d
movq 0x40(%rbp), %r9
movq %r9, -0x78(%rbp)
movl $0x5, %r9d
movq %rax, (%rsp)
movb -0x79(%rbp), %al
movsbl %al, %eax
movl %eax, 0x8(%rsp)
movq -0x78(%rbp), %rax
movsbl %r13b, %r13d
movl %r13d, 0x10(%rsp)
movsbl %r12b, %r12d
movl %r12d, 0x18(%rsp)
movsbl %r15b, %r15d
movl %r15d, 0x20(%rsp)
movl %r14d, 0x28(%rsp)
movl %ebx, 0x30(%rsp)
movl %r11d, 0x38(%rsp)
movl %r10d, 0x40(%rsp)
movq %rax, 0x48(%rsp)
callq 0x2fa00
jmp 0x277af
jmp 0x277b1
leaq 0x37180(%rip), %rax     # 0x5e938
movl (%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x27866
movq 0x3682b(%rip), %rax     # 0x5dff8
movq (%rax), %rdi
movq 0x40(%rbp), %rax
movl 0x1c(%rax), %edx
leaq 0x30c5d(%rip), %rsi     # 0x5843b
movb $0x0, %al
callq 0x2250
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
movq 0x40(%rbp), %rcx
cmpl 0x24(%rcx), %eax
jge 0x2784e
movq 0x367f9(%rip), %rax     # 0x5dff8
movq (%rax), %rdi
movq 0x40(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x60(%rbp), %rcx
movl (%rax,%rcx,4), %edx
shrl $0x4, %edx
movq 0x40(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x60(%rbp), %rcx
movl (%rax,%rcx,4), %eax
andl $0xf, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x2fea4(%rip), %rax     # 0x576d5
movsbl (%rax,%rcx), %ecx
leaq 0x2fe94(%rip), %rsi     # 0x576d0
movb $0x0, %al
callq 0x2250
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x277ec
movq 0x367a3(%rip), %rax     # 0x5dff8
movq (%rax), %rdi
leaq 0x2d888(%rip), %rsi     # 0x550e7
movb $0x0, %al
callq 0x2250
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax,%rax)