// File: /workspace/github_c_makefile_star2_O2/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 $0x128, %rsp            # imm = 0x128
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, 0x18(%rsp)
movl %esi, %ebp
movq %rdi, %r13
pushq $0x1
popq %rsi
movl %esi, 0x10(%rsp)
callq 0x25467
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
callq 0x24e7b
testb %bpl, %bpl
je 0x32035
movq %r12, %rdi
callq 0x24ead
leaq 0x8(%rsp), %rsi
leaq 0x14(%rsp), %rdx
movq %r12, %rdi
callq 0x256a7
testl %eax, %eax
je 0x320c3
movq 0x8(%rsp), %rsi
leaq 0x50df8(%rip), %rdi     # 0x82e4f
callq 0x1db41
movq 0x8(%rsp), %rdi
testl %eax, %eax
movq %r14, 0x28(%rsp)
movq %r15, 0x20(%rsp)
je 0x320e3
leaq 0x30(%rsp), %rsi
pushq $0x1e
popq %rdx
callq 0x1e59b
cmpl $0x2, %eax
jg 0x32092
leaq 0x50dd8(%rip), %rdi     # 0x82e60
movq %r13, %rsi
xorl %eax, %eax
callq 0x223fb
movq 0x40(%rsp), %rdx
movzbl (%rdx), %eax
cmpl $0x34, %eax
je 0x3215c
cmpl $0x33, %eax
jne 0x32166
cmpb $0x0, 0x1(%rdx)
jne 0x32166
movl $0x0, 0x4(%rsp)
jmp 0x3217f
leaq 0x50d79(%rip), %rdi     # 0x82e43
xorl %ebx, %ebx
movq %r13, %rsi
xorl %eax, %eax
callq 0x22186
pushq $0x1
popq %rax
movq 0x18(%rsp), %r13
jmp 0x32241
xorl %r15d, %r15d
leaq 0x8(%rsp), %rbp
leaq 0x14(%rsp), %r14
callq 0x1c306
movq %rax, %rbx
testl %r15d, %r15d
jne 0x3212d
movq 0x8(%rsp), %rax
cmpb $0x23, (%rax)
jne 0x3212d
movq %rbx, %rdi
callq 0x28c2d
movq %r12, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x256a7
xorl %r15d, %r15d
testl %eax, %eax
sete %r15b
movq 0x8(%rsp), %rdi
jmp 0x320f0
leaq 0x30(%rsp), %rsi
pushq $0x1e
popq %rdx
movq %rbx, %rdi
callq 0x1e59b
addl $-0x18, %eax
cmpl $-0x3, %eax
jae 0x321d2
testl %r15d, %r15d
movq 0x28(%rsp), %r14
jne 0x321dc
jmp 0x32219
cmpb $0x0, 0x1(%rdx)
je 0x321e6
leaq 0x50d0d(%rip), %rdi     # 0x82e7a
movl $0x0, 0x4(%rsp)
movq %r13, %rsi
xorl %eax, %eax
callq 0x223fb
pushq $0x4
popq %rbx
leaq 0x8(%rsp), %r14
leaq 0x14(%rsp), %r15
leaq 0x50d34(%rip), %rbp     # 0x82ec7
subl $0x1, %ebx
jb 0x321b9
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x256a7
testl %eax, %eax
jne 0x32193
movq %rbp, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x223fb
jmp 0x32193
movq 0x28(%rsp), %r14
movq 0x20(%rsp), %r15
movq 0x18(%rsp), %r13
movl 0x10(%rsp), %eax
movl 0x4(%rsp), %ebx
jmp 0x32241
testl %r15d, %r15d
movq 0x28(%rsp), %r14
je 0x32207
movq %r12, %rdi
callq 0x25590
jmp 0x3222a
movq 0x48(%rsp), %rdi
callq 0x166a3
movl %eax, 0x10(%rsp)
movq 0x50(%rsp), %rdi
callq 0x166a3
movl %eax, 0x4(%rsp)
jmp 0x3217f
movq 0x70(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x2b, %eax
je 0x321dc
cmpl $0x2d, %eax
je 0x321dc
leaq 0x50c40(%rip), %rdi     # 0x82e60
movq %r13, %rsi
xorl %eax, %eax
callq 0x223fb
movq 0x20(%rsp), %r15
movq 0x18(%rsp), %r13
movq %rbx, %rdi
callq 0x28c2d
xorl %ebx, %ebx
pushq $0x1
popq %rax
movl %eax, (%r13)
movl %ebx, (%r15)
movq %r12, (%r14)
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq