// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/psl.c
// Function: pslxFileOpenWithMetaConfig
static void pslxFileOpenWithMetaConfig(char *fileName, bool isMetaUnique, enum gfType *retQueryType, enum gfType *retTargetType, struct lineFile **retLf, FILE *f)
/* Read header part of psl and make sure it's right.  Return
 * sequence types and file handle and send meta data to output file f */
{
char *line;
int lineSize;
char *words[30];
char *version;
int wordCount;
int i;
enum gfType qt = gftRna,  tt = gftDna;
struct lineFile *lf = lineFileOpen(fileName, TRUE);

lineFileSetMetaDataOutput(lf, f);
if (isMetaUnique)
    lineFileSetUniqueMetaData(lf);
if (!lineFileNext(lf, &line, &lineSize))
    warn("%s is empty", fileName);
else
    {
    if (startsWith("psLayout version", line))
	{
	wordCount = chopLine(line, words);
	if (wordCount < 3)
	    errAbort("%s is not a psLayout file", fileName);
	version = words[2];
	if (sameString(version, "3"))
	    {
	    }
	else if (sameString(version, "4"))
	    {
	    qt = gfTypeFromName(words[3]);
	    tt = gfTypeFromName(words[4]);
	    }
	else
	    {
	    errAbort("%s is version %s of psLayout, this program can only handle through version 4",
		fileName,  version);
	    }
	for (i=0; i<4; ++i)
	    {
	    if (!lineFileNext(lf, &line, &lineSize))
		errAbort("%s severely truncated", fileName);
	    }
	}
    else
        {
	char *s = cloneString(line);
        boolean eof = FALSE;
        while ((line[0] == '#') && (!eof))
            {
            freeMem(s);
            if (!lineFileNext(lf, &line, &lineSize))
                eof = TRUE;
            s = cloneString(line);
            }
	wordCount = chopLine(s, words);
	if ((wordCount < 21 || wordCount > 23 || (words[8][0] != '+' && words[8][0] != '-')) && (!eof))
	    errAbort("%s is not a psLayout file", fileName);
	else
	    lineFileReuse(lf); 
	freeMem(s);
	}
    }
*retQueryType = qt;
*retTargetType = tt;
*retLf = lf;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %r9, %rbx
movq %r8, %r15
movq %rcx, %r14
movq %rdx, %r13
movl %esi, %ebp
movq %rdi, 0x18(%rsp)
movl $0x1, %esi
callq 0x2a1fc
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
callq 0x29bce
testb %bpl, %bpl
je 0x378bc
movq %r12, %rdi
callq 0x29c05
leaq 0x8(%rsp), %rsi
leaq 0x24(%rsp), %rdx
movq %r12, %rdi
callq 0x2a455
testl %eax, %eax
je 0x37982
movq 0x8(%rsp), %rsi
leaq 0x5c59d(%rip), %rdi     # 0x93e7f
callq 0x217c8
movq 0x8(%rsp), %rdi
testl %eax, %eax
movq %r15, 0x28(%rsp)
movq %r14, 0x38(%rsp)
movq %r13, 0x30(%rsp)
je 0x3799c
leaq 0x40(%rsp), %rsi
movl $0x1e, %edx
callq 0x223ad
cmpl $0x2, %eax
jg 0x3792a
leaq 0x5c572(%rip), %rdi     # 0x93e90
movq 0x18(%rsp), %rsi
xorl %eax, %eax
callq 0x26b6f
movq 0x50(%rsp), %r14
leaq 0x61c7b(%rip), %rsi     # 0x995b1
movq %r14, %rdi
callq 0x6a50
testl %eax, %eax
je 0x379fb
leaq 0x5cfa3(%rip), %rsi     # 0x948f0
movq %r14, %rdi
callq 0x6a50
testl %eax, %eax
je 0x37a63
movl $0x1, 0x14(%rsp)
leaq 0x5c53e(%rip), %rdi     # 0x93eaa
xorl %ebx, %ebx
movq 0x18(%rsp), %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x26b6f
jmp 0x37a7d
leaq 0x5c4ea(%rip), %rdi     # 0x93e73
xorl %ebx, %ebx
movq 0x18(%rsp), %rsi
xorl %eax, %eax
callq 0x268ca
jmp 0x37aec
callq 0x1f9f6
movq %rax, %rbp
movq 0x8(%rsp), %rax
xorl %r15d, %r15d
cmpb $0x23, (%rax)
jne 0x37a07
leaq 0x24(%rsp), %r14
movl $0x1, %r13d
movq %rbp, %rdi
callq 0x2dd41
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
movq %r14, %rdx
callq 0x2a455
testl %eax, %eax
cmovel %r13d, %r15d
movq 0x8(%rsp), %rdi
callq 0x1f9f6
movq %rax, %rbp
testl %r15d, %r15d
setne %bl
jne 0x37a09
movq 0x8(%rsp), %rax
cmpb $0x23, (%rax)
je 0x379bc
jmp 0x37a09
movl $0x1, 0x14(%rsp)
xorl %ebx, %ebx
jmp 0x37a7d
xorl %ebx, %ebx
leaq 0x40(%rsp), %rsi
movq %rbp, %rdi
movl $0x1e, %edx
callq 0x223ad
addl $-0x18, %eax
cmpl $-0x3, %eax
movq 0x38(%rsp), %r14
movq 0x30(%rsp), %r13
jae 0x37a3b
testb %bl, %bl
movq 0x28(%rsp), %r15
jne 0x37a59
jmp 0x37acf
testb %bl, %bl
movq 0x28(%rsp), %r15
jne 0x37a59
movq 0x80(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x2b, %eax
je 0x37a59
cmpl $0x2d, %eax
jne 0x37acf
movq %r12, %rdi
callq 0x2a331
jmp 0x37ae2
movq 0x58(%rsp), %rdi
callq 0x19881
movl %eax, 0x14(%rsp)
movq 0x60(%rsp), %rdi
callq 0x19881
movl %eax, %ebx
movl $0x4, %r13d
leaq 0x8(%rsp), %r14
leaq 0x24(%rsp), %r15
leaq 0x5c463(%rip), %rbp     # 0x93ef7
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2a455
testl %eax, %eax
jne 0x37ab5
movq %rbp, %rdi
movq 0x18(%rsp), %rsi
xorl %eax, %eax
callq 0x26b6f
decl %r13d
jne 0x37a94
movq 0x28(%rsp), %r15
movq 0x38(%rsp), %r14
movq 0x30(%rsp), %r13
movl 0x14(%rsp), %eax
jmp 0x37af1
leaq 0x5c3ba(%rip), %rdi     # 0x93e90
movq 0x18(%rsp), %rsi
xorl %eax, %eax
callq 0x26b6f
movq %rbp, %rdi
callq 0x2dd41
xorl %ebx, %ebx
movl $0x1, %eax
movl %eax, (%r13)
movl %ebx, (%r14)
movq %r12, (%r15)
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq