// File: /workspace/github_cpp_makefile_star2_O3/estwings57[P]CasHMC/sources/ConfigReader.cpp
// Function: CasHMC::SetField(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void SetField(string field_name, string field_value)
{
	int i;
	istringstream val_st(field_value);
	
	for(i=0; configMap[i].fieldPtr != NULL; i++) {
		if(field_name.compare(configMap[i].fieldName) == 0) {
			switch(configMap[i].fieldType) {
			case STRING: {
				//LINK_PRIORITY_SCHEME
				if(configMap[i].fieldName == "LINK_PRIORITY") {
					if(field_value == "ROUND_ROBIN") {
						LINK_PRIORITY = ROUND_ROBIN;
					}
					else if(field_value == "BUFFER_AWARE") {
						LINK_PRIORITY = BUFFER_AWARE;
					}
					else {
						ERROR(" == Error - Unknown field_value ["<<field_value<<"] for field_name ["<<field_name<<"] in ini file");
						exit(0);
					}
				}
				//LINK_POWER_MANAGEMENT
				else if(configMap[i].fieldName == "LINK_POWER") {
					if(field_value == "NO_MANAGEMENT") {
						LINK_POWER = NO_MANAGEMENT;
					}
					else if(field_value == "QUIESCE_SLEEP") {
						LINK_POWER = QUIESCE_SLEEP;
					}
					else if(field_value == "MSHR") {
						LINK_POWER = MSHR;
					}
					else if(field_value == "LINK_MONITOR") {
						LINK_POWER = LINK_MONITOR;
					}
					else if(field_value == "AUTONOMOUS") {
						LINK_POWER = AUTONOMOUS;
					}
					else {
						ERROR(" == Error - Unknown field_value ["<<field_value<<"] for field_name ["<<field_name<<"] in ini file");
						exit(0);
					}
				}
				//MAPPING_SCHEME
				else if(configMap[i].fieldName == "ADDRESS_MAPPING") {
					if(field_value == "MAX_BLOCK_32B") {
						ADDRESS_MAPPING = MAX_BLOCK_32B;
					}
					else if(field_value == "MAX_BLOCK_64B") {
						ADDRESS_MAPPING = MAX_BLOCK_64B;
					}
					else if(field_value == "MAX_BLOCK_128B") {
						ADDRESS_MAPPING = MAX_BLOCK_128B;
					}
					else if(field_value == "MAX_BLOCK_256B") {
						ADDRESS_MAPPING = MAX_BLOCK_256B;
					}
					else {
						ERROR(" == Error - Unknown field_value ["<<field_value<<"] for field_name ["<<field_name<<"] in ini file");
						exit(0);
					}
				}
				break;
			}
			case BOOL: {
				if(field_value == "true" || field_value == "1") {
					*((bool *)configMap[i].fieldPtr) = true;
				}
				else {
					*((bool *)configMap[i].fieldPtr) = false;
				}
				break;
			}
			case INT: {
				int val;
				val_st >> val;
				*((int *)configMap[i].fieldPtr) = val;
				break;
			}
			case UNSIGNED_CLK: {
				double val;
				val_st >> val;
				unsigned val_by_clk = ceil(val/tCK);
				*((unsigned *)configMap[i].fieldPtr) = val_by_clk;
				break;
			}
			case UINT64: {
				uint64_t val;
				val_st >> val;
				*((uint64_t *)configMap[i].fieldPtr) = val;
				break;
			}
			case DOUBLE: {
				double val;
				val_st >> val;
				*((double *)configMap[i].fieldPtr) = val;
				break;
			}
			}
			configMap[i].wasSet = true;
			break;
		}
	}
	
	if(configMap[i].fieldPtr == NULL) {
		ERROR(" == Error - Unknown field ["<<field_name<<"] in ini file");
		exit(0);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rsp), %rdi
movl $0x8, %edx
callq 0x44c0
cmpq $0x0, 0x23582(%rip)     # 0x3b610
je 0x180b5
leaq 0x23559(%rip), %r15     # 0x3b5f0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4050
testl %eax, %eax
je 0x1816e
cmpq $0x0, 0x50(%r15)
leaq 0x30(%r15), %r15
jne 0x18097
movq 0x22f34(%rip), %rdi     # 0x3aff0
leaq 0x17f5f(%rip), %rsi     # 0x30022
movl $0x8, %edx
callq 0x4340
movq 0x22f1c(%rip), %rdi     # 0x3aff0
leaq 0x19c70(%rip), %rsi     # 0x31d4b
movl $0x18, %edx
callq 0x4340
movq 0x22f04(%rip), %rdi     # 0x3aff0
leaq 0x187a4(%rip), %rsi     # 0x30897
movl $0x1, %edx
callq 0x4340
movq 0x22eec(%rip), %rdi     # 0x3aff0
movl $0x149, %esi            # imm = 0x149
callq 0x4500
movq %rax, %r14
leaq 0x17f29(%rip), %rsi     # 0x30041
movl $0x4, %edx
movq %rax, %rdi
callq 0x4340
leaq 0x19ce0(%rip), %rsi     # 0x31e0c
movl $0x1b, %edx
movq %r14, %rdi
callq 0x4340
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x4340
movq %rax, %rbx
leaq 0x19c6d(%rip), %rsi     # 0x31dbf
movl $0xd, %edx
movq %rax, %rdi
callq 0x4340
movq %rbx, %rdi
callq 0x4170
xorl %edi, %edi
callq 0x4360
movl 0x28(%r15), %eax
cmpq $0x5, %rax
ja 0x18412
leaq 0x19995(%rip), %rcx     # 0x31b18
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x19aa6(%rip), %rsi     # 0x31c39
movq %r15, %rdi
callq 0x4100
testl %eax, %eax
je 0x18308
leaq 0x19a9d(%rip), %rsi     # 0x31c47
movq %r15, %rdi
callq 0x4100
testl %eax, %eax
je 0x18345
leaq 0x19b17(%rip), %rsi     # 0x31cd8
movq %r15, %rdi
callq 0x4100
testl %eax, %eax
jne 0x18412
leaq 0x19bf5(%rip), %rsi     # 0x31dcd
movq %r14, %rdi
callq 0x4100
testl %eax, %eax
je 0x183cc
leaq 0x19bec(%rip), %rsi     # 0x31ddb
movq %r14, %rdi
callq 0x4100
testl %eax, %eax
je 0x183e4
leaq 0x19be3(%rip), %rsi     # 0x31de9
movq %r14, %rdi
callq 0x4100
testl %eax, %eax
je 0x183fc
leaq 0x19bdb(%rip), %rsi     # 0x31df8
movq %r14, %rdi
callq 0x4100
testl %eax, %eax
jne 0x1852a
movl $0x100, 0x23355(%rip)   # imm = 0x100
jmp 0x18412
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x4190
movq 0x8(%rsp), %rax
movq 0x20(%r15), %rcx
movq %rax, (%rcx)
jmp 0x182fe
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x41b0
movl 0x8(%rsp), %eax
movq 0x20(%r15), %rcx
movl %eax, (%rcx)
jmp 0x182fe
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x41d0
movsd 0x8(%rsp), %xmm0
divsd 0x23309(%rip), %xmm0    # 0x3b5a0
callq 0x4090
cvttsd2si %xmm0, %rax
movq 0x20(%r15), %rcx
movl %eax, (%rcx)
jmp 0x182fe
leaq 0x19b57(%rip), %rsi     # 0x31e07
movq %r14, %rdi
callq 0x4100
testl %eax, %eax
je 0x182f7
leaq 0x199e8(%rip), %rsi     # 0x31cab
movq %r14, %rdi
callq 0x4100
testl %eax, %eax
je 0x182f7
movq 0x20(%r15), %rax
movb $0x0, (%rax)
jmp 0x182fe
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x41d0
movsd 0x8(%rsp), %xmm0
movq 0x20(%r15), %rax
movsd %xmm0, (%rax)
jmp 0x182fe
movq 0x20(%r15), %rax
movb $0x1, (%rax)
movb $0x1, 0x2c(%r15)
jmp 0x18422
leaq 0x18905(%rip), %rsi     # 0x30c14
movq %r14, %rdi
callq 0x4100
testl %eax, %eax
je 0x183b4
leaq 0x188fa(%rip), %rsi     # 0x30c20
movq %r14, %rdi
callq 0x4100
testl %eax, %eax
jne 0x1844d
movl $0x1, 0x231a4(%rip)     # 0x3b4e4
jmp 0x18412
leaq 0x188fb(%rip), %rsi     # 0x30c47
movq %r14, %rdi
callq 0x4100
testl %eax, %eax
je 0x183c0
leaq 0x188f6(%rip), %rsi     # 0x30c55
movq %r14, %rdi
callq 0x4100
testl %eax, %eax
je 0x183d8
leaq 0x188f1(%rip), %rsi     # 0x30c63
movq %r14, %rdi
callq 0x4100
testl %eax, %eax
je 0x183f0
leaq 0x188e3(%rip), %rsi     # 0x30c68
movq %r14, %rdi
callq 0x4100
testl %eax, %eax
je 0x18408
leaq 0x188dd(%rip), %rsi     # 0x30c75
movq %r14, %rdi
callq 0x4100
testl %eax, %eax
jne 0x18607
movl $0x4, 0x23136(%rip)     # 0x3b4e8
jmp 0x18412
movl $0x0, 0x23126(%rip)     # 0x3b4e4
jmp 0x18412
movl $0x0, 0x2311e(%rip)     # 0x3b4e8
jmp 0x18412
movl $0x20, 0x231b6(%rip)    # 0x3b58c
jmp 0x18412
movl $0x1, 0x23106(%rip)     # 0x3b4e8
jmp 0x18412
movl $0x40, 0x2319e(%rip)    # 0x3b58c
jmp 0x18412
movl $0x2, 0x230ee(%rip)     # 0x3b4e8
jmp 0x18412
movl $0x80, 0x23186(%rip)    # 0x3b58c
jmp 0x18412
movl $0x3, 0x230d6(%rip)     # 0x3b4e8
movb $0x1, 0x2c(%r15)
cmpq $0x0, 0x20(%r15)
je 0x180b5
movq 0x22b9f(%rip), %rsi     # 0x3afc8
leaq 0x10(%rsp), %rdi
callq 0x43d0
leaq 0x88(%rsp), %rdi
callq 0x4120
addq $0x190, %rsp            # imm = 0x190
popq %rbx
popq %r14
popq %r15
retq
movq 0x22b9c(%rip), %rdi     # 0x3aff0
leaq 0x17bc7(%rip), %rsi     # 0x30022
movl $0x8, %edx
callq 0x4340
movq 0x22b84(%rip), %rdi     # 0x3aff0
leaq 0x198d8(%rip), %rsi     # 0x31d4b
movl $0x18, %edx
callq 0x4340
movq 0x22b6c(%rip), %rdi     # 0x3aff0
leaq 0x1840c(%rip), %rsi     # 0x30897
movl $0x1, %edx
callq 0x4340
movq 0x22b54(%rip), %rdi     # 0x3aff0
movl $0xf1, %esi
callq 0x4500
movq %rax, %r15
leaq 0x17b91(%rip), %rsi     # 0x30041
movl $0x4, %edx
movq %rax, %rdi
callq 0x4340
leaq 0x198c6(%rip), %rsi     # 0x31d8a
movl $0x21, %edx
movq %r15, %rdi
callq 0x4340
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0x4340
movq %rax, %r14
leaq 0x198c2(%rip), %rsi     # 0x31dac
movl $0x12, %edx
movq %rax, %rdi
callq 0x4340
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x4340
movq %rax, %rbx
leaq 0x198af(%rip), %rsi     # 0x31dbf
movl $0xd, %edx
movq %rax, %rdi
callq 0x4340
movq %rbx, %rdi
callq 0x4170
jmp 0x18167
movq 0x22abf(%rip), %rdi     # 0x3aff0
leaq 0x17aea(%rip), %rsi     # 0x30022
movl $0x8, %edx
callq 0x4340
movq 0x22aa7(%rip), %rdi     # 0x3aff0
leaq 0x197fb(%rip), %rsi     # 0x31d4b
movl $0x18, %edx
callq 0x4340
movq 0x22a8f(%rip), %rdi     # 0x3aff0
leaq 0x1832f(%rip), %rsi     # 0x30897
movl $0x1, %edx
callq 0x4340
movq 0x22a77(%rip), %rdi     # 0x3aff0
movl $0x11a, %esi            # imm = 0x11A
callq 0x4500
movq %rax, %r15
leaq 0x17ab4(%rip), %rsi     # 0x30041
movl $0x4, %edx
movq %rax, %rdi
callq 0x4340
leaq 0x197e9(%rip), %rsi     # 0x31d8a
movl $0x21, %edx
movq %r15, %rdi
callq 0x4340
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0x4340
movq %rax, %r14
leaq 0x197e5(%rip), %rsi     # 0x31dac
movl $0x12, %edx
movq %rax, %rdi
callq 0x4340
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x4340
movq %rax, %rbx
leaq 0x197d2(%rip), %rsi     # 0x31dbf
movl $0xd, %edx
movq %rax, %rdi
callq 0x4340
movq %rbx, %rdi
callq 0x4170
jmp 0x18167
movq 0x229e2(%rip), %rdi     # 0x3aff0
leaq 0x17a0d(%rip), %rsi     # 0x30022
movl $0x8, %edx
callq 0x4340
movq 0x229ca(%rip), %rdi     # 0x3aff0
leaq 0x1971e(%rip), %rsi     # 0x31d4b
movl $0x18, %edx
callq 0x4340
movq 0x229b2(%rip), %rdi     # 0x3aff0
leaq 0x18252(%rip), %rsi     # 0x30897
movl $0x1, %edx
callq 0x4340
movq 0x2299a(%rip), %rdi     # 0x3aff0
movl $0x107, %esi            # imm = 0x107
callq 0x4500
movq %rax, %r15
leaq 0x179d7(%rip), %rsi     # 0x30041
movl $0x4, %edx
movq %rax, %rdi
callq 0x4340
leaq 0x1970c(%rip), %rsi     # 0x31d8a
movl $0x21, %edx
movq %r15, %rdi
callq 0x4340
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0x4340
movq %rax, %r14
leaq 0x19708(%rip), %rsi     # 0x31dac
movl $0x12, %edx
movq %rax, %rdi
callq 0x4340
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x4340
movq %rax, %rbx
leaq 0x196f5(%rip), %rsi     # 0x31dbf
movl $0xd, %edx
movq %rax, %rdi
callq 0x4340
movq %rbx, %rdi
callq 0x4170
jmp 0x18167
jmp 0x186ee
jmp 0x186ee
jmp 0x186ee
jmp 0x186ee
jmp 0x186ee
movq %rax, %rbx
movq 0x228d0(%rip), %rsi     # 0x3afc8
leaq 0x10(%rsp), %rdi
callq 0x43d0
leaq 0x88(%rsp), %rdi
callq 0x4120
movq %rbx, %rdi
callq 0x4540
nop