// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rbp
movl %ebp, %esi
callq 0x25467
movq %rax, %r12
leaq 0x8(%rsp), %rsi
leaq 0x14(%rsp), %rdx
movq %rax, %rdi
callq 0x256a7
testl %eax, %eax
je 0x31f05
movq 0x8(%rsp), %rsi
leaq 0x50faf(%rip), %rdi     # 0x82e4f
callq 0x1db41
testl %eax, %eax
je 0x31f1a
movq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
pushq $0x1e
popq %rdx
callq 0x1e59b
cmpl $0x2, %eax
jg 0x31ed1
leaq 0x50f99(%rip), %rdi     # 0x82e60
movq %r13, %rsi
xorl %eax, %eax
callq 0x223fb
movq 0x40(%rsp), %rdx
movzbl (%rdx), %eax
cmpl $0x34, %eax
movq %rbx, 0x28(%rsp)
movq %r14, 0x20(%rsp)
movq %r15, 0x18(%rsp)
je 0x31f29
cmpl $0x33, %eax
jne 0x31f33
cmpb $0x0, 0x1(%rdx)
jne 0x31f33
movl %ebp, 0x4(%rsp)
movl $0x0, (%rsp)
jmp 0x31f4f
leaq 0x50f37(%rip), %rdi     # 0x82e43
xorl %ebp, %ebp
movq %r13, %rsi
xorl %eax, %eax
callq 0x22186
jmp 0x31f24
movq %r12, %rdi
callq 0x25590
xorl %ebp, %ebp
pushq $0x1
popq %rax
jmp 0x31f9f
cmpb $0x0, 0x1(%rdx)
je 0x31fba
movl %ebp, 0x4(%rsp)
leaq 0x50f3c(%rip), %rdi     # 0x82e7a
movl $0x0, (%rsp)
movq %r13, %rsi
xorl %eax, %eax
callq 0x223fb
pushq $0x4
popq %rbp
leaq 0x8(%rsp), %r14
leaq 0x14(%rsp), %r15
leaq 0x50f64(%rip), %rbx     # 0x82ec7
subl $0x1, %ebp
jb 0x31f89
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x256a7
testl %eax, %eax
jne 0x31f63
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x223fb
jmp 0x31f63
movq 0x28(%rsp), %rbx
movq 0x20(%rsp), %r14
movq 0x18(%rsp), %r15
movl 0x4(%rsp), %eax
movl (%rsp), %ebp
movl %eax, (%r15)
movl %ebp, (%r14)
movq %r12, (%rbx)
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x48(%rsp), %rdi
callq 0x166a3
movl %eax, 0x4(%rsp)
movq 0x50(%rsp), %rdi
callq 0x166a3
movl %eax, (%rsp)
jmp 0x31f4f