// File: 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
subq $0x280, %rsp            # imm = 0x280
movq %rdi, -0x240(%rbp)
movq %rdi, %rax
movq %rax, -0x238(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x230(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x99650
movq -0x230(%rbp), %rax
movq 0x50(%rax), %rsi
leaq -0x48(%rbp), %rdi
callq 0xbd260
jmp 0xfadae
leaq -0x48(%rbp), %rdi
callq 0xc0340
movq %rax, -0x248(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xbe0c0
movq -0x248(%rbp), %rax
cmpq $0x0, %rax
jne 0xfae01
movq -0x240(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x99290
movl $0x1, -0x58(%rbp)
jmp 0xfb36f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xfb388
leaq 0x5d13(%rip), %rsi      # 0x100b1b
leaq -0x30(%rbp), %rdi
callq 0x99460
jmp 0xfae13
leaq -0x78(%rbp), %rdi
callq 0x99650
movq -0x230(%rbp), %rax
movq 0x50(%rax), %rsi
leaq -0x90(%rbp), %rdi
callq 0xbd260
jmp 0xfae35
leaq -0x90(%rbp), %rdi
callq 0xef370
movq %rax, -0x250(%rbp)
jmp 0xfae4a
movq -0x250(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq -0x90(%rbp), %rdi
callq 0xef3a0
movq %rax, -0x258(%rbp)
jmp 0xfae6d
movq -0x258(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0xbdda0
testb $0x1, %al
jne 0xfae97
jmp 0xfb1ff
leaq -0x98(%rbp), %rdi
callq 0xbdde0
cmpl $0x1, 0x20(%rax)
jne 0xfb090
leaq -0x98(%rbp), %rdi
callq 0xbdde0
movq %rax, %rdx
leaq 0x5dc9(%rip), %rsi      # 0x100c8c
leaq -0x160(%rbp), %rdi
callq 0xa6e30
jmp 0xfaed1
leaq 0x5dbb(%rip), %rdx      # 0x100c93
leaq -0x140(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0xa10c0
jmp 0xfaeed
leaq -0x98(%rbp), %rdi
callq 0xbdde0
movq %rax, %rdx
leaq -0x120(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0xa1070
jmp 0xfaf11
leaq 0x4234(%rip), %rdx      # 0xff14c
leaq -0x100(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0xa10c0
jmp 0xfaf2d
leaq -0x98(%rbp), %rdi
callq 0xbdde0
movq %rax, %rdx
leaq -0xe0(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0xa1070
jmp 0xfaf51
leaq 0x5b9e(%rip), %rdx      # 0x100af6
leaq -0xc0(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0xa10c0
jmp 0xfaf6d
leaq -0x78(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x995d0
jmp 0xfaf7f
leaq -0xc0(%rbp), %rdi
callq 0x992c0
leaq -0xe0(%rbp), %rdi
callq 0x992c0
leaq -0x100(%rbp), %rdi
callq 0x992c0
leaq -0x120(%rbp), %rdi
callq 0x992c0
leaq -0x140(%rbp), %rdi
callq 0x992c0
leaq -0x160(%rbp), %rdi
callq 0x992c0
jmp 0xfb090
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xfb364
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xfb358
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xfb07f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xfb073
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xfb067
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xfb05b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xfb04f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x992c0
leaq -0xe0(%rbp), %rdi
callq 0x992c0
leaq -0x100(%rbp), %rdi
callq 0x992c0
leaq -0x120(%rbp), %rdi
callq 0x992c0
leaq -0x140(%rbp), %rdi
callq 0x992c0
leaq -0x160(%rbp), %rdi
callq 0x992c0
jmp 0xfb358
leaq -0x1c0(%rbp), %rdi
movl $0x1, %esi
callq 0xf8390
jmp 0xfb0a3
leaq -0x98(%rbp), %rdi
callq 0xbdde0
movq %rax, %rdx
leaq -0x1a0(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0xc25f0
jmp 0xfb0c7
movq -0x98(%rbp), %rax
movq %rax, -0x1d0(%rbp)
movq -0x1d0(%rbp), %rdi
movl $0x1, %esi
callq 0xef410
movq %rax, -0x260(%rbp)
jmp 0xfb0ef
movq -0x260(%rbp), %rax
movq %rax, -0x1c8(%rbp)
leaq -0x90(%rbp), %rdi
callq 0xef3a0
movq %rax, -0x268(%rbp)
jmp 0xfb112
movq -0x268(%rbp), %rax
movq %rax, -0x1d8(%rbp)
leaq -0x1c8(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0xef3d0
movb %al, %cl
leaq 0x5a72(%rip), %rax      # 0x100bae
leaq 0x58da(%rip), %rdx      # 0x100a1d
testb %cl, %cl
cmovneq %rax, %rdx
leaq -0x180(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0xa10c0
jmp 0xfb15e
leaq -0x30(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x995d0
jmp 0xfb170
leaq -0x180(%rbp), %rdi
callq 0x992c0
leaq -0x1a0(%rbp), %rdi
callq 0x992c0
leaq -0x1c0(%rbp), %rdi
callq 0x992c0
leaq -0x98(%rbp), %rdi
xorl %esi, %esi
callq 0xef440
movq %rax, -0x1e0(%rbp)
jmp 0xfae58
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xfb1ee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xfb1e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x992c0
leaq -0x1a0(%rbp), %rdi
callq 0x992c0
leaq -0x1c0(%rbp), %rdi
callq 0x992c0
jmp 0xfb358
leaq -0x78(%rbp), %rdi
callq 0x99350
movb $0x0, -0x222(%rbp)
cmpq $0x0, %rax
jbe 0xfb230
leaq 0x5992(%rip), %rdx      # 0x100bae
leaq -0x220(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0xaaee0
jmp 0xfb22e
jmp 0xfb268
leaq -0x221(%rbp), %rdi
movq %rdi, -0x270(%rbp)
callq 0x99850
movq -0x270(%rbp), %rdx
movb $0x1, -0x222(%rbp)
leaq 0x5957(%rip), %rsi      # 0x100baf
leaq -0x220(%rbp), %rdi
callq 0x99640
jmp 0xfb266
jmp 0xfb268
leaq -0x200(%rbp), %rdi
leaq -0x220(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0xa1070
jmp 0xfb281
leaq 0x4004(%rip), %rsi      # 0xff28c
leaq -0x200(%rbp), %rdi
callq 0x99460
movq %rax, -0x278(%rbp)
jmp 0xfb29d
movq -0x278(%rbp), %rsi
movq -0x240(%rbp), %rdi
callq 0x991c0
jmp 0xfb2b2
leaq -0x200(%rbp), %rdi
callq 0x992c0
leaq -0x220(%rbp), %rdi
callq 0x992c0
testb $0x1, -0x222(%rbp)
jne 0xfb2d5
jmp 0xfb2e1
leaq -0x221(%rbp), %rdi
callq 0x994f0
movl $0x1, -0x58(%rbp)
leaq -0x90(%rbp), %rdi
callq 0xbe0c0
leaq -0x78(%rbp), %rdi
callq 0x992c0
jmp 0xfb36f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xfb33f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xfb333
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x992c0
leaq -0x220(%rbp), %rdi
callq 0x992c0
testb $0x1, -0x222(%rbp)
jne 0xfb34a
jmp 0xfb356
leaq -0x221(%rbp), %rdi
callq 0x994f0
jmp 0xfb358
leaq -0x90(%rbp), %rdi
callq 0xbe0c0
leaq -0x78(%rbp), %rdi
callq 0x992c0
jmp 0xfb388
leaq -0x30(%rbp), %rdi
callq 0x992c0
movq -0x238(%rbp), %rax
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x992c0
movq -0x50(%rbp), %rdi
callq 0x99840
nopw (%rax,%rax)