// File: /workspace/github_cpp_makefile_star2_O1/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 0xea30
cmpq $0x0, 0x18(%rbx)
jne 0xed72
movq 0xe2dc(%rip), %rdi      # 0x1cff0
leaq 0x7ec1(%rip), %rsi      # 0x16bdc
movl $0x31, %edx
callq 0x4340
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x7e80(%rip), %rsi      # 0x16bb5
leaq 0x7e80(%rip), %rdx      # 0x16bbc
leaq 0x8(%rsp), %rdi
callq 0x6e3c
leaq 0x4(%rsp), %rsi
movl $0xd2, (%rsi)
leaq 0x8(%rsp), %rdi
callq 0xd138
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xed72
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x42e0
cmpq $0x0, 0x48(%rbx)
jne 0xedde
movq 0xe270(%rip), %rdi      # 0x1cff0
leaq 0x7e87(%rip), %rsi      # 0x16c0e
movl $0x43, %edx
callq 0x4340
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x7e14(%rip), %rsi      # 0x16bb5
leaq 0x7e14(%rip), %rdx      # 0x16bbc
leaq 0x8(%rsp), %rdi
callq 0x6e3c
leaq 0x4(%rsp), %rsi
movl $0xd8, (%rsi)
leaq 0x8(%rsp), %rdi
callq 0xd138
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xedde
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 %r13d, %r13d
movq %r13, 0x50(%rdi)
movq %r14, %rsi
callq 0x4180
movq 0x18(%rbx), %rax
andw $0xfeff, 0x20(%rax)     # imm = 0xFEFF
movq (%rbx), %rdi
callq 0xe48a
movq 0x18(%rbx), %rcx
movq %rax, 0x30(%rcx)
movq (%rbx), %rdi
leaq 0x8(%rsp), %rsi
movq %r13, (%rsi)
callq 0xe352
leaq 0x60(%rbx), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0xa304
movq (%rax), %rax
cmpl $0x0, 0x40(%rax)
je 0xf007
movl $0x58, %edi
callq 0x42d0
movq %rax, %r12
leaq 0x10(%rax), %rbp
movq %rbp, (%rax)
movq %r13, 0x8(%rax)
movb %r13b, 0x10(%rax)
movb %r13b, 0x20(%rax)
movl %r13d, 0x24(%rax)
movl %r13d, 0x2c(%rax)
movq %r13, 0x30(%rax)
movl %r13d, 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 0x134ec
movq %r15, %rdi
movq %r14, %rsi
callq 0xa304
movq (%rax), %rcx
movl 0x24(%r12), %eax
cmpl %eax, 0x40(%rcx)
jne 0xeed7
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)
jmp 0xefdc
movq (%r12), %rdi
cmpq %rbp, %rdi
je 0xeeec
movq (%rbp), %rsi
incq %rsi
callq 0x42e0
movl $0x58, %esi
movq %r12, %rdi
callq 0x42e0
movq 0xe0f0(%rip), %r12      # 0x1cff0
leaq 0x7d4b(%rip), %rsi      # 0x16c52
movl $0x2d, %edx
movq %r12, %rdi
callq 0x4340
leaq 0x7d65(%rip), %rsi      # 0x16c80
movl $0x6, %edx
movq %r12, %rdi
callq 0x4340
movl 0x24, %esi
movq %r12, %rdi
callq 0x4560
movq %rax, %r12
leaq 0x7dbc(%rip), %rsi      # 0x16cfd
movl $0x6, %edx
movq %rax, %rdi
callq 0x4340
movq (%rbx), %rdi
callq 0xe34a
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 0x7c19(%rip), %rsi      # 0x16bb5
leaq 0x7c19(%rip), %rdx      # 0x16bbc
leaq 0x8(%rsp), %rdi
callq 0x6e3c
leaq 0x4(%rsp), %rsi
movl $0x105, (%rsi)          # imm = 0x105
leaq 0x8(%rsp), %rdi
callq 0xd138
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xefd9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x42e0
xorl %r12d, %r12d
testq %r12, %r12
je 0xf007
movq (%r12), %rdi
leaq 0x10(%r12), %rax
cmpq %rax, %rdi
je 0xeffa
movq (%rax), %rsi
incq %rsi
callq 0x42e0
movl $0x58, %esi
movq %r12, %rdi
callq 0x42e0
movq %r15, %rdi
movq %r14, %rsi
callq 0xa304
movq (%rax), %rsi
movq 0x18(%rbx), %rdx
movq 0x30(%rdx), %rcx
movzbl 0x21(%rdx), %r8d
andl $0x1, %r8d
movq %rbx, %rdi
callq 0xf07a
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 0xf05d
jmp 0xf071
jmp 0xf06e
jmp 0xf050
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xf071
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x42e0
jmp 0xf071
jmp 0xf06e
movq %rax, %rbx
movq %rbx, %rdi
callq 0x4590
nop