// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
movl $0x8, %edx
callq 0x44c0
cmpq $0x0, 0x23d8a(%rip)     # 0x3c610
je 0x188ae
leaq 0x23d61(%rip), %r15     # 0x3c5f0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4050
testl %eax, %eax
je 0x188be
leaq 0x30(%r15), %r12
cmpq $0x0, 0x50(%r15)
movq %r12, %r15
jne 0x1888f
jmp 0x188b5
leaq 0x23d3b(%rip), %r12     # 0x3c5f0
addq $0x20, %r12
jmp 0x18b63
leaq 0x20(%r15), %r12
movl 0x28(%r15), %eax
cmpq $0x5, %rax
ja 0x18b5e
leaq 0x1a1d1(%rip), %rcx     # 0x32aa8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1a2e2(%rip), %rsi     # 0x32bc9
movq %r15, %rdi
callq 0x4100
testl %eax, %eax
je 0x18a54
leaq 0x1a2d9(%rip), %rsi     # 0x32bd7
movq %r15, %rdi
callq 0x4100
testl %eax, %eax
je 0x18a91
leaq 0x1a353(%rip), %rsi     # 0x32c68
movq %r15, %rdi
callq 0x4100
testl %eax, %eax
jne 0x18b5e
leaq 0x1a431(%rip), %rsi     # 0x32d5d
movq %r14, %rdi
callq 0x4100
testl %eax, %eax
je 0x18b18
leaq 0x1a428(%rip), %rsi     # 0x32d6b
movq %r14, %rdi
callq 0x4100
testl %eax, %eax
je 0x18b30
leaq 0x1a41f(%rip), %rsi     # 0x32d79
movq %r14, %rdi
callq 0x4100
testl %eax, %eax
je 0x18b48
leaq 0x1a417(%rip), %rsi     # 0x32d88
movq %r14, %rdi
callq 0x4100
testl %eax, %eax
jne 0x18d2d
movl $0x100, 0x23c01(%rip)   # imm = 0x100
jmp 0x18b5e
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x4190
movq (%rsp), %rax
movq (%r12), %rcx
movq %rax, (%rcx)
jmp 0x18b5e
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x41b0
movl (%rsp), %eax
movq (%r12), %rcx
movl %eax, (%rcx)
jmp 0x18b5e
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x41d0
movsd (%rsp), %xmm0
divsd 0x23bbe(%rip), %xmm0    # 0x3c5a0
callq 0x4090
cvttsd2si %xmm0, %rax
movq (%r12), %rcx
movl %eax, (%rcx)
jmp 0x18b5e
leaq 0x1a399(%rip), %rsi     # 0x32d97
movq %r14, %rdi
callq 0x4100
testl %eax, %eax
je 0x18a48
leaq 0x1a22a(%rip), %rsi     # 0x32c3b
movq %r14, %rdi
callq 0x4100
testl %eax, %eax
je 0x18a48
movq (%r12), %rax
movb $0x0, (%rax)
jmp 0x18b5e
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x41d0
movsd (%rsp), %xmm0
movq (%r12), %rax
movsd %xmm0, (%rax)
jmp 0x18b5e
movq (%r12), %rax
movb $0x1, (%rax)
jmp 0x18b5e
leaq 0x19159(%rip), %rsi     # 0x31bb4
movq %r14, %rdi
callq 0x4100
testl %eax, %eax
je 0x18b00
leaq 0x1914e(%rip), %rsi     # 0x31bc0
movq %r14, %rdi
callq 0x4100
testl %eax, %eax
jne 0x18c50
movl $0x1, 0x23a58(%rip)     # 0x3c4e4
jmp 0x18b5e
leaq 0x1914f(%rip), %rsi     # 0x31be7
movq %r14, %rdi
callq 0x4100
testl %eax, %eax
je 0x18b0c
leaq 0x1914a(%rip), %rsi     # 0x31bf5
movq %r14, %rdi
callq 0x4100
testl %eax, %eax
je 0x18b24
leaq 0x19145(%rip), %rsi     # 0x31c03
movq %r14, %rdi
callq 0x4100
testl %eax, %eax
je 0x18b3c
leaq 0x19137(%rip), %rsi     # 0x31c08
movq %r14, %rdi
callq 0x4100
testl %eax, %eax
je 0x18b54
leaq 0x19131(%rip), %rsi     # 0x31c15
movq %r14, %rdi
callq 0x4100
testl %eax, %eax
jne 0x18e0a
movl $0x4, 0x239ea(%rip)     # 0x3c4e8
jmp 0x18b5e
movl $0x0, 0x239da(%rip)     # 0x3c4e4
jmp 0x18b5e
movl $0x0, 0x239d2(%rip)     # 0x3c4e8
jmp 0x18b5e
movl $0x20, 0x23a6a(%rip)    # 0x3c58c
jmp 0x18b5e
movl $0x1, 0x239ba(%rip)     # 0x3c4e8
jmp 0x18b5e
movl $0x40, 0x23a52(%rip)    # 0x3c58c
jmp 0x18b5e
movl $0x2, 0x239a2(%rip)     # 0x3c4e8
jmp 0x18b5e
movl $0x80, 0x23a3a(%rip)    # 0x3c58c
jmp 0x18b5e
movl $0x3, 0x2398a(%rip)     # 0x3c4e8
movb $0x1, 0x2c(%r15)
cmpq $0x0, (%r12)
je 0x18b97
movq 0x23457(%rip), %rsi     # 0x3bfc8
leaq 0x8(%rsp), %rdi
callq 0x43d0
leaq 0x80(%rsp), %rdi
callq 0x4120
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x23452(%rip), %rdi     # 0x3bff0
leaq 0x1847d(%rip), %rsi     # 0x31022
movl $0x8, %edx
callq 0x4340
movq 0x2343a(%rip), %rdi     # 0x3bff0
leaq 0x1a11e(%rip), %rsi     # 0x32cdb
movl $0x18, %edx
callq 0x4340
movq 0x23422(%rip), %rdi     # 0x3bff0
leaq 0x18c62(%rip), %rsi     # 0x31837
movl $0x1, %edx
callq 0x4340
movq 0x2340a(%rip), %rdi     # 0x3bff0
movl $0x149, %esi            # imm = 0x149
callq 0x4500
movq %rax, %r14
leaq 0x18447(%rip), %rsi     # 0x31041
movl $0x4, %edx
movq %rax, %rdi
callq 0x4340
leaq 0x1a18e(%rip), %rsi     # 0x32d9c
movl $0x1b, %edx
movq %r14, %rdi
callq 0x4340
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x4340
movq %rax, %rbx
leaq 0x1a11b(%rip), %rsi     # 0x32d4f
movl $0xd, %edx
movq %rax, %rdi
callq 0x4340
movq %rbx, %rdi
callq 0x4170
xorl %edi, %edi
callq 0x4360
movq 0x23399(%rip), %rdi     # 0x3bff0
leaq 0x183c4(%rip), %rsi     # 0x31022
movl $0x8, %edx
callq 0x4340
movq 0x23381(%rip), %rdi     # 0x3bff0
leaq 0x1a065(%rip), %rsi     # 0x32cdb
movl $0x18, %edx
callq 0x4340
movq 0x23369(%rip), %rdi     # 0x3bff0
leaq 0x18ba9(%rip), %rsi     # 0x31837
movl $0x1, %edx
callq 0x4340
movq 0x23351(%rip), %rdi     # 0x3bff0
movl $0xf1, %esi
callq 0x4500
movq %rax, %r15
leaq 0x1838e(%rip), %rsi     # 0x31041
movl $0x4, %edx
movq %rax, %rdi
callq 0x4340
leaq 0x1a053(%rip), %rsi     # 0x32d1a
movl $0x21, %edx
movq %r15, %rdi
callq 0x4340
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0x4340
movq %rax, %r14
leaq 0x1a04f(%rip), %rsi     # 0x32d3c
movl $0x12, %edx
movq %rax, %rdi
callq 0x4340
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x4340
movq %rax, %rbx
leaq 0x1a03c(%rip), %rsi     # 0x32d4f
movl $0xd, %edx
movq %rax, %rdi
callq 0x4340
movq %rbx, %rdi
callq 0x4170
jmp 0x18c49
movq 0x232bc(%rip), %rdi     # 0x3bff0
leaq 0x182e7(%rip), %rsi     # 0x31022
movl $0x8, %edx
callq 0x4340
movq 0x232a4(%rip), %rdi     # 0x3bff0
leaq 0x19f88(%rip), %rsi     # 0x32cdb
movl $0x18, %edx
callq 0x4340
movq 0x2328c(%rip), %rdi     # 0x3bff0
leaq 0x18acc(%rip), %rsi     # 0x31837
movl $0x1, %edx
callq 0x4340
movq 0x23274(%rip), %rdi     # 0x3bff0
movl $0x11a, %esi            # imm = 0x11A
callq 0x4500
movq %rax, %r15
leaq 0x182b1(%rip), %rsi     # 0x31041
movl $0x4, %edx
movq %rax, %rdi
callq 0x4340
leaq 0x19f76(%rip), %rsi     # 0x32d1a
movl $0x21, %edx
movq %r15, %rdi
callq 0x4340
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0x4340
movq %rax, %r14
leaq 0x19f72(%rip), %rsi     # 0x32d3c
movl $0x12, %edx
movq %rax, %rdi
callq 0x4340
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x4340
movq %rax, %rbx
leaq 0x19f5f(%rip), %rsi     # 0x32d4f
movl $0xd, %edx
movq %rax, %rdi
callq 0x4340
movq %rbx, %rdi
callq 0x4170
jmp 0x18c49
movq 0x231df(%rip), %rdi     # 0x3bff0
leaq 0x1820a(%rip), %rsi     # 0x31022
movl $0x8, %edx
callq 0x4340
movq 0x231c7(%rip), %rdi     # 0x3bff0
leaq 0x19eab(%rip), %rsi     # 0x32cdb
movl $0x18, %edx
callq 0x4340
movq 0x231af(%rip), %rdi     # 0x3bff0
leaq 0x189ef(%rip), %rsi     # 0x31837
movl $0x1, %edx
callq 0x4340
movq 0x23197(%rip), %rdi     # 0x3bff0
movl $0x107, %esi            # imm = 0x107
callq 0x4500
movq %rax, %r15
leaq 0x181d4(%rip), %rsi     # 0x31041
movl $0x4, %edx
movq %rax, %rdi
callq 0x4340
leaq 0x19e99(%rip), %rsi     # 0x32d1a
movl $0x21, %edx
movq %r15, %rdi
callq 0x4340
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0x4340
movq %rax, %r14
leaq 0x19e95(%rip), %rsi     # 0x32d3c
movl $0x12, %edx
movq %rax, %rdi
callq 0x4340
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x4340
movq %rax, %rbx
leaq 0x19e82(%rip), %rsi     # 0x32d4f
movl $0xd, %edx
movq %rax, %rdi
callq 0x4340
movq %rbx, %rdi
callq 0x4170
jmp 0x18c49
jmp 0x18ef1
jmp 0x18ef1
jmp 0x18ef1
jmp 0x18ef1
jmp 0x18ef1
movq %rax, %rbx
movq 0x230cd(%rip), %rsi     # 0x3bfc8
leaq 0x8(%rsp), %rdi
callq 0x43d0
leaq 0x80(%rsp), %rdi
callq 0x4120
movq %rbx, %rdi
callq 0x4540
nop