// File: /workspace/github_cpp_makefile_star2_O1/srajangarg[P]raytracer/src/core/SceneLoader.cpp
// Function: SceneLoader::doG(std::istream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool SceneLoader::doG(istream & str, string & name)
{
  name = getString(str);

  if (name.empty())
  {
    *err << "Couldn't read group name at ";
    errLine(str.tellg());
    return false;
  }

  if (groups[name] != NULL)
  {
    *err << "Illegal re-use of group name \"" << name << "\" at ";
    curPos(*err, str.tellg());
    *err << endl;
    return false;
  }

  SceneGroup * n = new SceneGroup();
  groups[name] = n;
  n->name_ = name;

  do
  {
    int state = findOpenOrClosedParen(str);

    if (state == ERROR)
      return false;
    else if (state == CLOSED)
      return true;
    else if (state == OPEN)
    {
      string cmd;

      if (readCommand(str, cmd))
      {
        if (cmd != "I")
        {
          *err << "Command other than I from G at ";
          curPos(*err, str.tellg());
          *err << endl;
        }

        string iname;
        SceneInstance * newNode;

        if ((newNode = doI(str, iname)) != NULL)
        {
          n->children_.push_back( newNode );
        }

        findCloseParen(str);
      }
    }
  }
  while (true);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x7820
movq %r12, %rdi
movq %r15, %rsi
callq 0x43a0
movq (%r15), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xaedb
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4320
cmpq $0x0, 0x8(%r12)
je 0xaf8c
leaq 0x18(%rbx), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0xb4a0
cmpq $0x0, (%rax)
je 0xafbd
movq 0x90(%rbx), %r15
leaq 0x216c1(%rip), %rsi     # 0x2c5cf
movl $0x1e, %edx
movq %r15, %rdi
callq 0x4370
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %r15, %rdi
callq 0x4370
leaq 0x21256(%rip), %rsi     # 0x2c189
movl $0x5, %edx
movq %rax, %rdi
callq 0x4370
movq 0x90(%rbx), %r15
movq %r14, %rdi
callq 0x4590
movq %rbx, %rdi
movq %r15, %rsi
movl %eax, %edx
callq 0x773e
movq 0x90(%rbx), %rbx
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x42f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4050
movq %rax, %rdi
callq 0x4230
jmp 0xafb6
movq 0x90(%rbx), %rdi
leaq 0x21618(%rip), %rsi     # 0x2c5b2
movl $0x1c, %edx
callq 0x4370
movq %r14, %rdi
callq 0x4590
movq %rbx, %rdi
movl %eax, %esi
callq 0x8418
xorl %ebp, %ebp
jmp 0xb166
movl $0x68, %edi
callq 0x4310
movq %rax, %r15
movq %rax, %rdi
callq 0x5c38
movq %r13, %rdi
movq %r12, %rsi
callq 0xb4a0
movq %r15, (%rax)
leaq 0x8(%r15), %rdi
movq %r12, %rsi
callq 0x41c0
movq %r15, %rax
addq $0x28, %rax
movq %rax, 0x48(%rsp)
leaq 0x8(%rsp), %r13
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7d48
testl %eax, %eax
je 0xb01d
cmpl $0x1, %eax
jne 0xb107
movb $0x1, %bpl
jmp 0xb109
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x7b10
testb %al, %al
je 0xb140
movq %r13, %rdi
leaq 0x220e2(%rip), %rsi     # 0x2d137
callq 0x4110
testl %eax, %eax
je 0xb0c1
movq 0x90(%rbx), %rdi
movl $0x1f, %edx
leaq 0x2157d(%rip), %rsi     # 0x2c5ee
callq 0x4370
movq 0x90(%rbx), %r12
movq %r14, %rdi
callq 0x4590
movq %rbx, %rdi
movq %r12, %rsi
movl %eax, %edx
callq 0x773e
movq 0x90(%rbx), %r12
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x42f0
movsbl %al, %esi
movq %r12, %rdi
callq 0x4050
movq %rax, %rdi
callq 0x4230
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
movb $0x0, 0x38(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
leaq 0x28(%rsp), %rdx
callq 0x84a8
movq %rax, 0x50(%rsp)
testq %rax, %rax
je 0xb11c
movq 0x30(%r15), %rsi
cmpq 0x38(%r15), %rsi
je 0xb10d
movq %rax, (%rsi)
addq $0x8, 0x30(%r15)
jmp 0xb11c
xorl %ebp, %ebp
xorl %eax, %eax
jmp 0xb15e
movq 0x48(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0xc6f8
movq %r14, %rsi
callq 0x7ed0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xb140
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4320
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb15c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4320
movb $0x1, %al
testb %al, %al
jne 0xaffd
andb $0x1, %bpl
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x68, %esi
movq %r15, %rdi
jmp 0xb1c5
jmp 0xb1ab
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xb1ae
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4320
jmp 0xb1ae
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb1ca
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4320
movq %rbx, %rdi
callq 0x45c0