// File: /workspace/github_cpp_makefile_star2_O2/openflightmaps[P]ofm2xplane/main.cpp
// Function: search_in(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, rapidxml::xml_node<char>*, int)
void search_in(string target, xml_node<> *start,int l)
{
    xml_node<> * current;
    char* my_type=start->name();
	int ebene=0;
	while(true)
	{
        if(ebene==0)
        {
    	    if(string(start->name()).compare(my_type)==0 && start->first_node()!=NULL)
    		{
    			ebene++;
    			current=start->first_node();
    			goto check;
    		}else
    		{
                if(start->next_sibling(my_type)!=NULL)
                {
                    start=start->next_sibling(my_type);
                    goto check;
                }
            }
        }
        else
        {
            if(current->first_node()!=NULL)
            {
                ebene++;
                current=current->first_node();
                goto check;
            }
    		sibparent:
    		if(current->next_sibling()!=NULL)
    		{
    			current=current->next_sibling();
    			goto check;
    		}
    		if(current->parent()!=NULL && ebene > 0)
    		{
    			ebene--;
    			if(ebene==0)
    			{
    			    start=current->parent();
    			    if(start->next_sibling(my_type)!=NULL)
    			        start=start->next_sibling(my_type);
    			    else
    			        break;
    			    continue;
                }
    			else
    			{
    			    current=current->parent();
    			    goto sibparent;
                }
    		}
        }
		break;
		
		check:
		if(string(current->name()).compare(target)==0 && (l==-1 || l==ebene))
			cout << current->name() << "\t" << start->first_node("txtName")->value() << "\t" <<  current->value() << endl;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %edx, -0x3c(%rbp)
movq %rsi, %rbx
movq (%rsi), %rax
testq %rax, %rax
leaq 0x6a8c(%rip), %rcx      # 0xd1f8
cmoveq %rcx, %rax
movq %rax, -0x38(%rbp)
movq %rdi, -0x68(%rbp)
xorl %r12d, %r12d
leaq -0x60(%rbp), %r15
pushq $0x1
popq %r13
testl %r12d, %r12d
je 0x679c
movq 0x30(%r14), %rax
testq %rax, %rax
je 0x680b
incl %r12d
movq %rax, %r14
jmp 0x68ab
movq (%rbx), %rsi
testq %rsi, %rsi
leaq 0x6a4f(%rip), %rax      # 0xd1f8
cmoveq %rax, %rsi
movq %r15, %rdi
leaq -0x29(%rbp), %rdx
callq 0x6f24
movq %r15, %rdi
movq -0x38(%rbp), %rsi
callq 0x2090
movq %r15, %rdi
testl %eax, %eax
je 0x687a
callq 0x20d0
movq %rbx, %rdi
movq -0x38(%rbp), %rsi
xorl %edx, %edx
movl %r13d, %ecx
callq 0x6dec
testq %rax, %rax
je 0x69a6
xorl %r12d, %r12d
movq %rbx, %rdi
movq -0x38(%rbp), %rsi
xorl %edx, %edx
movl %r13d, %ecx
callq 0x6dec
movq %rax, %rbx
jmp 0x68a7
movq %r14, %r15
movq %r15, %r14
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl %r13d, %ecx
callq 0x6dec
testq %rax, %rax
jne 0x6895
testl %r12d, %r12d
jle 0x69a6
movq 0x20(%r14), %r15
testq %r15, %r15
je 0x69a6
decl %r12d
jne 0x680e
movq %r15, %rdi
movq -0x38(%rbp), %rsi
xorl %edx, %edx
movl %r13d, %ecx
callq 0x6dec
testq %rax, %rax
je 0x69a6
xorl %r12d, %r12d
movq %r15, %rdi
movq -0x38(%rbp), %rsi
xorl %edx, %edx
movl %r13d, %ecx
callq 0x6dec
movq %rax, %rbx
leaq -0x60(%rbp), %r15
jmp 0x6783
movq 0x30(%rbx), %r15
callq 0x20d0
testq %r15, %r15
je 0x67d5
movq 0x30(%rbx), %r14
movl %r13d, %r12d
jmp 0x68a7
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl %r13d, %ecx
callq 0x6dec
movq %rax, %r14
leaq -0x60(%rbp), %r15
movq (%r14), %rsi
testq %rsi, %rsi
leaq 0x6940(%rip), %rax      # 0xd1f8
cmoveq %rax, %rsi
movq %r15, %rdi
leaq -0x29(%rbp), %rdx
callq 0x6f24
movq %r15, %rdi
movq -0x68(%rbp), %rsi
callq 0x2040
testl %eax, %eax
je 0x68e5
movq %r15, %rdi
callq 0x20d0
jmp 0x6783
movl -0x3c(%rbp), %ecx
cmpl $-0x1, %ecx
sete %al
cmpl %ecx, %r12d
sete %r15b
orb %al, %r15b
leaq -0x60(%rbp), %rdi
callq 0x20d0
cmpb $0x1, %r15b
leaq -0x60(%rbp), %r15
jne 0x6783
movq (%r14), %rsi
testq %rsi, %rsi
leaq 0x68dc(%rip), %rax      # 0xd1f8
cmoveq %rax, %rsi
movq 0x66a9(%rip), %rdi      # 0xcfd0
callq 0x21b0
movq %rax, %rdi
leaq 0x2bb5(%rip), %rsi      # 0x94eb
callq 0x21b0
movq %rax, %r15
movq %rbx, %rdi
leaq 0x29c9(%rip), %rsi      # 0x9311
xorl %edx, %edx
movl %r13d, %ecx
callq 0x6d52
movq 0x8(%rax), %rsi
testq %rsi, %rsi
leaq 0x6898(%rip), %rax      # 0xd1f8
cmoveq %rax, %rsi
movq %r15, %rdi
leaq -0x60(%rbp), %r15
callq 0x21b0
movq %rax, %rdi
leaq 0x2b71(%rip), %rsi      # 0x94eb
callq 0x21b0
movq 0x8(%r14), %rsi
testq %rsi, %rsi
leaq 0x686b(%rip), %rcx      # 0xd1f8
cmoveq %rcx, %rsi
movq %rax, %rdi
callq 0x21b0
movq %rax, %rdi
callq 0x20e0
jmp 0x6783
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x20d0
movq %rbx, %rdi
callq 0x2330