// File: 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 %rbp
movq %rsp, %rbp
subq $0x340, %rsp            # imm = 0x340
movq %rdi, -0x1d8(%rbp)
movq %rsi, -0x1d0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x198(%rbp), %rdi
movl $0x8, %edx
callq 0x45d0
movl $0x0, -0x14(%rbp)
movslq -0x14(%rbp), %rcx
leaq 0x3fd8c(%rip), %rax     # 0x66690
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x20(%rax)
je 0x27217
movq -0x1d8(%rbp), %rdi
movslq -0x14(%rbp), %rax
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
leaq 0x3fd60(%rip), %rsi     # 0x66690
addq %rax, %rsi
callq 0x4050
movl %eax, -0x1dc(%rbp)
jmp 0x26940
movl -0x1dc(%rbp), %eax
cmpl $0x0, %eax
jne 0x27207
movslq -0x14(%rbp), %rax
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
leaq 0x3fd2e(%rip), %rcx     # 0x66690
movl 0x28(%rax,%rcx), %eax
movq %rax, -0x1e8(%rbp)
subq $0x5, %rax
ja 0x271ef
movq -0x1e8(%rbp), %rax
leaq 0x2c0bb(%rip), %rcx     # 0x52a40
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x41c0
jmp 0x27343
movslq -0x14(%rbp), %rax
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
leaq 0x3fccc(%rip), %rdi     # 0x66690
addq %rax, %rdi
leaq 0x2c19c(%rip), %rsi     # 0x52b6a
callq 0x17d00
movb %al, -0x1e9(%rbp)
jmp 0x269db
movb -0x1e9(%rbp), %al
testb $0x1, %al
jne 0x269ea
jmp 0x26b8f
movq -0x1d0(%rbp), %rdi
leaq 0x2b1ba(%rip), %rsi     # 0x51bb2
callq 0x17d00
movb %al, -0x1ea(%rbp)
jmp 0x26a05
movb -0x1ea(%rbp), %al
testb $0x1, %al
jne 0x26a11
jmp 0x26a20
movl $0x0, 0x3fb69(%rip)     # 0x66584
jmp 0x26b8a
movq -0x1d0(%rbp), %rdi
leaq 0x2b190(%rip), %rsi     # 0x51bbe
callq 0x17d00
movb %al, -0x1eb(%rbp)
jmp 0x26a3b
movb -0x1eb(%rbp), %al
testb $0x1, %al
jne 0x26a47
jmp 0x26a56
movl $0x1, 0x3fb33(%rip)     # 0x66584
jmp 0x26b88
movq 0x3f593(%rip), %rdi     # 0x65ff0
leaq 0x2a5d6(%rip), %rsi     # 0x5103a
callq 0x4380
movq %rax, -0x1f8(%rbp)
jmp 0x26a72
movq -0x1f8(%rbp), %rdi
leaq 0x2c26c(%rip), %rsi     # 0x52cec
callq 0x4380
movq %rax, -0x200(%rbp)
jmp 0x26a8e
movq -0x200(%rbp), %rdi
leaq 0x2ad99(%rip), %rsi     # 0x51835
callq 0x4380
movq %rax, -0x208(%rbp)
jmp 0x26aaa
movq -0x208(%rbp), %rdi
movl $0xf1, %esi
callq 0x4610
movq %rax, -0x210(%rbp)
jmp 0x26ac4
movq -0x210(%rbp), %rdi
leaq 0x2a587(%rip), %rsi     # 0x51059
callq 0x4380
movq %rax, -0x218(%rbp)
jmp 0x26ae0
movq -0x218(%rbp), %rdi
leaq 0x2c23d(%rip), %rsi     # 0x52d2b
callq 0x4380
movq %rax, -0x220(%rbp)
jmp 0x26afc
movq -0x1d0(%rbp), %rsi
movq -0x220(%rbp), %rdi
callq 0x4320
movq %rax, -0x228(%rbp)
jmp 0x26b18
movq -0x228(%rbp), %rdi
leaq 0x2c227(%rip), %rsi     # 0x52d4d
callq 0x4380
movq %rax, -0x230(%rbp)
jmp 0x26b34
movq -0x1d8(%rbp), %rsi
movq -0x230(%rbp), %rdi
callq 0x4320
movq %rax, -0x238(%rbp)
jmp 0x26b50
movq -0x238(%rbp), %rdi
leaq 0x2c202(%rip), %rsi     # 0x52d60
callq 0x4380
movq %rax, -0x240(%rbp)
jmp 0x26b6c
movq -0x240(%rbp), %rdi
movq 0x3f436(%rip), %rsi     # 0x65fb0
callq 0x43c0
jmp 0x26b81
xorl %edi, %edi
callq 0x4460
jmp 0x26b8a
jmp 0x27064
movslq -0x14(%rbp), %rax
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
leaq 0x3faee(%rip), %rdi     # 0x66690
addq %rax, %rdi
leaq 0x2bfcc(%rip), %rsi     # 0x52b78
callq 0x17d00
movb %al, -0x241(%rbp)
jmp 0x26bb9
movb -0x241(%rbp), %al
testb $0x1, %al
jne 0x26bc8
jmp 0x26e15
movq -0x1d0(%rbp), %rdi
leaq 0x2b00f(%rip), %rsi     # 0x51be5
callq 0x17d00
movb %al, -0x242(%rbp)
jmp 0x26be3
movb -0x242(%rbp), %al
testb $0x1, %al
jne 0x26bef
jmp 0x26bfe
movl $0x0, 0x3f98f(%rip)     # 0x66588
jmp 0x26e10
movq -0x1d0(%rbp), %rdi
leaq 0x2afe7(%rip), %rsi     # 0x51bf3
callq 0x17d00
movb %al, -0x243(%rbp)
jmp 0x26c19
movb -0x243(%rbp), %al
testb $0x1, %al
jne 0x26c25
jmp 0x26c34
movl $0x1, 0x3f959(%rip)     # 0x66588
jmp 0x26e0e
movq -0x1d0(%rbp), %rdi
leaq 0x2afbf(%rip), %rsi     # 0x51c01
callq 0x17d00
movb %al, -0x244(%rbp)
jmp 0x26c4f
movb -0x244(%rbp), %al
testb $0x1, %al
jne 0x26c5b
jmp 0x26c6a
movl $0x2, 0x3f923(%rip)     # 0x66588
jmp 0x26e0c
movq -0x1d0(%rbp), %rdi
leaq 0x2af8e(%rip), %rsi     # 0x51c06
callq 0x17d00
movb %al, -0x245(%rbp)
jmp 0x26c85
movb -0x245(%rbp), %al
testb $0x1, %al
jne 0x26c91
jmp 0x26ca0
movl $0x3, 0x3f8ed(%rip)     # 0x66588
jmp 0x26e0a
movq -0x1d0(%rbp), %rdi
leaq 0x2af65(%rip), %rsi     # 0x51c13
callq 0x17d00
movb %al, -0x246(%rbp)
jmp 0x26cbb
movb -0x246(%rbp), %al
testb $0x1, %al
jne 0x26cc7
jmp 0x26cd6
movl $0x4, 0x3f8b7(%rip)     # 0x66588
jmp 0x26e08
movq 0x3f313(%rip), %rdi     # 0x65ff0
leaq 0x2a356(%rip), %rsi     # 0x5103a
callq 0x4380
movq %rax, -0x250(%rbp)
jmp 0x26cf2
movq -0x250(%rbp), %rdi
leaq 0x2bfec(%rip), %rsi     # 0x52cec
callq 0x4380
movq %rax, -0x258(%rbp)
jmp 0x26d0e
movq -0x258(%rbp), %rdi
leaq 0x2ab19(%rip), %rsi     # 0x51835
callq 0x4380
movq %rax, -0x260(%rbp)
jmp 0x26d2a
movq -0x260(%rbp), %rdi
movl $0x107, %esi            # imm = 0x107
callq 0x4610
movq %rax, -0x268(%rbp)
jmp 0x26d44
movq -0x268(%rbp), %rdi
leaq 0x2a307(%rip), %rsi     # 0x51059
callq 0x4380
movq %rax, -0x270(%rbp)
jmp 0x26d60
movq -0x270(%rbp), %rdi
leaq 0x2bfbd(%rip), %rsi     # 0x52d2b
callq 0x4380
movq %rax, -0x278(%rbp)
jmp 0x26d7c
movq -0x1d0(%rbp), %rsi
movq -0x278(%rbp), %rdi
callq 0x4320
movq %rax, -0x280(%rbp)
jmp 0x26d98
movq -0x280(%rbp), %rdi
leaq 0x2bfa7(%rip), %rsi     # 0x52d4d
callq 0x4380
movq %rax, -0x288(%rbp)
jmp 0x26db4
movq -0x1d8(%rbp), %rsi
movq -0x288(%rbp), %rdi
callq 0x4320
movq %rax, -0x290(%rbp)
jmp 0x26dd0
movq -0x290(%rbp), %rdi
leaq 0x2bf82(%rip), %rsi     # 0x52d60
callq 0x4380
movq %rax, -0x298(%rbp)
jmp 0x26dec
movq -0x298(%rbp), %rdi
movq 0x3f1b6(%rip), %rsi     # 0x65fb0
callq 0x43c0
jmp 0x26e01
xorl %edi, %edi
callq 0x4460
jmp 0x26e0a
jmp 0x26e0c
jmp 0x26e0e
jmp 0x26e10
jmp 0x27062
movslq -0x14(%rbp), %rax
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
leaq 0x3f868(%rip), %rdi     # 0x66690
addq %rax, %rdi
leaq 0x2be0f(%rip), %rsi     # 0x52c41
callq 0x17d00
movb %al, -0x299(%rbp)
jmp 0x26e3f
movb -0x299(%rbp), %al
testb $0x1, %al
jne 0x26e4e
jmp 0x27060
movq -0x1d0(%rbp), %rdi
leaq 0x2bf12(%rip), %rsi     # 0x52d6e
callq 0x17d00
movb %al, -0x29a(%rbp)
jmp 0x26e69
movb -0x29a(%rbp), %al
testb $0x1, %al
jne 0x26e75
jmp 0x26e84
movl $0x20, 0x3f7ad(%rip)    # 0x6662c
jmp 0x2705e
movq -0x1d0(%rbp), %rdi
leaq 0x2beea(%rip), %rsi     # 0x52d7c
callq 0x17d00
movb %al, -0x29b(%rbp)
jmp 0x26e9f
movb -0x29b(%rbp), %al
testb $0x1, %al
jne 0x26eab
jmp 0x26eba
movl $0x40, 0x3f777(%rip)    # 0x6662c
jmp 0x2705c
movq -0x1d0(%rbp), %rdi
leaq 0x2bec2(%rip), %rsi     # 0x52d8a
callq 0x17d00
movb %al, -0x29c(%rbp)
jmp 0x26ed5
movb -0x29c(%rbp), %al
testb $0x1, %al
jne 0x26ee1
jmp 0x26ef0
movl $0x80, 0x3f741(%rip)    # 0x6662c
jmp 0x2705a
movq -0x1d0(%rbp), %rdi
leaq 0x2be9b(%rip), %rsi     # 0x52d99
callq 0x17d00
movb %al, -0x29d(%rbp)
jmp 0x26f0b
movb -0x29d(%rbp), %al
testb $0x1, %al
jne 0x26f17
jmp 0x26f26
movl $0x100, 0x3f70b(%rip)   # imm = 0x100
jmp 0x27058
movq 0x3f0c3(%rip), %rdi     # 0x65ff0
leaq 0x2a106(%rip), %rsi     # 0x5103a
callq 0x4380
movq %rax, -0x2a8(%rbp)
jmp 0x26f42
movq -0x2a8(%rbp), %rdi
leaq 0x2bd9c(%rip), %rsi     # 0x52cec
callq 0x4380
movq %rax, -0x2b0(%rbp)
jmp 0x26f5e
movq -0x2b0(%rbp), %rdi
leaq 0x2a8c9(%rip), %rsi     # 0x51835
callq 0x4380
movq %rax, -0x2b8(%rbp)
jmp 0x26f7a
movq -0x2b8(%rbp), %rdi
movl $0x11a, %esi            # imm = 0x11A
callq 0x4610
movq %rax, -0x2c0(%rbp)
jmp 0x26f94
movq -0x2c0(%rbp), %rdi
leaq 0x2a0b7(%rip), %rsi     # 0x51059
callq 0x4380
movq %rax, -0x2c8(%rbp)
jmp 0x26fb0
movq -0x2c8(%rbp), %rdi
leaq 0x2bd6d(%rip), %rsi     # 0x52d2b
callq 0x4380
movq %rax, -0x2d0(%rbp)
jmp 0x26fcc
movq -0x1d0(%rbp), %rsi
movq -0x2d0(%rbp), %rdi
callq 0x4320
movq %rax, -0x2d8(%rbp)
jmp 0x26fe8
movq -0x2d8(%rbp), %rdi
leaq 0x2bd57(%rip), %rsi     # 0x52d4d
callq 0x4380
movq %rax, -0x2e0(%rbp)
jmp 0x27004
movq -0x1d8(%rbp), %rsi
movq -0x2e0(%rbp), %rdi
callq 0x4320
movq %rax, -0x2e8(%rbp)
jmp 0x27020
movq -0x2e8(%rbp), %rdi
leaq 0x2bd32(%rip), %rsi     # 0x52d60
callq 0x4380
movq %rax, -0x2f0(%rbp)
jmp 0x2703c
movq -0x2f0(%rbp), %rdi
movq 0x3ef66(%rip), %rsi     # 0x65fb0
callq 0x43c0
jmp 0x27051
xorl %edi, %edi
callq 0x4460
jmp 0x2705a
jmp 0x2705c
jmp 0x2705e
jmp 0x27060
jmp 0x27062
jmp 0x27064
jmp 0x271ef
movq -0x1d0(%rbp), %rdi
leaq 0x2bd31(%rip), %rsi     # 0x52da8
callq 0x17d00
movb %al, -0x2f1(%rbp)
jmp 0x27084
movb -0x2f1(%rbp), %al
testb $0x1, %al
jne 0x270b7
jmp 0x27090
movq -0x1d0(%rbp), %rdi
leaq 0x2bb5f(%rip), %rsi     # 0x52bfd
callq 0x17d00
movb %al, -0x2f2(%rbp)
jmp 0x270ab
movb -0x2f2(%rbp), %al
testb $0x1, %al
jne 0x270b7
jmp 0x270d2
movslq -0x14(%rbp), %rcx
leaq 0x3f5ce(%rip), %rax     # 0x66690
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movb $0x1, (%rax)
jmp 0x270eb
movslq -0x14(%rbp), %rcx
leaq 0x3f5b3(%rip), %rax     # 0x66690
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movb $0x0, (%rax)
jmp 0x271ef
leaq -0x198(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
callq 0x4220
jmp 0x27105
movl -0x1a8(%rbp), %ecx
movslq -0x14(%rbp), %rdx
leaq 0x3f57a(%rip), %rax     # 0x66690
imulq $0x30, %rdx, %rdx
addq %rdx, %rax
movq 0x20(%rax), %rax
movl %ecx, (%rax)
jmp 0x271ef
leaq -0x198(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x42e0
jmp 0x2713d
movsd -0x1b0(%rbp), %xmm0
movsd 0x3f4f3(%rip), %xmm1    # 0x66640
divsd %xmm1, %xmm0
callq 0x40a0
cvttsd2si %xmm0, %rax
movl %eax, -0x1b4(%rbp)
movl -0x1b4(%rbp), %ecx
movslq -0x14(%rbp), %rdx
leaq 0x3f51e(%rip), %rax     # 0x66690
imulq $0x30, %rdx, %rdx
addq %rdx, %rax
movq 0x20(%rax), %rax
movl %ecx, (%rax)
jmp 0x271ef
leaq -0x198(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0x4500
jmp 0x27196
movq -0x1c0(%rbp), %rcx
movslq -0x14(%rbp), %rdx
leaq 0x3f4e8(%rip), %rax     # 0x66690
imulq $0x30, %rdx, %rdx
addq %rdx, %rax
movq 0x20(%rax), %rax
movq %rcx, (%rax)
jmp 0x271ef
leaq -0x198(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x42e0
jmp 0x271cd
movsd -0x1c8(%rbp), %xmm0
movslq -0x14(%rbp), %rcx
leaq 0x3f4b0(%rip), %rax     # 0x66690
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movsd %xmm0, (%rax)
movslq -0x14(%rbp), %rcx
leaq 0x3f496(%rip), %rax     # 0x66690
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movb $0x1, 0x2c(%rax)
jmp 0x27217
jmp 0x27209
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x268f9
movslq -0x14(%rbp), %rcx
leaq 0x3f46e(%rip), %rax     # 0x66690
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x20(%rax)
jne 0x2732e
movq 0x3edb5(%rip), %rdi     # 0x65ff0
leaq 0x29df8(%rip), %rsi     # 0x5103a
callq 0x4380
movq %rax, -0x300(%rbp)
jmp 0x27250
movq -0x300(%rbp), %rdi
leaq 0x2ba8e(%rip), %rsi     # 0x52cec
callq 0x4380
movq %rax, -0x308(%rbp)
jmp 0x2726c
movq -0x308(%rbp), %rdi
leaq 0x2a5bb(%rip), %rsi     # 0x51835
callq 0x4380
movq %rax, -0x310(%rbp)
jmp 0x27288
movq -0x310(%rbp), %rdi
movl $0x149, %esi            # imm = 0x149
callq 0x4610
movq %rax, -0x318(%rbp)
jmp 0x272a2
movq -0x318(%rbp), %rdi
leaq 0x29da9(%rip), %rsi     # 0x51059
callq 0x4380
movq %rax, -0x320(%rbp)
jmp 0x272be
movq -0x320(%rbp), %rdi
leaq 0x2bae1(%rip), %rsi     # 0x52dad
callq 0x4380
movq %rax, -0x328(%rbp)
jmp 0x272da
movq -0x1d8(%rbp), %rsi
movq -0x328(%rbp), %rdi
callq 0x4320
movq %rax, -0x330(%rbp)
jmp 0x272f6
movq -0x330(%rbp), %rdi
leaq 0x2ba5c(%rip), %rsi     # 0x52d60
callq 0x4380
movq %rax, -0x338(%rbp)
jmp 0x27312
movq -0x338(%rbp), %rdi
movq 0x3ec90(%rip), %rsi     # 0x65fb0
callq 0x43c0
jmp 0x27327
xorl %edi, %edi
callq 0x4460
leaq -0x198(%rbp), %rdi
callq 0x41c0
addq $0x340, %rsp            # imm = 0x340
popq %rbp
retq
movq -0x1a0(%rbp), %rdi
callq 0x4630
nop