// File: /workspace/github_c_makefile_star2_O3/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
movl $0x1, %esi
callq 0x2a550
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
callq 0x29f41
testb %bpl, %bpl
je 0x37bd2
movq %r12, %rdi
callq 0x29f78
movq %rsp, %rsi
leaq 0x14(%rsp), %rdx
movq %r12, %rdi
callq 0x2a7a9
testl %eax, %eax
je 0x37c62
movq (%rsp), %rsi
leaq 0x5c35e(%rip), %rdi     # 0x93f4f
callq 0x21b23
movq (%rsp), %rdi
testl %eax, %eax
je 0x37c84
leaq 0x30(%rsp), %rsi
movl $0x1e, %edx
callq 0x226f5
cmpl $0x2, %eax
jg 0x37c27
leaq 0x5c343(%rip), %rdi     # 0x93f60
movq %r13, %rsi
xorl %eax, %eax
callq 0x26e94
movq 0x40(%rsp), %rdx
movzbl (%rdx), %eax
cmpl $0x34, %eax
movq %r14, 0x28(%rsp)
movq %r15, 0x20(%rsp)
je 0x37d11
cmpl $0x33, %eax
jne 0x37d1b
cmpb $0x0, 0x1(%rdx)
jne 0x37d1b
movl $0x0, 0x10(%rsp)
jmp 0x37d34
leaq 0x5c2da(%rip), %rdi     # 0x93f43
xorl %ebp, %ebp
movq %r13, %rsi
xorl %eax, %eax
callq 0x26bea
movl $0x1, %eax
movq 0x18(%rsp), %rbx
jmp 0x37ded
callq 0x1feba
movq %rax, %rbp
movq (%rsp), %rax
cmpb $0x23, (%rax)
jne 0x37d8c
movq %r15, 0x20(%rsp)
movq %r14, 0x28(%rsp)
movq %rsp, %r14
leaq 0x14(%rsp), %r15
movq %rbp, %rdi
callq 0x2e0a0
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2a7a9
movl %eax, %ebx
movq (%rsp), %rdi
callq 0x1feba
movq %rax, %rbp
testl %ebx, %ebx
je 0x37cdc
movq (%rsp), %rax
cmpb $0x23, (%rax)
je 0x37cab
leaq 0x30(%rsp), %rsi
movq %rbp, %rdi
movl $0x1e, %edx
callq 0x226f5
addl $-0x18, %eax
cmpl $-0x3, %eax
movq 0x28(%rsp), %r14
movq 0x20(%rsp), %r15
jae 0x37da8
testl %ebx, %ebx
jne 0x37dc8
jmp 0x37dbe
cmpb $0x0, 0x1(%rdx)
je 0x37e07
leaq 0x5c258(%rip), %rdi     # 0x93f7a
movl $0x0, 0x10(%rsp)
movq %r13, %rsi
xorl %eax, %eax
callq 0x26e94
movl $0x1, 0xc(%rsp)
movl $0x4, %ebx
movq %rsp, %r14
leaq 0x14(%rsp), %r15
leaq 0x5c277(%rip), %rbp     # 0x93fc7
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2a7a9
testl %eax, %eax
jne 0x37d6f
movq %rbp, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x26e94
decl %ebx
jne 0x37d50
movq 0x28(%rsp), %r14
movq 0x20(%rsp), %r15
movq 0x18(%rsp), %rbx
movl 0x10(%rsp), %ebp
movl 0xc(%rsp), %eax
jmp 0x37ded
leaq 0x30(%rsp), %rsi
movq %rbp, %rdi
movl $0x1e, %edx
callq 0x226f5
addl $-0x18, %eax
cmpl $-0x3, %eax
jae 0x37dac
jmp 0x37dc8
testl %ebx, %ebx
je 0x37dbe
movq 0x70(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x2b, %eax
je 0x37dbe
cmpl $0x2d, %eax
jne 0x37dc8
movq %r12, %rdi
callq 0x2a685
jmp 0x37dd9
leaq 0x5c191(%rip), %rdi     # 0x93f60
movq %r13, %rsi
xorl %eax, %eax
callq 0x26e94
movq 0x18(%rsp), %rbx
movq %rbp, %rdi
callq 0x2e0a0
xorl %ebp, %ebp
movl $0x1, %eax
movl %eax, (%rbx)
movl %ebp, (%r15)
movq %r12, (%r14)
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x48(%rsp), %rdi
callq 0x19add
movl %eax, 0xc(%rsp)
movq 0x50(%rsp), %rdi
callq 0x19add
movl %eax, 0x10(%rsp)
jmp 0x37d3c