// File: /workspace/github_c_makefile_star2_O1/nh13[P]ksw/src/parasail/src/io.c
// Function: parasail_stat_fasta_buffer
parasail_file_stat_t* parasail_stat_fasta_buffer(const char *T, off_t size)
{
    off_t i = 0;
    unsigned long seq = 0;
    unsigned long c = 0;
    unsigned long c_tot = 0;
    stats_t stats;
    parasail_file_stat_t *pfs = NULL;

    stats_clear(&stats);

    if (NULL == T) {
        fprintf(stderr, "parasail_stat_fasta_buffer: NULL pointer\n");
        return NULL;
    }

    /* first line is always first sequence ID */
    if (T[i] != '>') {
        fprintf(stderr, "parasail_stat_fasta_buffer: "
                "poorly formatted FASTA file\n");
        return NULL;
    }

    i = skip_line(T, i);
    ++i;

    /* count that first sequence */
    ++seq;

    /* read rest of file */
    while (i<size) {
        if (T[i] == '>') {
            /* encountered a new sequence */
            ++seq;
            stats_sample_value(&stats, c);
            c = 0;
            i = skip_line(T, i);
        }
        else if (isalpha(T[i])) {
            ++c;
            ++c_tot;
        }
        else if (T[i] == '\n' || T[i] == '\r') {
            /* ignore newline */
            /* for the case of "\r\n" or "\n\r" */
            if (i+1<size && (T[i+1] == '\n' || T[i+1] == '\r')) {
                ++i;
            }
        }
        else if (isprint(T[i])) {
            fprintf(stderr, "parasail_stat_fasta_buffer: "
                    "non-alpha character ('%c')\n", T[i]);
            return NULL;
        }
        else {
            fprintf(stderr, "parasail_stat_fasta_buffer: "
                    "non-printing character ('%d')\n", T[i]);
            return NULL;
        }
        ++i;
    }

    /* still should have one sequence in the pipe */
    if (0 == c) {
        fprintf(stderr, "parasail_stat_fasta_buffer: "
                "empty sequence at end of input\n");
        return NULL;
    }
    stats_sample_value(&stats, c);

    pfs = (parasail_file_stat_t*)malloc(sizeof(parasail_file_stat_t));
    if (NULL == pfs) {
        perror("malloc");
        fprintf(stderr, "parasail_stat_fasta_buffer: "
                "cannont allocate parasail_file_stat_t");
        return NULL;
    }

    pfs->sequences = seq;
    pfs->characters = c_tot;
    pfs->shortest = (unsigned long)stats._min;
    pfs->longest = (unsigned long)stats._max;
    pfs->mean = (float)stats._mean;
    pfs->stddev = (float)stats_stddev(&stats);

    return pfs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
testq %rdi, %rdi
je 0x25171e
movq %rdi, %r14
cmpb $0x3e, (%rdi)
jne 0x251725
movq %rsi, %r13
movl $0x1, %ebx
movzbl -0x1(%r14,%rbx), %eax
cmpl $0xa, %eax
je 0x25133b
cmpl $0xd, %eax
je 0x25133b
incq %rbx
jmp 0x251326
movzbl (%r14,%rbx), %eax
cmpl $0xa, %eax
je 0x25134d
cmpl $0xd, %eax
je 0x25134d
decq %rbx
leaq 0x1(%rbx), %rbp
cmpq %r13, %rbp
jge 0x25157d
xorpd %xmm2, %xmm2
movl $0x1, %edx
movq $0x0, 0x8(%rsp)
movq 0x393cac(%rip), %xmm5   # 0x5e5020
movapd 0x393cb4(%rip), %xmm6   # 0x5e5030
xorl %eax, %eax
xorpd %xmm4, %xmm4
xorpd %xmm8, %xmm8
xorpd %xmm9, %xmm9
xorl %r12d, %r12d
movsbq (%r14,%rbp), %r15
cmpq $0x3e, %r15
jne 0x251432
movq %rax, %xmm0
punpckldq %xmm5, %xmm0    # xmm0 = xmm0[0],xmm5[0],xmm0[1],xmm5[1]
subpd %xmm6, %xmm0
movapd %xmm0, %xmm7
unpckhpd %xmm0, %xmm7            # xmm7 = xmm7[1],xmm0[1]
addsd %xmm0, %xmm7
movapd %xmm7, %xmm0
movapd %xmm7, %xmm1
testq %r12, %r12
je 0x2513d4
minsd %xmm7, %xmm4
maxsd %xmm7, %xmm2
movapd %xmm4, %xmm0
movapd %xmm2, %xmm1
incq %rdx
incq %r12
movapd %xmm7, %xmm2
subsd %xmm9, %xmm2
movq %r12, %xmm3
punpckldq %xmm5, %xmm3    # xmm3 = xmm3[0],xmm5[0],xmm3[1],xmm5[1]
subpd %xmm6, %xmm3
movapd %xmm3, %xmm4
unpckhpd %xmm3, %xmm4            # xmm4 = xmm4[1],xmm3[1]
addsd %xmm3, %xmm4
movapd %xmm2, %xmm3
divsd %xmm4, %xmm3
addsd %xmm9, %xmm3
subsd %xmm3, %xmm7
mulsd %xmm2, %xmm7
addsd %xmm8, %xmm7
movzbl (%r14,%rbp), %eax
cmpl $0xa, %eax
je 0x2514db
cmpl $0xd, %eax
je 0x2514db
incq %rbp
jmp 0x251416
movsd %xmm4, 0x20(%rsp)
movsd %xmm9, 0x30(%rsp)
movsd %xmm2, 0x40(%rsp)
movsd %xmm8, 0x50(%rsp)
movq %rax, (%rsp)
movq %r12, 0x10(%rsp)
movq %rdx, %r12
callq 0x1f0190
movq (%rax), %rax
movzwl (%rax,%r15,2), %eax
btl $0xa, %eax
jb 0x2514f6
cmpb $0xd, %r15b
movsd 0x50(%rsp), %xmm7
movsd 0x40(%rsp), %xmm1
movsd 0x30(%rsp), %xmm3
movsd 0x20(%rsp), %xmm0
je 0x25149a
movzbl %r15b, %ecx
cmpl $0xa, %ecx
jne 0x25174c
addq $0x2, %rbx
cmpq %r13, %rbx
jge 0x251534
movzbl (%r14,%rbx), %eax
cmpl $0xd, %eax
movq %r12, %rdx
movq 0x393b66(%rip), %xmm5   # 0x5e5020
movapd 0x393b6e(%rip), %xmm6   # 0x5e5030
je 0x25154e
cmpl $0xa, %eax
movq 0x10(%rsp), %r12
jne 0x251556
movq %rbx, %rbp
jmp 0x251556
leaq 0x1(%rbp), %rax
movzbl 0x1(%r14,%rbp), %ecx
cmpl $0xa, %ecx
je 0x2514ef
cmpl $0xd, %ecx
jne 0x2514f2
movq %rax, %rbp
xorl %eax, %eax
jmp 0x25155a
movq (%rsp), %rax
incq %rax
incq 0x8(%rsp)
movsd 0x30(%rsp), %xmm3
movsd 0x50(%rsp), %xmm7
movsd 0x20(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
movq %r12, %rdx
movq 0x10(%rsp), %r12
movq 0x393af6(%rip), %xmm5   # 0x5e5020
movapd 0x393afe(%rip), %xmm6   # 0x5e5030
jmp 0x25155a
movq %r12, %rdx
movq 0x10(%rsp), %r12
movq 0x393adc(%rip), %xmm5   # 0x5e5020
movapd 0x393ae4(%rip), %xmm6   # 0x5e5030
jmp 0x251556
movq %rbx, %rbp
movq 0x10(%rsp), %r12
movq (%rsp), %rax
movq %rbp, %rbx
incq %rbp
movapd %xmm1, %xmm2
movapd %xmm0, %xmm4
movapd %xmm7, %xmm8
movapd %xmm3, %xmm9
cmpq %r13, %rbp
jl 0x25138f
jmp 0x2515a0
movl $0x1, %edx
xorpd %xmm3, %xmm3
xorl %r12d, %r12d
xorpd %xmm7, %xmm7
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
xorl %eax, %eax
movq $0x0, 0x8(%rsp)
testq %rax, %rax
je 0x25172c
movapd %xmm3, 0x40(%rsp)
movapd %xmm7, 0x50(%rsp)
movq %rdx, %r14
movq %rax, %xmm2
punpckldq 0x393a5b(%rip), %xmm2 # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x393a63(%rip), %xmm2   # 0x5e5030
movapd %xmm2, %xmm3
unpckhpd %xmm2, %xmm3            # xmm3 = xmm3[1],xmm2[1]
addsd %xmm2, %xmm3
movapd %xmm3, %xmm4
movapd %xmm3, %xmm2
testq %r12, %r12
je 0x2515f6
minsd %xmm3, %xmm0
maxsd %xmm3, %xmm1
movapd %xmm0, %xmm4
movapd %xmm1, %xmm2
movapd %xmm4, 0x10(%rsp)
movapd %xmm2, 0x20(%rsp)
movapd %xmm3, 0x30(%rsp)
movl $0x28, %edi
callq 0x1f01f0
testq %rax, %rax
je 0x251733
movq %rax, %rbx
movapd 0x30(%rsp), %xmm0
movapd %xmm0, %xmm3
movapd 0x40(%rsp), %xmm5
subsd %xmm5, %xmm3
leaq 0x1(%r12), %rax
movq %rax, %xmm2
movq 0x3939dc(%rip), %xmm6   # 0x5e5020
punpckldq %xmm6, %xmm2    # xmm2 = xmm2[0],xmm6[0],xmm2[1],xmm6[1]
movapd 0x3939e0(%rip), %xmm1   # 0x5e5030
subpd %xmm1, %xmm2
movapd %xmm2, %xmm4
unpckhpd %xmm2, %xmm4            # xmm4 = xmm4[1],xmm2[1]
addsd %xmm2, %xmm4
movapd %xmm3, %xmm2
divsd %xmm4, %xmm2
addsd %xmm5, %xmm2
subsd %xmm2, %xmm0
mulsd %xmm3, %xmm0
addsd 0x50(%rsp), %xmm0
movq %r14, (%rbx)
movq 0x8(%rsp), %rax
movq %rax, 0x8(%rbx)
movapd 0x10(%rsp), %xmm4
cvttsd2si %xmm4, %rax
movsd 0x3c83f7(%rip), %xmm3   # 0x619a90
subsd %xmm3, %xmm4
cvttsd2si %xmm4, %rcx
movq %rax, %rdx
sarq $0x3f, %rdx
andq %rcx, %rdx
orq %rax, %rdx
movq %rdx, 0x10(%rbx)
movapd 0x20(%rsp), %xmm4
cvttsd2si %xmm4, %rax
subsd %xmm3, %xmm4
cvttsd2si %xmm4, %rcx
movq %rax, %rdx
sarq $0x3f, %rdx
andq %rcx, %rdx
orq %rax, %rdx
cvtsd2ss %xmm2, %xmm2
movq %rdx, 0x18(%rbx)
movss %xmm2, 0x20(%rbx)
movq %r12, %xmm2
punpckldq %xmm6, %xmm2    # xmm2 = xmm2[0],xmm6[0],xmm2[1],xmm6[1]
subpd %xmm1, %xmm2
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x25170e
sqrtsd %xmm0, %xmm0
jmp 0x251713
callq 0x1f0120
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x24(%rbx)
jmp 0x25173a
callq 0x1f0882
jmp 0x251738
callq 0x1f0820
jmp 0x251738
callq 0x1f0866
jmp 0x251738
callq 0x1f083c
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
btl $0xe, %eax
movq 0x55b881(%rip), %rax    # 0x7acfd8
movq (%rax), %rdi
jb 0x251765
leaq 0x3c8690(%rip), %rsi    # 0x619df3
jmp 0x25176c
leaq 0x3c864f(%rip), %rsi    # 0x619dbb
xorl %ebx, %ebx
movl %r15d, %edx
xorl %eax, %eax
callq 0x1f0220
jmp 0x25173a