// File: /workspace/github_c_makefile_star2_O3/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 $0x58, %rsp
movl %r8d, 0xc(%rsp)
movq %rdx, 0x10(%rsp)
movq %rsi, %r14
movq %rdi, %r13
xorl %ebx, %ebx
testl %r9d, %r9d
setne %al
movl 0x10(%rsi), %ebp
cmpb $0x2d, 0x18(%rsi)
movq %rcx, 0x20(%rsp)
movb %al, 0x4(%rsp)
jne 0x1e294
movl %ecx, %edi
subl %ebp, %edi
incl %edi
jmp 0x1e298
movl 0x14(%r14), %edi
movl 0x28(%r14), %r15d
callq 0x3279c
cmpb $0x2d, 0x30(%r14)
jne 0x1e2ba
movl %eax, %r12d
movq 0x10(%rsp), %rax
movl %eax, %edi
subl 0x28(%r14), %edi
incl %edi
jmp 0x1e2c1
movl %eax, %r12d
movl 0x2c(%r14), %edi
callq 0x3279c
movl %r12d, %edx
cmpl %r12d, %eax
cmovgl %eax, %edx
cmpl $0x0, 0xc(%rsp)
je 0x1e2ea
xorl %eax, %eax
movl %edx, %r12d
callq 0x1abf2
movl %r12d, %edx
movq %rax, 0x28(%rsp)
jmp 0x1e2f3
movq $0x0, 0x28(%rsp)
movq 0x20(%rsp), %rcx
movl 0x38(%r14), %r12d
testl %r12d, %r12d
jle 0x1e58e
movb 0x4(%rsp), %al
movb %al, %bl
leal 0x1(,%rbx,2), %eax
movl %eax, 0x4(%rsp)
leal 0x1(%rcx), %eax
movl %eax, 0x38(%rsp)
addq $0x8, 0x28(%rsp)
movq 0x10(%rsp), %rax
incl %eax
movl %eax, 0x34(%rsp)
xorl %eax, %eax
movl %edx, (%rsp)
movq %r14, 0x18(%rsp)
movq %r13, 0x50(%rsp)
movq %r15, 0x40(%rsp)
movl %eax, %r15d
leal 0x3c(%r15), %ebx
cmpl %r12d, %ebx
cmovgel %r12d, %ebx
movl %ecx, %eax
subl %ebp, %eax
leal 0x1(%rbp), %ecx
cmpb $0x2d, 0x18(%r14)
cmovel %eax, %ecx
movq %r13, %rdi
leaq 0x70fb2(%rip), %rsi     # 0x8f31b
xorl %eax, %eax
callq 0x6a90
movl %ebx, 0x3c(%rsp)
movslq %ebx, %rbx
movl %r12d, 0x8(%rsp)
cmpl %r15d, %r12d
movq %r15, 0x48(%rsp)
jle 0x1e3b5
movslq %r15d, %r15
movq 0x40(%r14), %rax
movsbl (%rax,%r15), %edi
movq %r14, %r12
xorl %r14d, %r14d
cmpl $0x2d, %edi
setne %r14b
movq %r13, %rsi
callq 0x6930
addl %r14d, %ebp
movq %r12, %r14
incq %r15
cmpq %rbx, %r15
jl 0x1e389
movl 0x38(%rsp), %edx
subl %ebp, %edx
cmpb $0x2d, 0x18(%r14)
cmovnel %ebp, %edx
movq %r13, %rdi
leaq 0x70f5b(%rip), %rsi     # 0x8f328
xorl %eax, %eax
callq 0x6a90
movq %r13, %rdi
leaq 0x70f50(%rip), %rsi     # 0x8f32e
movl (%rsp), %r12d
movl %r12d, %edx
leaq 0x70046(%rip), %rcx     # 0x8e432
xorl %eax, %eax
callq 0x6a90
movq 0x48(%rsp), %rax
cmpl %eax, 0x8(%rsp)
jle 0x1e501
movslq %eax, %r15
movq %r13, %r12
movq 0x18(%rsp), %rcx
movq 0x40(%rcx), %rax
movq 0x48(%rcx), %rcx
movb (%rax,%r15), %al
movsbq %al, %r14
movsbq (%rcx,%r15), %r13
cmpl $0x0, 0xc(%rsp)
je 0x1e445
cmpb %r13b, %al
je 0x1e461
shlq $0xa, %r14
addq 0x28(%rsp), %r14
cmpl $0x0, (%r14,%r13,4)
movl $0x2b, %eax
jle 0x1e45c
jmp 0x1e461
callq 0x6100
movq (%rax), %rcx
movl (%rcx,%r14,4), %edx
movl $0x7c, %eax
cmpl (%rcx,%r13,4), %edx
je 0x1e461
movl $0x20, %eax
movsbl %al, %edi
movq %r12, %r13
movq %r12, %rsi
callq 0x6930
incq %r15
cmpq %rbx, %r15
jl 0x1e405
movl $0xa, %edi
movq %r13, %rsi
callq 0x6930
movq 0x10(%rsp), %rax
movq 0x40(%rsp), %r15
subl %r15d, %eax
leal 0x1(%r15), %ecx
movq 0x18(%rsp), %rdx
cmpb $0x2d, 0x30(%rdx)
cmovel %eax, %ecx
movq %r13, %rdi
leaq 0x70e8f(%rip), %rsi     # 0x8f33a
movl (%rsp), %edx
xorl %eax, %eax
callq 0x6a90
movq 0x48(%rsp), %rax
cmpl %eax, 0x8(%rsp)
jle 0x1e53d
movslq %eax, %r13
movq 0x18(%rsp), %r14
movq 0x48(%r14), %rax
movq %r15, %r12
movsbl (%rax,%r13), %r15d
movl %r15d, %edi
movq 0x50(%rsp), %rsi
callq 0x6930
cmpl $0x2d, %r15d
movq %r12, %r15
movl 0x4(%rsp), %eax
movl $0x0, %ecx
cmovel %ecx, %eax
addl %eax, %r15d
incq %r13
cmpq %rbx, %r13
jl 0x1e4c8
jmp 0x1e542
movl $0xa, %edi
movq %r13, %rsi
callq 0x6930
movq 0x10(%rsp), %rax
movq 0x40(%rsp), %r15
subl %r15d, %eax
leal 0x1(%r15), %ecx
cmpb $0x2d, 0x30(%r14)
cmovel %eax, %ecx
movq %r13, %rdi
leaq 0x70e09(%rip), %rsi     # 0x8f33a
movl %r12d, %edx
xorl %eax, %eax
callq 0x6a90
jmp 0x1e542
movq 0x18(%rsp), %r14
movl 0x34(%rsp), %edx
subl %r15d, %edx
cmpb $0x2d, 0x30(%r14)
cmovnel %r15d, %edx
movq 0x50(%rsp), %r13
movq %r13, %rdi
leaq 0x70dc7(%rip), %rsi     # 0x8f328
xorl %eax, %eax
callq 0x6a90
movl $0xa, %edi
movq %r13, %rsi
callq 0x6930
movl 0x38(%r14), %r12d
movl 0x3c(%rsp), %eax
cmpl %r12d, %eax
movl (%rsp), %edx
movq 0x20(%rsp), %rcx
jl 0x1e33d
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq