// File: WShabti-Team[P]WShabtiPict/wshabtilib/input-parser/input-parser.cpp
// Function: parameter_parser(std::basic_ifstream<char, std::char_traits<char>>&, std::vector<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, std::allocator<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>>&)
void parameter_parser(ifstream &input_file_stream, vector<vector<string>> &parameter_matrix)
{
	string file_row;
	int num_of_params = 0;

	while(!input_file_stream.eof())
	{
		getline(input_file_stream, file_row);
		if(start_string_delim_find(file_row,'#'))
		{
			break;
		}

		string extracted_values = file_row.substr(file_row.find(':')+1); //pick only values of the params in the line (after ':' )
		vector<string> values_vector = split(extracted_values, ",");
	    parameter_matrix.push_back(vector<string>());

		//------------------------------------------THESE LINES ARE FOR CHECKING FOR RANGE INPUT IN FORMAT START:STOP:STEP AND INSERT INTO MODEL MATRIX------------------------------------------
		for (string value : values_vector)
		{
			if(value.find(':') == string::npos)
			{
				parameter_matrix[num_of_params].push_back(value);
			}
			else
			{
				vector<string> start_stop_step = split(extracted_values, ":");
				if(value.find('.') == string::npos)
				{
					for(int i= stoi(start_stop_step[0]); i<= stoi(start_stop_step[1]); i = i + stoi(start_stop_step[2]))
					{
						parameter_matrix[num_of_params].push_back(to_string(i));
					}
				}
				else
				{
					for(float i= stof(start_stop_step[0]); i<= stof(start_stop_step[1]); i = i + stof(start_stop_step[2]))
					{
						parameter_matrix[num_of_params].push_back(to_string(i));
					}
				} 
			}
		}
		//------------------------------------------THESE LINES ARE FOR CHECKING FOR RANGE INPUT IN FORMAT START:STOP:STEP AND INSERT INTO MODEL MATRIX------------------------------------------
		num_of_params++;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x260, %rsp            # imm = 0x260
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x77e0
movl $0x0, -0x34(%rbp)
movq -0x8(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x7a30
movb %al, -0x1e1(%rbp)
jmp 0x33b0e
movb -0x1e1(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x33b1f
jmp 0x341fd
movq -0x8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x70e0
jmp 0x33b2e
leaq -0x68(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x7270
jmp 0x33b3d
leaq -0x68(%rbp), %rdi
movl $0x23, %esi
callq 0x32ac0
movb %al, -0x1e2(%rbp)
jmp 0x33b53
leaq -0x68(%rbp), %rdi
callq 0x73e0
movb -0x1e2(%rbp), %al
testb $0x1, %al
jne 0x33b68
jmp 0x33b98
jmp 0x341fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3420f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x73e0
jmp 0x3420f
xorl %eax, %eax
movl %eax, %edx
leaq -0x30(%rbp), %rdi
movq %rdi, -0x1f0(%rbp)
movl $0x3a, %esi
callq 0x7790
movq -0x1f0(%rbp), %rsi
movq %rax, %rdx
incq %rdx
leaq -0x88(%rbp), %rdi
movq $-0x1, %rcx
callq 0x7620
jmp 0x33bd3
leaq -0xc0(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x7270
jmp 0x33be8
leaq -0xe1(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
callq 0x79e0
movq -0x1f8(%rbp), %rdx
leaq 0x32069(%rip), %rsi     # 0x65c72
leaq -0xe0(%rbp), %rdi
callq 0xd700
jmp 0x33c17
leaq -0xa0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
leaq -0xe0(%rbp), %rdx
callq 0x32880
jmp 0x33c33
leaq -0xe0(%rbp), %rdi
callq 0x73e0
leaq -0xe1(%rbp), %rdi
callq 0x7660
leaq -0xc0(%rbp), %rdi
callq 0x73e0
movq -0x10(%rbp), %rax
movq %rax, -0x208(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x100(%rbp)
movq $0x0, -0xf0(%rbp)
leaq -0x100(%rbp), %rdi
movq %rdi, -0x200(%rbp)
callq 0x32b00
movq -0x208(%rbp), %rdi
movq -0x200(%rbp), %rsi
callq 0x34540
jmp 0x33c9f
leaq -0x100(%rbp), %rdi
callq 0x32bc0
leaq -0xa0(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x108(%rbp), %rdi
callq 0x33300
movq %rax, -0x110(%rbp)
movq -0x108(%rbp), %rdi
callq 0x33180
movq %rax, -0x118(%rbp)
leaq -0x110(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x34570
testb $0x1, %al
jne 0x33cfb
jmp 0x341bd
leaq -0x110(%rbp), %rdi
callq 0x339f0
movq %rax, %rsi
leaq -0x138(%rbp), %rdi
callq 0x7270
jmp 0x33d18
leaq -0x138(%rbp), %rdi
movl $0x3a, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x7790
cmpq $-0x1, %rax
jne 0x33ded
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x345b0
movq %rax, %rdi
leaq -0x138(%rbp), %rsi
callq 0x32b20
jmp 0x33d55
jmp 0x34192
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x341ef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x33d91
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x73e0
leaq -0xe1(%rbp), %rdi
callq 0x7660
leaq -0xc0(%rbp), %rdi
callq 0x73e0
jmp 0x341ef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x32bc0
jmp 0x341e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x341e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x341af
leaq -0x170(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x7270
jmp 0x33e02
leaq -0x191(%rbp), %rdi
movq %rdi, -0x210(%rbp)
callq 0x79e0
movq -0x210(%rbp), %rdx
leaq 0x30cfd(%rip), %rsi     # 0x64b20
leaq -0x190(%rbp), %rdi
callq 0xd700
jmp 0x33e31
leaq -0x150(%rbp), %rdi
leaq -0x170(%rbp), %rsi
leaq -0x190(%rbp), %rdx
callq 0x32880
jmp 0x33e4d
leaq -0x190(%rbp), %rdi
callq 0x73e0
leaq -0x191(%rbp), %rdi
callq 0x7660
leaq -0x170(%rbp), %rdi
callq 0x73e0
leaq -0x138(%rbp), %rdi
movl $0x2e, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x7790
cmpq $-0x1, %rax
jne 0x34027
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0x220(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x32c40
movq -0x220(%rbp), %rsi
movq %rax, %rdi
movl $0xa, %edx
callq 0x345f0
movl %eax, -0x214(%rbp)
jmp 0x33ec3
movl -0x214(%rbp), %eax
movl %eax, -0x198(%rbp)
movl -0x198(%rbp), %eax
movl %eax, -0x228(%rbp)
leaq -0x150(%rbp), %rdi
movl $0x1, %esi
callq 0x32c40
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x345f0
movl %eax, -0x224(%rbp)
jmp 0x33f05
movl -0x228(%rbp), %eax
movl -0x224(%rbp), %ecx
cmpl %ecx, %eax
jg 0x34022
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x345b0
movq %rax, -0x230(%rbp)
movl -0x198(%rbp), %esi
leaq -0x1b8(%rbp), %rdi
callq 0x34630
jmp 0x33f41
movq -0x230(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x32b90
jmp 0x33f56
leaq -0x1b8(%rbp), %rdi
callq 0x73e0
movl -0x198(%rbp), %eax
movl %eax, -0x238(%rbp)
leaq -0x150(%rbp), %rdi
movl $0x2, %esi
callq 0x32c40
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x345f0
movl %eax, -0x234(%rbp)
jmp 0x33f98
movl -0x234(%rbp), %ecx
movl -0x238(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x198(%rbp)
jmp 0x33ecf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x33fd7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x73e0
leaq -0x191(%rbp), %rdi
callq 0x7660
leaq -0x170(%rbp), %rdi
callq 0x73e0
jmp 0x341af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x34184
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x73e0
jmp 0x34184
jmp 0x34176
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0x248(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x32c40
movq -0x248(%rbp), %rsi
movq %rax, %rdi
callq 0x34750
movss %xmm0, -0x23c(%rbp)
jmp 0x34057
movss -0x23c(%rbp), %xmm0
movss %xmm0, -0x1bc(%rbp)
movss -0x1bc(%rbp), %xmm0
movss %xmm0, -0x250(%rbp)
leaq -0x150(%rbp), %rdi
movl $0x1, %esi
callq 0x32c40
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x34750
movss %xmm0, -0x24c(%rbp)
jmp 0x3409e
movss -0x24c(%rbp), %xmm0
movss -0x250(%rbp), %xmm1
ucomiss %xmm1, %xmm0
jb 0x34174
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x345b0
movq %rax, -0x258(%rbp)
movss -0x1bc(%rbp), %xmm0
leaq -0x1e0(%rbp), %rdi
callq 0x34790
jmp 0x340e1
movq -0x258(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x32b90
jmp 0x340f6
leaq -0x1e0(%rbp), %rdi
callq 0x73e0
movss -0x1bc(%rbp), %xmm0
movss %xmm0, -0x260(%rbp)
leaq -0x150(%rbp), %rdi
movl $0x2, %esi
callq 0x32c40
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x34750
movss %xmm0, -0x25c(%rbp)
jmp 0x34139
movss -0x25c(%rbp), %xmm1
movss -0x260(%rbp), %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x1bc(%rbp)
jmp 0x34067
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x73e0
jmp 0x34184
jmp 0x34176
leaq -0x150(%rbp), %rdi
callq 0x32bc0
jmp 0x34192
leaq -0x150(%rbp), %rdi
callq 0x32bc0
jmp 0x341af
leaq -0x138(%rbp), %rdi
callq 0x73e0
leaq -0x110(%rbp), %rdi
callq 0x345d0
jmp 0x33cdf
leaq -0x138(%rbp), %rdi
callq 0x73e0
jmp 0x341e3
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x32bc0
leaq -0x88(%rbp), %rdi
callq 0x73e0
jmp 0x33af3
leaq -0xa0(%rbp), %rdi
callq 0x32bc0
leaq -0x88(%rbp), %rdi
callq 0x73e0
jmp 0x3420f
leaq -0x30(%rbp), %rdi
callq 0x73e0
addq $0x260, %rsp            # imm = 0x260
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x73e0
movq -0x40(%rbp), %rdi
callq 0x79d0
nopw %cs:(%rax,%rax)