// File: /workspace/github_cpp_makefile_star2_O2/CoinXu[P]reviser-compiler/src/compiler/javascript/javascript_generator.cpp
// Function: reviser::javascript::JavaScriptGenerator::Import[abi:cxx11]()
string JavaScriptGenerator::Import() {
    // decorators
    vector<string> deco(descriptor->Decorators());
    vector<string> decorators;

    for (vector<string>::iterator it = begin(deco); it != end(deco); it++ ) {
      if (ReviserSyntaxBuildIn.find(*it) == ReviserSyntaxBuildIn.end()) {
        message.Runtime("undefined error: " + *it + " not defined in decorators.");
      }
      decorators.push_back(JavaScriptCommon::ImportId(ReviserSyntaxBuildIn.at(*it)));
    }

    vector<string> revisers;
    vector<DataType> types = descriptor->DataTypes();
    map<string, int> unique;

    if (descriptor->include_type_array) {
      revisers.push_back(JavaScriptCommon::ImportId(ReviserMethodMap[REVISER_TYPE_ARRAY]));
    }

    if (descriptor->include_struct_array) {
      revisers.push_back(JavaScriptCommon::ImportId(ReviserMethodMap[REVISER_TYPE_ARRAY_STRUCT]));
    }

    for (vector<DataType>::iterator it = begin(types); it != end(types); it++) {
      vector<ReviserSyntaxDefinition> defs = JavaScriptCommon::FindReviserSyntaxDefinitionByDataType(*it);
      for (ReviserSyntaxDefinition d : defs) {
        string id = JavaScriptCommon::ImportId(d);
        if (unique.find(id) == unique.end()) {
          unique[id] = 0;
          revisers.push_back(id);
        }
      }
    }

    return "import { Reviser } from \"data-reviser\";\n"
      + (decorators.size() > 0 ? ("import { " + JavaScriptCommon::JoinVector(decorators, ", ") + " } from \"data-reviser\";\n") : "")
      + (revisers.size() > 0 ? ("import { " + JavaScriptCommon::JoinVector(revisers, ", ") + " } from \"data-reviser\";") : "");
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x358, %rsp            # imm = 0x358
movq %rsi, %r14
movq %rdi, -0x58(%rbp)
movq 0x50(%rsi), %rsi
leaq -0x168(%rbp), %rbx
movq %rbx, %rdi
callq 0x41494
xorps %xmm0, %xmm0
leaq -0xa0(%rbp), %rax
movaps %xmm0, (%rax)
andq $0x0, 0x10(%rax)
movq (%rbx), %r12
movq %r14, -0x60(%rbp)
leaq 0x58(%r14), %rax
movq %rax, -0x108(%rbp)
leaq 0x1ca4b(%rip), %rbx     # 0x6cad0
leaq 0x8(%rbx), %rax
movq %rax, -0x38(%rbp)
leaq -0x100(%rbp), %r14
leaq -0x378(%rbp), %r15
cmpq -0x160(%rbp), %r12
je 0x5014c
movq %rbx, %rdi
movq %r12, %rsi
callq 0x51846
cmpq -0x38(%rbp), %rax
jne 0x50103
movq %r14, %rdi
leaq 0x896f(%rip), %rsi      # 0x58a32
movq %r12, %rdx
callq 0x3aa1e
leaq -0x2f8(%rbp), %r13
movq %r13, %rdi
movq %r14, %rsi
leaq 0x8965(%rip), %rdx      # 0x58a44
callq 0x38f1f
movq -0x108(%rbp), %rdi
movq %r13, %rsi
callq 0x3a8c2
movq %r13, %rdi
callq 0x35180
movq %r14, %rdi
callq 0x35180
movq %rbx, %rdi
movq %r12, %rsi
callq 0x50d04
movq %r15, %rdi
movq %rax, %rsi
callq 0x406a8
movq %r14, %rdi
movq %r15, %rsi
callq 0x35470
leaq -0xa0(%rbp), %rdi
movq %r14, %rsi
callq 0x38f8a
movq %r14, %rdi
callq 0x35180
movq %r15, %rdi
callq 0x4062c
addq $0x20, %r12
jmp 0x5009b
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
andq $0x0, -0x40(%rbp)
movq -0x60(%rbp), %rbx
movq 0x50(%rbx), %rsi
leaq -0x120(%rbp), %rdi
callq 0x414c8
leaq -0x250(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movq 0x50(%rbx), %rax
cmpb $0x1, 0x60(%rax)
jne 0x501fd
leaq -0xc0(%rbp), %rsi
movl $0x1, (%rsi)
leaq 0x1c95a(%rip), %rdi     # 0x6cb00
callq 0x50d54
leaq -0x2d8(%rbp), %rdi
movq %rax, %rsi
callq 0x406a8
leaq -0x100(%rbp), %rdi
leaq -0x2d8(%rbp), %rsi
callq 0x35470
leaq -0x50(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x38f8a
leaq -0x100(%rbp), %rdi
callq 0x35180
leaq -0x2d8(%rbp), %rdi
callq 0x4062c
movq -0x60(%rbp), %rax
movq 0x50(%rax), %rax
cmpb $0x1, 0x61(%rax)
jne 0x50263
leaq -0xc0(%rbp), %rsi
andl $0x0, (%rsi)
leaq 0x1c8ec(%rip), %rdi     # 0x6cb00
callq 0x50d54
leaq -0x298(%rbp), %rdi
movq %rax, %rsi
callq 0x406a8
leaq -0x100(%rbp), %rdi
leaq -0x298(%rbp), %rsi
callq 0x35470
leaq -0x50(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x38f8a
leaq -0x100(%rbp), %rdi
callq 0x35180
leaq -0x298(%rbp), %rdi
callq 0x4062c
movq -0x120(%rbp), %rax
leaq -0x100(%rbp), %r15
leaq -0x338(%rbp), %rbx
leaq -0xc0(%rbp), %r12
cmpq -0x118(%rbp), %rax
je 0x50336
movq %rax, -0x38(%rbp)
movl (%rax), %esi
leaq -0x80(%rbp), %rdi
callq 0x50da6
movq -0x80(%rbp), %r14
movq -0x78(%rbp), %r13
cmpq %r13, %r14
je 0x50320
movq %r15, %rdi
movq %r14, %rsi
callq 0x406a8
movq %rbx, %rdi
movq %r15, %rsi
callq 0x406a8
movq %r12, %rdi
movq %rbx, %rsi
callq 0x35470
movq %rbx, %rdi
callq 0x4062c
leaq -0x258(%rbp), %rdi
movq %r12, %rsi
callq 0x51a00
leaq -0x250(%rbp), %rcx
cmpq %rcx, %rax
jne 0x5030a
leaq -0x258(%rbp), %rdi
movq %r12, %rsi
callq 0x50e74
andl $0x0, (%rax)
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
callq 0x38f8a
movq %r12, %rdi
callq 0x35180
movq %r15, %rdi
callq 0x4062c
addq $0x40, %r14
jmp 0x502a3
leaq -0x80(%rbp), %rdi
callq 0x50ede
movq -0x38(%rbp), %rax
addq $0x4, %rax
jmp 0x5027f
movq -0xa0(%rbp), %r14
movq -0x98(%rbp), %r15
cmpq %r14, %r15
je 0x503c1
leaq -0x150(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x41758
movq -0x58(%rbp), %rbx
leaq 0x86a5(%rip), %rsi      # 0x58a0c
leaq -0x208(%rbp), %rdi
leaq -0x2a(%rbp), %rdx
callq 0x35130
leaq -0x228(%rbp), %rdi
leaq -0x150(%rbp), %rsi
leaq -0x208(%rbp), %rdx
callq 0x4fe2e
leaq 0x86f1(%rip), %rsi      # 0x58a89
leaq -0x80(%rbp), %rdi
leaq -0x228(%rbp), %rdx
callq 0x3aa1e
leaq 0x86c1(%rip), %rdx      # 0x58a70
leaq -0xc0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x38f1f
jmp 0x503dc
leaq 0x8777(%rip), %rsi      # 0x58b3f
leaq -0xc0(%rbp), %rdi
leaq -0x80(%rbp), %rdx
callq 0x35130
movq -0x58(%rbp), %rbx
leaq 0x867d(%rip), %rsi      # 0x58a60
leaq -0x100(%rbp), %rdi
leaq -0xc0(%rbp), %rdx
callq 0x3e4a8
movq -0x50(%rbp), %r12
movq -0x48(%rbp), %r13
cmpq %r12, %r13
je 0x5047a
leaq -0x138(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x41758
leaq 0x85f2(%rip), %rsi      # 0x58a0c
leaq -0x1c8(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x35130
leaq -0x1e8(%rbp), %rdi
leaq -0x138(%rbp), %rsi
leaq -0x1c8(%rbp), %rdx
callq 0x4fe2e
leaq 0x863e(%rip), %rsi      # 0x58a89
leaq -0x188(%rbp), %rdi
leaq -0x1e8(%rbp), %rdx
callq 0x3aa1e
leaq 0x862e(%rip), %rdx      # 0x58a93
leaq -0x1a8(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x38f1f
jmp 0x50494
leaq 0x86be(%rip), %rsi      # 0x58b3f
leaq -0x1a8(%rbp), %rdi
leaq -0x188(%rbp), %rdx
callq 0x35130
leaq -0x100(%rbp), %rsi
leaq -0x1a8(%rbp), %rdx
movq %rbx, %rdi
callq 0x3a9ad
leaq -0x1a8(%rbp), %rdi
callq 0x35180
cmpq %r12, %r13
je 0x504eb
leaq -0x188(%rbp), %rdi
callq 0x35180
leaq -0x1e8(%rbp), %rdi
callq 0x35180
leaq -0x1c8(%rbp), %rdi
callq 0x35180
leaq -0x138(%rbp), %rdi
callq 0x38d68
leaq -0x100(%rbp), %rdi
callq 0x35180
leaq -0xc0(%rbp), %rdi
callq 0x35180
cmpq %r14, %r15
je 0x50535
leaq -0x80(%rbp), %rdi
callq 0x35180
leaq -0x228(%rbp), %rdi
callq 0x35180
leaq -0x208(%rbp), %rdi
callq 0x35180
leaq -0x150(%rbp), %rdi
callq 0x38d68
leaq -0x258(%rbp), %rdi
callq 0x51436
leaq -0x120(%rbp), %rdi
callq 0x421ae
leaq -0x50(%rbp), %rdi
callq 0x38d68
leaq -0xa0(%rbp), %rdi
callq 0x38d68
leaq -0x168(%rbp), %rdi
callq 0x38d68
movq %rbx, %rax
addq $0x358, %rsp            # imm = 0x358
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x505e0
jmp 0x506d9
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
callq 0x35180
jmp 0x5059e
movq %rax, %rbx
leaq -0x298(%rbp), %rdi
jmp 0x505c2
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
callq 0x35180
jmp 0x505bb
movq %rax, %rbx
leaq -0x2d8(%rbp), %rdi
callq 0x4062c
jmp 0x50748
movq %rax, %rbx
jmp 0x5061e
movq %rax, %rbx
jmp 0x5062a
movq %rax, %rbx
jmp 0x50636
movq %rax, %rbx
jmp 0x50642
movq %rax, %rbx
jmp 0x5064e
movq %rax, %rbx
jmp 0x5066f
movq %rax, %rbx
jmp 0x50678
movq %rax, %rbx
jmp 0x50684
movq %rax, %rbx
jmp 0x50690
jmp 0x506d9
movq %rax, %rbx
leaq -0x1a8(%rbp), %rdi
callq 0x35180
cmpq %r12, %r13
je 0x5064e
leaq -0x188(%rbp), %rdi
callq 0x35180
leaq -0x1e8(%rbp), %rdi
callq 0x35180
leaq -0x1c8(%rbp), %rdi
callq 0x35180
leaq -0x138(%rbp), %rdi
callq 0x38d68
leaq -0x100(%rbp), %rdi
callq 0x35180
leaq -0xc0(%rbp), %rdi
callq 0x35180
cmpq %r14, %r15
je 0x50748
leaq -0x80(%rbp), %rdi
callq 0x35180
leaq -0x228(%rbp), %rdi
callq 0x35180
leaq -0x208(%rbp), %rdi
callq 0x35180
leaq -0x150(%rbp), %rdi
callq 0x38d68
jmp 0x50748
movq %rax, %rbx
jmp 0x5065a
jmp 0x506d9
jmp 0x506d9
movq %rax, %rbx
jmp 0x50760
jmp 0x50702
movq %rax, %rbx
leaq -0x2f8(%rbp), %rdi
callq 0x35180
jmp 0x506c8
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
callq 0x35180
jmp 0x50769
movq %rax, %rbx
jmp 0x50748
movq %rax, %rbx
jmp 0x506f2
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
callq 0x35180
leaq -0x378(%rbp), %rdi
callq 0x4062c
jmp 0x50769
jmp 0x50702
movq %rax, %rbx
jmp 0x50769
jmp 0x50724
movq %rax, %rbx
jmp 0x5073f
movq %rax, %rbx
jmp 0x50733
movq %rax, %rbx
leaq -0x338(%rbp), %rdi
callq 0x4062c
jmp 0x50733
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
callq 0x35180
leaq -0x100(%rbp), %rdi
callq 0x4062c
leaq -0x80(%rbp), %rdi
callq 0x50ede
leaq -0x258(%rbp), %rdi
callq 0x51436
leaq -0x120(%rbp), %rdi
callq 0x421ae
leaq -0x50(%rbp), %rdi
callq 0x38d68
leaq -0xa0(%rbp), %rdi
callq 0x38d68
leaq -0x168(%rbp), %rdi
callq 0x38d68
movq %rbx, %rdi
callq 0x355f0
nop