// File: /workspace/github_c_makefile_star2_O1/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 0xbbf12(%rip), %r12     # 0x177a88
leaq 0xb3503(%rip), %r15     # 0x16f080
leaq 0x8(%rsp), %r13
movb 0xbbf18(%rip), %al      # 0x177aa0
testb %al, %al
je 0xbbc55
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 0xbbbcc
movl $0x6, %esi
movq %r14, %rdi
callq *%rax
jmp 0xbbbf0
movl $0x2, %esi
movq %r14, %rdi
callq *%rax
movq %r14, %rdi
movl $0x4, %esi
callq 0x55e90
movslq 0x68(%rbx), %rcx
cmpq %rcx, %rax
je 0xbbc9b
movq %r14, %rdi
movl $0x4, %esi
callq 0x55e90
addq $-0xe, %rax
movq (%r14), %rcx
movq %r14, %rdi
movq %rax, %rsi
callq *0x30(%rcx)
movzwl 0x8(%r14), %ecx
testw %cx, %cx
je 0xbbc1d
movq 0x10(%r14), %rax
jmp 0xbbc2e
movw $0x5, 0xf8(%r14)
movq $-0x1, %rax
testw %cx, %cx
je 0xbbc39
movq 0x48(%r14), %rcx
jmp 0xbbc4a
movw $0x5, 0xf8(%r14)
movq $-0x1, %rcx
cmpq %rcx, %rax
jg 0xbbb82
jmp 0xbbcae
leaq 0xbbe44(%rip), %rdi     # 0x177aa0
callq 0x56120
testl %eax, %eax
je 0xbbb90
movq %r12, %rdi
leaq 0x6f024(%rip), %rsi     # 0x12ac97
callq 0x579f0
movq 0xb12b1(%rip), %rdi     # 0x16cf30
movq %r12, %rsi
movq %r15, %rdx
callq 0x57e10
leaq 0xbbe0f(%rip), %rdi     # 0x177aa0
callq 0x56b80
jmp 0xbbb90
movq %r14, %rdi
movl $0x4, %esi
callq 0x55e90
cmpq $0x14, %rax
jle 0xbbccb
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
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 0xbbd2b
movq %r14, %rdi
movl $0x1, %esi
callq 0x55e90
movl %eax, 0x60(%rbx)
leaq 0xbbbce(%rip), %r14     # 0x177900
xorl %r12d, %r12d
leaq 0x20(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x585c0
testl %eax, %eax
jne 0xbbd4d
movl %r12d, 0x58(%rbx)
incq %r12
addq $0x18, %r14
cmpq $0x7, %r12
jne 0xbbd3a
movb $0x1, %bl
jmp 0xbbcb0
movq %rax, %rbx
leaq 0xbbd35(%rip), %rdi     # 0x177aa0
callq 0x56420
jmp 0xbbd8e
jmp 0xbbd7a
jmp 0xbbd8b
jmp 0xbbd8b
jmp 0xbbd8b
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x59200
jmp 0xbbd8e
jmp 0xbbd8b
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x59200
movq %rbx, %rdi
callq 0x57090