// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/lib/blastOut.c
// Function: blastiodAxtOutput
static void blastiodAxtOutput(FILE *f, struct axt *axt, int tSize, int qSize, 
	int lineSize, boolean isProt, boolean isTranslated)
/* Output base-by-base part of alignment in blast-like fashion. */
{
int tOff = axt->tStart;
int dt = (isTranslated ? 3 : 1);
int qOff = axt->qStart;
int lineStart, lineEnd, i;
int digits = calcDigitCount(axt, tSize, qSize);
struct axtScoreScheme *ss = NULL;

if (isProt)
    ss = axtScoreSchemeProteinDefault();
for (lineStart = 0; lineStart < axt->symCount; lineStart = lineEnd)
    {
    lineEnd = lineStart + lineSize;
    if (lineEnd > axt->symCount) lineEnd = axt->symCount;
    fprintf(f, "Query: %-*d ", digits, plusStrandPos(qOff, qSize, axt->qStrand, FALSE));
    for (i=lineStart; i<lineEnd; ++i)
	{
	char c = axt->qSym[i];
	fputc(c, f);
	if (c != '-')
	    ++qOff;
	}
    fprintf(f, " %-d\n", plusStrandPos(qOff, qSize, axt->qStrand, TRUE));
    fprintf(f, "       %*s ", digits, " ");
    for (i=lineStart; i<lineEnd; ++i)
        {
	char q, t, c;
	q = axt->qSym[i];
	t = axt->tSym[i];
	if (isProt)
	    {
	    if (q == t)
	        c = q;
	    else if (ss->matrix[(int)q][(int)t] > 0)
	        c = '+';
	    else
	        c = ' ';
	    }
	else
	    c = ((toupper(q) == toupper(t)) ? '|' : ' ');

	fputc(c, f);
	}
    fprintf(f, "\n");
    fprintf(f, "Sbjct: %-*d ", digits, plusStrandPos(tOff, tSize, axt->tStrand, FALSE));
    for (i=lineStart; i<lineEnd; ++i)
	{
	char c = axt->tSym[i];
	fputc(c, f);
	if (c != '-')
	    tOff += dt;
	}
    fprintf(f, " %-d\n", plusStrandPos(tOff, tSize, axt->tStrand, TRUE));
    fprintf(f, "\n");
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r8d, 0x4(%rsp)
movl %ecx, %r14d
movq %rdx, 0x8(%rsp)
movq %rsi, %r12
movq %rdi, %r13
xorl %ebx, %ebx
testl %r9d, %r9d
setne %al
movl 0x10(%rsi), %ebp
cmpb $0x2d, 0x18(%rsi)
jne 0x1a84e
movl %r14d, %edi
subl %ebp, %edi
incl %edi
jmp 0x1a853
movl 0x14(%r12), %edi
movb %al, %bl
movl 0x28(%r12), %eax
movq %rax, 0x28(%rsp)
callq 0x2d0d3
movl %eax, %r15d
cmpb $0x2d, 0x30(%r12)
jne 0x1a87f
movq 0x8(%rsp), %rax
movl %eax, %edi
subl 0x28(%r12), %edi
incl %edi
jmp 0x1a884
movl 0x2c(%r12), %edi
callq 0x2d0d3
cmpl %r15d, %eax
cmovgl %eax, %r15d
movl %r15d, (%rsp)
cmpl $0x0, 0x4(%rsp)
je 0x1a8a4
xorl %eax, %eax
callq 0x176c4
jmp 0x1a8a6
xorl %eax, %eax
leal 0x1(,%rbx,2), %ecx
movl %ecx, 0x24(%rsp)
leal 0x1(%r14), %ecx
movl %ecx, 0x1c(%rsp)
addq $0x8, %rax
movq %rax, 0x40(%rsp)
movq 0x8(%rsp), %rax
incl %eax
movl %eax, 0x18(%rsp)
xorl %ebx, %ebx
movq %r14, 0x38(%rsp)
movl 0x38(%r12), %r15d
cmpl %r15d, %ebx
jge 0x1aabe
leal 0x3c(%rbx), %eax
cmpl %r15d, %eax
cmovll %eax, %r15d
movl %r14d, %eax
subl %ebp, %eax
leal 0x1(%rbp), %ecx
cmpb $0x2d, 0x18(%r12)
cmovel %eax, %ecx
movq %r13, %rdi
leaq 0x63944(%rip), %rsi     # 0x7e24b
movl (%rsp), %edx
xorl %eax, %eax
callq 0x6a90
movslq %ebx, %rax
movl %r15d, 0x20(%rsp)
movslq %r15d, %rcx
movq %rcx, 0x10(%rsp)
movq %rax, 0x30(%rsp)
movq %rax, %r15
cmpq 0x10(%rsp), %r15
jge 0x1a954
movq 0x40(%r12), %rax
movsbl (%rax,%r15), %edi
xorl %r14d, %r14d
cmpl $0x2d, %edi
setne %r14b
movq %r13, %rsi
callq 0x6930
addl %r14d, %ebp
incq %r15
jmp 0x1a929
movl 0x1c(%rsp), %edx
subl %ebp, %edx
cmpb $0x2d, 0x18(%r12)
cmovnel %ebp, %edx
movq %r13, %rdi
leaq 0x638eb(%rip), %rsi     # 0x7e258
xorl %eax, %eax
callq 0x6a90
movq %r13, %rdi
leaq 0x638e0(%rip), %rsi     # 0x7e25e
movl (%rsp), %edx
leaq 0x62a4a(%rip), %rcx     # 0x7d3d2
xorl %eax, %eax
callq 0x6a90
movq 0x30(%rsp), %r15
cmpq 0x10(%rsp), %r15
jge 0x1aa0f
movq %rbp, %rbx
movq %r12, %rcx
movq %r13, %r12
movq 0x40(%rcx), %rax
movq %rcx, %rbp
movq 0x48(%rcx), %rcx
movb (%rax,%r15), %al
movsbq %al, %r13
movsbq (%rcx,%r15), %r14
cmpl $0x0, 0x4(%rsp)
je 0x1a9de
cmpb %r14b, %al
je 0x1a9f6
shlq $0xa, %r13
addq 0x40(%rsp), %r13
cmpl $0x0, (%r13,%r14,4)
pushq $0x2b
popq %rax
jle 0x1a9f3
jmp 0x1a9f6
callq 0x6100
movq (%rax), %rcx
movl (%rcx,%r13,4), %edx
pushq $0x7c
popq %rax
cmpl (%rcx,%r14,4), %edx
je 0x1a9f6
pushq $0x20
popq %rax
movsbl %al, %edi
movq %r12, %r13
movq %r12, %rsi
callq 0x6930
incq %r15
movq %rbp, %r12
movq %rbx, %rbp
jmp 0x1a994
pushq $0xa
popq %rdi
movq %r13, %rsi
callq 0x6930
movq 0x8(%rsp), %rax
movq 0x28(%rsp), %rbx
subl %ebx, %eax
leal 0x1(%rbx), %ecx
cmpb $0x2d, 0x30(%r12)
cmovel %eax, %ecx
movq %r13, %rdi
leaq 0x6382e(%rip), %rsi     # 0x7e26a
movl (%rsp), %edx
xorl %eax, %eax
callq 0x6a90
movq 0x30(%rsp), %r14
cmpq 0x10(%rsp), %r14
jge 0x1aa7e
movq 0x48(%r12), %rax
movsbl (%rax,%r14), %r15d
movl %r15d, %edi
movq %r13, %rsi
callq 0x6930
cmpl $0x2d, %r15d
movl 0x24(%rsp), %eax
movl $0x0, %edx
cmovel %edx, %eax
addl %eax, %ebx
incq %r14
jmp 0x1aa4b
movl 0x18(%rsp), %edx
subl %ebx, %edx
cmpb $0x2d, 0x30(%r12)
movq %rbx, 0x28(%rsp)
cmovnel %ebx, %edx
movq %r13, %rdi
leaq 0x637bc(%rip), %rsi     # 0x7e258
xorl %eax, %eax
callq 0x6a90
pushq $0xa
popq %rdi
movq %r13, %rsi
callq 0x6930
movl 0x20(%rsp), %eax
movl %eax, %ebx
movq 0x38(%rsp), %r14
jmp 0x1a8d4
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq