// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/lib/twoBit.c
// Function: twoBitOutNBeds
void twoBitOutNBeds(struct twoBitFile *tbf, char *seqName, FILE *outF)
/* output a series of bed3's that enumerate the number of N's in a sequence*/
{
int nBlockCount;

twoBitSeekTo(tbf, seqName);

(*tbf->ourReadBits32)(tbf->f, tbf->isSwapped);

/* Read in blocks of N. */
nBlockCount = (*tbf->ourReadBits32)(tbf->f, tbf->isSwapped);

if (nBlockCount > 0)
    {
    bits32 *nStarts = NULL, *nSizes = NULL;
    int i;

    AllocArray(nStarts, nBlockCount);
    AllocArray(nSizes, nBlockCount);
    (*tbf->ourMustRead)(tbf->f, nStarts, sizeof(nStarts[0]) * nBlockCount);
    (*tbf->ourMustRead)(tbf->f, nSizes, sizeof(nSizes[0]) * nBlockCount);
    if (tbf->isSwapped)
	{
	for (i=0; i<nBlockCount; ++i)
	    {
	    nStarts[i] = byteSwap32(nStarts[i]);
	    nSizes[i] = byteSwap32(nSizes[i]);
	    }
	}

    for (i=0; i<nBlockCount; ++i)
	{
	fprintf(outF, "%s\t%d\t%d\n", seqName, nStarts[i], nStarts[i] + nSizes[i]);
	}

    freez(&nStarts);
    freez(&nSizes);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x5a4e0
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rdi
movq -0x8(%rbp), %rcx
movl 0x18(%rcx), %esi
callq *%rax
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rdi
movq -0x8(%rbp), %rcx
movl 0x18(%rcx), %esi
callq *%rax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jle 0x5b189
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movslq -0x1c(%rbp), %rdi
shlq $0x2, %rdi
callq 0x409d0
movq %rax, -0x28(%rbp)
movslq -0x1c(%rbp), %rdi
shlq $0x2, %rdi
callq 0x409d0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x88(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rdi
movq -0x28(%rbp), %rsi
movslq -0x1c(%rbp), %rdx
shlq $0x2, %rdx
callq *%rax
movq -0x8(%rbp), %rax
movq 0x88(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rdi
movq -0x30(%rbp), %rsi
movslq -0x1c(%rbp), %rdx
shlq $0x2, %rdx
callq *%rax
movq -0x8(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x5b124
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x5b122
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %edi
callq 0x30770
movl %eax, %edx
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %edi
callq 0x30770
movl %eax, %edx
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x5b0d5
jmp 0x5b124
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x5b177
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rsi
movl (%rax,%rsi,4), %r8d
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rsi
addl (%rax,%rsi,4), %r8d
leaq 0x83685(%rip), %rsi     # 0xde7ea
movb $0x0, %al
callq 0x6a80
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x5b12b
leaq -0x28(%rbp), %rdi
callq 0x40d70
leaq -0x30(%rbp), %rdi
callq 0x40d70
addq $0x40, %rsp
popq %rbp
retq
nop