// File: /workspace/github_cpp_makefile_star2_O3/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 0x43d0
movzbl (%r15), %eax
cmpl $0x23, %eax
je 0x7e9f
cmpl $0x29, %eax
je 0x7e8a
cmpl $0x7b, %eax
jne 0x7efc
movq %r14, %rdi
callq 0x4580
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 0x4420
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x7fab
movzbl 0xf(%rsp), %eax
cmpl $0x23, %eax
je 0x7e39
cmpl $0x7d, %eax
je 0x805b
movsbl %al, %esi
movq %rbp, %rdi
callq 0x42b0
jmp 0x7dfc
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 0x42e0
movsbl %al, %edx
movq %r14, %rdi
movq %r13, %rsi
callq 0x45f0
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0x7dfc
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4310
jmp 0x7dfc
movq %r14, %rdi
movl $0x29, %esi
callq 0x4610
xorl %r15d, %r15d
jmp 0x8049
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 0x42e0
movsbl %al, %edx
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x45f0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7d84
movq %rax, %r15
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
jne 0x8017
jmp 0x8049
movsbl %al, %esi
movq %r14, %rdi
callq 0x4610
movq %r14, %rdi
callq 0x4150
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x4200
movq (%r14), %rax
movq -0x18(%rax), %rdi
testb $0x5, 0x20(%r14,%rdi)
je 0x8026
addq %r14, %rdi
xorl %r15d, %r15d
xorl %esi, %esi
callq 0x4550
movq 0x90(%rbx), %rdi
leaq 0x232e6(%rip), %rsi     # 0x2b230
movl $0x25, %edx
callq 0x4360
movq 0x90(%rbx), %r12
movq %r14, %rdi
callq 0x4580
movq %rbx, %rdi
movq %r12, %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
movq %r14, %rdi
callq 0x4150
jmp 0x8049
movq 0x90(%rbx), %rdi
leaq 0x23252(%rip), %rsi     # 0x2b20b
movl $0x24, %edx
callq 0x4360
movq 0x90(%rbx), %rsi
movq %rbx, %rdi
movq 0x50(%rsp), %rdx
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
xorl %r15d, %r15d
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x8049
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4310
jmp 0x8049
movl $0x10, %edi
callq 0x4300
movq %rax, %r15
movsd 0x10(%rsp), %xmm0
leaq 0x2e8e8(%rip), %rax     # 0x36928
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 0x4300
movq %rax, %r15
movq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0xaffc
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
testb %al, %al
jne 0x8008
movq 0x90(%rbx), %r12
leaq 0x23158(%rip), %rsi     # 0x2b1e8
movl $0x22, %edx
movq %r12, %rdi
callq 0x4360
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r12, %rdi
callq 0x4360
leaq 0x230e3(%rip), %rsi     # 0x2b199
movl $0x5, %edx
movq %rax, %rdi
callq 0x4360
movq 0x90(%rbx), %r12
movq %r14, %rdi
callq 0x4580
movq %rbx, %rdi
movq %r12, %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
movq (%r15), %rax
movq %r15, %rdi
callq *0x20(%rax)
jmp 0x8005
jmp 0x8159
movq %rax, %rbx
movl $0xc0, %esi
movq %r15, %rdi
jmp 0x8152
jmp 0x8159
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
jne 0x816b
jmp 0x8178
jmp 0x8159
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0x815c
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4310
jmp 0x815c
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x8178
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4310
movq %rbx, %rdi
callq 0x45b0