// File: FR13ndSDP[P]NHT/Parameters.cpp
// Function: Parameters::readParameters(char const*)
int Parameters::readParameters(const char *filename)
{
    stringstream buffer;
    string line;
    string paramName;
    int paramValue_int = 0;
    double paramValue= 0;
    string paramStr;

    ifstream fin(filename);
    if (!fin.good())
    {
        string msg("parameters file not found");
        msg.append(filename);
        throw runtime_error(msg);
    }
    while (fin.good())
    {
        getline(fin, line);
        if (line[0] != '#')
        {
            buffer << line; //order is important
            buffer >> paramName;
            if (paramName.compare("unSteady") == 0)
            {
                buffer >> paramValue_int;
                uS = paramValue_int;
            }
            else if (paramName.compare("Boundary_L") == 0)
            {
                buffer >> paramValue_int;
                B_L = paramValue_int;
            }
            else if (paramName.compare("Boundary_R") == 0)
            {
                buffer >> paramValue_int;
                B_R = paramValue_int;
            }
            else if (paramName.compare("Q_L") == 0)
            {
                buffer >> paramValue;
                Q_L = paramValue;
            }
            else if (paramName.compare("Q_R") == 0)
            {
                buffer >> paramValue_int;
                Q_R = paramValue_int;
            }
            else if (paramName.compare("solver") == 0)
            {
                buffer >> paramStr;
                solver = paramStr;
            }
            else if (paramName.compare("L") == 0)
            {
                buffer >> paramValue;
                L = paramValue;
            }
            else if (paramName.compare("N") == 0)
            {
                buffer >> paramValue_int;
                N = paramValue_int;
            }
            else if (paramName.compare("dt") == 0)
            {
                buffer >> paramValue;
                dt = paramValue;
            }
            else if (paramName.compare("A1") == 0)
            {
                buffer >> paramValue;
                A1 = paramValue;
            }
            else if (paramName.compare("A2") == 0)
            {
                buffer >> paramValue;
                A2 = paramValue;
            }
            else if (paramName.compare("RHOC") == 0)
            {
                buffer >> paramValue;
                RHOC = paramValue;
            }
            else if (paramName.compare("K") == 0)
            {
                buffer >> paramValue;
                K = paramValue;
            }
            else if (paramName.compare("TA") == 0)
            {
                buffer >> paramValue;
                TA = paramValue;
            }
            else if (paramName.compare("TB") == 0)
            {
                buffer >> paramValue;
                TB = paramValue;
            }
            else if (paramName.compare("P") == 0)
            {
                buffer >> paramValue;
                P = paramValue;
            }
            else
            {
                throw runtime_error(string("unknown parameter: ").append(paramName));
            }
        }
    }
    fin.close();
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4c0, %rsp            # imm = 0x4C0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x478(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x2150
leaq -0x1b8(%rbp), %rdi
callq 0x22a0
leaq -0x1d8(%rbp), %rdi
callq 0x22a0
movl $0x0, -0x1dc(%rbp)
movq $0x0, -0x1e8(%rbp)
leaq -0x208(%rbp), %rdi
callq 0x22a0
movq -0x10(%rbp), %rsi
leaq -0x410(%rbp), %rdi
movl $0x8, %edx
callq 0x2380
jmp 0x45da
movq -0x410(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x410(%rbp,%rax), %rdi
callq 0x2320
movb %al, -0x479(%rbp)
jmp 0x45fa
movb -0x479(%rbp), %al
testb $0x1, %al
jne 0x472f
jmp 0x460a
leaq -0x441(%rbp), %rdi
movq %rdi, -0x488(%rbp)
callq 0x2360
movq -0x488(%rbp), %rdx
leaq 0x3aba(%rip), %rsi      # 0x80e5
leaq -0x440(%rbp), %rdi
callq 0x5700
jmp 0x4639
leaq -0x441(%rbp), %rdi
callq 0x2240
movq -0x10(%rbp), %rsi
leaq -0x440(%rbp), %rdi
callq 0x23a0
jmp 0x4657
movl $0x10, %edi
callq 0x20f0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x490(%rbp)
leaq -0x440(%rbp), %rsi
callq 0x22f0
jmp 0x467c
movq -0x490(%rbp), %rdi
movq 0x6966(%rip), %rsi      # 0xaff0
movq 0x692f(%rip), %rdx      # 0xafc0
callq 0x2340
jmp 0x4dd6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x418(%rbp)
movl %eax, -0x41c(%rbp)
jmp 0x4d9a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x418(%rbp)
movl %eax, -0x41c(%rbp)
jmp 0x4d8e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x418(%rbp)
movl %eax, -0x41c(%rbp)
leaq -0x441(%rbp), %rdi
callq 0x2240
jmp 0x4d8e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x418(%rbp)
movl %eax, -0x41c(%rbp)
jmp 0x471e
movq -0x490(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x418(%rbp)
movl %eax, -0x41c(%rbp)
callq 0x2170
leaq -0x440(%rbp), %rdi
callq 0x2120
jmp 0x4d8e
jmp 0x4731
movq -0x410(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x410(%rbp,%rax), %rdi
callq 0x2320
movb %al, -0x491(%rbp)
jmp 0x4751
movb -0x491(%rbp), %al
testb $0x1, %al
jne 0x4760
jmp 0x4d39
leaq -0x410(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x2060
jmp 0x4775
xorl %eax, %eax
movl %eax, %esi
leaq -0x1b8(%rbp), %rdi
callq 0x23d0
movq %rax, -0x4a0(%rbp)
jmp 0x478e
movq -0x4a0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
je 0x4d34
leaq -0x188(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x21e0
jmp 0x47b6
leaq -0x198(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x2280
jmp 0x47cb
leaq -0x1d8(%rbp), %rdi
leaq 0x3926(%rip), %rsi      # 0x80ff
callq 0x20a0
cmpl $0x0, %eax
jne 0x480d
leaq -0x198(%rbp), %rdi
leaq -0x1dc(%rbp), %rsi
callq 0x2110
jmp 0x47f8
movq -0x478(%rbp), %rax
movl -0x1dc(%rbp), %ecx
movl %ecx, 0x4(%rax)
jmp 0x4d32
leaq -0x1d8(%rbp), %rdi
leaq 0x38ed(%rip), %rsi      # 0x8108
callq 0x20a0
cmpl $0x0, %eax
jne 0x484f
leaq -0x198(%rbp), %rdi
leaq -0x1dc(%rbp), %rsi
callq 0x2110
jmp 0x483a
movq -0x478(%rbp), %rax
movl -0x1dc(%rbp), %ecx
movl %ecx, 0x8(%rax)
jmp 0x4d30
leaq -0x1d8(%rbp), %rdi
leaq 0x38b6(%rip), %rsi      # 0x8113
callq 0x20a0
cmpl $0x0, %eax
jne 0x4891
leaq -0x198(%rbp), %rdi
leaq -0x1dc(%rbp), %rsi
callq 0x2110
jmp 0x487c
movq -0x478(%rbp), %rax
movl -0x1dc(%rbp), %ecx
movl %ecx, 0xc(%rax)
jmp 0x4d2e
leaq -0x1d8(%rbp), %rdi
leaq 0x387f(%rip), %rsi      # 0x811e
callq 0x20a0
cmpl $0x0, %eax
jne 0x48d7
leaq -0x198(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x21b0
jmp 0x48be
movq -0x478(%rbp), %rax
movsd -0x1e8(%rbp), %xmm0
movsd %xmm0, 0x60(%rax)
jmp 0x4d2c
leaq -0x1d8(%rbp), %rdi
leaq 0x383d(%rip), %rsi      # 0x8122
callq 0x20a0
cmpl $0x0, %eax
jne 0x491d
leaq -0x198(%rbp), %rdi
leaq -0x1dc(%rbp), %rsi
callq 0x2110
jmp 0x4904
movq -0x478(%rbp), %rax
cvtsi2sdl -0x1dc(%rbp), %xmm0
movsd %xmm0, 0x58(%rax)
jmp 0x4d2a
leaq -0x1d8(%rbp), %rdi
leaq 0x37fb(%rip), %rsi      # 0x8126
callq 0x20a0
cmpl $0x0, %eax
jne 0x4968
leaq -0x198(%rbp), %rdi
leaq -0x208(%rbp), %rsi
callq 0x2280
jmp 0x494a
movq -0x478(%rbp), %rdi
addq $0x68, %rdi
leaq -0x208(%rbp), %rsi
callq 0x2030
jmp 0x4963
jmp 0x4d28
leaq -0x1d8(%rbp), %rdi
leaq 0x37aa(%rip), %rsi      # 0x8120
callq 0x20a0
cmpl $0x0, %eax
jne 0x49ae
leaq -0x198(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x21b0
jmp 0x4995
movq -0x478(%rbp), %rax
movsd -0x1e8(%rbp), %xmm0
movsd %xmm0, 0x18(%rax)
jmp 0x4d26
leaq -0x1d8(%rbp), %rdi
leaq 0x3771(%rip), %rsi      # 0x812d
callq 0x20a0
cmpl $0x0, %eax
jne 0x49ef
leaq -0x198(%rbp), %rdi
leaq -0x1dc(%rbp), %rsi
callq 0x2110
jmp 0x49db
movq -0x478(%rbp), %rax
movl -0x1dc(%rbp), %ecx
movl %ecx, (%rax)
jmp 0x4d24
leaq -0x1d8(%rbp), %rdi
leaq 0x3732(%rip), %rsi      # 0x812f
callq 0x20a0
cmpl $0x0, %eax
jne 0x4a35
leaq -0x198(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x21b0
jmp 0x4a1c
movq -0x478(%rbp), %rax
movsd -0x1e8(%rbp), %xmm0
movsd %xmm0, 0x10(%rax)
jmp 0x4d22
leaq -0x1d8(%rbp), %rdi
leaq 0x36ef(%rip), %rsi      # 0x8132
callq 0x20a0
cmpl $0x0, %eax
jne 0x4a7b
leaq -0x198(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x21b0
jmp 0x4a62
movq -0x478(%rbp), %rax
movsd -0x1e8(%rbp), %xmm0
movsd %xmm0, 0x20(%rax)
jmp 0x4d20
leaq -0x1d8(%rbp), %rdi
leaq 0x36ac(%rip), %rsi      # 0x8135
callq 0x20a0
cmpl $0x0, %eax
jne 0x4ac1
leaq -0x198(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x21b0
jmp 0x4aa8
movq -0x478(%rbp), %rax
movsd -0x1e8(%rbp), %xmm0
movsd %xmm0, 0x28(%rax)
jmp 0x4d1e
leaq -0x1d8(%rbp), %rdi
leaq 0x3669(%rip), %rsi      # 0x8138
callq 0x20a0
cmpl $0x0, %eax
jne 0x4b07
leaq -0x198(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x21b0
jmp 0x4aee
movq -0x478(%rbp), %rax
movsd -0x1e8(%rbp), %xmm0
movsd %xmm0, 0x30(%rax)
jmp 0x4d1c
leaq -0x1d8(%rbp), %rdi
leaq 0x3628(%rip), %rsi      # 0x813d
callq 0x20a0
cmpl $0x0, %eax
jne 0x4b4d
leaq -0x198(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x21b0
jmp 0x4b34
movq -0x478(%rbp), %rax
movsd -0x1e8(%rbp), %xmm0
movsd %xmm0, 0x38(%rax)
jmp 0x4d1a
leaq -0x1d8(%rbp), %rdi
leaq 0x35e4(%rip), %rsi      # 0x813f
callq 0x20a0
cmpl $0x0, %eax
jne 0x4b93
leaq -0x198(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x21b0
jmp 0x4b7a
movq -0x478(%rbp), %rax
movsd -0x1e8(%rbp), %xmm0
movsd %xmm0, 0x40(%rax)
jmp 0x4d18
leaq -0x1d8(%rbp), %rdi
leaq 0x35a1(%rip), %rsi      # 0x8142
callq 0x20a0
cmpl $0x0, %eax
jne 0x4bd9
leaq -0x198(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x21b0
jmp 0x4bc0
movq -0x478(%rbp), %rax
movsd -0x1e8(%rbp), %xmm0
movsd %xmm0, 0x48(%rax)
jmp 0x4d16
leaq -0x1d8(%rbp), %rdi
leaq 0x355e(%rip), %rsi      # 0x8145
callq 0x20a0
cmpl $0x0, %eax
jne 0x4c1f
leaq -0x198(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x21b0
jmp 0x4c06
movq -0x478(%rbp), %rax
movsd -0x1e8(%rbp), %xmm0
movsd %xmm0, 0x50(%rax)
jmp 0x4d14
movb $0x1, -0x46a(%rbp)
movl $0x10, %edi
callq 0x20f0
movq %rax, -0x4b0(%rbp)
leaq -0x469(%rbp), %rdi
movq %rdi, -0x4a8(%rbp)
callq 0x2360
movq -0x4a8(%rbp), %rdx
leaq 0x34ef(%rip), %rsi      # 0x8147
leaq -0x468(%rbp), %rdi
callq 0x5700
jmp 0x4c66
leaq -0x468(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x23b0
movq %rax, -0x4b8(%rbp)
jmp 0x4c82
movq -0x4b8(%rbp), %rsi
movq -0x4b0(%rbp), %rdi
callq 0x22f0
jmp 0x4c97
movq -0x4b0(%rbp), %rdi
movb $0x0, -0x46a(%rbp)
movq 0x6344(%rip), %rsi      # 0xaff0
movq 0x630d(%rip), %rdx      # 0xafc0
callq 0x2340
jmp 0x4dd6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x418(%rbp)
movl %eax, -0x41c(%rbp)
jmp 0x4cef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x418(%rbp)
movl %eax, -0x41c(%rbp)
leaq -0x468(%rbp), %rdi
callq 0x2120
leaq -0x469(%rbp), %rdi
callq 0x2240
testb $0x1, -0x46a(%rbp)
jne 0x4d06
jmp 0x4d12
movq -0x4b0(%rbp), %rdi
callq 0x2170
jmp 0x4d8e
jmp 0x4d16
jmp 0x4d18
jmp 0x4d1a
jmp 0x4d1c
jmp 0x4d1e
jmp 0x4d20
jmp 0x4d22
jmp 0x4d24
jmp 0x4d26
jmp 0x4d28
jmp 0x4d2a
jmp 0x4d2c
jmp 0x4d2e
jmp 0x4d30
jmp 0x4d32
jmp 0x4d34
jmp 0x4731
leaq -0x410(%rbp), %rdi
callq 0x2070
jmp 0x4d47
leaq -0x410(%rbp), %rdi
callq 0x2080
leaq -0x208(%rbp), %rdi
callq 0x2120
leaq -0x1d8(%rbp), %rdi
callq 0x2120
leaq -0x1b8(%rbp), %rdi
callq 0x2120
leaq -0x198(%rbp), %rdi
callq 0x2180
xorl %eax, %eax
addq $0x4c0, %rsp            # imm = 0x4C0
popq %rbp
retq
leaq -0x410(%rbp), %rdi
callq 0x2080
leaq -0x208(%rbp), %rdi
callq 0x2120
leaq -0x1d8(%rbp), %rdi
callq 0x2120
leaq -0x1b8(%rbp), %rdi
callq 0x2120
leaq -0x198(%rbp), %rdi
callq 0x2180
movq -0x418(%rbp), %rdi
callq 0x2350
nopw %cs:(%rax,%rax)