// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/psl.c
// Function: pslxFileOpen
void pslxFileOpen(char *fileName, enum gfType *retQueryType, enum gfType *retTargetType, struct lineFile **retLf)
/* Read header part of psl and make sure it's right.  Return
 * sequence types and file handle. */
{
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);

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
	lineFileReuse(lf); 
    }
*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 %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r13
movl $0x1, %ebp
movl $0x1, %esi
callq 0x2a1fc
movq %rax, %r12
leaq 0x8(%rsp), %rsi
leaq 0x14(%rsp), %rdx
movq %rax, %rdi
callq 0x2a455
testl %eax, %eax
je 0x377a4
movq 0x8(%rsp), %rsi
leaq 0x5c771(%rip), %rdi     # 0x93e7f
callq 0x217c8
testl %eax, %eax
je 0x377bc
movq %r14, 0x20(%rsp)
movq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movl $0x1e, %edx
callq 0x223ad
cmpl $0x2, %eax
jg 0x3774a
leaq 0x5c750(%rip), %rdi     # 0x93e90
movq %r13, %rsi
xorl %eax, %eax
callq 0x26b6f
movq 0x40(%rsp), %r14
leaq 0x61e5b(%rip), %rsi     # 0x995b1
movq %r14, %rdi
callq 0x6a50
testl %eax, %eax
movq %rbx, 0x28(%rsp)
movq %r15, 0x18(%rsp)
je 0x377cd
leaq 0x5d17d(%rip), %rsi     # 0x948f0
movq %r14, %rdi
callq 0x6a50
testl %eax, %eax
je 0x377de
movl $0x1, 0x4(%rsp)
leaq 0x5c71c(%rip), %rdi     # 0x93eaa
movl $0x0, (%rsp)
movq %r13, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x26b6f
jmp 0x377f9
leaq 0x5c6c8(%rip), %rdi     # 0x93e73
movq %r13, %rsi
xorl %eax, %eax
callq 0x268ca
xorl %eax, %eax
jmp 0x37848
movq %r12, %rdi
callq 0x2a331
xorl %eax, %eax
movl $0x1, %ebp
jmp 0x37848
movl $0x1, 0x4(%rsp)
movl $0x0, (%rsp)
jmp 0x377f9
movq 0x48(%rsp), %rdi
callq 0x19881
movl %eax, 0x4(%rsp)
movq 0x50(%rsp), %rdi
callq 0x19881
movl %eax, (%rsp)
movl $0x4, %ebx
leaq 0x8(%rsp), %r14
leaq 0x14(%rsp), %r15
leaq 0x5c6e8(%rip), %rbp     # 0x93ef7
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2a455
testl %eax, %eax
jne 0x3782e
movq %rbp, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x26b6f
decl %ebx
jne 0x3780f
movq 0x28(%rsp), %rbx
movq 0x20(%rsp), %r14
movq 0x18(%rsp), %r15
movl 0x4(%rsp), %ebp
movl (%rsp), %eax
movl %ebp, (%r15)
movl %eax, (%r14)
movq %r12, (%rbx)
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq