// File: CoinXu[P]reviser-compiler/src/compiler/typescript/typescript_generator.cpp
// Function: reviser::typescript::TypeScriptGenerator::Generate[abi:cxx11]()
string TypeScriptGenerator::Generate() {
    string block_separetor = "\n\n";
    string code(
      "//\n"
      "// language: TypeScript\n"
      "// generated by reviser-comiper\n"
      "// do not change this file\n"
      "// see https://github.com/CoinXu/reviser-compiler\n\n\n"
    );
    code += Import() + block_separetor;

    for (StmtSeqItem it: seq) {
      switch(it.type) {
        case STMT_TYPE_STRUCT:
          code += StmtStruct(structures.at(it.index)) + block_separetor;
          break;

        case STMT_TYPE_ENUM:
          code += StmtEnum(enums.at(it.index)) + block_separetor;
          break;

        default:
          break;
      }
    }

    return code + Export() + block_separetor;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1e0, %rsp            # imm = 0x1E0
movq %rdi, -0x1c0(%rbp)
movq %rdi, %rax
movq %rax, -0x1b8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1b0(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x1a8(%rbp)
callq 0x99850
movq -0x1a8(%rbp), %rdx
leaq 0x56e0(%rip), %rsi      # 0x100bad
leaq -0x30(%rbp), %rdi
callq 0x99640
jmp 0xfb4d8
leaq -0x31(%rbp), %rdi
callq 0x994f0
leaq -0x69(%rbp), %rdi
movq %rdi, -0x1c8(%rbp)
callq 0x99850
movq -0x1c8(%rbp), %rdx
leaq 0x579a(%rip), %rsi      # 0x100c99
leaq -0x68(%rbp), %rdi
callq 0x99640
jmp 0xfb50a
leaq -0x69(%rbp), %rdi
callq 0x994f0
movq -0x1b0(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
callq 0xfa000
jmp 0xfb528
leaq -0x90(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0xa1070
jmp 0xfb541
leaq -0x68(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x995d0
jmp 0xfb553
leaq -0x90(%rbp), %rdi
callq 0x992c0
leaq -0xb0(%rbp), %rdi
callq 0x992c0
movq -0x1b0(%rbp), %rax
addq $0x8, %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rdi
callq 0xb7470
movq %rax, -0xc0(%rbp)
movq -0xb8(%rbp), %rdi
callq 0xb74a0
movq %rax, -0xc8(%rbp)
leaq -0xc0(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0xb74d0
testb $0x1, %al
jne 0xfb5bf
jmp 0xfb810
leaq -0xc0(%rbp), %rdi
callq 0xb7510
movups (%rax), %xmm0
movaps %xmm0, -0xe0(%rbp)
movl -0xe0(%rbp), %eax
movl %eax, -0x1cc(%rbp)
testl %eax, %eax
je 0xfb73c
jmp 0xfb5eb
movl -0x1cc(%rbp), %eax
subl $0x1, %eax
je 0xfb67b
jmp 0xfb7fb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x994f0
jmp 0xfb8d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x69(%rbp), %rdi
callq 0x994f0
jmp 0xfb8cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xfb8c3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xfb66a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x992c0
leaq -0xb0(%rbp), %rdi
callq 0x992c0
jmp 0xfb8c3
movq -0x1b0(%rbp), %rdi
addq $0x20, %rdi
movq -0xd8(%rbp), %rsi
callq 0xb7530
movq %rax, -0x1d8(%rbp)
jmp 0xfb69b
movq -0x1b0(%rbp), %rsi
movq -0x1d8(%rbp), %rax
movq (%rax), %rdx
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x120(%rbp), %rdi
callq *%rax
jmp 0xfb6bd
leaq -0x100(%rbp), %rdi
leaq -0x120(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0xa1070
jmp 0xfb6d6
leaq -0x68(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x995d0
jmp 0xfb6e8
leaq -0x100(%rbp), %rdi
callq 0x992c0
leaq -0x120(%rbp), %rdi
callq 0x992c0
jmp 0xfb7fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xfb72b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x992c0
leaq -0x120(%rbp), %rdi
callq 0x992c0
jmp 0xfb8c3
movq -0x1b0(%rbp), %rdi
addq $0x38, %rdi
movq -0xd8(%rbp), %rsi
callq 0xb7570
movq %rax, -0x1e0(%rbp)
jmp 0xfb75c
movq -0x1b0(%rbp), %rsi
movq -0x1e0(%rbp), %rax
movq (%rax), %rdx
movq (%rsi), %rax
movq 0x8(%rax), %rax
leaq -0x160(%rbp), %rdi
callq *%rax
jmp 0xfb77f
leaq -0x140(%rbp), %rdi
leaq -0x160(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0xa1070
jmp 0xfb798
leaq -0x68(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x995d0
jmp 0xfb7aa
leaq -0x140(%rbp), %rdi
callq 0x992c0
leaq -0x160(%rbp), %rdi
callq 0x992c0
jmp 0xfb7fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xfb7ea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x992c0
leaq -0x160(%rbp), %rdi
callq 0x992c0
jmp 0xfb8c3
jmp 0xfb7fd
jmp 0xfb7ff
leaq -0xc0(%rbp), %rdi
callq 0xb75b0
jmp 0xfb5a3
movq -0x1b0(%rbp), %rsi
leaq -0x1a0(%rbp), %rdi
callq 0xfad60
jmp 0xfb825
leaq -0x180(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x1a0(%rbp), %rdx
callq 0xeba70
jmp 0xfb83e
movq -0x1c0(%rbp), %rdi
leaq -0x180(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0xa1070
jmp 0xfb857
leaq -0x180(%rbp), %rdi
callq 0x992c0
leaq -0x1a0(%rbp), %rdi
callq 0x992c0
leaq -0x68(%rbp), %rdi
callq 0x992c0
leaq -0x30(%rbp), %rdi
callq 0x992c0
movq -0x1b8(%rbp), %rax
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xfb8b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x992c0
leaq -0x1a0(%rbp), %rdi
callq 0x992c0
leaq -0x68(%rbp), %rdi
callq 0x992c0
leaq -0x30(%rbp), %rdi
callq 0x992c0
movq -0x40(%rbp), %rdi
callq 0x99840
nop