// File: /workspace/github_c_makefile_star2_O3/enzo1982[P]smooth/misc/pciio.cpp
// Function: PCIIO::ReadFORMTAG(smooth::IO::InStream*)
bool PCIIO::ReadFORMTAG(PCIIn in)
{
	S::String cfName;

	in->Seek(0);

	do
	{
		static String	 formTag = "FORM";

		if (in->InputString(4).Compare(formTag) == 0)
		{
			in->RelSeek(2);

			if (in->InputNumber(4) == imageid)
			{
				if (in->InputNumber(4) > 20)	return false;
				else
				{
					cfName = in->InputString(3);

					bpcc = in->InputNumber(1);
					compression = in->InputNumber(1);

					if (compression == RLE) rlebits = in->InputNumber(1);

					for (int i = 0; i < 7; i++)
					{
						if (cfName.Compare(cfNames[i]) == 0) colorspace = (S::GUI::Color::ColorSpace) i;
					}

					return true;
				}
			}
			else
			{
				in->RelSeek(in->InputNumber(4) - 14);
			}
		}
		else
		{
			in->RelSeek(6);

			in->RelSeek(in->InputNumber(4) - 14);
		}
	}
	while (in->Size() > in->GetPos());

	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0x58e20
movq (%r14), %rax
movq %r14, %rdi
xorl %esi, %esi
callq *0x28(%rax)
leaq 0xbbe04(%rip), %r12     # 0x176a88
leaq 0xb33f5(%rip), %r15     # 0x16e080
leaq 0x8(%rsp), %r13
movb 0xbbe0a(%rip), %al      # 0x176aa0
testb %al, %al
je 0xbad33
movq %r13, %rdi
movq %r14, %rsi
movl $0x4, %edx
callq 0x589a0
movq %r13, %rdi
movq %r12, %rsi
callq 0x585c0
movl %eax, %ebp
movq %r13, %rdi
callq 0x59200
movq (%r14), %rax
movq 0x30(%rax), %rax
testl %ebp, %ebp
je 0xbacda
movl $0x6, %esi
movq %r14, %rdi
callq *%rax
jmp 0xbacfe
movl $0x2, %esi
movq %r14, %rdi
callq *%rax
movq %r14, %rdi
movl $0x4, %esi
callq 0x55e90
movslq 0x68(%rbx), %rcx
cmpq %rcx, %rax
je 0xbada0
movq %r14, %rdi
movl $0x4, %esi
callq 0x55e90
addq $-0xe, %rax
movq (%r14), %rcx
movq %r14, %rdi
movq %rax, %rsi
callq *0x30(%rcx)
cmpw $0x0, 0x8(%r14)
je 0xbad79
movq 0x10(%r14), %rax
cmpq 0x48(%r14), %rax
jg 0xbac90
jmp 0xbad83
leaq 0xbbd66(%rip), %rdi     # 0x176aa0
callq 0x56120
testl %eax, %eax
je 0xbac9e
movq %r12, %rdi
leaq 0x6f16c(%rip), %rsi     # 0x129ebd
callq 0x579f0
movq 0xb11d3(%rip), %rdi     # 0x16bf30
movq %r12, %rsi
movq %r15, %rdx
callq 0x57e10
leaq 0xbbd31(%rip), %rdi     # 0x176aa0
callq 0x56b80
jmp 0xbac9e
movw $0x5, 0xf8(%r14)
xorl %ebx, %ebx
leaq 0x20(%rsp), %rdi
callq 0x59200
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
movl $0x4, %esi
callq 0x55e90
cmpq $0x14, %rax
jg 0xbad83
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
movl $0x3, %edx
callq 0x589a0
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x555f0
leaq 0x8(%rsp), %rdi
callq 0x59200
movq %r14, %rdi
movl $0x1, %esi
callq 0x55e90
movl %eax, 0x54(%rbx)
movq %r14, %rdi
movl $0x1, %esi
callq 0x55e90
movl %eax, 0x50(%rbx)
cmpl $0x3, %eax
jne 0xbae13
movq %r14, %rdi
movl $0x1, %esi
callq 0x55e90
movl %eax, 0x60(%rbx)
leaq 0xbbae6(%rip), %r14     # 0x176900
xorl %r12d, %r12d
leaq 0x20(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x585c0
testl %eax, %eax
jne 0xbae35
movl %r12d, 0x58(%rbx)
incq %r12
addq $0x18, %r14
cmpq $0x7, %r12
jne 0xbae22
movb $0x1, %bl
jmp 0xbad85
movq %rax, %rbx
leaq 0xbbc4d(%rip), %rdi     # 0x176aa0
callq 0x56420
jmp 0xbae76
jmp 0xbae64
jmp 0xbae73
jmp 0xbae73
jmp 0xbae73
jmp 0xbae73
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x59200
jmp 0xbae76
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x59200
movq %rbx, %rdi
callq 0x57090