// File: /workspace/github_cpp_makefile_star2_O2/CoinXu[P]reviser-compiler/src/compiler/typescript/typescript_generator.cpp
// Function: reviser::typescript::TypeScriptGenerator::Import[abi:cxx11]()
string TypeScriptGenerator::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(TypeScriptCommon::ImportId(ReviserSyntaxBuildIn.at(*it)));
    }

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

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

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

    for (vector<DataType>::iterator it = begin(types); it != end(types); it++) {
      vector<ReviserSyntaxDefinition> defs = TypeScriptCommon::FindReviserSyntaxDefinitionByDataType(*it);
      for (ReviserSyntaxDefinition d : defs) {
        string id = TypeScriptCommon::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 { " + TypeScriptCommon::JoinVector(decorators, ", ") + " } from \"data-reviser\";\n") : "")
      + (revisers.size() > 0 ? ("import { " + TypeScriptCommon::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 0x1833b(%rip), %rbx     # 0x6cad0
leaq 0x8(%rbx), %rax
movq %rax, -0x38(%rbp)
leaq -0x100(%rbp), %r14
leaq -0x378(%rbp), %r15
cmpq -0x160(%rbp), %r12
je 0x5485c
movq %rbx, %rdi
movq %r12, %rsi
callq 0x51846
cmpq -0x38(%rbp), %rax
jne 0x54813
movq %r14, %rdi
leaq 0x425f(%rip), %rsi      # 0x58a32
movq %r12, %rdx
callq 0x3aa1e
leaq -0x2f8(%rbp), %r13
movq %r13, %rdi
movq %r14, %rsi
leaq 0x4255(%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 0x547ab
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 0x5490d
leaq -0xc0(%rbp), %rsi
movl $0x1, (%rsi)
leaq 0x1824a(%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 0x54973
leaq -0xc0(%rbp), %rsi
andl $0x0, (%rsi)
leaq 0x181dc(%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 0x54a46
movq %rax, -0x38(%rbp)
movl (%rax), %esi
leaq -0x80(%rbp), %rdi
callq 0x55564
movq -0x80(%rbp), %r14
movq -0x78(%rbp), %r13
cmpq %r13, %r14
je 0x54a30
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 0x54a1a
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 0x549b3
leaq -0x80(%rbp), %rdi
callq 0x50ede
movq -0x38(%rbp), %rax
addq $0x4, %rax
jmp 0x5498f
movq -0xa0(%rbp), %r14
movq -0x98(%rbp), %r15
cmpq %r14, %r15
je 0x54ad1
leaq -0x150(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x41758
movq -0x58(%rbp), %rbx
leaq 0x3f95(%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 0x5449c
leaq 0x3fe1(%rip), %rsi      # 0x58a89
leaq -0x80(%rbp), %rdi
leaq -0x228(%rbp), %rdx
callq 0x3aa1e
leaq 0x3fb1(%rip), %rdx      # 0x58a70
leaq -0xc0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x38f1f
jmp 0x54aec
leaq 0x4067(%rip), %rsi      # 0x58b3f
leaq -0xc0(%rbp), %rdi
leaq -0x80(%rbp), %rdx
callq 0x35130
movq -0x58(%rbp), %rbx
leaq 0x3f6d(%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 0x54b8a
leaq -0x138(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x41758
leaq 0x3ee2(%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 0x5449c
leaq 0x3f2e(%rip), %rsi      # 0x58a89
leaq -0x188(%rbp), %rdi
leaq -0x1e8(%rbp), %rdx
callq 0x3aa1e
leaq 0x3f1e(%rip), %rdx      # 0x58a93
leaq -0x1a8(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x38f1f
jmp 0x54ba4
leaq 0x3fae(%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 0x54bfb
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 0x54c45
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 0x54cf0
jmp 0x54de9
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
callq 0x35180
jmp 0x54cae
movq %rax, %rbx
leaq -0x298(%rbp), %rdi
jmp 0x54cd2
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
callq 0x35180
jmp 0x54ccb
movq %rax, %rbx
leaq -0x2d8(%rbp), %rdi
callq 0x4062c
jmp 0x54e58
movq %rax, %rbx
jmp 0x54d2e
movq %rax, %rbx
jmp 0x54d3a
movq %rax, %rbx
jmp 0x54d46
movq %rax, %rbx
jmp 0x54d52
movq %rax, %rbx
jmp 0x54d5e
movq %rax, %rbx
jmp 0x54d7f
movq %rax, %rbx
jmp 0x54d88
movq %rax, %rbx
jmp 0x54d94
movq %rax, %rbx
jmp 0x54da0
jmp 0x54de9
movq %rax, %rbx
leaq -0x1a8(%rbp), %rdi
callq 0x35180
cmpq %r12, %r13
je 0x54d5e
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 0x54e58
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 0x54e58
movq %rax, %rbx
jmp 0x54d6a
jmp 0x54de9
jmp 0x54de9
movq %rax, %rbx
jmp 0x54e70
jmp 0x54e12
movq %rax, %rbx
leaq -0x2f8(%rbp), %rdi
callq 0x35180
jmp 0x54dd8
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
callq 0x35180
jmp 0x54e79
movq %rax, %rbx
jmp 0x54e58
movq %rax, %rbx
jmp 0x54e02
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
callq 0x35180
leaq -0x378(%rbp), %rdi
callq 0x4062c
jmp 0x54e79
jmp 0x54e12
movq %rax, %rbx
jmp 0x54e79
jmp 0x54e34
movq %rax, %rbx
jmp 0x54e4f
movq %rax, %rbx
jmp 0x54e43
movq %rax, %rbx
leaq -0x338(%rbp), %rdi
callq 0x4062c
jmp 0x54e43
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