// File: /workspace/github_c_makefile_star2_O2/enzo1982[P]smooth/tools/translator/section.cpp
// Function: Section::Filter(smooth::String const&, smooth::GUI::List*)
Bool Section::Filter(const String &string, List *list_filtered)
{
	if (list == NIL) return True;

	for (Int i = 0; i < list->Length(); i++)
	{
		const ListEntry	*entry = list->GetNthEntry(i);

		if (entry->GetObjectType() == Tree::classID)
		{
			Tree	*tree	 = new Tree(entry->GetText());

			sections.Get(entry->GetText().ComputeCRC32())->Filter(string, tree->GetList());

			if (tree->Length() > 0)
			{
				tree->Open();
				list_filtered->Add(tree);
			}
			else
			{
				delete tree;
			}
		}
		else if (entry->GetObjectType() == StringItem::classID && entry->GetText().ToLower().Contains(string))
		{
			StringItem	*item = new StringItem(((StringItem *) entry)->GetID(),
							       ((StringItem *) entry)->GetOriginal(),
							       ((StringItem *) entry)->GetTranslation());

			item->SetFont(entry->GetFont());

			list_filtered->Add(item);
		}
	}

	/* OnSelectEntry may already be connected if we parsed a template
	 * before, so try to disconnect before actually connecting it.
	 */
	list_filtered->onSelectEntry.Disconnect(&Section::OnSelectEntry, this);
	list_filtered->onSelectEntry.Connect(&Section::OnSelectEntry, this);

	return True;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, 0x10(%rsp)
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x9d76
movq %rdx, %r14
movq 0xf3e5(%rip), %rax      # 0x18f88
leaq 0xf986(%rip), %rcx      # 0x19530
leaq 0xd0(%rbx), %rdx
movq %rdx, 0x18(%rsp)
xorl %ebp, %ebp
movswl (%rax), %r13d
movswl (%rcx), %eax
movl %eax, 0xc(%rsp)
movl %r13d, 0x8(%rsp)
movq (%rdi), %rax
callq *0x178(%rax)
cmpl %eax, %ebp
jge 0x9d48
movq 0x18(%rbx), %rdi
movq (%rdi), %rax
movl %ebp, %esi
callq *0x180(%rax)
movq %rax, %r12
leaq 0x20(%rax), %r15
movq %r15, %rdi
movl %r13d, %esi
callq 0x82d0
testb %al, %al
je 0x9c76
movl $0xd60, %edi            # imm = 0xD60
callq 0x8530
movq %rax, %r15
movq (%r12), %rax
movq %r12, %rdi
callq *0xa8(%rax)
movq %r15, %rdi
movq %rax, %rsi
callq 0x8920
movq (%r12), %rax
movq %r12, %rdi
callq *0xa8(%rax)
movq %rax, %rdi
callq 0x8560
movq 0x18(%rsp), %rdi
movl %eax, %esi
callq 0xae28
movq (%rax), %rdi
movq %r15, %rdx
addq $0x630, %rdx            # imm = 0x630
movq 0x10(%rsp), %rsi
callq 0x9b76
cmpl $0x0, 0xc48(%r15)
jle 0x9d34
movq %r15, %rdi
callq 0x9ec2
jmp 0x9d26
movq %r15, %rdi
movl 0xc(%rsp), %esi
callq 0x82d0
testb %al, %al
je 0x9d3d
movl %ebp, %r13d
movq %rbx, %rbp
movq %r14, %rbx
movq (%r12), %rax
movq %r12, %rdi
callq *0xa8(%rax)
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x8380
movq %r14, %rdi
movq 0x10(%rsp), %rsi
callq 0x8070
movl %eax, %r15d
movq %r14, %rdi
callq 0x8990
testb %r15b, %r15b
movq %rbx, %r14
movq %rbp, %rbx
movl %r13d, %ebp
movl 0x8(%rsp), %r13d
je 0x9d3d
movl $0x668, %edi            # imm = 0x668
callq 0x8530
movq %rax, %r15
movl 0x630(%r12), %esi
leaq 0x638(%r12), %rdx
movq %r12, %rcx
addq $0x650, %rcx            # imm = 0x650
movq %rax, %rdi
callq 0xb6d8
movq (%r12), %rax
movq %r12, %rdi
callq *0xe8(%rax)
movq (%r15), %rcx
movq %r15, %rdi
movq %rax, %rsi
callq *0xe0(%rcx)
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x30(%rax)
jmp 0x9d3d
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
incl %ebp
movq 0x18(%rbx), %rdi
jmp 0x9bc8
addq $0x688, %r14            # imm = 0x688
leaq -0x6a6(%rip), %r15      # 0x96b0
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x9eca
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x9f34
movb $0x1, %al
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x668, %esi            # imm = 0x668
jmp 0x9da8
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x8990
jmp 0x9db0
movq %rax, %rbx
movl $0xd60, %esi            # imm = 0xD60
movq %r15, %rdi
callq 0x80a0
movq %rbx, %rdi
callq 0x8290