// File: CoinXu[P]reviser-compiler/src/compiler/typescript/typescript_expr.cpp
// Function: reviser::typescript::TypeScriptDeclare::Generate[abi:cxx11]()
string TypeScriptDeclare::Generate() {
    string type;
    string value;

    switch (node->type) {
      case TYPE_ENUM:
      case TYPE_STRUCT:
        type = node->type_id->text;
        break;

      case TYPE_BOOL:
      case TYPE_FLOAT:
      case TYPE_DOUBLE:
      case TYPE_INT32:
      case TYPE_INT64:
      case TYPE_UINT32:
      case TYPE_UINT64:
      case TYPE_STRING:
        type = TypeScriptBuildInDataTypeMap[node->type];
        break;

      default:
        type = "any";
    }

    if (node->array_type) {
      type = type + "[]";
    }

    return "public "
      + node->id->text
      + ": " + type + " = "
      + TypeScriptRightValue(node->rv).Generate();
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x150(%rbp)
movq %rdi, %rax
movq %rax, -0x148(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x140(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x99650
leaq -0x50(%rbp), %rdi
callq 0x99650
movq -0x140(%rbp), %rax
movq 0x8(%rax), %rax
movl (%rax), %eax
movl %eax, -0x134(%rbp)
subl $0x8, %eax
jb 0xf931c
jmp 0xf92db
movl -0x134(%rbp), %eax
addl $-0x9, %eax
subl $0x1, %eax
ja 0xf9350
jmp 0xf92eb
movq -0x140(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rsi
addq $0x8, %rsi
leaq -0x30(%rbp), %rdi
callq 0x99070
jmp 0xf9309
jmp 0xf9364
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xf956f
movq -0x140(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0x37bea(%rip), %rdi     # 0x130f18
callq 0xf9730
movq %rax, -0x158(%rbp)
jmp 0xf933c
movq -0x158(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x99070
jmp 0xf934e
jmp 0xf9364
leaq 0x791e(%rip), %rsi      # 0x100c75
leaq -0x30(%rbp), %rdi
callq 0x99630
jmp 0xf9362
jmp 0xf9364
movq -0x140(%rbp), %rax
movq 0x8(%rax), %rax
testb $0x1, 0x4(%rax)
je 0xf93a1
leaq 0x7705(%rip), %rdx      # 0x100a81
leaq -0x80(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xaaee0
jmp 0xf938b
leaq -0x30(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x99590
leaq -0x80(%rbp), %rdi
callq 0x992c0
movq -0x140(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdx
addq $0x8, %rdx
leaq 0x78be(%rip), %rsi      # 0x100c79
leaq -0x100(%rbp), %rdi
callq 0xa6e30
jmp 0xf93c9
leaq 0x5ecd(%rip), %rdx      # 0xff29d
leaq -0xe0(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0xa10c0
jmp 0xf93e5
leaq -0xc0(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0xa1070
jmp 0xf93fe
leaq 0x767f(%rip), %rdx      # 0x100a84
leaq -0xa0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0xa10c0
jmp 0xf941a
movq -0x140(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rax), %rsi
leaq -0x130(%rbp), %rdi
callq 0xf8440
jmp 0xf9437
leaq -0x120(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0xf8480
jmp 0xf944c
movq -0x150(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0x120(%rbp), %rdx
callq 0xa6d60
jmp 0xf9468
leaq -0x120(%rbp), %rdi
callq 0x992c0
leaq -0x130(%rbp), %rdi
callq 0xf8470
leaq -0xa0(%rbp), %rdi
callq 0x992c0
leaq -0xc0(%rbp), %rdi
callq 0x992c0
leaq -0xe0(%rbp), %rdi
callq 0x992c0
leaq -0x100(%rbp), %rdi
callq 0x992c0
leaq -0x50(%rbp), %rdi
callq 0x992c0
leaq -0x30(%rbp), %rdi
callq 0x992c0
movq -0x148(%rbp), %rax
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xf9563
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xf9557
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xf954b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xf953f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xf9533
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x992c0
leaq -0x130(%rbp), %rdi
callq 0xf8470
leaq -0xa0(%rbp), %rdi
callq 0x992c0
leaq -0xc0(%rbp), %rdi
callq 0x992c0
leaq -0xe0(%rbp), %rdi
callq 0x992c0
leaq -0x100(%rbp), %rdi
callq 0x992c0
leaq -0x50(%rbp), %rdi
callq 0x992c0
leaq -0x30(%rbp), %rdi
callq 0x992c0
movq -0x58(%rbp), %rdi
callq 0x99840
nopw (%rax,%rax)