// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/uniprot.c
// Function: renderUniprotReport
void renderUniprotReport(int passType, int passPrimary, FILE * passStream, const char * passProxy) {
	UniprotList * globalLists;
	UniprotList uniprotLists[3];
	CURLBuffer tempBuffer;
    char commonHeader[] = "Count\tAbundance\tQuality (Avg)\tQuality (Max)";

	// Prepare data
	prepareUniprotReport(passType, passPrimary, uniprotLists, &tempBuffer, passProxy);

	// Report no data
	globalLists = getGlobalLists(passPrimary);
	if (globalLists[0].entryCount == 0) {
		fprintf(passStream, "No entries to report\n");
		return;
	}

	// Render requested report
	switch (passType) {
	case OUTPUT_TYPE_UNIPROT_SIMPLE:
		fprintf(passStream, "%s\tUniProtKB\n", commonHeader);
		renderUniprotEntries(uniprotLists + UNIPROT_LIST_FULL, UNIPROT_LIST_FULL, passStream);
		fprintf(passStream, "\n\n%s\tGene\n", commonHeader);
		renderUniprotEntries(uniprotLists + UNIPROT_LIST_GENES, UNIPROT_LIST_GENES, passStream);
		fprintf(passStream, "\n\n%s\tOrganism\n", commonHeader);
		renderUniprotEntries(uniprotLists + UNIPROT_LIST_ORGANISM, UNIPROT_LIST_ORGANISM, passStream);

		break;

	case OUTPUT_TYPE_UNIPROT_FULL:
		fprintf(passStream, "%s\tUniProtKB\tID\tOrganism\tProtein Names\tGenes\tPathway\tFeatures\tGene Ontology\tReviewed\tExistence\tComments\tCross Reference (KEGG)\tCross Reference (GeneID)\tCross Reference (PATRIC)\tCross Reference(EnsemblBacteria)\tTaxonomic ID\tLineage\n", commonHeader);
		renderUniprotEntries(uniprotLists + UNIPROT_LIST_FULL, UNIPROT_LIST_FULL, passStream);
		freeCURLBuffer(&tempBuffer);

		break;
	}

	cleanUniprotLists(uniprotLists, passPrimary);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x78, %rsp
movq %rcx, %r8
movq %rdx, %r14
movl %esi, %ebx
movl %edi, %ebp
movups 0x192a1(%rip), %xmm0    # 0x228fc
movups %xmm0, 0x5c(%rsp)
movaps 0x19289(%rip), %xmm0    # 0x228f0
movaps %xmm0, 0x50(%rsp)
movaps 0x1926d(%rip), %xmm0    # 0x228e0
movaps %xmm0, 0x40(%rsp)
movq %rsp, %rdx
leaq 0x30(%rsp), %rcx
callq 0x8e85
testl %ebx, %ebx
leaq 0x237d2(%rip), %rax     # 0x2ce60
leaq 0x237c3(%rip), %rcx     # 0x2ce58
cmoveq %rax, %rcx
movq (%rcx), %rax
cmpl $0x0, 0x8(%rax)
je 0x9727
cmpl $0x1, %ebp
je 0x973e
testl %ebp, %ebp
jne 0x976b
leaq 0x18cc0(%rip), %rsi     # 0x2237e
leaq 0x40(%rsp), %r15
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3500
movq %rsp, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x9780
leaq 0x18ca8(%rip), %rsi     # 0x2238c
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3500
leaq 0x10(%rsp), %rdi
pushq $0x1
popq %rsi
movq %r14, %rdx
callq 0x9780
leaq 0x18c8f(%rip), %rsi     # 0x22397
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3500
leaq 0x20(%rsp), %rdi
pushq $0x2
popq %rsi
movq %r14, %rdx
callq 0x9780
jmp 0x976b
leaq 0x18c3a(%rip), %rdi     # 0x22368
pushq $0x15
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x3790
jmp 0x9775
leaq 0x18c61(%rip), %rsi     # 0x223a6
leaq 0x40(%rsp), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0x3500
movq %rsp, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x9780
movq 0x30(%rsp), %rdi
callq 0x3390
movq %rsp, %rdi
movl %ebx, %esi
callq 0x9864
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq