// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/maf.c
// Function: mafWriteDelimiter
void mafWriteDelimiter(FILE *f, struct mafAli *ali, char delimiter)
/* Write next alignment to file. */
{
struct mafComp *comp;
int srcChars = 0, startChars = 0, sizeChars = 0, srcSizeChars = 0;

/* Write out alignment header */
fprintf(f, "a score=%f%c", ali->score, delimiter);

/* include region definition */
if (ali->regDef != NULL)
    fprintf(f, "r %s %d %s%c", ali->regDef->type, ali->regDef->size, ali->regDef->id, delimiter);

/* Figure out length of each field. */
for (comp = ali->components; comp != NULL; comp = comp->next)
    {
    int len = 0;
    /* a name like '.' will break some tools, so replace it
    * with a generic name */
    if (sameString(comp->src,"."))
	comp->src=cloneString("defaultName");
    len = strlen(comp->src);
    if (srcChars < len)
        srcChars = len;
    len = digitsBaseTen(comp->start);
    if (startChars < len)
        startChars = len;
    len = digitsBaseTen(comp->size);
    if (sizeChars < len)
        sizeChars = len;
    len = digitsBaseTen(comp->srcSize);
    if (srcSizeChars < len)
        srcSizeChars = len;
    }

/* Write out each component. */
for (comp = ali->components; comp != NULL; comp = comp->next)
    {
    if ((comp->size == 0) && (comp->leftStatus))
	fprintf(f, "e %-*s %*d %*d %c %*d %c%c", 
	    srcChars, comp->src, startChars, comp->start, 
	    sizeChars, comp->leftLen, comp->strand, 
	    srcSizeChars, comp->srcSize, comp->leftStatus, delimiter);
    else
	{
	fprintf(f, "s %-*s %*d %*d %c %*d %s%c", 
	    srcChars, comp->src, startChars, comp->start, 
	    sizeChars, comp->size, comp->strand, 
	    srcSizeChars, comp->srcSize, comp->text, delimiter);

	if (comp->quality)
		fprintf(f, "q %-*s %s%c",
		srcChars + startChars + sizeChars + srcSizeChars + 5,
		comp->src, comp->quality, delimiter);

	if (comp->leftStatus)
	    fprintf(f,"i %-*s %c %d %c %d%c",srcChars,comp->src,
		comp->leftStatus,comp->leftLen,comp->rightStatus,comp->rightLen, delimiter);
	}

    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
movsd 0x8(%rsi), %xmm0
leaq 0x64bf7(%rip), %rsi     # 0x91922
movb $0x1, %al
callq 0x6a90
movq 0x20(%r15), %rax
testq %rax, %rax
je 0x2cd59
movq (%rax), %rdx
movl 0x8(%rax), %ecx
movq 0x10(%rax), %r8
leaq 0x64be3(%rip), %rsi     # 0x9192f
movq %r14, %rdi
movl %ebx, %r9d
xorl %eax, %eax
callq 0x6a90
movq %r14, 0x10(%rsp)
movq %rbx, 0x18(%rsp)
movq 0x10(%r15), %rbx
testq %rbx, %rbx
je 0x2cf53
movq %r15, 0x30(%rsp)
xorl %ebp, %ebp
xorl %r13d, %r13d
xorl %r12d, %r12d
xorl %r15d, %r15d
movl %r15d, %r14d
movl %r12d, 0x2c(%rsp)
movl %r13d, 0x20(%rsp)
movl %ebp, 0xc(%rsp)
movq 0x8(%rbx), %rdi
cmpb $0x2e, (%rdi)
jne 0x2cdb3
cmpb $0x0, 0x1(%rdi)
jne 0x2cdb3
leaq 0x64b95(%rip), %rdi     # 0x9193c
callq 0x1feba
movq %rax, %rdi
movq %rax, 0x8(%rbx)
callq 0x62d0
movq %rax, %r15
cmpl %r15d, %r14d
cmovgl %r14d, %r15d
movl 0x18(%rbx), %edi
callq 0x3279c
movl %eax, %r12d
movl 0x2c(%rsp), %eax
cmpl %r12d, %eax
cmovgl %eax, %r12d
movl 0x1c(%rbx), %edi
callq 0x3279c
movl %eax, %r13d
movl 0x20(%rsp), %eax
cmpl %r13d, %eax
cmovgl %eax, %r13d
movl 0x10(%rbx), %edi
callq 0x3279c
movl %eax, %ebp
movl 0xc(%rsp), %eax
cmpl %ebp, %eax
cmovgl %eax, %ebp
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x2cd80
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rbx
testq %rbx, %rbx
je 0x2cf53
leal (%r15,%r12), %eax
addl %r13d, %eax
addl %ebp, %eax
addl $0x5, %eax
movl %eax, 0xc(%rsp)
movl 0x1c(%rbx), %r10d
testl %r10d, %r10d
je 0x2ceee
movq 0x8(%rbx), %rcx
movl 0x18(%rbx), %r9d
movsbl 0x14(%rbx), %r11d
movl 0x10(%rbx), %r14d
subq $0x8, %rsp
movq 0x18(%rsp), %rdi
leaq 0x64b06(%rip), %rsi     # 0x91963
movl %r15d, %edx
movl %r12d, %r8d
xorl %eax, %eax
pushq 0x20(%rsp)
pushq 0x20(%rbx)
pushq %r14
pushq %rbp
pushq %r11
pushq %r10
pushq %r13
callq 0x6a90
addq $0x40, %rsp
movq 0x28(%rbx), %r8
testq %r8, %r8
je 0x2cea7
movq 0x8(%rbx), %rcx
movq 0x10(%rsp), %rdi
leaq 0x64ae7(%rip), %rsi     # 0x9197e
movl 0xc(%rsp), %edx
movq 0x18(%rsp), %r9
xorl %eax, %eax
callq 0x6a90
movsbl 0x30(%rbx), %r8d
testl %r8d, %r8d
je 0x2cf47
movq 0x8(%rbx), %rcx
movl 0x34(%rbx), %r9d
movsbl 0x38(%rbx), %r10d
movl 0x3c(%rbx), %r11d
subq $0x8, %rsp
movq 0x18(%rsp), %rdi
leaq 0x64ab4(%rip), %rsi     # 0x9198a
movl %r15d, %edx
xorl %eax, %eax
pushq 0x20(%rsp)
pushq %r11
pushq %r10
callq 0x6a90
addq $0x20, %rsp
jmp 0x2cf47
movsbl 0x30(%rbx), %r11d
testl %r11d, %r11d
je 0x2ce3c
movq 0x8(%rbx), %rcx
movl 0x18(%rbx), %r9d
movl 0x34(%rbx), %eax
movq %rax, 0x20(%rsp)
movsbl 0x14(%rbx), %r14d
movl 0x10(%rbx), %r10d
subq $0x8, %rsp
movq 0x18(%rsp), %rdi
leaq 0x64a23(%rip), %rsi     # 0x91948
movl %r15d, %edx
movl %r12d, %r8d
xorl %eax, %eax
pushq 0x20(%rsp)
pushq %r11
pushq %r10
pushq %rbp
pushq %r14
pushq 0x50(%rsp)
pushq %r13
callq 0x6a90
addq $0x40, %rsp
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x2ce2f
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq