// File: /workspace/github_c_makefile_star2_O1/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 %rdx, (%rsp)
movq %rsi, 0x10(%rsp)
cmpq $0x0, 0x18(%rdi)
je 0x8e1a
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq (%rdi), %rax
callq *0x178(%rax)
testl %eax, %eax
jle 0x8de8
movq 0x10335(%rip), %rax     # 0x18f88
leaq 0x108ce(%rip), %rcx     # 0x19528
leaq 0xd0(%rbx), %rdx
movq %rdx, 0x18(%rsp)
xorl %ebp, %ebp
movswl (%rax), %r14d
movswl (%rcx), %eax
movl %eax, 0xc(%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 %r14d, %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 0x9f68
movq (%rax), %rdi
movq %r15, %rdx
addq $0x630, %rdx            # imm = 0x630
movq 0x10(%rsp), %rsi
callq 0x8c12
cmpl $0x0, 0xc48(%r15)
jle 0x8dc8
movq %r15, %rdi
movl $0x1, %esi
callq 0x7040
jmp 0x8db9
movq %r15, %rdi
movl 0xc(%rsp), %esi
callq 0x72d0
movl %eax, %r15d
testb %al, %al
je 0x8d57
movq (%r12), %rax
movq %r12, %rdi
callq *0xa8(%rax)
leaq 0x20(%rsp), %r13
movq %r13, %rdi
movq %rax, %rsi
callq 0x7380
movq %r13, %rdi
movq 0x10(%rsp), %rsi
callq 0x7070
movl %eax, %r13d
jmp 0x8d5a
xorl %r13d, %r13d
testb %r15b, %r15b
je 0x8d69
leaq 0x20(%rsp), %rdi
callq 0x7980
testb %r13b, %r13b
je 0x8dd1
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 0xa878
movq (%r12), %rax
movq %r12, %rdi
callq *0xe8(%rax)
movq (%r15), %rcx
movq %r15, %rdi
movq %rax, %rsi
callq *0xe0(%rcx)
movq (%rsp), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *0x30(%rax)
jmp 0x8dd1
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
movq (%rsp), %r14
addq $0x688, %r14            # imm = 0x688
leaq -0x6d2(%rip), %r15      # 0x8728
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x8f2a
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x8f96
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 0x8e4c
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x7980
jmp 0x8e54
movq %rax, %rbx
movl $0xd60, %esi            # imm = 0xD60
movq %r15, %rdi
callq 0x70a0
movq %rbx, %rdi
callq 0x7290