// File: /workspace/github_cpp_makefile_star2_O3/CoinXu[P]reviser-compiler/src/compiler/typescript/typescript_struct.cpp
// Function: reviser::typescript::TypeScriptStruct::Generate[abi:cxx11]()
string TypeScriptStruct::Generate() {
    string indent = TypeScriptCommon::Indent(node->level);
    string indent_next = TypeScriptCommon::Indent(node->level + 1);

    vector<string> properties;
    string ns =  indent + "namespace Ns" + node->id->text + " {\n";

    for (vector<Struct::ContentStore>::iterator it = begin(node->contents);
      it != end(node->contents); it++) {
      const string new_line = next(it) == end(node->contents) ? "\n" : "\n\n";

      switch ((*it).type) {
        case DeclareProperty: {
          TypeScriptStructProperty g(node->properties.at((*it).index), this);
          properties.push_back(g.Generate() + new_line);
          break;
        }

        case DeclareStruct: {
          TypeScriptStruct g(node->structs.at((*it).index), this);
          ns += g.Generate() + new_line;
          break;
        }

        case DeclareEnum: {
          TypeScriptEnum g(node->enums.at((*it).index), this);
          ns += g.Generate() + new_line;
          break;
        }

        default:
          break;
      }
    }

    ns += indent_next + "export class " + node->id->text + " extends Reviser {\n";
    for (string p: properties) {
      ns += p;
    }
    ns += indent_next + "}\n";
    ns += indent + "}\n";

    return ns;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x20(%rsi), %rax
movl 0x98(%rax), %esi
leaq -0x120(%rbp), %rdi
callq 0x492b4
movq 0x20(%r14), %rax
movl 0x98(%rax), %esi
incl %esi
leaq -0x100(%rbp), %rdi
callq 0x492b4
xorps %xmm0, %xmm0
movaps %xmm0, -0xe0(%rbp)
movq $0x0, -0xd0(%rbp)
leaq -0x88(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x120(%rbp), %rsi
movq -0x118(%rbp), %rdx
addq %rsi, %rdx
leaq -0x98(%rbp), %rdi
callq 0x290da
leaq 0x4d6b(%rip), %rsi      # 0x50cf5
leaq -0x98(%rbp), %rdi
callq 0x24650
movq 0x20(%r14), %rax
movq 0x30(%rax), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
leaq -0x98(%rbp), %rdi
callq 0x240f0
leaq -0x40(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4bfd7
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x4bfdf
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq -0x50(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x4b8f(%rip), %rsi      # 0x50b90
callq 0x24650
leaq 0x10(%rbx), %rsi
movq %rsi, (%rbx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
movq %rsi, -0xa0(%rbp)
je 0x4c02f
movq %rdx, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x4c035
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0x4c05a
callq 0x24320
movq %rbx, -0x58(%rbp)
movq -0x98(%rbp), %rdi
cmpq %r15, %rdi
je 0x4c06f
callq 0x24320
movq 0x20(%r14), %rax
movq 0x80(%rax), %r15
movq 0x88(%rax), %rax
cmpq %rax, %r15
je 0x4c392
leaq -0x68(%rbp), %rbx
leaq -0xc0(%rbp), %r12
leaq 0x10(%r15), %r13
xorl %ecx, %ecx
cmpq %rax, %r13
leaq 0x4aad(%rip), %rsi      # 0x50b52
leaq 0x4aa7(%rip), %rax      # 0x50b53
cmoveq %rax, %rsi
sete %cl
leaq -0x88(%rbp), %rax
movq %rax, -0x98(%rbp)
negq %rcx
leaq (%rsi,%rcx), %rdx
addq $0x2, %rdx
leaq -0x98(%rbp), %rdi
callq 0x29178
movl (%r15), %eax
testl %eax, %eax
je 0x4c1fe
cmpl $0x1, %eax
je 0x4c170
cmpl $0x2, %eax
jne 0x4c363
movq 0x20(%r14), %rcx
movq 0x8(%r15), %rsi
movq 0x68(%rcx), %rax
movq 0x70(%rcx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rsi, %rdx
jbe 0x4c613
movq (%rax,%rsi,8), %rsi
leaq -0x50(%rbp), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0x48c24
movq %r12, %rdi
movq %r15, %rsi
callq 0x48c5c
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
movq %r12, %rdi
callq 0x240f0
movq %rbx, -0x78(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4c307
movq %rdx, -0x78(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x68(%rbp)
jmp 0x4c30d
movq 0x20(%r14), %rax
movq 0x8(%r15), %rsi
movq 0x50(%rax), %rcx
movq 0x58(%rax), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rsi, %rdx
jbe 0x4c605
movq (%rcx,%rsi,8), %rcx
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movb $0x0, -0x40(%rbp)
movq %r14, -0x38(%rbp)
movq %rcx, -0x30(%rbp)
movl 0x98(%rax), %eax
incl %eax
movl %eax, 0x98(%rcx)
movq %r12, %rdi
leaq -0x50(%rbp), %rsi
callq 0x4befe
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
movq %r12, %rdi
callq 0x240f0
movq %rbx, -0x78(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4c282
movq %rdx, -0x78(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x68(%rbp)
jmp 0x4c288
movq 0x20(%r14), %rax
movq 0x8(%r15), %rsi
movq 0x38(%rax), %rcx
movq 0x40(%rax), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rsi, %rdx
jbe 0x4c5f7
movq (%rcx,%rsi,8), %rcx
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movb $0x0, -0x40(%rbp)
movq %r14, -0x38(%rbp)
movq %rcx, -0x30(%rbp)
movl 0x98(%rax), %eax
incl %eax
movl %eax, 0x8(%rcx)
movq %r12, %rdi
leaq -0x50(%rbp), %rsi
callq 0x4c7ca
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
movq %r12, %rdi
callq 0x240f0
movq %rbx, -0x78(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4c2b2
movq %rdx, -0x78(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x68(%rbp)
jmp 0x4c2b8
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, -0x70(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq -0x58(%rbp), %rdi
callq 0x240f0
jmp 0x4c2df
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, -0x70(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0xe0(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x43c06
movq -0x78(%rbp), %rdi
cmpq %rbx, %rdi
je 0x4c2ed
callq 0x24320
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x4c363
callq 0x24320
jmp 0x4c363
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, -0x70(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq -0x58(%rbp), %rdi
callq 0x240f0
movq -0x78(%rbp), %rdi
cmpq %rbx, %rdi
je 0x4c343
callq 0x24320
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x4c35b
callq 0x24320
movq %r15, %rdi
callq 0x48c4c
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x4c37b
callq 0x24320
movq 0x20(%r14), %rax
movq 0x88(%rax), %rax
movq %r13, %r15
cmpq %rax, %r13
jne 0x4c095
leaq -0x68(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq -0x100(%rbp), %rsi
movq -0xf8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x78(%rbp), %rdi
callq 0x290da
leaq 0x4947(%rip), %rsi      # 0x50d02
leaq -0x78(%rbp), %rdi
callq 0x24650
leaq -0x88(%rbp), %r15
movq 0x20(%r14), %rax
movq 0x30(%rax), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
leaq -0x78(%rbp), %rdi
callq 0x240f0
leaq -0x40(%rbp), %r13
movq %r15, -0x98(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
movq -0x58(%rbp), %r12
je 0x4c415
movq %rdx, -0x98(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x88(%rbp)
jmp 0x4c41c
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq -0x98(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x4753(%rip), %rsi      # 0x50b94
callq 0x24650
movq %r13, -0x50(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4c466
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x4c46e
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, -0x48(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %r12, %rdi
callq 0x240f0
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x4c4a3
callq 0x24320
movq -0x98(%rbp), %rdi
cmpq %r15, %rdi
je 0x4c4b4
callq 0x24320
movq -0x78(%rbp), %rdi
cmpq %rbx, %rdi
je 0x4c4c2
callq 0x24320
movq -0xe0(%rbp), %rbx
movq -0xd8(%rbp), %r15
cmpq %r15, %rbx
je 0x4c516
leaq -0x50(%rbp), %r14
movq %r13, -0x50(%rbp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x290da
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %r12, %rdi
callq 0x240f0
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x4c50d
callq 0x24320
addq $0x20, %rbx
cmpq %r15, %rbx
jne 0x4c4d9
leaq -0x50(%rbp), %rdi
movq %r13, (%rdi)
movq -0x100(%rbp), %rsi
movq -0xf8(%rbp), %rdx
addq %rsi, %rdx
callq 0x290da
leaq 0x466e(%rip), %rsi      # 0x50ba8
leaq -0x50(%rbp), %rdi
callq 0x24650
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %r12, %rdi
callq 0x240f0
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x4c561
callq 0x24320
leaq -0x50(%rbp), %rdi
movq %r13, (%rdi)
movq -0x120(%rbp), %rsi
movq -0x118(%rbp), %rdx
addq %rsi, %rdx
callq 0x290da
leaq 0x4623(%rip), %rsi      # 0x50ba8
leaq -0x50(%rbp), %rdi
callq 0x24650
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %r12, %rdi
callq 0x240f0
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x4c5ac
callq 0x24320
leaq -0xe0(%rbp), %rdi
callq 0x28e24
leaq -0xf0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4c5cd
callq 0x24320
leaq -0x110(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4c5e2
callq 0x24320
movq %r12, %rax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2ccc(%rip), %rdi      # 0x4f2ca
xorl %eax, %eax
callq 0x24510
leaq 0x2cbe(%rip), %rdi      # 0x4f2ca
xorl %eax, %eax
callq 0x24510
leaq 0x2cb0(%rip), %rdi      # 0x4f2ca
xorl %eax, %eax
callq 0x24510
jmp 0x4c75e
jmp 0x4c75e
jmp 0x4c771
jmp 0x4c75e
jmp 0x4c75e
jmp 0x4c771
movq %rax, %r14
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x4c655
callq 0x24320
jmp 0x4c655
movq %rax, %r14
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x4c674
callq 0x24320
jmp 0x4c674
jmp 0x4c671
movq %rax, %r14
movq -0x78(%rbp), %rdi
cmpq %rbx, %rdi
jne 0x4c76a
jmp 0x4c774
jmp 0x4c771
movq %rax, %r14
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0x4c6a3
callq 0x24320
jmp 0x4c6a3
jmp 0x4c6a0
movq %rax, %r14
movq -0x98(%rbp), %rdi
cmpq %r15, %rdi
jne 0x4c787
jmp 0x4c78c
movq %rax, %r14
jmp 0x4c78c
movq %rax, %r14
jmp 0x4c7ad
jmp 0x4c744
jmp 0x4c6e5
jmp 0x4c715
jmp 0x4c744
jmp 0x4c744
movq %rax, %r14
movq -0x78(%rbp), %rdi
cmpq %rbx, %rdi
je 0x4c6fb
callq 0x24320
jmp 0x4c6fb
movq %rax, %r14
movq -0x78(%rbp), %rdi
cmpq %rbx, %rdi
je 0x4c718
callq 0x24320
jmp 0x4c718
movq %rax, %r14
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x4c735
callq 0x24320
jmp 0x4c735
movq %rax, %r14
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x4c747
callq 0x24320
jmp 0x4c747
movq %rax, %r14
leaq -0x50(%rbp), %rdi
callq 0x48c4c
jmp 0x4c747
jmp 0x4c744
jmp 0x4c744
movq %rax, %r14
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
jne 0x4c76a
jmp 0x4c774
jmp 0x4c771
movq %rax, %r14
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x4c774
callq 0x24320
jmp 0x4c774
movq %rax, %r14
movq -0x58(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq (%rax), %rdi
cmpq %rcx, %rdi
je 0x4c78c
callq 0x24320
leaq -0xe0(%rbp), %rdi
callq 0x28e24
leaq -0xf0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4c7ad
callq 0x24320
leaq -0x110(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4c7c2
callq 0x24320
movq %r14, %rdi
callq 0x245f0