// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/lib/blastOut.c
// Function: wuBlastOut
static void wuBlastOut(struct axtBundle *abList, int queryIx, boolean isProt, 
	FILE *f, 
	char *databaseName, int databaseSeqCount, double databaseLetterCount, 
	char *ourId)
/* Do wublast-like output at end of processing query. */
{
char asciiNum[32];
struct targetHits *targetList = NULL, *target;
char *queryName;
int isRc;
int querySize = abList->qSize;
boolean isTranslated = (abList->axtList->frame != 0);

/* Print out stuff that doesn't depend on query or database. */
if (ourId == NULL)
    ourId = "axtBlastOut";
fprintf(f, "%s 2.0MP-WashU [%s]\n", progType(isProt, abList, TRUE), ourId);
fprintf(f, "\n");
fprintf(f, "Copyright (C) 2000-2002 Jim Kent\n");
fprintf(f, "All Rights Reserved\n");
fprintf(f, "\n");
fprintf(f, "Reference:  Kent, WJ. (2002) BLAT - The BLAST-like alignment tool\n");
fprintf(f, "\n");
if (!isProt)
    {
    fprintf(f, "Notice:  this program and its default parameter settings are optimized to find\n");
    fprintf(f, "nearly identical sequences very rapidly.  For slower but more sensitive\n");
    fprintf(f, "alignments please use other methods.\n");
    fprintf(f, "\n");
    }

/* Print query and database info. */
queryName = abList->axtList->qName;
fprintf(f, "Query=  %s\n", queryName);
fprintf(f, "        (%d letters; record %d)\n", abList->qSize, queryIx);
fprintf(f, "\n");
fprintf(f, "Database:  %s\n",  databaseName);
sprintLongWithCommas(asciiNum, databaseLetterCount);
fprintf(f, "           %d sequences; %s total letters\n",  databaseSeqCount, asciiNum);
fprintf(f, "Searching....10....20....30....40....50....60....70....80....90....100%% done\n");
fprintf(f, "\n");

targetList = bundleIntoTargets(abList);

/* Print out summary of hits. */
fprintf(f, "                                                                     Smallest\n");
fprintf(f, "                                                                       Sum\n");
fprintf(f, "                                                              High  Probability\n");
fprintf(f, "Sequences producing High-scoring Segment Pairs:              Score  P(N)      N\n");
fprintf(f, "\n");
for (target = targetList; target != NULL; target = target->next)
    {
    double expectation = blastzScoreToWuExpectation(target->score, databaseLetterCount);
    double p = expectationToProbability(expectation);
    fprintf(f, "%-61s %4d  %8.1e %2d\n", target->name, 
    	blastzToWublastScore(target->score), p, slCount(target->axtList));
    }

/* Print out details on each target. */
for (target = targetList; target != NULL; target = target->next)
    {
    fprintf(f, "\n\n>%s\n", target->name);
    fprintf(f, "        Length = %d\n", target->size);
    fprintf(f, "\n");
    for (isRc=0; isRc <= 1; ++isRc)
	{
	boolean saidStrand = FALSE;
	char strand = (isRc ? '-' : '+');
	char *strandName = nameForStrand(strand);
	struct axtRef *ref;
	struct axt *axt;
	for (ref = target->axtList; ref != NULL; ref = ref->next)
	    {
	    axt = ref->axt;
	    if (axt->qStrand == strand)
		{
		int matches = countMatches(axt->qSym, axt->tSym, axt->symCount);
		int positives = countPositives(axt->qSym, axt->tSym, axt->symCount);
		if (!saidStrand)
		    {
		    saidStrand = TRUE;
		    if (!isProt)
			fprintf(f, "  %s Strand HSPs:\n\n", strandName);
		    }
		fprintf(f, " Score = %d (%2.1f bits), Expect = %5.1e, P = %5.1e\n",
		     blastzToWublastScore(axt->score), 
		     blastzScoreToWuBits(axt->score, isProt),
		     blastzScoreToWuExpectation(axt->score, databaseLetterCount),
		     blastzScoreToWuExpectation(axt->score, databaseLetterCount));
		fprintf(f, " Identities = %d/%d (%d%%), Positives = %d/%d (%d%%)",
		     matches, axt->symCount, round(100.0 * matches / axt->symCount),
		     positives, axt->symCount, round(100.0 * positives / axt->symCount));
		if (isProt)
		    {
		    if (axt->frame != 0)
		        fprintf(f, ", Frame = %c%d", axt->tStrand, axt->frame);
		    fprintf(f, "\n");
		    }
		else
		    fprintf(f, ", Strand = %s / Plus\n", strandName);
		fprintf(f, "\n");
		blastiodAxtOutput(f, axt, target->size, querySize, 60, isProt, isTranslated);
		}
	    }
	}
    }

/* Cleanup time. */
targetHitsFreeList(&targetList);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
movsd %xmm0, -0x30(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0x70(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x0, 0x50(%rax)
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x74(%rbp)
cmpq $0x0, 0x10(%rbp)
jne 0x25765
leaq 0xb353c(%rip), %rax     # 0xd8c9d
movq %rax, 0x10(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xb8(%rbp)
movl -0x10(%rbp), %edi
movq -0x8(%rbp), %rsi
movl $0x1, %edx
callq 0x26f10
movq -0xb8(%rbp), %rdi
movq %rax, %rdx
movq 0x10(%rbp), %rcx
leaq 0xb3513(%rip), %rsi     # 0xd8ca9
movb $0x0, %al
callq 0x6a80
movq -0x18(%rbp), %rdi
leaq 0xb3871(%rip), %rsi     # 0xd9019
movb $0x0, %al
callq 0x6a80
movq -0x18(%rbp), %rdi
leaq 0xb3504(%rip), %rsi     # 0xd8cbe
movb $0x0, %al
callq 0x6a80
movq -0x18(%rbp), %rdi
leaq 0xb3514(%rip), %rsi     # 0xd8ce0
movb $0x0, %al
callq 0x6a80
movq -0x18(%rbp), %rdi
leaq 0xb383b(%rip), %rsi     # 0xd9019
movb $0x0, %al
callq 0x6a80
movq -0x18(%rbp), %rdi
leaq 0xb3505(%rip), %rsi     # 0xd8cf5
movb $0x0, %al
callq 0x6a80
movq -0x18(%rbp), %rdi
leaq 0xb3817(%rip), %rsi     # 0xd9019
movb $0x0, %al
callq 0x6a80
cmpl $0x0, -0x10(%rbp)
jne 0x25857
movq -0x18(%rbp), %rdi
leaq 0xb351e(%rip), %rsi     # 0xd8d38
movb $0x0, %al
callq 0x6a80
movq -0x18(%rbp), %rdi
leaq 0xb355c(%rip), %rsi     # 0xd8d88
movb $0x0, %al
callq 0x6a80
movq -0x18(%rbp), %rdi
leaq 0xb3593(%rip), %rsi     # 0xd8dd1
movb $0x0, %al
callq 0x6a80
movq -0x18(%rbp), %rdi
leaq 0xb37c9(%rip), %rsi     # 0xd9019
movb $0x0, %al
callq 0x6a80
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rdi
movq -0x68(%rbp), %rdx
leaq 0xb3581(%rip), %rsi     # 0xd8df7
movb $0x0, %al
callq 0x6a80
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x14(%rax), %edx
movl -0xc(%rbp), %ecx
leaq 0xb3571(%rip), %rsi     # 0xd8e03
movb $0x0, %al
callq 0x6a80
movq -0x18(%rbp), %rdi
leaq 0xb3775(%rip), %rsi     # 0xd9019
movb $0x0, %al
callq 0x6a80
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0xb356a(%rip), %rsi     # 0xd8e24
movb $0x0, %al
callq 0x6a80
leaq -0x50(%rbp), %rdi
cvttsd2si -0x30(%rbp), %rsi
callq 0x48710
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %edx
leaq -0x50(%rbp), %rcx
leaq 0xb3551(%rip), %rsi     # 0xd8e33
movb $0x0, %al
callq 0x6a80
movq -0x18(%rbp), %rdi
leaq 0xb356a(%rip), %rsi     # 0xd8e5e
movb $0x0, %al
callq 0x6a80
movq -0x18(%rbp), %rdi
leaq 0xb3713(%rip), %rsi     # 0xd9019
movb $0x0, %al
callq 0x6a80
movq -0x8(%rbp), %rdi
callq 0x26f90
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rdi
leaq 0xb3588(%rip), %rsi     # 0xd8ead
movb $0x0, %al
callq 0x6a80
movq -0x18(%rbp), %rdi
leaq 0xb35c5(%rip), %rsi     # 0xd8efc
movb $0x0, %al
callq 0x6a80
movq -0x18(%rbp), %rdi
leaq 0xb35ff(%rip), %rsi     # 0xd8f48
movb $0x0, %al
callq 0x6a80
movq -0x18(%rbp), %rdi
leaq 0xb363e(%rip), %rsi     # 0xd8f99
movb $0x0, %al
callq 0x6a80
movq -0x18(%rbp), %rdi
leaq 0xb36ac(%rip), %rsi     # 0xd9019
movb $0x0, %al
callq 0x6a80
movq -0x58(%rbp), %rax
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
je 0x25a35
movq -0x60(%rbp), %rax
movl 0x20(%rax), %edi
movsd -0x30(%rbp), %xmm0
callq 0x27120
movsd %xmm0, -0x80(%rbp)
movsd -0x80(%rbp), %xmm0
callq 0x271a0
movsd %xmm0, -0x88(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x60(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xd0(%rbp)
movq -0x60(%rbp), %rax
movl 0x20(%rax), %edi
callq 0x271e0
movl %eax, -0xc4(%rbp)
movsd -0x88(%rbp), %xmm0
movsd %xmm0, -0xc0(%rbp)
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x2a810
movq -0xd8(%rbp), %rdi
movq -0xd0(%rbp), %rdx
movl -0xc4(%rbp), %ecx
movsd -0xc0(%rbp), %xmm0
movl %eax, %r8d
leaq 0xb35cc(%rip), %rsi     # 0xd8fea
movb $0x1, %al
callq 0x6a80
movq -0x60(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0x2597c
movq -0x58(%rbp), %rax
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
je 0x25dc1
movq -0x18(%rbp), %rdi
movq -0x60(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0xb35a5(%rip), %rsi     # 0xd9000
movb $0x0, %al
callq 0x6a80
movq -0x18(%rbp), %rdi
movq -0x60(%rbp), %rax
movl 0x10(%rax), %edx
leaq 0xb3d9b(%rip), %rsi     # 0xd980f
movb $0x0, %al
callq 0x6a80
movq -0x18(%rbp), %rdi
leaq 0xb3593(%rip), %rsi     # 0xd9019
movb $0x0, %al
callq 0x6a80
movl $0x0, -0x6c(%rbp)
cmpl $0x1, -0x6c(%rbp)
jg 0x25daf
movl $0x0, -0x8c(%rbp)
movl -0x6c(%rbp), %edx
movl $0x2b, %eax
movl $0x2d, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movb %al, -0x8d(%rbp)
movsbl -0x8d(%rbp), %edi
callq 0x27200
movq %rax, -0x98(%rbp)
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0xa0(%rbp)
cmpq $0x0, -0xa0(%rbp)
je 0x25d9f
movq -0xa0(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movsbl 0x18(%rax), %eax
movsbl -0x8d(%rbp), %ecx
cmpl %ecx, %eax
jne 0x25d87
movq -0xa8(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0xa8(%rbp), %rax
movq 0x48(%rax), %rsi
movq -0xa8(%rbp), %rax
movl 0x38(%rax), %edx
callq 0x27240
movl %eax, -0xac(%rbp)
movq -0xa8(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0xa8(%rbp), %rax
movq 0x48(%rax), %rsi
movq -0xa8(%rbp), %rax
movl 0x38(%rax), %edx
callq 0x272c0
movl %eax, -0xb0(%rbp)
cmpl $0x0, -0x8c(%rbp)
jne 0x25ba7
movl $0x1, -0x8c(%rbp)
cmpl $0x0, -0x10(%rbp)
jne 0x25ba5
movq -0x18(%rbp), %rdi
movq -0x98(%rbp), %rdx
leaq 0xb3469(%rip), %rsi     # 0xd9007
movb $0x0, %al
callq 0x6a80
jmp 0x25ba7
movq -0x18(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0xa8(%rbp), %rax
movl 0x34(%rax), %edi
callq 0x271e0
movl %eax, -0xec(%rbp)
movq -0xa8(%rbp), %rax
movl 0x34(%rax), %edi
movl -0x10(%rbp), %esi
callq 0x27350
movsd %xmm0, -0xe0(%rbp)
movq -0xa8(%rbp), %rax
movl 0x34(%rax), %edi
movsd -0x30(%rbp), %xmm0
callq 0x27120
movsd %xmm0, -0xe8(%rbp)
movq -0xa8(%rbp), %rax
movl 0x34(%rax), %edi
movsd -0x30(%rbp), %xmm0
callq 0x27120
movq -0xf8(%rbp), %rdi
movl -0xec(%rbp), %edx
movsd -0xe8(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0xe0(%rbp), %xmm0
leaq 0xb33e3(%rip), %rsi     # 0xd901b
movb $0x3, %al
callq 0x6a80
movq -0x18(%rbp), %rdi
movl -0xac(%rbp), %edx
movq -0xa8(%rbp), %rax
movl 0x38(%rax), %ecx
cvtsi2sdl -0xac(%rbp), %xmm1
movsd 0xb24b5(%rip), %xmm0    # 0xd8118
mulsd %xmm1, %xmm0
movq -0xa8(%rbp), %rax
cvtsi2sdl 0x38(%rax), %xmm1
divsd %xmm1, %xmm0
movsd 0xb2fb9(%rip), %xmm1    # 0xd8c38
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %r8d
movl -0xb0(%rbp), %r9d
movq -0xa8(%rbp), %rax
movl 0x38(%rax), %r10d
cvtsi2sdl -0xb0(%rbp), %xmm1
movsd 0xb246e(%rip), %xmm0    # 0xd8118
mulsd %xmm1, %xmm0
movq -0xa8(%rbp), %rax
cvtsi2sdl 0x38(%rax), %xmm1
divsd %xmm1, %xmm0
movsd 0xb2f72(%rip), %xmm1    # 0xd8c38
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
leaq 0xb337b(%rip), %rsi     # 0xd9050
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x6a80
cmpl $0x0, -0x10(%rbp)
je 0x25d32
movq -0xa8(%rbp), %rax
cmpl $0x0, 0x50(%rax)
je 0x25d1e
movq -0x18(%rbp), %rdi
movq -0xa8(%rbp), %rax
movsbl 0x30(%rax), %edx
movq -0xa8(%rbp), %rax
movl 0x50(%rax), %ecx
leaq 0xb336e(%rip), %rsi     # 0xd9085
movb $0x0, %al
callq 0x6a80
movq -0x18(%rbp), %rdi
leaq 0xb32f0(%rip), %rsi     # 0xd9019
movb $0x0, %al
callq 0x6a80
jmp 0x25d4b
movq -0x18(%rbp), %rdi
movq -0x98(%rbp), %rdx
leaq 0xb3350(%rip), %rsi     # 0xd9094
movb $0x0, %al
callq 0x6a80
movq -0x18(%rbp), %rdi
leaq 0xb32c3(%rip), %rsi     # 0xd9019
movb $0x0, %al
callq 0x6a80
movq -0x18(%rbp), %rdi
movq -0xa8(%rbp), %rsi
movq -0x60(%rbp), %rax
movl 0x10(%rax), %edx
movl -0x70(%rbp), %ecx
movl -0x10(%rbp), %r9d
movl -0x74(%rbp), %eax
movl $0x3c, %r8d
movl %eax, (%rsp)
callq 0x273b0
jmp 0x25d89
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xa0(%rbp)
jmp 0x25ae3
jmp 0x25da1
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x25a94
jmp 0x25db1
movq -0x60(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0x25a3d
leaq -0x58(%rbp), %rdi
callq 0x276f0
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopw %cs:(%rax,%rax)