// File: /workspace/github_cpp_makefile_star2_O3/tap3edit[P]tap3xml/Asn.cpp
// Function: Asn::decode()
void Asn::decode()
{

    /* 1. Decode Specification */

    _decode_spec();


    /* 2. Prepare Tree to decode */

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

    if (!_spec_rootnode.size())
    {
        cerr << "Error. The root node should be specified with the method \"specroot\"";
        err_trace(__FILE__, __LINE__);
    }

    _tree->pc=1;
    _tree->children=NULL;
    _tree->tagname=_spec_rootnode;
    _tree->indef = false;
    _tree->size_d = _bfin->get_end();


    /* 3. Read initial tag if needed */

    _bfin->set_pos(0);

    if ( _spec_tree[_spec_rootnode]->tagid )
    {
        /* The rootnode could have its own tag but not necessarily (like in case of CHOICE)  */
        /* In case it has, we read it here, because in _decode() we assume that the rootnode */
        /* is already decoded. E.g. "DataInterChange" has no own tag, but "Nrtrde" has.      */

        /* 3.1 Eat up the first tag */

        treenode *child=new treenode();

        _asnitem->tree(child);
        _asnitem->decode();

        if (_spec_tree[_spec_rootnode]->tagid == child->tag_d)
        {

            /* 3.1.1. Tag matches */

            _tree->tag_d = child->tag_d;
            _tree->size_d = child->size_d;
            _tree->indef = child->indef;
        }
        else
        {
            /* 3.1.2. Tag does not match */

            delete child; 
            child = NULL;

            cerr << "Error: File does not match the specifications";
            cerr << " tag: " << child->tag_d << " pos: " << _bfin->get_pos() << endl;
            err_trace(__FILE__, __LINE__);
        }

        delete child; 
        child = NULL;

    }

    /* 4. Decode file */

    _decode(_spec_tree[_spec_rootnode], _tree, _tree->size_d, _tree->indef);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
callq 0xe394
cmpq $0x0, 0x18(%rbx)
jne 0xe6d8
movq 0xe976(%rip), %rdi      # 0x1cff0
leaq 0x855b(%rip), %rsi      # 0x16bdc
movl $0x31, %edx
callq 0x4340
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x851a(%rip), %rsi      # 0x16bb5
leaq 0x851a(%rip), %rdx      # 0x16bbc
leaq 0x8(%rsp), %rdi
callq 0x6c96
leaq 0x4(%rsp), %rsi
movl $0xd2, (%rsi)
leaq 0x8(%rsp), %rdi
callq 0xcde4
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xe6d8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x42e0
cmpq $0x0, 0x48(%rbx)
jne 0xe744
movq 0xe90a(%rip), %rdi      # 0x1cff0
leaq 0x8521(%rip), %rsi      # 0x16c0e
movl $0x43, %edx
callq 0x4340
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x84ae(%rip), %rsi      # 0x16bb5
leaq 0x84ae(%rip), %rdx      # 0x16bbc
leaq 0x8(%rsp), %rdi
callq 0x6c96
leaq 0x4(%rsp), %rsi
movl $0xd8, (%rsi)
leaq 0x8(%rsp), %rdi
callq 0xcde4
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xe744
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0x18(%rbx), %rax
orw $0x4, 0x20(%rax)
leaq 0x40(%rbx), %r14
movq 0x18(%rbx), %rdi
xorl %ebp, %ebp
movq %rbp, 0x50(%rdi)
movq %r14, %rsi
callq 0x4180
movq 0x18(%rbx), %rax
andw $0xfeff, 0x20(%rax)     # imm = 0xFEFF
movq (%rbx), %rdi
callq 0xddf0
movq 0x18(%rbx), %rcx
movq %rax, 0x30(%rcx)
movq (%rbx), %rdi
leaq 0x8(%rsp), %rsi
movq %rbp, (%rsi)
callq 0xdcb8
leaq 0x60(%rbx), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0xa082
movq (%rax), %rax
cmpl $0x0, 0x40(%rax)
je 0xe966
movl $0x58, %edi
callq 0x42d0
movq %rax, %r12
leaq 0x10(%rax), %r13
movq %r13, (%rax)
movq %rbp, 0x8(%rax)
movb $0x0, 0x10(%rax)
movw $0x0, 0x20(%rax)
movl %ebp, 0x24(%rax)
movl %ebp, 0x2c(%rax)
movq %rbp, 0x30(%rax)
movl %ebp, 0x40(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%rax)
movq 0x10(%rbx), %rdi
movq (%rdi), %rax
movq %r12, %rsi
callq *0x8(%rax)
movq 0x10(%rbx), %rdi
callq 0x12e04
movq %r15, %rdi
movq %r14, %rsi
callq 0xa082
movq (%rax), %rax
movl 0x40(%rax), %eax
cmpl 0x24(%r12), %eax
jne 0xe854
movq 0x18(%rbx), %rcx
movl %eax, 0x24(%rcx)
movq 0x30(%r12), %rax
movq %rax, 0x30(%rcx)
movzwl 0x20(%r12), %eax
andl $0x100, %eax            # imm = 0x100
movl $0xfffffeff, %edx       # imm = 0xFFFFFEFF
andl 0x20(%rcx), %edx
orl %eax, %edx
movw %dx, 0x20(%rcx)
movq (%r12), %rdi
cmpq %r13, %rdi
je 0xe959
movq (%r13), %rsi
incq %rsi
callq 0x42e0
jmp 0xe959
movq (%r12), %rdi
cmpq %r13, %rdi
je 0xe869
movq (%r13), %rsi
incq %rsi
callq 0x42e0
movl $0x58, %esi
movq %r12, %rdi
callq 0x42e0
movq 0xe773(%rip), %r12      # 0x1cff0
leaq 0x83ce(%rip), %rsi      # 0x16c52
movl $0x2d, %edx
movq %r12, %rdi
callq 0x4340
leaq 0x83e8(%rip), %rsi      # 0x16c80
movl $0x6, %edx
movq %r12, %rdi
callq 0x4340
movl 0x24, %esi
movq %r12, %rdi
callq 0x4560
movq %rax, %r12
leaq 0x843f(%rip), %rsi      # 0x16cfd
movl $0x6, %edx
movq %rax, %rdi
callq 0x4340
movq (%rbx), %rdi
callq 0xdcb0
movq %r12, %rdi
movq %rax, %rsi
callq 0x4290
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x42a0
movsbl %al, %esi
movq %r12, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41e0
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x829c(%rip), %rsi      # 0x16bb5
leaq 0x829c(%rip), %rdx      # 0x16bbc
leaq 0x8(%rsp), %rdi
callq 0x6c96
leaq 0x4(%rsp), %rsi
movl $0x105, (%rsi)          # imm = 0x105
leaq 0x8(%rsp), %rdi
callq 0xcde4
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xe956
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x42e0
xorl %r12d, %r12d
movl $0x58, %esi
movq %r12, %rdi
callq 0x42e0
movq %r15, %rdi
movq %r14, %rsi
callq 0xa082
movq (%rax), %rsi
movq 0x18(%rbx), %rdx
movq 0x30(%rdx), %rcx
movzbl 0x21(%rdx), %r8d
andl $0x1, %r8d
movq %rbx, %rdi
callq 0xe9d8
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
jne 0xe9bc
jmp 0xe9d0
jmp 0xe9cd
jmp 0xe9af
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xe9d0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x42e0
jmp 0xe9d0
jmp 0xe9cd
movq %rax, %rbx
movq %rbx, %rdi
callq 0x4590