// File: /workspace/github_cpp_makefile_star2_O2/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
xorl %eax, %eax
leaq 0x18f06(%rip), %rdx     # 0x26760
leaq 0x3202f(%rip), %rsi     # 0x3f890
cmpq $0x30, %rax
je 0xd873
movl (%rax,%rdx), %ecx
movl %ecx, (%rax,%rsi)
addq $0x4, %rax
jmp 0xd861
callq 0xdc2d
leaq 0x31f21(%rip), %rsi     # 0x3f7a0
leaq 0x18d21(%rip), %rdx     # 0x265a7
leaq -0x88(%rbp), %rbx
movq %rbx, %rdi
callq 0xc40d
movq (%rbx), %rsi
leaq -0x290(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x4740
movq -0x290(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x270(%rbp,%rax)
je 0xd8e2
leaq 0x18cf0(%rip), %rsi     # 0x265b3
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rdx
callq 0xb292
leaq -0x48(%rbp), %rdi
callq 0x10b68
leaq -0x48(%rbp), %rdi
callq 0x47e8
leaq -0x290(%rbp), %rbx
leaq -0x88(%rbp), %r14
pushq $0x1
popq %r15
leaq -0x48(%rbp), %r13
leaq -0x68(%rbp), %r12
movq -0x290(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x270(%rbp,%rax)
jne 0xd9a5
movq %rbx, %rdi
movq %r14, %rsi
callq 0x40a0
cmpq $0x0, -0x80(%rbp)
je 0xd8fc
movq -0x88(%rbp), %rax
cmpb $0x23, (%rax)
je 0xd8fc
movq %r14, %rdi
movl %r15d, %esi
callq 0xcb30
testb %al, %al
je 0xd8fc
movq %r13, %rdi
leaq 0x18c9f(%rip), %rsi     # 0x265eb
movq %r12, %rdx
callq 0xb292
movq %r13, %rdi
callq 0x10b68
movq %r13, %rdi
callq 0x47e8
movq %r12, %rdi
leaq 0x18cb9(%rip), %rsi     # 0x26627
movq %r14, %rdx
callq 0xde6a
movq %r13, %rdi
movq %r12, %rsi
leaq 0x18ca5(%rip), %rdx     # 0x26628
callq 0xb309
movq %r13, %rdi
callq 0x10b68
movq %r13, %rdi
callq 0x47e8
movq %r12, %rdi
callq 0x47e8
jmp 0xd8fc
leaq 0x31c74(%rip), %rbx     # 0x3f620
xorl %r12d, %r12d
leaq -0x68(%rbp), %r15
leaq -0x48(%rbp), %r13
xorl %r14d, %r14d
cmpq $0xc, %r14
je 0xda2b
movl %r14d, %edi
callq 0xd5b0
testb %al, %al
je 0xda1e
leaq 0x18d8d(%rip), %rax     # 0x26760
movl (%r12,%rax), %eax
leaq 0x31eb2(%rip), %rcx     # 0x3f890
movl %eax, (%r12,%rcx)
movq %r15, %rdi
leaq 0x18c3e(%rip), %rsi     # 0x2662a
movq %rbx, %rdx
callq 0xde6a
movq %r13, %rdi
movq %r15, %rsi
leaq 0x18c52(%rip), %rdx     # 0x26653
callq 0xb309
movq %r13, %rdi
callq 0x10b68
movq %r13, %rdi
callq 0x47e8
movq %r15, %rdi
callq 0x47e8
incq %r14
addq $0x20, %rbx
addq $0x4, %r12
jmp 0xd9ba
callq 0xd5f5
testb %al, %al
je 0xda5a
leaq 0x18c1b(%rip), %rsi     # 0x26656
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rdx
callq 0xb292
leaq -0x48(%rbp), %rdi
callq 0x10b68
leaq -0x48(%rbp), %rdi
callq 0x47e8
callq 0xd61d
testb %al, %al
je 0xda89
leaq 0x18c41(%rip), %rsi     # 0x266ab
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rdx
callq 0xb292
leaq -0x48(%rbp), %rdi
callq 0x10b68
leaq -0x48(%rbp), %rdi
callq 0x47e8
movq 0x31db0(%rip), %rax     # 0x3f840
cmpq 0x31db1(%rip), %rax     # 0x3f848
jne 0xdaf8
leaq -0x48(%rbp), %rsi
movb $0x0, (%rsi)
leaq 0x31d99(%rip), %rdi     # 0x3f840
callq 0xe3ca
leaq -0x48(%rbp), %rsi
movb $0x1, (%rsi)
leaq 0x31d86(%rip), %rdi     # 0x3f840
callq 0xe3ca
leaq -0x48(%rbp), %rsi
movb $0x2, (%rsi)
leaq 0x31d73(%rip), %rdi     # 0x3f840
callq 0xe3ca
leaq -0x48(%rbp), %rsi
movb $0x3, (%rsi)
leaq 0x31d60(%rip), %rdi     # 0x3f840
callq 0xe3ca
leaq -0x48(%rbp), %rsi
movb $0x4, (%rsi)
leaq 0x31d4d(%rip), %rdi     # 0x3f840
callq 0xe3ca
movq 0x31d59(%rip), %rax     # 0x3f858
cmpq 0x31d5a(%rip), %rax     # 0x3f860
jne 0xdb41
leaq -0x48(%rbp), %rsi
movb $0x0, (%rsi)
leaq 0x31d42(%rip), %rdi     # 0x3f858
callq 0xe3ca
leaq -0x48(%rbp), %rsi
movb $0x1, (%rsi)
leaq 0x31d2f(%rip), %rdi     # 0x3f858
callq 0xe3ca
leaq -0x48(%rbp), %rsi
movb $0x2, (%rsi)
leaq 0x31d1c(%rip), %rdi     # 0x3f858
callq 0xe3ca
movq 0x31d28(%rip), %rax     # 0x3f870
cmpq 0x31d29(%rip), %rax     # 0x3f878
jne 0xdb85
leaq 0x18b79(%rip), %rsi     # 0x266d1
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rdx
callq 0xb292
leaq 0x31d04(%rip), %rdi     # 0x3f870
leaq -0x48(%rbp), %rsi
callq 0xc834
leaq -0x48(%rbp), %rdi
callq 0x47e8
movq 0x31ceb(%rip), %rax     # 0x3f870
movq %rax, 0x31d34(%rip)     # 0x3f8c0
leaq -0x290(%rbp), %rdi
callq 0x4110
leaq -0x88(%rbp), %rdi
callq 0x47e8
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xdbdf
jmp 0xdc0a
jmp 0xdc0a
jmp 0xdc0a
jmp 0xdc0a
jmp 0xdc0a
jmp 0xdc0a
jmp 0xdc0a
jmp 0xdc0a
jmp 0xdc0a
jmp 0xdbdf
jmp 0xdc0a
jmp 0xdbdf
jmp 0xdc0a
jmp 0xdbdf
jmp 0xdc0a
movq %rax, %rbx
jmp 0xdc19
jmp 0xdbf3
jmp 0xdbec
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
jmp 0xdc03
jmp 0xdc0a
jmp 0xdc0a
movq %rax, %rbx
jmp 0xdbff
jmp 0xdc0a
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x47e8
leaq -0x68(%rbp), %rdi
callq 0x47e8
jmp 0xdc0d
movq %rax, %rbx
leaq -0x290(%rbp), %rdi
callq 0x4110
leaq -0x88(%rbp), %rdi
callq 0x47e8
movq %rbx, %rdi
callq 0x4710