// File: /workspace/github_cpp_makefile_star2_O1/srajangarg[P]raytracer/src/core/SceneLoader.cpp
// Function: SceneLoader::getValue(std::istream&)
ParametricValue * SceneLoader::getValue(istream & str)
{
  char temp;
  str >> temp;

  if (temp == '{') // time-varying expression
  {
    int start = str.tellg();
    string expr;

    while (str.get(temp))
    {
      if (temp == '}') // completed expr
      {
        ParametricValue * v = new ExprValue(expr.c_str());

        if (!v->good())
        {
          *err << "Error: couldn't parse expression \"" << expr << "\" at ";
          curPos(*err, str.tellg());
          *err << endl;
          delete v;
          return NULL;
        }
        else
        {
          return v;
        }
      }
      else if (temp == '#')
      {
        string no;
        getline(str, no);
      }
      else
      {
        expr += temp;
      }
    }

    *err << "Error: No closing brace for expr at ";
    curPos(*err, start);
    *err << endl;
    return NULL;
  }
  else if (temp == ')')
  {
    str.putback(temp);
    return NULL;
  }
  else if (temp == '#')
  {
    string no;
    getline(str, no);
    return getValue(str);
  }
  else
  {
    str.putback(temp);
    double val;
    str.peek();
    str >> val;

    if (str.fail())
    {
      str.clear();
      *err << "Failed to extract a numeric value at ";
      curPos(*err, str.tellg());
      *err << endl;
      str.peek();
      return NULL;
    }
    else
    {
      return new ConstValue(val);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xf(%rsp), %r15
movq %rsi, %rdi
movq %r15, %rsi
callq 0x43e0
movzbl (%r15), %eax
cmpl $0x23, %eax
je 0x8137
cmpl $0x29, %eax
je 0x8124
cmpl $0x7b, %eax
jne 0x8194
movq %r14, %rdi
callq 0x4590
movq %rax, 0x50(%rsp)
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x40(%rsp), %r15
leaq 0xf(%rsp), %r12
leaq 0x30(%rsp), %r13
leaq 0x10(%rsp), %rbp
movq %r14, %rdi
movq %r12, %rsi
callq 0x4430
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x8243
movzbl 0xf(%rsp), %eax
cmpl $0x23, %eax
je 0x80d3
cmpl $0x7d, %eax
je 0x82f3
movsbl %al, %esi
movq %rbp, %rdi
callq 0x42c0
jmp 0x8096
movq %r15, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movb $0x0, 0x40(%rsp)
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x42f0
movsbl %al, %edx
movq %r14, %rdi
movq %r13, %rsi
callq 0x4600
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0x8096
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4320
jmp 0x8096
movsbl %al, %esi
movq %r14, %rdi
callq 0x4620
xorl %r15d, %r15d
jmp 0x82e1
leaq 0x20(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x42f0
movsbl %al, %edx
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x4600
movq %rbx, %rdi
movq %r14, %rsi
callq 0x801e
movq %rax, %r15
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
jne 0x82af
jmp 0x82e1
movsbl %al, %esi
movq %r14, %rdi
callq 0x4620
movq %r14, %rdi
callq 0x4150
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x4210
movq (%r14), %rax
movq -0x18(%rax), %rdi
testb $0x5, 0x20(%r14,%rdi)
je 0x82be
addq %r14, %rdi
xorl %r15d, %r15d
xorl %esi, %esi
callq 0x4560
movq 0x90(%rbx), %rdi
leaq 0x2403e(%rip), %rsi     # 0x2c220
movl $0x25, %edx
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), %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
movq %r14, %rdi
callq 0x4150
jmp 0x82e1
movq 0x90(%rbx), %rdi
leaq 0x23faa(%rip), %rsi     # 0x2c1fb
movl $0x24, %edx
callq 0x4370
movq 0x90(%rbx), %rsi
movq %rbx, %rdi
movq 0x50(%rsp), %rdx
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
xorl %r15d, %r15d
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x82e1
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4320
jmp 0x82e1
movl $0x10, %edi
callq 0x4310
movq %rax, %r15
movsd 0x10(%rsp), %xmm0
leaq 0x2f668(%rip), %rax     # 0x37940
movq %rax, (%r15)
movsd %xmm0, 0x8(%r15)
movq %r15, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xc0, %edi
callq 0x4310
movq %rax, %r15
movq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0xb362
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
testb %al, %al
jne 0x82a0
movq 0x90(%rbx), %r12
leaq 0x23eb0(%rip), %rsi     # 0x2c1d8
movl $0x22, %edx
movq %r12, %rdi
callq 0x4370
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r12, %rdi
callq 0x4370
leaq 0x23e3b(%rip), %rsi     # 0x2c189
movl $0x5, %edx
movq %rax, %rdi
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), %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
movq (%r15), %rax
movq %r15, %rdi
callq *0x20(%rax)
jmp 0x829d
jmp 0x83f1
movq %rax, %rbx
movl $0xc0, %esi
movq %r15, %rdi
jmp 0x83ea
jmp 0x83f1
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
jne 0x8403
jmp 0x8410
jmp 0x83f1
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0x83f4
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4320
jmp 0x83f4
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x8410
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4320
movq %rbx, %rdi
callq 0x45c0