// File: /workspace/github_c_makefile_star2_O2/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, (%rsp)
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0x5a180
movq (%r14), %rax
movq %r14, %rdi
xorl %esi, %esi
callq *0x28(%rax)
leaq 0xb7d77(%rip), %r12     # 0x16cc48
leaq 0x8(%rsp), %r13
pushq $0x4
popq %rbp
pushq $0x6
popq %r15
movb 0xb7d7d(%rip), %al      # 0x16cc60
testb %al, %al
je 0xb4f77
movq %r13, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x59cd0
movq %r13, %rdi
movq %r12, %rsi
callq 0x598b0
movl %eax, %ebx
movq %r13, %rdi
callq 0x5a588
movq (%r14), %rax
movq 0x30(%rax), %rax
testl %ebx, %ebx
je 0xb4f22
movq %r14, %rdi
movq %r15, %rsi
callq *%rax
jmp 0xb4f45
movq %r14, %rdi
pushq $0x2
popq %rsi
callq *%rax
movq %r14, %rdi
movl %ebp, %esi
callq 0x56f60
movq (%rsp), %rcx
movslq 0x68(%rcx), %rcx
cmpq %rcx, %rax
je 0xb4fe8
movq %r14, %rdi
movl %ebp, %esi
callq 0x56f60
addq $-0xe, %rax
movq (%r14), %rcx
movq %r14, %rdi
movq %rax, %rsi
callq *0x30(%rcx)
cmpw $0x0, 0x8(%r14)
je 0xb4fc1
movq 0x10(%r14), %rax
cmpq 0x48(%r14), %rax
jg 0xb4edd
jmp 0xb4fcb
leaq 0xb7ce2(%rip), %rdi     # 0x16cc60
callq 0x57210
testl %eax, %eax
je 0xb4eeb
movq %r12, %rdi
leaq 0x64c58(%rip), %rsi     # 0x119bed
callq 0x58c40
movq 0xacf8f(%rip), %rdi     # 0x161f30
movq %r12, %rsi
leaq 0xaf295(%rip), %rdx     # 0x164240
callq 0x590a0
leaq 0xb7ca9(%rip), %rdi     # 0x16cc60
callq 0x57cf0
jmp 0xb4eeb
movw $0x5, 0xf8(%r14)
xorl %ebx, %ebx
leaq 0x20(%rsp), %rdi
callq 0x5a588
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x4
popq %rsi
movq %r14, %rdi
callq 0x56f60
cmpq $0x14, %rax
jg 0xb4fcb
leaq 0x8(%rsp), %rdi
pushq $0x3
popq %rdx
movq %r14, %rsi
callq 0x59cd0
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x56630
leaq 0x8(%rsp), %rdi
callq 0x5a588
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x56f60
movq (%rsp), %rcx
movl %eax, 0x54(%rcx)
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x56f60
movq (%rsp), %rcx
movl %eax, 0x50(%rcx)
cmpl $0x3, %eax
jne 0xb505d
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x56f60
movq (%rsp), %rcx
movl %eax, 0x60(%rcx)
leaq 0xb7a5c(%rip), %r14     # 0x16cac0
xorl %ebx, %ebx
leaq 0x20(%rsp), %r15
cmpq $0x7, %rbx
je 0xb5090
movq %r15, %rdi
movq %r14, %rsi
callq 0x598b0
testl %eax, %eax
jne 0xb5087
movq (%rsp), %rax
movl %ebx, 0x58(%rax)
incq %rbx
addq $0x18, %r14
jmp 0xb506b
movb $0x1, %bl
jmp 0xb4fcd
movq %rax, %rbx
leaq 0xb7bbf(%rip), %rdi     # 0x16cc60
callq 0x57520
jmp 0xb50c4
jmp 0xb50b2
jmp 0xb50c1
jmp 0xb50c1
jmp 0xb50c1
jmp 0xb50c1
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5a588
jmp 0xb50c4
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x5a588
movq %rbx, %rdi
callq 0x58260