// File: /workspace/github_cpp_makefile_star2_O1/bauerj4[P]Riemann1D/src/Context.cpp
// Function: readContext(char*, context_t&)
int readContext(char * PATH, context_t &context)
{
  ifstream file; 
  file.open(PATH,ifstream::in);
  vector<string> tokens;

  if (file.is_open())
    {
      int i=0;
      string line;
      while(getline(file,line))
        {
	  delimitString(tokens,line, " = ");
	  i++;
	}

      for (int j = 0; j < tokens.size(); j++)
	{
	  if(tokens[j] == "MESH_RESOLUTION")
            {
              context.MESH_RESOLUTION =  atoi(tokens[j + 2].c_str());
            }

	  if(tokens[j] == "RHO_L")
	    {
	      context.RHO_L = atof(tokens[j + 2].c_str());
	    }
         
	  if(tokens[j] == "RHO_R")
            {
              context.RHO_R = atof(tokens[j + 2].c_str());
            }

	  if (tokens[j] == "U_L")
	    {
	      context.U_L = atof(tokens[j + 2].c_str());
	    }

          if (tokens[j] == "U_R")
            {
              context.U_R = atof(tokens[j + 2].c_str());
            }


          if (tokens[j] == "P_L")
            {
              context.P_L = atof(tokens[j + 2].c_str());
            }

          if (tokens[j] == "P_R")
            {
              context.P_R = atof(tokens[j + 2].c_str());
            }


          if (tokens[j] == "CFL_NUMBER")
            {
              context.CFL_NUMBER = atof(tokens[j + 2].c_str());
            }

          if (tokens[j] == "EVOLVE_TIME")
            {
              context.EVOLVE_TIME = atof(tokens[j + 2].c_str());
            }

          if (tokens[j] == "X0")
            {
              context.X0 = atof(tokens[j + 2].c_str());
            }


          if (tokens[j] == "X1")
            {
              context.X1 = atof(tokens[j + 2].c_str());
            }

          if (tokens[j] == "INITIAL_DISCONTINUITY")
            {
              context.INITIAL_DISCONTINUITY = atof(tokens[j + 2].c_str());
            }



          if(tokens[j] == "SOLUTION_METHOD")
            {
              context.SOLUTION_METHOD = tokens[j + 2];
            }


          if(tokens[j] == "SNAPSHOT_PATH")
            {
              context.SNAPSHOT_PATH = tokens[j + 2];
            }

	  //cout << "Read token is " + tokens[j] << endl;
	}
    }
  file.close();

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x90(%rsp), %r14
movq %r14, %rdi
callq 0x21f0
movq %r14, %rdi
movq %r15, %rsi
movl $0x8, %edx
callq 0x2100
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
leaq 0x108(%rsp), %rdi
callq 0x2060
testb %al, %al
je 0x29a9
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x90(%rsp), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %edx
leaq 0x90(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x2320
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
je 0x29df
movq (%rsp), %rdi
cmpq %rdi, 0x8(%rsp)
je 0x298d
leaq 0x60(%rbx), %rax
movq %rax, 0x48(%rsp)
leaq 0x80(%rbx), %rax
movq %rax, 0x40(%rsp)
xorl %r15d, %r15d
leaq 0x8930(%rip), %r13      # 0xb04d
leaq 0x893f(%rip), %rbp      # 0xb063
leaq 0x8948(%rip), %r14      # 0xb073
xorl %r12d, %r12d
addq %r15, %rdi
leaq 0x88cc(%rip), %rsi      # 0xb004
callq 0x2090
testl %eax, %eax
jne 0x2751
movq (%rsp), %rax
movq 0x40(%rax,%r15), %rdi
callq 0x22a0
movl %eax, (%rbx)
movq (%rsp), %rdi
addq %r15, %rdi
leaq 0x88b5(%rip), %rsi      # 0xb014
callq 0x2090
testl %eax, %eax
jne 0x277b
movq (%rsp), %rax
movq 0x40(%rax,%r15), %rdi
callq 0x2240
movsd %xmm0, 0x18(%rbx)
movq (%rsp), %rdi
addq %r15, %rdi
leaq 0x8891(%rip), %rsi      # 0xb01a
callq 0x2090
testl %eax, %eax
jne 0x27a5
movq (%rsp), %rax
movq 0x40(%rax,%r15), %rdi
callq 0x2240
movsd %xmm0, 0x20(%rbx)
movq (%rsp), %rdi
addq %r15, %rdi
leaq 0x886d(%rip), %rsi      # 0xb020
callq 0x2090
testl %eax, %eax
jne 0x27cf
movq (%rsp), %rax
movq 0x40(%rax,%r15), %rdi
callq 0x2240
movsd %xmm0, 0x28(%rbx)
movq (%rsp), %rdi
addq %r15, %rdi
leaq 0x8847(%rip), %rsi      # 0xb024
callq 0x2090
testl %eax, %eax
jne 0x27f9
movq (%rsp), %rax
movq 0x40(%rax,%r15), %rdi
callq 0x2240
movsd %xmm0, 0x30(%rbx)
movq (%rsp), %rdi
addq %r15, %rdi
leaq 0x8821(%rip), %rsi      # 0xb028
callq 0x2090
testl %eax, %eax
jne 0x2823
movq (%rsp), %rax
movq 0x40(%rax,%r15), %rdi
callq 0x2240
movsd %xmm0, 0x38(%rbx)
movq (%rsp), %rdi
addq %r15, %rdi
leaq 0x87fb(%rip), %rsi      # 0xb02c
callq 0x2090
testl %eax, %eax
jne 0x284d
movq (%rsp), %rax
movq 0x40(%rax,%r15), %rdi
callq 0x2240
movsd %xmm0, 0x40(%rbx)
movq (%rsp), %rdi
addq %r15, %rdi
leaq 0x87d5(%rip), %rsi      # 0xb030
callq 0x2090
testl %eax, %eax
jne 0x2877
movq (%rsp), %rax
movq 0x40(%rax,%r15), %rdi
callq 0x2240
movsd %xmm0, 0x50(%rbx)
movq (%rsp), %rdi
addq %r15, %rdi
leaq 0x87b6(%rip), %rsi      # 0xb03b
callq 0x2090
testl %eax, %eax
jne 0x28a1
movq (%rsp), %rax
movq 0x40(%rax,%r15), %rdi
callq 0x2240
movsd %xmm0, 0x58(%rbx)
movq (%rsp), %rdi
addq %r15, %rdi
leaq 0x8798(%rip), %rsi      # 0xb047
callq 0x2090
testl %eax, %eax
jne 0x28cb
movq (%rsp), %rax
movq 0x40(%rax,%r15), %rdi
callq 0x2240
movsd %xmm0, 0x8(%rbx)
movq (%rsp), %rdi
addq %r15, %rdi
leaq 0x8771(%rip), %rsi      # 0xb04a
callq 0x2090
testl %eax, %eax
jne 0x28f5
movq (%rsp), %rax
movq 0x40(%rax,%r15), %rdi
callq 0x2240
movsd %xmm0, 0x10(%rbx)
movq (%rsp), %rdi
addq %r15, %rdi
movq %r13, %rsi
callq 0x2090
testl %eax, %eax
jne 0x291b
movq (%rsp), %rax
movq 0x40(%rax,%r15), %rdi
callq 0x2240
movsd %xmm0, 0x48(%rbx)
movq (%rsp), %rdi
addq %r15, %rdi
movq %rbp, %rsi
callq 0x2090
testl %eax, %eax
jne 0x2944
movq (%rsp), %rax
leaq (%rax,%r15), %rsi
addq $0x40, %rsi
movq 0x48(%rsp), %rdi
callq 0x20e0
movq (%rsp), %rdi
addq %r15, %rdi
movq %r14, %rsi
callq 0x2090
testl %eax, %eax
jne 0x296d
movq (%rsp), %rax
leaq (%rax,%r15), %rsi
addq $0x40, %rsi
movq 0x40(%rsp), %rdi
callq 0x20e0
incq %r12
movq (%rsp), %rdi
movq 0x8(%rsp), %rax
subq %rdi, %rax
sarq $0x5, %rax
addq $0x20, %r15
cmpq %r12, %rax
ja 0x272e
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x29a9
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x90(%rsp), %rdi
callq 0x2040
movq %rsp, %rdi
callq 0x2c42
leaq 0x90(%rsp), %rdi
callq 0x2070
xorl %eax, %eax
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x60(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
leaq 0x50(%rsp), %rdi
callq 0x2ca8
leaq 0x80(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x876d(%rip), %rsi      # 0xb17f
leaq 0x8769(%rip), %rdx      # 0xb182
leaq 0x70(%rsp), %rdi
callq 0x2d38
movq %rsp, %rdi
leaq 0x50(%rsp), %rsi
callq 0x256c
movq %rax, %rbx
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0x2a52
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x21d0
jmp 0x2a52
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x2a7a
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x21d0
jmp 0x2a7a
movq %rax, %rbx
jmp 0x2a96
movq %rax, %rbx
jmp 0x2a9e
jmp 0x2a77
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x2a96
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21d0
movq %rsp, %rdi
callq 0x2c42
leaq 0x90(%rsp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x2300