// File: /workspace/github_cpp_makefile_star2_O1/lotuskip[P]yuxtapa/server/settings.cpp
// Function: Config::read_config()
void Config::read_config()
{
	// first, initialize with defaults:
	int i;
	for(i = 0; i < MAX_INT_SETTING; ++i)
		int_settings[i] = default_sets[i];

	string s = get_config_dir() + "server.conf";
	ifstream file(s.c_str());
	if(!file)
		to_log("Warning: config file does not exist or is not readable!");
	while(file)
	{
		// This is very crude parsing; if the file is not right it probably is read all wrong
		getline(file, s);
		if(s.empty() || s[0] == '#')
			continue;
		if(parse_config(s, true))
		{
			to_log("Warning: could not parse the following line in config file:");
			to_log("\t\"" + s + "\"");
		}
	}
	
	// everything extracted (or failed altogether), check:
	for(i = 0; i < MAX_INT_SETTING; ++i)
		if(validate_int_set(i))
		{
			int_settings[i] = default_sets[i];
			to_log("Warning: config gave invalid value for \'" + keywords[i] + "\'.");
		}
	if(validate_classlim())
		to_log("Config error: classlimit is too small "
			"with respect to the number of players allowed!");
	if(validate_minp())
		to_log("Config error: minplayers forced to 0!");
	// Check modes:
	if(poss_modes.empty())
	{
		poss_modes.push_back(GM_DOM);
		poss_modes.push_back(GM_CONQ);
		poss_modes.push_back(GM_STEAL);
		poss_modes.push_back(GM_DESTR);
		poss_modes.push_back(GM_TDM);
	}
	// Similarly check map types:
	if(poss_mtypes.empty())
	{
		poss_mtypes.push_back(MT_DUNGEON);
		poss_mtypes.push_back(MT_OUTDOOR);
		poss_mtypes.push_back(MT_COMPLEX);
	}
	// Force at least one bot name:
	if(botnames.empty())
		botnames.push_back("Mr. Brown");
	botname_iter = botnames.begin();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movaps 0x1b2ce(%rip), %xmm0    # 0x2c760
movaps %xmm0, 0x31427(%rip)    # 0x428c0
movaps 0x1b2b0(%rip), %xmm0    # 0x2c750
movaps %xmm0, 0x31409(%rip)    # 0x428b0
movaps 0x1b292(%rip), %xmm0    # 0x2c740
movaps %xmm0, 0x313eb(%rip)    # 0x428a0
callq 0x11ada
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
movq 0x312e7(%rip), %rsi     # 0x427b0
movq 0x312e8(%rip), %rdx     # 0x427b8
addq %rsi, %rdx
leaq -0x68(%rbp), %rbx
movq %rbx, %rdi
callq 0xfa82
leaq 0x1b05c(%rip), %rsi     # 0x2c542
movq %rbx, %rdi
callq 0x47c0
movq -0x68(%rbp), %rsi
leaq -0x290(%rbp), %rdi
movl $0x8, %edx
callq 0x4780
movq -0x290(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x270(%rbp,%rax)
je 0x11555
leaq -0x38(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x1b027(%rip), %rsi     # 0x2c54e
leaq 0x1b057(%rip), %rdx     # 0x2c585
leaq -0x48(%rbp), %rdi
callq 0xdfec
leaq -0x48(%rbp), %rdi
callq 0x15050
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0x11555
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43f0
movq -0x290(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x270(%rbp,%rax)
jne 0x116c7
leaq (%rax,%rbp), %rdi
addq $-0x290, %rdi           # imm = 0xFD70
leaq -0x38(%rbp), %r15
leaq -0x290(%rbp), %rbx
leaq -0x68(%rbp), %r14
leaq -0x48(%rbp), %r13
leaq -0x88(%rbp), %r12
movl $0xa, %esi
callq 0x43d0
movsbl %al, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4790
cmpq $0x0, -0x60(%rbp)
je 0x116a7
movq -0x68(%rbp), %rax
cmpb $0x23, (%rax)
je 0x116a7
movq %r14, %rdi
movl $0x1, %esi
callq 0x10138
testb %al, %al
je 0x116a7
movq %r15, -0x48(%rbp)
movq %r13, %rdi
leaq 0x1afa0(%rip), %rsi     # 0x2c586
leaq 0x1afd4(%rip), %rdx     # 0x2c5c1
callq 0xdfec
movq %r13, %rdi
callq 0x15050
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x1160f
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43f0
movq %r12, %rdi
leaq 0x1afa9(%rip), %rsi     # 0x2c5c2
movq %r14, %rdx
callq 0x11dd6
movq %r12, %rdi
leaq 0x1af98(%rip), %rsi     # 0x2c5c3
callq 0x47c0
movq %r15, -0x48(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x11650
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0x11657
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, -0x40(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r13, %rdi
callq 0x15050
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x1168b
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43f0
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x116a7
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x43f0
movq -0x290(%rbp), %rax
movq -0x18(%rax), %rax
leaq (%rax,%rbp), %rdi
addq $-0x290, %rdi           # imm = 0xFD70
testb $0x5, 0x20(%rdi)
je 0x11593
leaq -0x38(%rbp), %r13
leaq 0x30f5e(%rip), %rbx     # 0x42630
xorl %r14d, %r14d
leaq 0x311c4(%rip), %r12     # 0x428a0
leaq -0x88(%rbp), %r15
cmpq $0x20, %r14
jne 0x11701
movl 0x311d1(%rip), %eax     # 0x428c0
testl $0xfffffffb, %eax       # imm = 0xFFFFFFFB
setne %cl
cmpl $0x6, %eax
setne %al
andb %cl, %al
jmp 0x11721
movl (%r14,%r12), %eax
leaq 0x1b064(%rip), %rcx     # 0x2c770
cmpl (%rcx,%r14,2), %eax
jb 0x11729
leaq 0x1b057(%rip), %rcx     # 0x2c770
cmpl 0x4(%rcx,%r14,2), %eax
seta %al
testb %al, %al
je 0x117d2
leaq 0x1b010(%rip), %rax     # 0x2c740
movl (%r14,%rax), %eax
movl %eax, (%r14,%r12)
movq %r15, %rdi
leaq 0x1ae83(%rip), %rsi     # 0x2c5c5
movq %rbx, %rdx
callq 0x11dd6
movq %r15, %rdi
leaq 0x1ae9a(%rip), %rsi     # 0x2c5ee
callq 0x47c0
movq %r13, -0x48(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x11779
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0x11781
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, -0x40(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x48(%rbp), %rdi
callq 0x15050
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x117b6
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43f0
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x117d2
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x43f0
addq $0x20, %rbx
addq $0x4, %r14
cmpq $0x30, %r14
jne 0x116e3
movl 0x310c6(%rip), %eax     # 0x428b0
testl %eax, %eax
je 0x11840
leal (%rax,%rax,4), %ecx
leal (%rax,%rcx,4), %ecx
addl %eax, %ecx
cmpl 0x310a4(%rip), %ecx     # 0x428a0
jae 0x11840
movl $0x0, 0x310a8(%rip)     # 0x428b0
leaq -0x48(%rbp), %rdi
movq %r13, (%rdi)
leaq 0x1addb(%rip), %rsi     # 0x2c5f1
leaq 0x1ae28(%rip), %rdx     # 0x2c645
callq 0xdfec
leaq -0x48(%rbp), %rdi
callq 0x15050
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x11840
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43f0
movl 0x31086(%rip), %eax     # 0x428cc
cmpl 0x31054(%rip), %eax     # 0x428a0
ja 0x1185c
testl %eax, %eax
je 0x1189e
cmpq $0x0, 0x30f9e(%rip)     # 0x427f8
jne 0x1189e
movl $0x0, 0x31066(%rip)     # 0x428cc
leaq -0x48(%rbp), %rdi
movq %r13, (%rdi)
leaq 0x1add2(%rip), %rsi     # 0x2c646
leaq 0x1adf0(%rip), %rdx     # 0x2c66b
callq 0xdfec
leaq -0x48(%rbp), %rdi
callq 0x15050
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x1189e
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43f0
movq 0x30fab(%rip), %rax     # 0x42850
cmpq 0x30fac(%rip), %rax     # 0x42858
jne 0x1190d
leaq -0x48(%rbp), %rsi
movb $0x0, (%rsi)
leaq 0x30f94(%rip), %rdi     # 0x42850
callq 0x1231e
leaq -0x48(%rbp), %rsi
movb $0x1, (%rsi)
leaq 0x30f81(%rip), %rdi     # 0x42850
callq 0x1231e
leaq -0x48(%rbp), %rsi
movb $0x2, (%rsi)
leaq 0x30f6e(%rip), %rdi     # 0x42850
callq 0x1231e
leaq -0x48(%rbp), %rsi
movb $0x3, (%rsi)
leaq 0x30f5b(%rip), %rdi     # 0x42850
callq 0x1231e
leaq -0x48(%rbp), %rsi
movb $0x4, (%rsi)
leaq 0x30f48(%rip), %rdi     # 0x42850
callq 0x1231e
movq 0x30f54(%rip), %rax     # 0x42868
cmpq 0x30f55(%rip), %rax     # 0x42870
jne 0x11956
leaq -0x48(%rbp), %rsi
movb $0x0, (%rsi)
leaq 0x30f3d(%rip), %rdi     # 0x42868
callq 0x1231e
leaq -0x48(%rbp), %rsi
movb $0x1, (%rsi)
leaq 0x30f2a(%rip), %rdi     # 0x42868
callq 0x1231e
leaq -0x48(%rbp), %rsi
movb $0x2, (%rsi)
leaq 0x30f17(%rip), %rdi     # 0x42868
callq 0x1231e
movq 0x30f23(%rip), %rax     # 0x42880
cmpq 0x30f24(%rip), %rax     # 0x42888
jne 0x119a5
leaq -0x48(%rbp), %rdi
movq %r13, (%rdi)
leaq 0x1acf8(%rip), %rsi     # 0x2c66c
leaq 0x1acfa(%rip), %rdx     # 0x2c675
callq 0xdfec
leaq 0x30ef9(%rip), %rdi     # 0x42880
leaq -0x48(%rbp), %rsi
callq 0xfcce
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x119a5
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43f0
movq 0x30ed4(%rip), %rax     # 0x42880
movq %rax, 0x30f1d(%rip)     # 0x428d0
leaq -0x290(%rbp), %rdi
callq 0x40f0
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x119d8
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x43f0
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11a30
jmp 0x11aaa
jmp 0x11a30
jmp 0x11aaa
jmp 0x11aaa
jmp 0x11aaa
jmp 0x11aaa
jmp 0x11aaa
jmp 0x11aaa
jmp 0x11aaa
jmp 0x11aaa
jmp 0x11aaa
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
jne 0x11a65
jmp 0x11aad
jmp 0x11aaa
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
jne 0x11a65
jmp 0x11aad
jmp 0x11aaa
jmp 0x11a42
movq %rax, %rbx
jmp 0x11ab9
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
jne 0x11a79
jmp 0x11a8c
jmp 0x11a89
jmp 0x11aaa
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x11aad
movq -0x38(%rbp), %rsi
jmp 0x11aa0
jmp 0x11aaa
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x11a8c
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43f0
jmp 0x11a8c
jmp 0x11aaa
movq %rax, %rbx
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x11aad
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x43f0
jmp 0x11aad
movq %rax, %rbx
leaq -0x290(%rbp), %rdi
callq 0x40f0
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x11ad2
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x43f0
movq %rbx, %rdi
callq 0x4750