// File: /workspace/github_cpp_makefile_star2_O3/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 0x299a
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 0x29d0
movq (%rsp), %rdi
cmpq %rdi, 0x8(%rsp)
je 0x297e
leaq 0x60(%rbx), %rax
movq %rax, 0x48(%rsp)
leaq 0x80(%rbx), %rax
movq %rax, 0x40(%rsp)
xorl %r12d, %r12d
leaq 0x8946(%rip), %rbp      # 0xb063
leaq 0x894f(%rip), %r14      # 0xb073
xorl %r13d, %r13d
addq %r12, %rdi
leaq 0x88d3(%rip), %rsi      # 0xb004
callq 0x2090
movq (%rsp), %r15
testl %eax, %eax
jne 0x274a
movq 0x40(%r15,%r12), %rdi
callq 0x22a0
movl %eax, (%rbx)
addq %r12, %r15
movq %r15, %rdi
leaq 0x88bd(%rip), %rsi      # 0xb014
callq 0x2090
movq (%rsp), %r15
testl %eax, %eax
jne 0x2773
movq 0x40(%r15,%r12), %rdi
callq 0x2240
movsd %xmm0, 0x18(%rbx)
addq %r12, %r15
movq %r15, %rdi
leaq 0x889a(%rip), %rsi      # 0xb01a
callq 0x2090
movq (%rsp), %r15
testl %eax, %eax
jne 0x279c
movq 0x40(%r15,%r12), %rdi
callq 0x2240
movsd %xmm0, 0x20(%rbx)
addq %r12, %r15
movq %r15, %rdi
leaq 0x8877(%rip), %rsi      # 0xb020
callq 0x2090
movq (%rsp), %r15
testl %eax, %eax
jne 0x27c5
movq 0x40(%r15,%r12), %rdi
callq 0x2240
movsd %xmm0, 0x28(%rbx)
addq %r12, %r15
movq %r15, %rdi
leaq 0x8852(%rip), %rsi      # 0xb024
callq 0x2090
movq (%rsp), %r15
testl %eax, %eax
jne 0x27ee
movq 0x40(%r15,%r12), %rdi
callq 0x2240
movsd %xmm0, 0x30(%rbx)
addq %r12, %r15
movq %r15, %rdi
leaq 0x882d(%rip), %rsi      # 0xb028
callq 0x2090
movq (%rsp), %r15
testl %eax, %eax
jne 0x2817
movq 0x40(%r15,%r12), %rdi
callq 0x2240
movsd %xmm0, 0x38(%rbx)
addq %r12, %r15
movq %r15, %rdi
leaq 0x8808(%rip), %rsi      # 0xb02c
callq 0x2090
movq (%rsp), %r15
testl %eax, %eax
jne 0x2840
movq 0x40(%r15,%r12), %rdi
callq 0x2240
movsd %xmm0, 0x40(%rbx)
addq %r12, %r15
movq %r15, %rdi
leaq 0x87e3(%rip), %rsi      # 0xb030
callq 0x2090
movq (%rsp), %r15
testl %eax, %eax
jne 0x2869
movq 0x40(%r15,%r12), %rdi
callq 0x2240
movsd %xmm0, 0x50(%rbx)
addq %r12, %r15
movq %r15, %rdi
leaq 0x87c5(%rip), %rsi      # 0xb03b
callq 0x2090
movq (%rsp), %r15
testl %eax, %eax
jne 0x2892
movq 0x40(%r15,%r12), %rdi
callq 0x2240
movsd %xmm0, 0x58(%rbx)
addq %r12, %r15
movq %r15, %rdi
leaq 0x87a8(%rip), %rsi      # 0xb047
callq 0x2090
movq (%rsp), %r15
testl %eax, %eax
jne 0x28bb
movq 0x40(%r15,%r12), %rdi
callq 0x2240
movsd %xmm0, 0x8(%rbx)
addq %r12, %r15
movq %r15, %rdi
leaq 0x8782(%rip), %rsi      # 0xb04a
callq 0x2090
movq (%rsp), %r15
testl %eax, %eax
jne 0x28e4
movq 0x40(%r15,%r12), %rdi
callq 0x2240
movsd %xmm0, 0x10(%rbx)
addq %r12, %r15
movq %r15, %rdi
leaq 0x875c(%rip), %rsi      # 0xb04d
callq 0x2090
movq (%rsp), %r15
testl %eax, %eax
jne 0x290d
movq 0x40(%r15,%r12), %rdi
callq 0x2240
movsd %xmm0, 0x48(%rbx)
addq %r12, %r15
movq %r15, %rdi
movq %rbp, %rsi
callq 0x2090
testl %eax, %eax
jne 0x2935
movq (%rsp), %rax
leaq (%rax,%r12), %rsi
addq $0x40, %rsi
movq 0x48(%rsp), %rdi
callq 0x20e0
movq (%rsp), %rdi
addq %r12, %rdi
movq %r14, %rsi
callq 0x2090
testl %eax, %eax
jne 0x295e
movq (%rsp), %rax
leaq (%rax,%r12), %rsi
addq $0x40, %rsi
movq 0x40(%rsp), %rdi
callq 0x20e0
incq %r13
movq (%rsp), %rdi
movq 0x8(%rsp), %rax
subq %rdi, %rax
sarq $0x5, %rax
addq $0x20, %r12
cmpq %r13, %rax
ja 0x2727
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x299a
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x90(%rsp), %rdi
callq 0x2040
movq %rsp, %rdi
callq 0x2c34
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 0x2c9e
leaq 0x80(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x877c(%rip), %rsi      # 0xb17f
leaq 0x8778(%rip), %rdx      # 0xb182
leaq 0x70(%rsp), %rdi
callq 0x2d34
movq %rsp, %rdi
leaq 0x50(%rsp), %rsi
callq 0x256c
movq %rax, %rbx
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0x2a43
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x21d0
jmp 0x2a43
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x2a6b
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x21d0
jmp 0x2a6b
movq %rax, %rbx
jmp 0x2a87
movq %rax, %rbx
jmp 0x2a8f
jmp 0x2a68
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x2a87
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21d0
movq %rsp, %rdi
callq 0x2c34
leaq 0x90(%rsp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x2300