// File: /workspace/github_cpp_makefile_star2_O2/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 $0x48, %rsp
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x6e00
movq %r12, %rdi
movq %r15, %rsi
callq 0x43b0
movq %r15, %rdi
callq 0x4170
cmpq $0x0, 0x8(%r12)
je 0x9674
leaq 0x18(%rbx), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x9a8c
cmpq $0x0, (%rax)
je 0x969e
movq 0x90(%rbx), %rdi
leaq 0x17f87(%rip), %rsi     # 0x215af
callq 0x4300
movq %rax, %rdi
movq %r12, %rsi
callq 0x42e0
leaq 0x17b2a(%rip), %rsi     # 0x21169
movq %rax, %rdi
callq 0x4300
movq 0x90(%rbx), %r15
movq %r14, %rdi
callq 0x45a0
movq %rbx, %rdi
movq %r15, %rsi
movl %eax, %edx
callq 0x6d66
movq 0x90(%rbx), %rdi
callq 0x4190
jmp 0x97d8
movq 0x90(%rbx), %rdi
leaq 0x17f10(%rip), %rsi     # 0x21592
callq 0x4300
movq %r14, %rdi
callq 0x45a0
movq %rbx, %rdi
movl %eax, %esi
callq 0x76b4
jmp 0x97d8
pushq $0x68
popq %rdi
callq 0x4320
movq %rax, %r15
movq %rax, %rdi
callq 0x56d4
movq %r13, %rdi
movq %r12, %rsi
callq 0x9a8c
movq %r15, (%rax)
leaq 0x8(%r15), %rdi
movq %r12, %rsi
callq 0x41c0
leaq 0x18(%rsp), %r13
leaq 0x38(%rsp), %rbp
addq $0x28, %r15
leaq 0x8(%rsp), %r12
movq %rbx, %rdi
movq %r14, %rsi
callq 0x71d2
testl %eax, %eax
jne 0x97cf
movq %r13, 0x8(%rsp)
andq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x7050
testb %al, %al
je 0x97c2
movq %r12, %rdi
leaq 0x189d6(%rip), %rsi     # 0x220f7
callq 0x9d88
testb %al, %al
je 0x977c
movq 0x90(%rbx), %rdi
leaq 0x17e96(%rip), %rsi     # 0x215ce
callq 0x4300
movq %r14, %rdi
movq %r15, %r12
movq %rbp, %r15
movq %r13, %rbp
movq 0x90(%rbx), %r13
callq 0x45a0
movq %rbx, %rdi
movq %r13, %rsi
movl %eax, %edx
callq 0x6d66
movq 0x90(%rbx), %rdi
callq 0x4190
movq %rbp, %r13
movq %r15, %rbp
movq %r12, %r15
leaq 0x8(%rsp), %r12
movq %rbp, 0x28(%rsp)
andq $0x0, 0x30(%rsp)
movb $0x0, 0x38(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
leaq 0x28(%rsp), %rdx
callq 0x770e
movq %rax, (%rsp)
testq %rax, %rax
je 0x97b0
movq %r15, %rdi
movq %rsp, %rsi
callq 0x9af2
movq %r14, %rsi
callq 0x72de
leaq 0x28(%rsp), %rdi
callq 0x4170
movq %r12, %rdi
callq 0x4170
jmp 0x96de
cmpl $0x1, %eax
jne 0x97d8
movb $0x1, %al
jmp 0x97da
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
pushq $0x68
popq %rsi
movq %r15, %rdi
callq 0x4330
jmp 0x9817
jmp 0x980a
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x4170
jmp 0x980d
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x4170
movq %rbx, %rdi
callq 0x45c0
nop