// File: /workspace/github_cpp_makefile_star2_O2/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 0x53b3a
movq 0x20(%r14), %rax
movl 0x98(%rax), %esi
incl %esi
leaq -0x100(%rbp), %rdi
callq 0x53b3a
xorps %xmm0, %xmm0
movaps %xmm0, -0xa0(%rbp)
andq $0x0, -0x90(%rbp)
leaq 0x35fc(%rip), %rdx      # 0x58ce1
leaq -0xc0(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x3ccf9
movq 0x20(%r14), %rax
movq 0x30(%rax), %rdx
addq $0x8, %rdx
leaq -0x60(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x38ef6
leaq 0x3460(%rip), %rdx      # 0x58b7b
leaq -0x60(%rbp), %rsi
movq %rbx, -0x30(%rbp)
movq %rbx, %rdi
callq 0x38f1f
leaq -0x60(%rbp), %rdi
callq 0x35180
leaq -0xc0(%rbp), %r12
movq %r12, %rdi
callq 0x35180
movq %r14, -0x68(%rbp)
movq 0x20(%r14), %rax
movq 0x80(%rax), %r13
movq 0x88(%rax), %rax
cmpq %rax, %r13
je 0x55932
movq %r13, %r15
addq $0x10, %r13
cmpq %rax, %r13
leaq 0x33ca(%rip), %rsi      # 0x58b3d
leaq 0x33c4(%rip), %rax      # 0x58b3e
cmoveq %rax, %rsi
movq %r12, %rdi
leaq -0x60(%rbp), %rdx
callq 0x35130
movl -0x10(%r13), %eax
testl %eax, %eax
je 0x5589c
cmpl $0x1, %eax
je 0x55829
cmpl $0x2, %eax
jne 0x5591d
movq -0x68(%rbp), %rbx
movq 0x20(%rbx), %rdi
addq $0x68, %rdi
movq 0x8(%r15), %rsi
callq 0x400dc
leaq -0x60(%rbp), %r15
movq (%rax), %rsi
movq %r15, %rdi
movq %rbx, %rdx
callq 0x53762
movq %r12, %r14
leaq -0xe0(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5379a
leaq -0x88(%rbp), %r12
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x38ef6
movq -0x30(%rbp), %rdi
movq %r12, %rsi
callq 0x35670
movq %r12, %rdi
callq 0x35180
leaq -0xe0(%rbp), %rdi
callq 0x35180
movq %r15, %rdi
callq 0x5378a
movq %r14, %r12
jmp 0x5591d
movq -0x68(%rbp), %rbx
movq 0x20(%rbx), %rdi
addq $0x50, %rdi
movq 0x8(%r15), %rsi
callq 0x400ba
movq (%rax), %rax
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
movb $0x0, -0x50(%rbp)
movq %rbx, -0x48(%rbp)
movq %rax, -0x40(%rbp)
movq 0x20(%rbx), %rcx
movl 0x98(%rcx), %ecx
incl %ecx
movl %ecx, 0x98(%rax)
leaq -0xe0(%rbp), %r15
movq %r15, %rdi
leaq -0x60(%rbp), %rsi
callq 0x55684
leaq -0x88(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x38ef6
movq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq 0x35670
jmp 0x5590d
movq -0x68(%rbp), %rbx
movq 0x20(%rbx), %rdi
addq $0x38, %rdi
movq 0x8(%r15), %rsi
callq 0x52fbc
movq (%rax), %rax
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
movb $0x0, -0x50(%rbp)
movq %rbx, -0x48(%rbp)
movq %rax, -0x40(%rbp)
movq 0x20(%rbx), %rcx
movl 0x98(%rcx), %ecx
incl %ecx
movl %ecx, 0x8(%rax)
leaq -0xe0(%rbp), %r15
movq %r15, %rdi
leaq -0x60(%rbp), %rsi
callq 0x55bba
leaq -0x88(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x38ef6
leaq -0xa0(%rbp), %rdi
movq %rbx, %rsi
callq 0x4fe9c
movq %rbx, %rdi
callq 0x35180
movq %r15, %rdi
callq 0x35180
movq %r12, %rdi
callq 0x35180
movq -0x68(%rbp), %rax
movq 0x20(%rax), %rax
jmp 0x55752
leaq 0x33b5(%rip), %rdx      # 0x58cee
leaq -0x88(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x3ccf9
movq -0x68(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x30(%rax), %rdx
addq $0x8, %rdx
leaq -0xc0(%rbp), %rdi
leaq -0x88(%rbp), %rsi
movq -0x30(%rbp), %r12
callq 0x38ef6
leaq 0x3205(%rip), %rdx      # 0x58b7f
leaq -0x60(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x38f1f
leaq -0x60(%rbp), %rsi
movq %r12, %rdi
callq 0x35670
leaq -0x60(%rbp), %rbx
movq %rbx, %rdi
callq 0x35180
leaq -0xc0(%rbp), %rdi
callq 0x35180
leaq -0x88(%rbp), %rdi
callq 0x35180
movq -0xa0(%rbp), %r14
movq -0x98(%rbp), %r15
cmpq %r15, %r14
je 0x559f1
movq %rbx, %rdi
movq %r14, %rsi
callq 0x35470
movq %r12, %rdi
movq %rbx, %rsi
callq 0x35670
movq %rbx, %rdi
callq 0x35180
addq $0x20, %r14
jmp 0x559c8
leaq 0x319b(%rip), %rdx      # 0x58b93
leaq -0x60(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x3ccf9
leaq -0x60(%rbp), %rsi
movq %r12, %rdi
callq 0x35670
leaq -0x60(%rbp), %rdi
callq 0x35180
leaq 0x316f(%rip), %rdx      # 0x58b93
leaq -0x60(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x3ccf9
leaq -0x60(%rbp), %rsi
movq %r12, %rdi
callq 0x35670
leaq -0x60(%rbp), %rdi
callq 0x35180
leaq -0xa0(%rbp), %rdi
callq 0x38d68
leaq -0x100(%rbp), %rdi
callq 0x35180
leaq -0x120(%rbp), %rdi
callq 0x35180
movq %r12, %rax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
jmp 0x55b65
jmp 0x55b7f
jmp 0x55b71
jmp 0x55b6c
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x35180
jmp 0x55aae
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
callq 0x35180
jmp 0x55abf
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
jmp 0x55b65
jmp 0x55b7f
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x35180
jmp 0x55ae1
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
jmp 0x55b89
movq %rax, %rbx
jmp 0x55b8e
movq %rax, %rbx
jmp 0x55ba6
jmp 0x55b16
jmp 0x55b38
jmp 0x55b5b
jmp 0x55b5b
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x35180
jmp 0x55b2a
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x35180
jmp 0x55b3b
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
callq 0x35180
jmp 0x55b4c
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
callq 0x35180
jmp 0x55b5e
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x5378a
jmp 0x55b5e
jmp 0x55b5b
jmp 0x55b5b
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
callq 0x35180
jmp 0x55b82
movq %rax, %rbx
jmp 0x55b86
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x35180
jmp 0x55b86
movq %rax, %rbx
movq -0x30(%rbp), %r12
movq %r12, %rdi
callq 0x35180
leaq -0xa0(%rbp), %rdi
callq 0x38d68
leaq -0x100(%rbp), %rdi
callq 0x35180
leaq -0x120(%rbp), %rdi
callq 0x35180
movq %rbx, %rdi
callq 0x355f0