// File: tap3edit[P]tap3xml/XmlItem.cpp
// Function: XmlItem::encode[abi:cxx11](int)
string XmlItem::encode(int depth)
{
    ostringstream item;
    
    extern string apply_xml_rules(string str);

    if (_tree==NULL) {
        cerr << "treenode structure was not set with tree() method";
        err_trace(__FILE__, __LINE__);
    }


    /* 1. Preparing XML Item */

    if ( !_tree->pc )
    {
        item << string(depth*4, ' ') << "<" << _tree->tagname << ">";
        /* _001_ { */
        if (_tree->value == NULL)
            item << "";
        else
            item << apply_xml_rules(*_tree->value) ;
        /* _001_ } */
        item << "</" << _tree->tagname << ">\n";
    }
    else
    {
        item << string(depth*4, ' ') << "<" << _tree->tagname << ">\n";
    }


    /* 2. Return value */

    return  item.str();

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2e0, %rsp            # imm = 0x2E0
movq %rdi, -0x270(%rbp)
movq %rdi, %rax
movq %rax, -0x268(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x260(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x4540
movq -0x260(%rbp), %rax
cmpq $0x0, 0x40(%rax)
jne 0x22f77
movq 0xe141(%rip), %rdi      # 0x30fe8
leaq 0x2e0c(%rip), %rsi      # 0x25cba
callq 0x4340
jmp 0x22eb5
leaq -0x1c1(%rbp), %rdi
movq %rdi, -0x278(%rbp)
callq 0x46e0
movq -0x278(%rbp), %rdx
leaq 0x33e6(%rip), %rsi      # 0x262bc
leaq -0x1c0(%rbp), %rdi
callq 0x7670
jmp 0x22ee4
movl $0x42, -0x1c8(%rbp)
leaq -0x1c0(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x151c0
jmp 0x22f03
leaq -0x1c0(%rbp), %rdi
callq 0x41e0
leaq -0x1c1(%rbp), %rdi
callq 0x43d0
jmp 0x22f77
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x198(%rbp)
movl %eax, -0x19c(%rbp)
jmp 0x23304
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x198(%rbp)
movl %eax, -0x19c(%rbp)
jmp 0x22f66
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x198(%rbp)
movl %eax, -0x19c(%rbp)
leaq -0x1c0(%rbp), %rdi
callq 0x41e0
leaq -0x1c1(%rbp), %rdi
callq 0x43d0
jmp 0x23304
movq -0x260(%rbp), %rax
movq 0x40(%rax), %rax
movw 0x20(%rax), %ax
shrw $0x2, %ax
andw $0x1, %ax
cmpw $0x0, %ax
jne 0x231c9
movl -0x14(%rbp), %eax
shll $0x2, %eax
cltq
movq %rax, -0x288(%rbp)
leaq -0x1e9(%rbp), %rdi
movq %rdi, -0x280(%rbp)
callq 0x46e0
movq -0x288(%rbp), %rsi
movq -0x280(%rbp), %rcx
leaq -0x1e8(%rbp), %rdi
movl $0x20, %edx
callq 0x1f2f0
jmp 0x22fdb
leaq -0x190(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x42e0
movq %rax, -0x290(%rbp)
jmp 0x22ff7
movq -0x290(%rbp), %rdi
leaq 0x2aea(%rip), %rsi      # 0x25aef
callq 0x4340
movq %rax, -0x298(%rbp)
jmp 0x23013
movq -0x298(%rbp), %rdi
movq -0x260(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0x42e0
movq %rax, -0x2a0(%rbp)
jmp 0x23033
movq -0x2a0(%rbp), %rdi
leaq 0x2fab(%rip), %rsi      # 0x25fec
callq 0x4340
jmp 0x23048
leaq -0x1e8(%rbp), %rdi
callq 0x41e0
leaq -0x1e9(%rbp), %rdi
callq 0x43d0
movq -0x260(%rbp), %rax
movq 0x40(%rax), %rax
cmpq $0x0, 0x48(%rax)
jne 0x230cf
leaq 0x2a75(%rip), %rsi      # 0x25aee
leaq -0x190(%rbp), %rdi
callq 0x4340
jmp 0x23087
jmp 0x23173
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x198(%rbp)
movl %eax, -0x19c(%rbp)
jmp 0x230be
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x198(%rbp)
movl %eax, -0x19c(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0x41e0
leaq -0x1e9(%rbp), %rdi
callq 0x43d0
jmp 0x23304
movq -0x260(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x48(%rax), %rsi
leaq -0x230(%rbp), %rdi
callq 0x4170
jmp 0x230ec
leaq -0x210(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x15460
jmp 0x23101
leaq -0x190(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x42e0
jmp 0x23116
leaq -0x210(%rbp), %rdi
callq 0x41e0
leaq -0x230(%rbp), %rdi
callq 0x41e0
jmp 0x23173
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x198(%rbp)
movl %eax, -0x19c(%rbp)
jmp 0x23162
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x198(%rbp)
movl %eax, -0x19c(%rbp)
leaq -0x210(%rbp), %rdi
callq 0x41e0
leaq -0x230(%rbp), %rdi
callq 0x41e0
jmp 0x23304
leaq 0x314e(%rip), %rsi      # 0x262c8
leaq -0x190(%rbp), %rdi
callq 0x4340
movq %rax, -0x2a8(%rbp)
jmp 0x2318f
movq -0x2a8(%rbp), %rdi
movq -0x260(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0x42e0
movq %rax, -0x2b0(%rbp)
jmp 0x231af
movq -0x2b0(%rbp), %rdi
leaq 0xfbb(%rip), %rsi       # 0x24178
callq 0x4340
jmp 0x231c4
jmp 0x232d3
movl -0x14(%rbp), %eax
shll $0x2, %eax
cltq
movq %rax, -0x2c0(%rbp)
leaq -0x251(%rbp), %rdi
movq %rdi, -0x2b8(%rbp)
callq 0x46e0
movq -0x2c0(%rbp), %rsi
movq -0x2b8(%rbp), %rcx
leaq -0x250(%rbp), %rdi
movl $0x20, %edx
callq 0x1f2f0
jmp 0x2320c
leaq -0x190(%rbp), %rdi
leaq -0x250(%rbp), %rsi
callq 0x42e0
movq %rax, -0x2c8(%rbp)
jmp 0x23228
movq -0x2c8(%rbp), %rdi
leaq 0x28b9(%rip), %rsi      # 0x25aef
callq 0x4340
movq %rax, -0x2d0(%rbp)
jmp 0x23244
movq -0x2d0(%rbp), %rdi
movq -0x260(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0x42e0
movq %rax, -0x2d8(%rbp)
jmp 0x23264
movq -0x2d8(%rbp), %rdi
leaq 0xf06(%rip), %rsi       # 0x24178
callq 0x4340
jmp 0x23279
leaq -0x250(%rbp), %rdi
callq 0x41e0
leaq -0x251(%rbp), %rdi
callq 0x43d0
jmp 0x232d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x198(%rbp)
movl %eax, -0x19c(%rbp)
jmp 0x232c5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x198(%rbp)
movl %eax, -0x19c(%rbp)
leaq -0x250(%rbp), %rdi
callq 0x41e0
leaq -0x251(%rbp), %rdi
callq 0x43d0
jmp 0x23304
movq -0x270(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x4380
jmp 0x232e8
leaq -0x190(%rbp), %rdi
callq 0x40c0
movq -0x268(%rbp), %rax
addq $0x2e0, %rsp            # imm = 0x2E0
popq %rbp
retq
leaq -0x190(%rbp), %rdi
callq 0x40c0
movq -0x198(%rbp), %rdi
callq 0x46d0
nopl (%rax)