// File: /workspace/github_cpp_makefile_star2_O1/srajangarg[P]raytracer/src/core/SceneLoader.cpp
// Function: SceneLoader::doCamera(std::istream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool SceneLoader::doCamera(istream & str, string & name)
{
  if (!getName(str, "camera", name))
    return false;

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

  do
  {
    int state = findOpenOrClosedParen(str);

    if (state == ERROR)
    {
      setCameraDefaults(n);
      return false;
    }
    else if (state == CLOSED)
    {
      setCameraDefaults(n);
      return true;
    }
    else if (state == OPEN)
    {
      string cmd;
      vector<ParametricValue *> values;
      string sides = "lrbtnf";
      int side = 0;

      if (readCommand(str, cmd))
      {
        if (cmd == "perspective")
        {
          if (getValues(str, values) < 1)
          {
            *err << "Perspective with no parameters at ";
            errLine(str.tellg());
          }
          else
          {
            cleanAfter(values, 1);
            n->camera_->perspective_ = values[0];
          }
        }
        else if (cmd.size() == 1 && (side = (int)sides.find(cmd)) != string::npos)
        {
          if (getValues(str, values) < 1)
          {
            *err << "l with no parameters at ";
            errLine(str.tellg());
          }
          else
          {
            cleanAfter(values, 1);
            n->camera_->frustum_[side] = values[0];
          }
        }
        else
        {
          *err << "Error: command " << cmd << " not recognized at ";
          errLine(str.tellg());
        }

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x68(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x21ad9(%rip), %rsi     # 0x2c55c
leaq 0x21ad8(%rip), %rdx     # 0x2c562
leaq 0x58(%rsp), %r15
movq %r15, %rdi
callq 0xc09a
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x8ff8
movl %eax, %ebp
movq 0x58(%rsp), %rdi
cmpq %r13, %rdi
je 0xaac1
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x4320
testb %bpl, %bpl
je 0xadf2
movl $0x68, %edi
callq 0x4310
movq %rax, %r15
movq %rax, %rdi
callq 0x5c38
leaq 0x18(%r14), %rdi
movq %r12, %rsi
callq 0xb4a0
movq %r15, (%rax)
movq %r15, %rdi
addq $0x8, %rdi
movq %r12, %rsi
callq 0x41c0
movl $0x38, %edi
callq 0x4310
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movq $0x0, 0x30(%rax)
movq %rax, 0x50(%r15)
leaq 0x28(%rsp), %r12
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7d48
testl %eax, %eax
je 0xab4e
movq %r15, %rsi
cmpl $0x1, %eax
jne 0xac4c
callq 0xa8fc
movb $0x1, %r13b
jmp 0xac54
movq %r12, 0x18(%rsp)
xorl %eax, %eax
movq %rax, 0x20(%rsp)
movb $0x0, 0x28(%rsp)
movq %rax, 0x10(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x48(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0x38(%rsp), %rdi
leaq 0x219e2(%rip), %rsi     # 0x2c563
leaq 0x219e1(%rip), %rdx     # 0x2c569
callq 0xc09a
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x18(%rsp), %rdx
callq 0x7b10
testb %al, %al
je 0xad9d
leaq 0x18(%rsp), %rdi
leaq 0x219b9(%rip), %rsi     # 0x2c56a
callq 0x4110
testl %eax, %eax
je 0xac5b
movq 0x20(%rsp), %rcx
cmpq $0x1, %rcx
jne 0xabf4
movq 0x18(%rsp), %rsi
leaq 0x38(%rsp), %rdi
xorl %edx, %edx
callq 0x45a0
movq %rax, %rbp
shlq $0x20, %rax
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
cmpq %rcx, %rax
jne 0xacc8
movq 0x90(%r14), %rbp
movl $0xf, %edx
movq %rbp, %rdi
leaq 0x21748(%rip), %rsi     # 0x2c352
callq 0x4370
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq %rbp, %rdi
callq 0x4370
movl $0x13, %edx
movq %rax, %rdi
leaq 0x21732(%rip), %rsi     # 0x2c362
callq 0x4370
movq %rbx, %rdi
callq 0x4590
movq %r14, %rdi
movl %eax, %esi
callq 0x8418
jmp 0xad95
callq 0xa8fc
xorl %r13d, %r13d
xorl %eax, %eax
jmp 0xade8
movq %r14, %rdi
movq %rbx, %rsi
movq %rsp, %rdx
callq 0x7fb2
testl %eax, %eax
jle 0xad3f
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
subq %rax, %rcx
cmpq $0x9, %rcx
jb 0xacb5
movl $0x1, %ecx
movl $0x2, %ebp
movq (%rax,%rcx,8), %rdi
testq %rdi, %rdi
je 0xac9c
movq (%rdi), %rax
callq *0x20(%rax)
movl %ebp, %ecx
movq (%rsp), %rax
movq 0x8(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
incl %ebp
cmpq %rcx, %rdx
ja 0xac8d
movq (%rsp), %rax
movq (%rax), %rax
movq 0x50(%r15), %rcx
movq %rax, (%rcx)
jmp 0xad95
movq %r14, %rdi
movq %rbx, %rsi
movq %rsp, %rdx
callq 0x7fb2
testl %eax, %eax
jle 0xad6b
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
subq %rax, %rcx
cmpq $0x9, %rcx
jb 0xad25
movl $0x1, %ecx
movl $0x2, %r12d
movq (%rax,%rcx,8), %rdi
testq %rdi, %rdi
je 0xad0a
movq (%rdi), %rax
callq *0x20(%rax)
movl %r12d, %ecx
movq (%rsp), %rax
movq 0x8(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
incl %r12d
cmpq %rcx, %rdx
ja 0xacfb
movslq %ebp, %rax
movq (%rsp), %rcx
movq (%rcx), %rcx
movq 0x50(%r15), %rdx
movq %rcx, 0x8(%rdx,%rax,8)
leaq 0x28(%rsp), %r12
jmp 0xad95
movq 0x90(%r14), %rdi
movl $0x22, %edx
leaq 0x21824(%rip), %rsi     # 0x2c576
callq 0x4370
movq %rbx, %rdi
callq 0x4590
movq %r14, %rdi
movl %eax, %esi
callq 0x8418
jmp 0xad95
movq 0x90(%r14), %rdi
movl $0x18, %edx
leaq 0x2181b(%rip), %rsi     # 0x2c599
callq 0x4370
movq %rbx, %rdi
callq 0x4590
movq %r14, %rdi
movl %eax, %esi
callq 0x8418
movq %rbx, %rsi
callq 0x7ed0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0xadb9
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x4320
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xadcf
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4320
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0xade6
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x4320
movb $0x1, %al
testb %al, %al
jne 0xab26
jmp 0xadf5
xorl %r13d, %r13d
andb $0x1, %r13b
movl %r13d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xae37
movq %rax, %rbx
movl $0x68, %esi
movq %r15, %rdi
jmp 0xae7e
jmp 0xae37
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %r13, %rdi
je 0xae83
movq 0x68(%rsp), %rsi
jmp 0xae7b
jmp 0xae37
movq %rax, %rbx
jmp 0xae56
movq %rax, %rbx
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0xae56
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x4320
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xae6c
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4320
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0xae83
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x4320
movq %rbx, %rdi
callq 0x45c0
nop