// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/misc/pciio.cpp
// Function: PCIIO::FindImageID(smooth::IO::InStream*)
bool PCIIO::FindImageID(PCIIn in)
{
	int	 imageid = 0;

	in->Seek(0);

	do
	{
		static String	 nameTag = "NAME";

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

			imageid = in->InputNumber(4);

			if (in->InputString(in->InputNumber(4) - 14).Compare(imagename) == 0)
			{
				this->imageid = imageid;

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

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

	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
xorl %ecx, %ecx
movl %ecx, %esi
callq *0x28(%rax)
cmpb $0x0, 0xf9c29(%rip)     # 0x214770
jne 0x11ab95
leaq 0xf9c20(%rip), %rdi     # 0x214770
callq 0x5a4e0
cmpl $0x0, %eax
je 0x11ab95
leaq 0xf9bf7(%rip), %rdi     # 0x214758
leaq 0x8bfe0(%rip), %rsi     # 0x1a6b48
callq 0x5c1f0
jmp 0x11ab6f
movq 0xee3b2(%rip), %rdi     # 0x208f28
leaq 0xf9bdb(%rip), %rsi     # 0x214758
leaq 0xf0b7c(%rip), %rdx     # 0x20b700
callq 0x5c700
leaq 0xf9be0(%rip), %rdi     # 0x214770
callq 0x5b0c0
movq -0x18(%rbp), %rsi
leaq -0x48(%rbp), %rdi
movq %rdi, -0x78(%rbp)
movl $0x4, %edx
callq 0x5d4f0
movq -0x78(%rbp), %rdi
leaq 0xf9ba2(%rip), %rsi     # 0x214758
callq 0x5d070
movl %eax, -0x6c(%rbp)
jmp 0x11abc0
leaq -0x48(%rbp), %rdi
callq 0x5df00
movl -0x6c(%rbp), %eax
cmpl $0x0, %eax
jne 0x11acbd
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
movq 0x30(%rax), %rax
movl $0x2, %esi
callq *%rax
movq -0x18(%rbp), %rdi
movl $0x4, %esi
movl %esi, -0x94(%rbp)
callq 0x5a170
movl -0x94(%rbp), %esi
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0x5a170
movq -0x90(%rbp), %rsi
movl %eax, %edx
addl $-0xe, %edx
leaq -0x60(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0x5d4f0
movq -0x68(%rbp), %rsi
movq -0x88(%rbp), %rdi
addq $0x38, %rsi
callq 0x5d070
movl %eax, -0x7c(%rbp)
jmp 0x11ac49
leaq -0x60(%rbp), %rdi
callq 0x5df00
movl -0x7c(%rbp), %eax
cmpl $0x0, %eax
jne 0x11acbb
movq -0x68(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, 0x68(%rax)
movb $0x1, -0x1(%rbp)
jmp 0x11ad2b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq 0xf9af0(%rip), %rdi     # 0x214770
callq 0x5a860
jmp 0x11ad39
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x5df00
jmp 0x11ad39
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x5df00
jmp 0x11ad39
jmp 0x11acf9
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
movl $0x6, %esi
callq *0x30(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x18(%rbp), %rdi
movl $0x4, %esi
callq 0x5a170
movq -0xa0(%rbp), %rdi
movq %rax, %rsi
subq $0xe, %rsi
movq (%rdi), %rax
callq *0x30(%rax)
jmp 0x11acfb
movq -0x18(%rbp), %rdi
callq 0x5a580
movq %rax, -0xa8(%rbp)
movq -0x18(%rbp), %rdi
callq 0x5da70
movq %rax, %rcx
movq -0xa8(%rbp), %rax
cmpq %rcx, %rax
jg 0x11ab40
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xb0, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x5b6b0
nopw %cs:(%rax,%rax)