// File: /workspace/github_cpp_makefile_star2_O3/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 0x75a0
movq %r12, %rdi
movq %r15, %rsi
callq 0x4390
movq (%r15), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xab8d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4310
cmpq $0x0, 0x8(%r12)
je 0xac41
leaq 0x18(%rbx), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0xb11e
cmpq $0x0, (%rax)
je 0xac70
movq 0x90(%rbx), %r15
leaq 0x20a1f(%rip), %rsi     # 0x2b5df
movl $0x1e, %edx
movq %r15, %rdi
callq 0x4360
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %r15, %rdi
callq 0x4360
leaq 0x205b4(%rip), %rsi     # 0x2b199
movl $0x5, %edx
movq %rax, %rdi
callq 0x4360
movq 0x90(%rbx), %r15
movq %r14, %rdi
callq 0x4580
movq %rbx, %rdi
movq %r15, %rsi
movl %eax, %edx
callq 0x74be
movq 0x90(%rbx), %rbx
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x42e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4050
movq %rax, %rdi
callq 0x4220
jmp 0xae09
movq 0x90(%rbx), %rdi
leaq 0x20973(%rip), %rsi     # 0x2b5c2
movl $0x1c, %edx
callq 0x4360
movq %r14, %rdi
callq 0x4580
movq %rbx, %rdi
movl %eax, %esi
callq 0x8180
jmp 0xae09
movl $0x68, %edi
callq 0x4300
movq %rax, %r15
movq %rax, %rdi
callq 0x5c1c
movq %r13, %rdi
movq %r12, %rsi
callq 0xb11e
movq %r15, (%rax)
leaq 0x8(%r15), %rdi
movq %r12, %rsi
callq 0x41b0
leaq 0x38(%rsp), %r12
movq %r15, %rax
addq $0x28, %rax
movq %rax, 0x48(%rsp)
leaq 0x8(%rsp), %r13
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7aaa
testl %eax, %eax
jne 0xae00
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 0x7872
testb %al, %al
je 0xaddb
movq %r13, %rdi
leaq 0x214f7(%rip), %rsi     # 0x2c1f7
callq 0x4110
testl %eax, %eax
je 0xad6c
movq 0x90(%rbx), %rdi
movl $0x1f, %edx
leaq 0x208e2(%rip), %rsi     # 0x2b5fe
callq 0x4360
movq 0x90(%rbx), %rbp
movq %r14, %rdi
callq 0x4580
movq %rbx, %rdi
movq %rbp, %rsi
movl %eax, %edx
callq 0x74be
movq 0x90(%rbx), %rbp
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x42e0
movsbl %al, %esi
movq %rbp, %rdi
callq 0x4050
movq %rax, %rdi
callq 0x4220
movq %r12, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
movb $0x0, 0x38(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
leaq 0x28(%rsp), %rdx
callq 0x8216
movq %rax, 0x50(%rsp)
testq %rax, %rax
je 0xadbc
movq 0x30(%r15), %rsi
cmpq 0x38(%r15), %rsi
je 0xadad
movq %rax, (%rsi)
addq $0x8, 0x30(%r15)
jmp 0xadbc
movq 0x48(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0xc31a
movq %r14, %rsi
callq 0x7c34
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0xaddb
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4310
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xacb5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4310
jmp 0xacb5
cmpl $0x1, %eax
jne 0xae09
movb $0x1, %al
jmp 0xae0b
xorl %eax, %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 0xae5f
jmp 0xae45
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0xae48
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4310
jmp 0xae48
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xae64
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4310
movq %rbx, %rdi
callq 0x45b0