// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/lib/psl.c
// Function: pslOutFormat
void pslOutFormat(struct psl *el, FILE *f, char sep, char lastSep) 
/* Print out selected psl values.  Separate fields with sep. Follow last field with lastSep. */
/* Prints out a better format with bold field headings followed by value */
/* Requires further upstream work to ensure that only the field headers */
/* declared here are printed if replacing an existing psl print function*/
{
const char *headers[] = {"Matches", "Mismatches", "Matches in repeats", "Number of N bases", "Query name", "Size", "Start", "End", "Chromosome", "Strand", "Start", "End"};
char *hformat = "<B>%s:</B> "; /* string for formatted print for headers */
char *uformat = "<B>%s:</B> %u%c"; /* string for formatted print for unsigned variable */
char *targName;

fprintf(f, uformat, headers[0], el->match, sep);
fprintf(f, uformat, headers[1], el->misMatch, sep);
fprintf(f, uformat, headers[2], el->repMatch, sep);
fprintf(f, uformat, headers[3], el->nCount, sep);

fprintf(f, hformat, headers[4]);
if (sep == ',') fputc('"',f);
fprintf(f, "%s", el->qName);
if (sep == ',') fputc('"',f);
fputc(sep,f);

fprintf(f, uformat, headers[5], el->qSize, sep);
fprintf(f, uformat, headers[6], el->qStart, sep);
fprintf(f, uformat, headers[7], el->qEnd, sep);

fprintf(f, hformat, headers[8]);
if (sep == ',') fputc('"',f);
/* skip leading 'chr' in string to get only chromosome part */
targName = el->tName;
if (startsWith("chr", el->tName))
   targName += 3;
fprintf(f, "%s", targName);

if (sep == ',') fputc('"',f);
fputc(sep,f);

fprintf(f, hformat, headers[9]);
if (sep == ',') fputc('"',f);
fprintf(f, "%s", el->strand);
if (sep == ',') fputc('"',f);
fputc(sep,f);

fprintf(f, uformat, headers[10], el->tStart, sep);
fprintf(f, uformat, headers[11], el->tEnd, sep);

fputc(lastSep,f);

if (ferror(f))
    {
    perror("Error writing psl file\n");
    errAbort("\n");
    }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, %rbx
movq %rdi, %r15
movl 0x8(%rdi), %ecx
leaq 0x515a0(%rip), %r12     # 0x82e05
leaq 0x51538(%rip), %rdx     # 0x82da4
movq %rsi, %rdi
movq %r12, %rsi
movl %r14d, %r8d
xorl %eax, %eax
callq 0x6a90
movl 0xc(%r15), %ecx
leaq 0x51525(%rip), %rdx     # 0x82dac
movq %rbx, %rdi
movq %r12, %rsi
movl %r14d, %r8d
xorl %eax, %eax
callq 0x6a90
movl 0x10(%r15), %ecx
leaq 0x51515(%rip), %rdx     # 0x82db7
movq %rbx, %rdi
movq %r12, %rsi
movl %r14d, %r8d
xorl %eax, %eax
callq 0x6a90
movl 0x14(%r15), %ecx
leaq 0x5150d(%rip), %rdx     # 0x82dca
movq %rbx, %rdi
movq %r12, %rsi
movl %r14d, %r8d
xorl %eax, %eax
callq 0x6a90
leaq 0x51525(%rip), %rsi     # 0x82df9
leaq 0x51501(%rip), %rdx     # 0x82ddc
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6a90
cmpb $0x2c, %r14b
jne 0x31913
pushq $0x22
popq %r12
movl %r12d, %edi
movq %rbx, %rsi
callq 0x6930
movq 0x30(%r15), %rdi
movq %rbx, %rsi
callq 0x6810
movl %r12d, %edi
movq %rbx, %rsi
callq 0x6930
jmp 0x3191f
movq 0x30(%r15), %rdi
movq %rbx, %rsi
callq 0x6810
movl %r14d, %edi
movq %rbx, %rsi
callq 0x6930
movl 0x38(%r15), %ecx
leaq 0x514d0(%rip), %r12     # 0x82e05
leaq 0x4aaaa(%rip), %rdx     # 0x7c3e6
movq %rbx, %rdi
movq %r12, %rsi
movl %r14d, %r8d
xorl %eax, %eax
callq 0x6a90
movl 0x3c(%r15), %ecx
leaq 0x4f376(%rip), %rdx     # 0x80ccd
movq %rbx, %rdi
movq %r12, %rsi
movl %r14d, %r8d
xorl %eax, %eax
callq 0x6a90
movl 0x40(%r15), %ecx
leaq 0x4af2b(%rip), %rdx     # 0x7c89d
movq %rbx, %rdi
movq %r12, %rsi
movl %r14d, %r8d
xorl %eax, %eax
callq 0x6a90
leaq 0x51470(%rip), %rsi     # 0x82df9
leaq 0x51457(%rip), %rdx     # 0x82de7
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6a90
cmpb $0x2c, %r14b
jne 0x31a13
pushq $0x22
popq %r12
movl %r12d, %edi
movq %rbx, %rsi
callq 0x6930
movq 0x48(%r15), %r13
leaq 0x4e584(%rip), %rdi     # 0x7ff3e
movq %r13, %rsi
callq 0x1db41
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
leaq (%rcx,%rcx,2), %rdi
addq %r13, %rdi
movq %rbx, %rsi
callq 0x6810
movl %r12d, %edi
movq %rbx, %rsi
callq 0x6930
movl %r14d, %edi
movq %rbx, %rsi
callq 0x6930
leaq 0x51404(%rip), %rsi     # 0x82df9
leaq 0x513f6(%rip), %rdx     # 0x82df2
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6a90
movl %r12d, %edi
movq %rbx, %rsi
callq 0x6930
jmp 0x31a5f
movq 0x48(%r15), %r12
leaq 0x4e520(%rip), %rdi     # 0x7ff3e
movq %r12, %rsi
callq 0x1db41
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
leaq (%rcx,%rcx,2), %rdi
addq %r12, %rdi
movq %rbx, %rsi
callq 0x6810
movl %r14d, %edi
movq %rbx, %rsi
callq 0x6930
leaq 0x513ab(%rip), %rsi     # 0x82df9
leaq 0x5139d(%rip), %rdx     # 0x82df2
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6a90
leaq 0x28(%r15), %rdi
movq %rbx, %rsi
callq 0x6810
cmpb $0x2c, %r14b
jne 0x31a7c
pushq $0x22
popq %rdi
movq %rbx, %rsi
callq 0x6930
movl %r14d, %edi
movq %rbx, %rsi
callq 0x6930
movl 0x54(%r15), %ecx
leaq 0x51373(%rip), %r12     # 0x82e05
leaq 0x4f234(%rip), %rdx     # 0x80ccd
movq %rbx, %rdi
movq %r12, %rsi
movl %r14d, %r8d
xorl %eax, %eax
callq 0x6a90
movl 0x58(%r15), %ecx
leaq 0x4ade9(%rip), %rdx     # 0x7c89d
movq %rbx, %rdi
movq %r12, %rsi
movl %r14d, %r8d
xorl %eax, %eax
callq 0x6a90
movsbl %bpl, %edi
movq %rbx, %rsi
callq 0x6930
movq %rbx, %rdi
callq 0x6e00
testl %eax, %eax
jne 0x31aeb
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5129a(%rip), %rdi     # 0x82d8c
callq 0x6590
leaq 0x4c693(%rip), %rdi     # 0x7e191
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x223fb