// File: /workspace/github_c_makefile_star2_O3/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, 0x8(%rsp)
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x8e1b
movq %rdx, %r14
movq (%rdi), %rax
callq *0x178(%rax)
testl %eax, %eax
jle 0x8ded
movq 0x1033a(%rip), %rax     # 0x18f88
leaq 0x108d3(%rip), %rcx     # 0x19528
leaq 0xd0(%rbx), %rdx
movq %rdx, 0x18(%rsp)
xorl %ebp, %ebp
movswl (%rax), %r13d
movswl (%rcx), %eax
movl %eax, 0x4(%rsp)
movq %rbx, 0x10(%rsp)
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 0x72d0
testb %al, %al
je 0x8d15
movl $0xd60, %edi            # imm = 0xD60
callq 0x7530
movq %rax, %r15
movq (%r12), %rax
movq %r12, %rdi
callq *0xa8(%rax)
movq %r15, %rdi
movq %rax, %rsi
callq 0x7910
movq (%r12), %rax
movq %r12, %rdi
callq *0xa8(%rax)
movq %rax, %rdi
callq 0x7560
movq 0x18(%rsp), %rdi
movl %eax, %esi
callq 0x9f28
movq (%rax), %rdi
movq %r15, %rdx
addq $0x630, %rdx            # imm = 0x630
movq 0x8(%rsp), %rsi
callq 0x8c10
cmpl $0x0, 0xc48(%r15)
jle 0x8dcd
movq %r15, %rdi
movl $0x1, %esi
callq 0x7040
jmp 0x8dbf
movq %r15, %rdi
movl 0x4(%rsp), %esi
callq 0x72d0
testb %al, %al
je 0x8dd6
movl %r13d, %ebx
movq %r14, %r13
movq (%r12), %rax
movq %r12, %rdi
callq *0xa8(%rax)
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x7380
movq %r14, %rdi
movq 0x8(%rsp), %rsi
callq 0x7070
movl %eax, %r15d
movq %r14, %rdi
callq 0x7980
testb %r15b, %r15b
movq %r13, %r14
movl %ebx, %r13d
movq 0x10(%rsp), %rbx
je 0x8dd6
movl $0x668, %edi            # imm = 0x668
callq 0x7530
movq %rax, %r15
movl 0x630(%r12), %esi
leaq 0x638(%r12), %rdx
movq %r12, %rcx
addq $0x650, %rcx            # imm = 0x650
movq %rax, %rdi
callq 0xa824
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 0x8dd6
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
incl %ebp
movq 0x18(%rbx), %rdi
movq (%rdi), %rax
callq *0x178(%rax)
cmpl %eax, %ebp
jl 0x8c73
addq $0x688, %r14            # imm = 0x688
leaq -0x6d3(%rip), %r15      # 0x8728
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x8f2c
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x8f98
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 0x8e4d
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x7980
jmp 0x8e55
movq %rax, %rbx
movl $0xd60, %esi            # imm = 0xD60
movq %r15, %rdi
callq 0x70a0
movq %rbx, %rdi
callq 0x7290
nop