// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/misc/wgsim.c
// Function: seq_read_fasta
int seq_read_fasta(FILE *fp, seq_t *seq, char *locus, char *comment)
{
	int c, l, max;
	char *p;
	
	c = 0;
	while (!feof(fp) && fgetc(fp) != '>');
	if (feof(fp)) return -1;
	p = locus;
	while (!feof(fp) && (c = fgetc(fp)) != ' ' && c != '\t' && c != '\n')
		if (c != '\r') *p++ = c;
	*p = '\0';
	if (comment) {
		p = comment;
		if (c != '\n') {
			while (!feof(fp) && ((c = fgetc(fp)) == ' ' || c == '\t'));
			if (c != '\n') {
				*p++ = c;
				while (!feof(fp) && (c = fgetc(fp)) != '\n')
					if (c != '\r') *p++ = c;
			}
		}
		*p = '\0';
	} else if (c != '\n') while (!feof(fp) && fgetc(fp) != '\n');
	l = 0; max = seq->m;
	while (!feof(fp) && (c = fgetc(fp)) != '>') {
		if (isalpha(c) || c == '-' || c == '.') {
			if (l + 1 >= max) {
				max += SEQ_BLOCK_SIZE;
				seq->s = (unsigned char*)realloc(seq->s, sizeof(char) * max);
			}
			seq->s[l++] = (unsigned char)c;
		}
	}
	if (c == '>') ungetc(c,fp);
	seq->s[l] = 0;
	seq->m = max; seq->l = l;
	return l;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r14
movq %r14, %rdi
callq 0x1140
testl %eax, %eax
jne 0x2681
movq %r14, %rdi
callq 0x10e0
cmpl $0x3e, %eax
jne 0x2668
movq %r14, %rdi
callq 0x1140
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x2837
movq %r14, %rdi
callq 0x1140
xorl %r13d, %r13d
testl %eax, %eax
jne 0x26d5
movq %r14, %rdi
callq 0x10e0
movl %eax, %r13d
cmpl $0xd, %eax
je 0x26cb
leal -0x9(%r13), %eax
cmpl $0x2, %eax
jb 0x26d5
cmpl $0x20, %r13d
je 0x26d5
movb %r13b, (%r12)
incq %r12
movq %r14, %rdi
callq 0x1140
jmp 0x26a1
movb $0x0, (%r12)
movl $0xa, %r12d
testq %r15, %r15
je 0x2758
cmpl $0xa, %r13d
je 0x2752
movq %r14, %rdi
callq 0x1140
testl %eax, %eax
jne 0x270d
movq %r14, %rdi
callq 0x10e0
movl %eax, %r13d
cmpl $0x20, %eax
je 0x26eb
cmpl $0x9, %r13d
je 0x26eb
cmpl $0xa, %r13d
je 0x2752
movb %r13b, (%r15)
incq %r15
movq %r14, %rdi
callq 0x1140
testl %eax, %eax
je 0x272a
movl %r13d, %r12d
jmp 0x2752
movq %r14, %rdi
callq 0x10e0
movl %eax, %r12d
cmpl $0xd, %eax
je 0x2746
cmpl $0xa, %r12d
je 0x2752
movb %r12b, (%r15)
incq %r15
movq %r14, %rdi
callq 0x1140
testl %eax, %eax
je 0x272a
movb $0x0, (%r15)
jmp 0x277a
cmpl $0xa, %r13d
je 0x277a
movq %r14, %rdi
callq 0x1140
testl %eax, %eax
jne 0x2777
movq %r14, %rdi
callq 0x10e0
cmpl $0xa, %eax
jne 0x275e
movl %r13d, %r12d
movl 0x4(%rbx), %r15d
movq %r14, %rdi
callq 0x1140
xorl %ebp, %ebp
testl %eax, %eax
jne 0x2813
xorl %r13d, %r13d
movq %r14, %rdi
callq 0x10e0
cmpl $0x3e, %eax
je 0x280a
movl %eax, %r12d
callq 0x11e0
leal -0x2d(%r12), %ecx
cmpl $0x2, %ecx
jb 0x27c8
movq (%rax), %rax
movslq %r12d, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
jne 0x27c8
movl %r13d, %ebp
jmp 0x27f9
leal 0x1(%r13), %ebp
cmpl %r15d, %ebp
jl 0x27ee
movslq 0x3938(%rip), %rax      # 0x6110
movslq %r15d, %r15
addq %rax, %r15
movq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0x1180
movq %rax, 0x8(%rbx)
movq 0x8(%rbx), %rax
movslq %r13d, %rcx
movb %r12b, (%rax,%rcx)
movq %r14, %rdi
callq 0x1140
movl %ebp, %r13d
testl %eax, %eax
je 0x2793
jmp 0x2813
movl $0x3e, %r12d
movl %r13d, %ebp
cmpl $0x3e, %r12d
jne 0x2826
movl $0x3e, %edi
movq %r14, %rsi
callq 0x1170
movq 0x8(%rbx), %rax
movslq %ebp, %rcx
movb $0x0, (%rax,%rcx)
movl %r15d, 0x4(%rbx)
movl %ecx, (%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq