// File: /workspace/github_cpp_makefile_star2_O2/CoinXu[P]reviser-compiler/src/compiler/typescript/typescript_generator.cpp
// Function: reviser::typescript::TypeScriptGenerator::Export[abi:cxx11]()
string TypeScriptGenerator::Export() {
    string code;

    if (descriptor->GlobalVariables().size() == 0) {
      return code;
    }

    code += "export {\n";
    string alias;
    vector<Descriptor::VariableDeclare> variables = descriptor->GlobalVariables();

    for (vector<Descriptor::VariableDeclare>::iterator it = begin(variables); it != end(variables); it++) {
      if ((*it).type == DECLARE_STRUCT) {
        alias += "const " + (*it).id + " = Ns" + (*it).id + "." + (*it).id + ";\n";
      }
      code += TypeScriptCommon::Indent(1) + (*it).id + (next(it) == end(variables) ? "\n" : ",\n");
    }

    return (alias.size() > 0 ? (alias + "\n") : "") + code += "}";
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
leaq -0x38(%rbp), %r14
movq %r14, -0x10(%r14)
andq $0x0, -0x8(%r14)
movq %rsi, %rbx
movq %rdi, %r13
movb $0x0, (%r14)
movq 0x50(%rsi), %rsi
leaq -0xa8(%rbp), %rdi
callq 0x414ac
leaq -0xa8(%rbp), %rdi
movq 0x8(%rdi), %r15
movq (%rdi), %r12
callq 0x4195a
cmpq %r12, %r15
je 0x550c1
leaq 0x3bb3(%rip), %rsi      # 0x58aab
leaq -0x48(%rbp), %rdi
callq 0x35640
leaq -0x98(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x50(%rbx), %rsi
leaq -0x88(%rbp), %rdi
callq 0x414ac
movq %r13, -0x70(%rbp)
movq -0x88(%rbp), %rbx
addq $0x28, %rbx
leaq -0xe8(%rbp), %r15
leaq -0x28(%rbx), %r13
cmpq -0x80(%rbp), %r13
je 0x55098
cmpl $0x1, -0x8(%rbx)
jne 0x55026
leaq -0x108(%rbp), %r12
movq %r12, %rdi
leaq 0x3cb9(%rip), %rsi      # 0x58c1c
movq %r13, %rdx
callq 0x3aa1e
leaq -0x128(%rbp), %r14
movq %r14, %rdi
movq %r12, %rsi
leaq 0x3ca4(%rip), %rdx      # 0x58c23
callq 0x38f1f
leaq -0x148(%rbp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x38ef6
leaq -0xc8(%rbp), %r14
movq %r14, %rdi
movq %r12, %rsi
leaq 0x219f(%rip), %rdx      # 0x5714c
callq 0x38f1f
leaq -0x68(%rbp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x38ef6
movq %r15, %rdi
movq %r12, %rsi
leaq 0x3ab5(%rip), %rdx      # 0x58a86
callq 0x38f1f
leaq -0xa8(%rbp), %rdi
movq %r15, %rsi
callq 0x35670
movq %r15, %rdi
callq 0x35180
leaq -0x68(%rbp), %rdi
callq 0x35180
leaq -0xc8(%rbp), %rdi
callq 0x35180
leaq -0x148(%rbp), %rdi
callq 0x35180
leaq -0x128(%rbp), %rdi
callq 0x35180
leaq -0x108(%rbp), %rdi
callq 0x35180
leaq -0xc8(%rbp), %r14
movq %r14, %rdi
pushq $0x1
popq %rsi
callq 0x53b3a
leaq -0x68(%rbp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x42892
cmpq -0x80(%rbp), %rbx
leaq 0x3958(%rip), %rdx      # 0x589ad
leaq 0x3ae2(%rip), %rax      # 0x58b3e
cmoveq %rax, %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x38f1f
leaq -0x48(%rbp), %rdi
movq %r15, %rsi
callq 0x35670
movq %r15, %rdi
callq 0x35180
movq %r12, %rdi
callq 0x35180
movq %r14, %rdi
callq 0x35180
addq $0x28, %rbx
jmp 0x54f3a
movq -0xa0(%rbp), %r14
testq %r14, %r14
movq -0x70(%rbp), %r13
je 0x550e7
leaq 0x3a8f(%rip), %rdx      # 0x58b3e
leaq -0x68(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3ccf9
jmp 0x550fe
leaq 0x10(%r13), %rax
movq %rax, (%r13)
movq -0x48(%rbp), %rcx
cmpq %r14, %rcx
je 0x55162
movq %rcx, (%r13)
movq -0x38(%rbp), %rax
movq %rax, 0x10(%r13)
jmp 0x55169
leaq 0x3a51(%rip), %rsi      # 0x58b3f
leaq -0x68(%rbp), %rdi
leaq -0xc8(%rbp), %rdx
callq 0x35130
leaq -0xe8(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x38ef6
leaq 0x2173(%rip), %rsi      # 0x5728c
leaq -0xe8(%rbp), %rdi
callq 0x35640
movq %r13, %rdi
movq %rax, %rsi
callq 0x35470
leaq -0xe8(%rbp), %rdi
callq 0x35180
leaq -0x68(%rbp), %rdi
callq 0x35180
testq %r14, %r14
leaq -0x88(%rbp), %rdi
callq 0x4195a
leaq -0xa8(%rbp), %rdi
callq 0x35180
jmp 0x5517e
movups (%r14), %xmm0
movups %xmm0, (%rax)
movq -0x40(%rbp), %rax
movq %rax, 0x8(%r13)
movq %r14, -0x48(%rbp)
andq $0x0, -0x40(%rbp)
movb $0x0, -0x38(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x35180
movq %r13, %rax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5523d
jmp 0x5523d
movq %rax, %rbx
jmp 0x551cc
movq %rax, %rbx
jmp 0x5527c
jmp 0x551b5
movq %rax, %rbx
jmp 0x55288
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
callq 0x35180
leaq -0x68(%rbp), %rdi
callq 0x35180
testq %r14, %r14
jmp 0x55270
movq %rax, %rbx
jmp 0x55234
movq %rax, %rbx
jmp 0x5521c
movq %rax, %rbx
jmp 0x55207
jmp 0x5523d
movq %rax, %rbx
jmp 0x55228
movq %rax, %rbx
jmp 0x55210
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
callq 0x35180
leaq -0x68(%rbp), %rdi
callq 0x35180
leaq -0xc8(%rbp), %rdi
callq 0x35180
leaq -0x148(%rbp), %rdi
callq 0x35180
leaq -0x128(%rbp), %rdi
callq 0x35180
leaq -0x108(%rbp), %rdi
jmp 0x5526b
movq %rax, %rbx
jmp 0x55270
movq %rax, %rbx
jmp 0x55264
movq %rax, %rbx
jmp 0x5525b
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
callq 0x35180
leaq -0x68(%rbp), %rdi
callq 0x35180
leaq -0xc8(%rbp), %rdi
callq 0x35180
leaq -0x88(%rbp), %rdi
callq 0x4195a
leaq -0xa8(%rbp), %rdi
callq 0x35180
leaq -0x48(%rbp), %rdi
callq 0x35180
movq %rbx, %rdi
callq 0x355f0
nop