// File: yeonnic[P]solparser/./tree.cpp
// Function: S_Parent(__gnu_cxx::__normal_iterator<Token const*, std::vector<Token, std::allocator<Token>>>, SolTree&)
int S_Parent(Tokit begin, SolTree &out){
  vector<SolTree> tmp;
  int count = 0;
  auto it = begin;

  cout << "S_Parent() called!!" << endl;
  cout << " it->str : " << it->str << endl;

  if(it->type == TokenType::lbracket){
    it++;
    count++;
    for(; it->type != TokenType::rbracket && it->type != TokenType::eof; it++){
      int c = 0;
      count++;
      switch(it->type){
        case TokenType::constructor:
        case TokenType::function:
          if((it+1)->type != TokenType::eof){
            auto p = SolTree((it+1)->str, NodeType::function);
            it++;
            count++;
            c = S_Function(it, p);
            count += c;
            tmp.push_back(p);
          } else {
            cout << "function error!! line : " << it->line << endl;
            exit(-1);
          }
          break;
        default:
          tmp.push_back(SolTree(it->str, NodeType::none));
          break;
      }
    }
  } else {
    cout << "error! line : " << it->line;
    exit(-1);
  }

  out.children = tmp;

  return count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x240, %rsp            # imm = 0x240
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x34de0
movl $0x0, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq 0x18d4e(%rip), %rdi     # 0x4cfd0
leaq 0x3c09(%rip), %rsi      # 0x37e92
callq 0x6320
movq %rax, -0x208(%rbp)
jmp 0x34297
movq -0x208(%rbp), %rdi
movq 0x18d1b(%rip), %rsi     # 0x4cfc0
callq 0x6360
jmp 0x342ac
movq 0x18d1d(%rip), %rdi     # 0x4cfd0
leaq 0x3bec(%rip), %rsi      # 0x37ea6
callq 0x6320
movq %rax, -0x210(%rbp)
jmp 0x342c8
leaq -0x38(%rbp), %rdi
callq 0x34e00
movq -0x210(%rbp), %rdi
movq %rax, %rsi
callq 0x62d0
movq %rax, -0x218(%rbp)
jmp 0x342e9
movq -0x218(%rbp), %rdi
movq 0x18cc9(%rip), %rsi     # 0x4cfc0
callq 0x6360
jmp 0x342fe
leaq -0x38(%rbp), %rdi
callq 0x34e00
cmpl $0x19, 0x20(%rax)
jne 0x345df
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
callq 0x34e60
movq %rax, -0x50(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x34e00
movq %rax, %rcx
xorl %eax, %eax
cmpl $0x1a, 0x20(%rcx)
movb %al, -0x219(%rbp)
je 0x34359
leaq -0x38(%rbp), %rdi
callq 0x34e00
cmpl $0x1, 0x20(%rax)
setne %al
movb %al, -0x219(%rbp)
movb -0x219(%rbp), %al
testb $0x1, %al
jne 0x34368
jmp 0x345dd
movl $0x0, -0x54(%rbp)
movl -0x2c(%rbp), %eax
incl %eax
movl %eax, -0x2c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x34e00
movl 0x20(%rax), %eax
addl $-0xa, %eax
subl $0x2, %eax
jb 0x343a1
jmp 0x34530
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x34653
leaq -0x38(%rbp), %rdi
movl $0x1, %esi
callq 0x34e20
movq %rax, -0x60(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x34e00
cmpl $0x1, 0x20(%rax)
je 0x344cf
leaq -0x38(%rbp), %rdi
movl $0x1, %esi
callq 0x34e20
movq %rax, -0x128(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x34e00
movq %rax, %rsi
leaq -0x120(%rbp), %rdi
callq 0x6150
jmp 0x343f8
leaq -0x100(%rbp), %rdi
leaq -0x120(%rbp), %rsi
movl $0x6, %edx
callq 0x34ed0
jmp 0x34412
leaq -0x120(%rbp), %rdi
callq 0x61f0
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
callq 0x34e60
movq %rax, -0x130(%rbp)
movl -0x2c(%rbp), %eax
incl %eax
movl %eax, -0x2c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x138(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x33ab0
movl %eax, -0x220(%rbp)
jmp 0x3445e
movl -0x220(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %ecx
movl -0x2c(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x2c(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x35000
jmp 0x34484
leaq -0x100(%rbp), %rdi
callq 0x80e0
jmp 0x3452b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x61f0
jmp 0x34653
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x80e0
jmp 0x34653
movq 0x18afa(%rip), %rdi     # 0x4cfd0
leaq 0x39d5(%rip), %rsi      # 0x37eb2
callq 0x6320
movq %rax, -0x228(%rbp)
jmp 0x344eb
leaq -0x38(%rbp), %rdi
callq 0x34e00
movq -0x228(%rbp), %rdi
movl 0x24(%rax), %esi
callq 0x6600
movq %rax, -0x230(%rbp)
jmp 0x3450c
movq -0x230(%rbp), %rdi
movq 0x18aa6(%rip), %rsi     # 0x4cfc0
callq 0x6360
jmp 0x34521
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x63e0
jmp 0x345c4
leaq -0x38(%rbp), %rdi
callq 0x34e00
movq %rax, %rsi
leaq -0x1f8(%rbp), %rdi
callq 0x6150
jmp 0x3454a
leaq -0x1d8(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
xorl %edx, %edx
callq 0x34ed0
jmp 0x34561
leaq -0x28(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x34ea0
jmp 0x34573
leaq -0x1d8(%rbp), %rdi
callq 0x80e0
leaq -0x1f8(%rbp), %rdi
callq 0x61f0
jmp 0x345c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x345b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x80e0
leaq -0x1f8(%rbp), %rdi
callq 0x61f0
jmp 0x34653
jmp 0x345c6
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
callq 0x34e60
movq %rax, -0x200(%rbp)
jmp 0x34329
jmp 0x3461f
movq 0x189ea(%rip), %rdi     # 0x4cfd0
leaq 0x38de(%rip), %rsi      # 0x37ecb
callq 0x6320
movq %rax, -0x238(%rbp)
jmp 0x345fb
leaq -0x38(%rbp), %rdi
callq 0x34e00
movq -0x238(%rbp), %rdi
movl 0x24(%rax), %esi
callq 0x6600
jmp 0x34615
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x63e0
movq -0x10(%rbp), %rdi
addq $0x28, %rdi
leaq -0x28(%rbp), %rsi
callq 0x35070
jmp 0x34632
movl -0x2c(%rbp), %eax
movl %eax, -0x23c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x8ef0
movl -0x23c(%rbp), %eax
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x8ef0
movq -0x40(%rbp), %rdi
callq 0x6620
nopw %cs:(%rax,%rax)