// File: /workspace/github_cpp_makefile_star2_O1/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 0x4a586
movq 0x20(%r14), %rax
movl 0x98(%rax), %esi
incl %esi
leaq -0x100(%rbp), %rdi
callq 0x4a586
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 0x2a264
leaq 0x49ff(%rip), %rsi      # 0x51cf5
leaq -0x98(%rbp), %rdi
callq 0x25650
movq 0x20(%r14), %rax
movq 0x30(%rax), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
leaq -0x98(%rbp), %rdi
callq 0x250f0
leaq -0x40(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4d343
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x4d34b
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 0x4823(%rip), %rsi      # 0x51b90
callq 0x25650
leaq 0x10(%rbx), %rsi
movq %rsi, (%rbx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
movq %rsi, -0xa0(%rbp)
je 0x4d39b
movq %rdx, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x4d3a1
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 0x4d3c6
callq 0x25320
movq %rbx, -0x58(%rbp)
movq -0x98(%rbp), %rdi
cmpq %r15, %rdi
je 0x4d3db
callq 0x25320
movq 0x20(%r14), %rax
movq 0x80(%rax), %r15
movq 0x88(%rax), %rax
cmpq %rax, %r15
je 0x4d6fe
leaq -0x68(%rbp), %rbx
leaq -0xc0(%rbp), %r12
leaq 0x10(%r15), %r13
xorl %ecx, %ecx
cmpq %rax, %r13
leaq 0x4741(%rip), %rsi      # 0x51b52
leaq 0x473b(%rip), %rax      # 0x51b53
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 0x2a2fe
movl (%r15), %eax
testl %eax, %eax
je 0x4d56a
cmpl $0x1, %eax
je 0x4d4dc
cmpl $0x2, %eax
jne 0x4d6cf
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 0x4d97f
movq (%rax,%rsi,8), %rsi
leaq -0x50(%rbp), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0x49efc
movq %r12, %rdi
movq %r15, %rsi
callq 0x49f34
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
movq %r12, %rdi
callq 0x250f0
movq %rbx, -0x78(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4d673
movq %rdx, -0x78(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x68(%rbp)
jmp 0x4d679
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 0x4d971
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 0x4d26a
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
movq %r12, %rdi
callq 0x250f0
movq %rbx, -0x78(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4d5ee
movq %rdx, -0x78(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x68(%rbp)
jmp 0x4d5f4
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 0x4d963
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 0x4db36
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
movq %r12, %rdi
callq 0x250f0
movq %rbx, -0x78(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4d61e
movq %rdx, -0x78(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x68(%rbp)
jmp 0x4d624
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 0x250f0
jmp 0x4d64b
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 0x44dfe
movq -0x78(%rbp), %rdi
cmpq %rbx, %rdi
je 0x4d659
callq 0x25320
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x4d6cf
callq 0x25320
jmp 0x4d6cf
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 0x250f0
movq -0x78(%rbp), %rdi
cmpq %rbx, %rdi
je 0x4d6af
callq 0x25320
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x4d6c7
callq 0x25320
movq %r15, %rdi
callq 0x49f24
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x4d6e7
callq 0x25320
movq 0x20(%r14), %rax
movq 0x88(%rax), %rax
movq %r13, %r15
cmpq %rax, %r13
jne 0x4d401
leaq -0x68(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq -0x100(%rbp), %rsi
movq -0xf8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x78(%rbp), %rdi
callq 0x2a264
leaq 0x45db(%rip), %rsi      # 0x51d02
leaq -0x78(%rbp), %rdi
callq 0x25650
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 0x250f0
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 0x4d781
movq %rdx, -0x98(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x88(%rbp)
jmp 0x4d788
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 0x43e7(%rip), %rsi      # 0x51b94
callq 0x25650
movq %r13, -0x50(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4d7d2
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x4d7da
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 0x250f0
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x4d80f
callq 0x25320
movq -0x98(%rbp), %rdi
cmpq %r15, %rdi
je 0x4d820
callq 0x25320
movq -0x78(%rbp), %rdi
cmpq %rbx, %rdi
je 0x4d82e
callq 0x25320
movq -0xe0(%rbp), %rbx
movq -0xd8(%rbp), %r15
cmpq %r15, %rbx
je 0x4d882
leaq -0x50(%rbp), %r14
movq %r13, -0x50(%rbp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x2a264
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %r12, %rdi
callq 0x250f0
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x4d879
callq 0x25320
addq $0x20, %rbx
cmpq %r15, %rbx
jne 0x4d845
leaq -0x50(%rbp), %rdi
movq %r13, (%rdi)
movq -0x100(%rbp), %rsi
movq -0xf8(%rbp), %rdx
addq %rsi, %rdx
callq 0x2a264
leaq 0x4302(%rip), %rsi      # 0x51ba8
leaq -0x50(%rbp), %rdi
callq 0x25650
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %r12, %rdi
callq 0x250f0
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x4d8cd
callq 0x25320
leaq -0x50(%rbp), %rdi
movq %r13, (%rdi)
movq -0x120(%rbp), %rsi
movq -0x118(%rbp), %rdx
addq %rsi, %rdx
callq 0x2a264
leaq 0x42b7(%rip), %rsi      # 0x51ba8
leaq -0x50(%rbp), %rdi
callq 0x25650
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %r12, %rdi
callq 0x250f0
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x4d918
callq 0x25320
leaq -0xe0(%rbp), %rdi
callq 0x29fb8
leaq -0xf0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4d939
callq 0x25320
leaq -0x110(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4d94e
callq 0x25320
movq %r12, %rax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2960(%rip), %rdi      # 0x502ca
xorl %eax, %eax
callq 0x25510
leaq 0x2952(%rip), %rdi      # 0x502ca
xorl %eax, %eax
callq 0x25510
leaq 0x2944(%rip), %rdi      # 0x502ca
xorl %eax, %eax
callq 0x25510
jmp 0x4daca
jmp 0x4daca
jmp 0x4dadd
jmp 0x4daca
jmp 0x4daca
jmp 0x4dadd
movq %rax, %r14
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x4d9c1
callq 0x25320
jmp 0x4d9c1
movq %rax, %r14
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x4d9e0
callq 0x25320
jmp 0x4d9e0
jmp 0x4d9dd
movq %rax, %r14
movq -0x78(%rbp), %rdi
cmpq %rbx, %rdi
jne 0x4dad6
jmp 0x4dae0
jmp 0x4dadd
movq %rax, %r14
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0x4da0f
callq 0x25320
jmp 0x4da0f
jmp 0x4da0c
movq %rax, %r14
movq -0x98(%rbp), %rdi
cmpq %r15, %rdi
jne 0x4daf3
jmp 0x4daf8
movq %rax, %r14
jmp 0x4daf8
movq %rax, %r14
jmp 0x4db19
jmp 0x4dab0
jmp 0x4da51
jmp 0x4da81
jmp 0x4dab0
jmp 0x4dab0
movq %rax, %r14
movq -0x78(%rbp), %rdi
cmpq %rbx, %rdi
je 0x4da67
callq 0x25320
jmp 0x4da67
movq %rax, %r14
movq -0x78(%rbp), %rdi
cmpq %rbx, %rdi
je 0x4da84
callq 0x25320
jmp 0x4da84
movq %rax, %r14
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x4daa1
callq 0x25320
jmp 0x4daa1
movq %rax, %r14
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x4dab3
callq 0x25320
jmp 0x4dab3
movq %rax, %r14
leaq -0x50(%rbp), %rdi
callq 0x49f24
jmp 0x4dab3
jmp 0x4dab0
jmp 0x4dab0
movq %rax, %r14
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
jne 0x4dad6
jmp 0x4dae0
jmp 0x4dadd
movq %rax, %r14
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x4dae0
callq 0x25320
jmp 0x4dae0
movq %rax, %r14
movq -0x58(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq (%rax), %rdi
cmpq %rcx, %rdi
je 0x4daf8
callq 0x25320
leaq -0xe0(%rbp), %rdi
callq 0x29fb8
leaq -0xf0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4db19
callq 0x25320
leaq -0x110(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4db2e
callq 0x25320
movq %r14, %rdi
callq 0x255f0