// File: CoinXu[P]reviser-compiler/src/compiler/javascript/javascript_generator.cpp
// Function: reviser::javascript::JavaScriptGenerator::Generate[abi:cxx11]()
string JavaScriptGenerator::Generate() {
    string block_separetor = "\n\n";
    string code(
      "//\n"
      "// language: JavaScript\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 0x12790(%rip), %rsi     # 0x100bad
leaq -0x30(%rbp), %rdi
callq 0x99640
jmp 0xee428
leaq -0x31(%rbp), %rdi
callq 0x994f0
leaq -0x69(%rbp), %rdi
movq %rdi, -0x1c8(%rbp)
callq 0x99850
movq -0x1c8(%rbp), %rdx
leaq 0x126d6(%rip), %rsi     # 0x100b25
leaq -0x68(%rbp), %rdi
callq 0x99640
jmp 0xee45a
leaq -0x69(%rbp), %rdi
callq 0x994f0
movq -0x1b0(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
callq 0xed290
jmp 0xee478
leaq -0x90(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0xa1070
jmp 0xee491
leaq -0x68(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x995d0
jmp 0xee4a3
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 0xee50f
jmp 0xee760
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 0xee68c
jmp 0xee53b
movl -0x1cc(%rbp), %eax
subl $0x1, %eax
je 0xee5cb
jmp 0xee74b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x994f0
jmp 0xee825
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x69(%rbp), %rdi
callq 0x994f0
jmp 0xee81c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xee813
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xee5ba
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 0xee813
movq -0x1b0(%rbp), %rdi
addq $0x20, %rdi
movq -0xd8(%rbp), %rsi
callq 0xb7530
movq %rax, -0x1d8(%rbp)
jmp 0xee5eb
movq -0x1b0(%rbp), %rsi
movq -0x1d8(%rbp), %rax
movq (%rax), %rdx
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x120(%rbp), %rdi
callq *%rax
jmp 0xee60d
leaq -0x100(%rbp), %rdi
leaq -0x120(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0xa1070
jmp 0xee626
leaq -0x68(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x995d0
jmp 0xee638
leaq -0x100(%rbp), %rdi
callq 0x992c0
leaq -0x120(%rbp), %rdi
callq 0x992c0
jmp 0xee74d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xee67b
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 0xee813
movq -0x1b0(%rbp), %rdi
addq $0x38, %rdi
movq -0xd8(%rbp), %rsi
callq 0xb7570
movq %rax, -0x1e0(%rbp)
jmp 0xee6ac
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 0xee6cf
leaq -0x140(%rbp), %rdi
leaq -0x160(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0xa1070
jmp 0xee6e8
leaq -0x68(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x995d0
jmp 0xee6fa
leaq -0x140(%rbp), %rdi
callq 0x992c0
leaq -0x160(%rbp), %rdi
callq 0x992c0
jmp 0xee74d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xee73a
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 0xee813
jmp 0xee74d
jmp 0xee74f
leaq -0xc0(%rbp), %rdi
callq 0xb75b0
jmp 0xee4f3
movq -0x1b0(%rbp), %rsi
leaq -0x1a0(%rbp), %rdi
callq 0xedff0
jmp 0xee775
leaq -0x180(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x1a0(%rbp), %rdx
callq 0xeba70
jmp 0xee78e
movq -0x1c0(%rbp), %rdi
leaq -0x180(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0xa1070
jmp 0xee7a7
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 0xee807
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