// File: tap3edit[P]tap3xml/TapInfo.cpp
// Function: TapInfo::_findtreeversion(treenode*, int)
void TapInfo::_findtreeversion(treenode *tree, int depth)
{
    vector<treenode *>::iterator    vii;
    int                 i;

    if (depth>2)
        return;

    pair<string, string> types[] =
    {
        pair<string,string>("transferBatch",   "TAP"),      /* Tap file */
        pair<string,string>("notification",    "TAP"),      /* Notification file */
        pair<string,string>("returnBatch",     "RAP"),      /* Rap file */
        pair<string,string>("acknowledgement", "ACK")       /* Acknowledgment file */
    };

    pair<string, int *> version[] =
    {
        pair<string,int *>("specificationVersionNumber",    &_version),
        pair<string,int *>("releaseVersionNumber",          &_release),
        pair<string,int *>("rapSpecificationVersionNumber", &_suplversion),
        pair<string,int *>("rapReleaseVersionNumber",       &_suplrelease)
    };

    for (i=0;i<4;i++)
        if (tree->tagname==types[i].first)
            _type=types[i].second;

    if (tree->children!=NULL)
    {
        for (vii=tree->children->begin();vii!=tree->children->end();vii++)
        {
            for (i=0;i<4;i++)
            {
                if ((*vii)->tagname==version[i].first)
                    if ( (*vii)->value!=NULL )
                        *(version[i].second)=atoi((*(*vii)->value).c_str());
            }
        }
    }

    if (_version<0)
    {
        if (tree->children!=NULL)
        {
            _findtreeversion((*tree->children)[0],depth+1);
        }
    }


    return;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2c0, %rsp            # imm = 0x2C0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x238(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xb6b0
cmpl $0x2, -0x14(%rbp)
jle 0xab85
jmp 0xb0b0
leaq -0x130(%rbp), %rdi
movq %rdi, -0x138(%rbp)
leaq 0x1a744(%rip), %rsi     # 0x252de
leaq 0x1a60a(%rip), %rdx     # 0x251ab
callq 0xb6d0
jmp 0xaba8
leaq -0xf0(%rbp), %rdi
movq %rdi, -0x138(%rbp)
leaq 0x1a72f(%rip), %rsi     # 0x252ec
leaq 0x1a5e7(%rip), %rdx     # 0x251ab
callq 0xb7b0
jmp 0xabcb
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x138(%rbp)
leaq 0x1a719(%rip), %rsi     # 0x252f9
leaq 0x1a5c0(%rip), %rdx     # 0x251a7
callq 0xb890
jmp 0xabee
leaq -0x70(%rbp), %rdi
movq %rdi, -0x138(%rbp)
leaq 0x1a705(%rip), %rsi     # 0x25305
leaq 0x1a6af(%rip), %rdx     # 0x252b6
callq 0xb970
jmp 0xac0e
movq -0x238(%rbp), %rax
leaq -0x1f0(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
addq $0x8, %rax
movq %rax, -0x200(%rbp)
leaq 0x1a6e0(%rip), %rsi     # 0x25315
leaq -0x200(%rbp), %rdx
callq 0xba50
jmp 0xac43
movq -0x238(%rbp), %rax
leaq -0x1c8(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
addq $0x10, %rax
movq %rax, -0x208(%rbp)
leaq 0x1a6c6(%rip), %rsi     # 0x25330
leaq -0x208(%rbp), %rdx
callq 0xbad0
jmp 0xac78
movq -0x238(%rbp), %rax
leaq -0x1a0(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
addq $0xc, %rax
movq %rax, -0x210(%rbp)
leaq 0x1a6a6(%rip), %rsi     # 0x25345
leaq -0x210(%rbp), %rdx
callq 0xbb50
jmp 0xacad
movq -0x238(%rbp), %rax
leaq -0x178(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
addq $0x14, %rax
movq %rax, -0x218(%rbp)
leaq 0x1a68f(%rip), %rsi     # 0x25363
leaq -0x218(%rbp), %rdx
callq 0xbbd0
jmp 0xace2
movl $0x0, -0x24(%rbp)
cmpl $0x4, -0x24(%rbp)
jge 0xae44
movq -0x10(%rbp), %rdi
movslq -0x24(%rbp), %rax
leaq -0x130(%rbp), %rsi
shlq $0x6, %rax
addq %rax, %rsi
callq 0xb580
testb $0x1, %al
jne 0xad17
jmp 0xae34
movq -0x238(%rbp), %rdi
movslq -0x24(%rbp), %rax
shlq $0x6, %rax
leaq -0x110(%rbp,%rax), %rsi
addq $0x18, %rdi
callq 0x4050
jmp 0xad39
jmp 0xae34
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
movq -0x138(%rbp), %rax
leaq -0x130(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x240(%rbp)
je 0xad9b
movq -0x240(%rbp), %rdi
addq $-0x40, %rdi
movq %rdi, -0x248(%rbp)
callq 0xb550
movq -0x248(%rbp), %rax
leaq -0x130(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x240(%rbp)
jne 0xad6a
jmp 0xb0b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
movq -0x1f8(%rbp), %rax
leaq -0x1f0(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x250(%rbp)
je 0xadfd
movq -0x250(%rbp), %rdi
addq $-0x28, %rdi
movq %rdi, -0x258(%rbp)
callq 0xb690
movq -0x258(%rbp), %rax
leaq -0x1f0(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x250(%rbp)
jne 0xadcc
jmp 0xb062
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
leaq -0x1f0(%rbp), %rax
movq %rax, -0x268(%rbp)
addq $0xa0, %rax
movq %rax, -0x260(%rbp)
jmp 0xaffc
jmp 0xae36
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xace9
movq -0x10(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0xaf50
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0xbc50
movq %rax, -0x220(%rbp)
movq -0x220(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0xbcc0
movq %rax, -0x228(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0xbc80
testb $0x1, %al
jne 0xae9f
jmp 0xaf4e
movl $0x0, -0x24(%rbp)
cmpl $0x4, -0x24(%rbp)
jge 0xaf35
leaq -0x20(%rbp), %rdi
callq 0xbcf0
movq (%rax), %rdi
movslq -0x24(%rbp), %rax
leaq -0x1f0(%rbp), %rsi
imulq $0x28, %rax, %rax
addq %rax, %rsi
callq 0xb580
testb $0x1, %al
jne 0xaed9
jmp 0xaf25
leaq -0x20(%rbp), %rdi
callq 0xbcf0
movq (%rax), %rax
cmpq $0x0, 0x48(%rax)
je 0xaf23
leaq -0x20(%rbp), %rdi
callq 0xbcf0
movq (%rax), %rax
movq 0x48(%rax), %rdi
callq 0x4160
movq %rax, %rdi
callq 0x4610
movl %eax, %ecx
movslq -0x24(%rbp), %rdx
leaq -0x1f0(%rbp), %rax
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movq 0x20(%rax), %rax
movl %ecx, (%rax)
jmp 0xaf25
jmp 0xaf27
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xaea6
jmp 0xaf37
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0xbd10
movq %rax, -0x230(%rbp)
jmp 0xae72
jmp 0xaf50
movq -0x238(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jge 0xaf93
movq -0x10(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0xaf91
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xbd50
movq -0x238(%rbp), %rdi
movq (%rax), %rsi
movl -0x14(%rbp), %edx
incl %edx
callq 0xab50
jmp 0xaf8f
jmp 0xaf91
jmp 0xaf93
leaq -0x1f0(%rbp), %rax
movq %rax, -0x278(%rbp)
addq $0xa0, %rax
movq %rax, -0x270(%rbp)
movq -0x270(%rbp), %rdi
addq $-0x28, %rdi
movq %rdi, -0x280(%rbp)
callq 0xb690
movq -0x278(%rbp), %rcx
movq -0x280(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x270(%rbp)
jne 0xafae
leaq -0x130(%rbp), %rax
movq %rax, -0x290(%rbp)
addq $0x100, %rax            # imm = 0x100
movq %rax, -0x288(%rbp)
jmp 0xb02f
movq -0x260(%rbp), %rdi
addq $-0x28, %rdi
movq %rdi, -0x298(%rbp)
callq 0xb690
movq -0x268(%rbp), %rcx
movq -0x298(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x260(%rbp)
jne 0xaffc
jmp 0xb062
movq -0x288(%rbp), %rdi
addq $-0x40, %rdi
movq %rdi, -0x2a0(%rbp)
callq 0xb550
movq -0x290(%rbp), %rcx
movq -0x2a0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x288(%rbp)
jne 0xb02f
jmp 0xb0b0
leaq -0x130(%rbp), %rax
movq %rax, -0x2b0(%rbp)
addq $0x100, %rax            # imm = 0x100
movq %rax, -0x2a8(%rbp)
movq -0x2a8(%rbp), %rdi
addq $-0x40, %rdi
movq %rdi, -0x2b8(%rbp)
callq 0xb550
movq -0x2b0(%rbp), %rcx
movq -0x2b8(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x2a8(%rbp)
jne 0xb07d
jmp 0xb0b9
addq $0x2c0, %rsp            # imm = 0x2C0
popq %rbp
retq
movq -0x140(%rbp), %rdi
callq 0x46d0
nopw %cs:(%rax,%rax)