// File: /workspace/github_cpp_makefile_star2_O3/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 0x1b42b(%rip), %xmm0    # 0x2c760
movaps %xmm0, 0x31584(%rip)    # 0x428c0
movaps 0x1b40d(%rip), %xmm0    # 0x2c750
movaps %xmm0, 0x31566(%rip)    # 0x428b0
movaps 0x1b3ef(%rip), %xmm0    # 0x2c740
movaps %xmm0, 0x31548(%rip)    # 0x428a0
callq 0x11983
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
movq 0x31444(%rip), %rsi     # 0x427b0
movq 0x31445(%rip), %rdx     # 0x427b8
addq %rsi, %rdx
leaq -0x68(%rbp), %rbx
movq %rbx, %rdi
callq 0xf988
leaq 0x1b1b9(%rip), %rsi     # 0x2c542
movq %rbx, %rdi
callq 0x47b0
movq -0x68(%rbp), %rsi
leaq -0x290(%rbp), %rdi
movl $0x8, %edx
callq 0x4770
movq -0x290(%rbp), %rax
movq -0x18(%rax), %rax
movl -0x270(%rbp,%rax), %ecx
testb $0x5, %cl
je 0x1140c
leaq -0x38(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x1b182(%rip), %rsi     # 0x2c54e
leaq 0x1b1b2(%rip), %rdx     # 0x2c585
leaq -0x48(%rbp), %rdi
callq 0xe01c
leaq -0x48(%rbp), %rdi
callq 0x14f24
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0x113fa
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43f0
movq -0x290(%rbp), %rax
movq -0x18(%rax), %rax
movl -0x270(%rbp,%rax), %ecx
testb $0x5, %cl
jne 0x1156e
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 0x4780
cmpq $0x0, -0x60(%rbp)
je 0x1154e
movq -0x68(%rbp), %rax
cmpb $0x23, (%rax)
je 0x1154e
movq %r14, %rdi
movl $0x1, %esi
callq 0x10014
testb %al, %al
je 0x1154e
movq %r15, -0x48(%rbp)
movq %r13, %rdi
leaq 0x1b0f9(%rip), %rsi     # 0x2c586
leaq 0x1b12d(%rip), %rdx     # 0x2c5c1
callq 0xe01c
movq %r13, %rdi
callq 0x14f24
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x114b6
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43f0
movq %r12, %rdi
leaq 0x1b102(%rip), %rsi     # 0x2c5c2
movq %r14, %rdx
callq 0x11c74
movq %r12, %rdi
leaq 0x1b0f1(%rip), %rsi     # 0x2c5c3
callq 0x47b0
movq %r15, -0x48(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x114f7
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0x114fe
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 0x14f24
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x11532
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43f0
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x1154e
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 0x1143a
leaq -0x38(%rbp), %r13
leaq 0x310b7(%rip), %rbx     # 0x42630
xorl %r14d, %r14d
leaq 0x3131d(%rip), %r12     # 0x428a0
leaq -0x88(%rbp), %r15
cmpq $0x20, %r14
jne 0x115ab
movl 0x3132a(%rip), %eax     # 0x428c0
cmpl $0x6, %eax
ja 0x115ce
movl $0x51, %ecx
btl %eax, %ecx
jb 0x11677
jmp 0x115ce
movl (%r14,%r12), %eax
leaq 0x1b1ba(%rip), %rcx     # 0x2c770
cmpl (%rcx,%r14,2), %eax
jb 0x115ce
leaq 0x1b1ad(%rip), %rcx     # 0x2c770
cmpl 0x4(%rcx,%r14,2), %eax
jbe 0x11677
leaq 0x1b16b(%rip), %rax     # 0x2c740
movl (%r14,%rax), %eax
movl %eax, (%r14,%r12)
movq %r15, %rdi
leaq 0x1afde(%rip), %rsi     # 0x2c5c5
movq %rbx, %rdx
callq 0x11c74
movq %r15, %rdi
leaq 0x1aff5(%rip), %rsi     # 0x2c5ee
callq 0x47b0
movq %r13, -0x48(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1161e
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0x11626
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 0x14f24
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x1165b
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43f0
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x11677
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x43f0
addq $0x20, %rbx
addq $0x4, %r14
cmpq $0x30, %r14
jne 0x1158a
movl 0x31221(%rip), %ecx     # 0x428b0
movl 0x3120b(%rip), %eax     # 0x428a0
testl %ecx, %ecx
je 0x116ed
leal (%rcx,%rcx,4), %edx
leal (%rcx,%rdx,4), %edx
addl %ecx, %edx
cmpl %eax, %edx
jae 0x116ed
movl $0x0, 0x31201(%rip)     # 0x428b0
leaq -0x48(%rbp), %rdi
movq %r13, (%rdi)
leaq 0x1af34(%rip), %rsi     # 0x2c5f1
leaq 0x1af81(%rip), %rdx     # 0x2c645
callq 0xe01c
leaq -0x48(%rbp), %rdi
callq 0x14f24
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x116e7
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43f0
movl 0x311b3(%rip), %eax     # 0x428a0
movl 0x311d9(%rip), %ecx     # 0x428cc
cmpl %eax, %ecx
ja 0x11705
testl %ecx, %ecx
je 0x11747
cmpq $0x0, 0x310f5(%rip)     # 0x427f8
jne 0x11747
movl $0x0, 0x311bd(%rip)     # 0x428cc
leaq -0x48(%rbp), %rdi
movq %r13, (%rdi)
leaq 0x1af29(%rip), %rsi     # 0x2c646
leaq 0x1af47(%rip), %rdx     # 0x2c66b
callq 0xe01c
leaq -0x48(%rbp), %rdi
callq 0x14f24
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x11747
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43f0
movq 0x31102(%rip), %rax     # 0x42850
cmpq 0x31103(%rip), %rax     # 0x42858
jne 0x117b6
leaq -0x48(%rbp), %rsi
movb $0x0, (%rsi)
leaq 0x310eb(%rip), %rdi     # 0x42850
callq 0x121ec
leaq -0x48(%rbp), %rsi
movb $0x1, (%rsi)
leaq 0x310d8(%rip), %rdi     # 0x42850
callq 0x121ec
leaq -0x48(%rbp), %rsi
movb $0x2, (%rsi)
leaq 0x310c5(%rip), %rdi     # 0x42850
callq 0x121ec
leaq -0x48(%rbp), %rsi
movb $0x3, (%rsi)
leaq 0x310b2(%rip), %rdi     # 0x42850
callq 0x121ec
leaq -0x48(%rbp), %rsi
movb $0x4, (%rsi)
leaq 0x3109f(%rip), %rdi     # 0x42850
callq 0x121ec
movq 0x310ab(%rip), %rax     # 0x42868
cmpq 0x310ac(%rip), %rax     # 0x42870
jne 0x117ff
leaq -0x48(%rbp), %rsi
movb $0x0, (%rsi)
leaq 0x31094(%rip), %rdi     # 0x42868
callq 0x121ec
leaq -0x48(%rbp), %rsi
movb $0x1, (%rsi)
leaq 0x31081(%rip), %rdi     # 0x42868
callq 0x121ec
leaq -0x48(%rbp), %rsi
movb $0x2, (%rsi)
leaq 0x3106e(%rip), %rdi     # 0x42868
callq 0x121ec
movq 0x3107a(%rip), %rax     # 0x42880
cmpq 0x3107b(%rip), %rax     # 0x42888
jne 0x11855
leaq -0x48(%rbp), %rdi
movq %r13, (%rdi)
leaq 0x1ae4f(%rip), %rsi     # 0x2c66c
leaq 0x1ae51(%rip), %rdx     # 0x2c675
callq 0xe01c
leaq 0x31050(%rip), %rdi     # 0x42880
leaq -0x48(%rbp), %rsi
callq 0xfbcc
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x1184e
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43f0
movq 0x3102b(%rip), %rax     # 0x42880
movq %rax, 0x31074(%rip)     # 0x428d0
leaq -0x290(%rbp), %rdi
callq 0x40f0
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x11881
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 0x118d9
jmp 0x11953
jmp 0x11953
jmp 0x11953
jmp 0x11953
jmp 0x11953
jmp 0x11953
jmp 0x11953
jmp 0x11953
jmp 0x11953
jmp 0x118d9
jmp 0x11953
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
jne 0x1190e
jmp 0x11956
jmp 0x11953
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
jne 0x1190e
jmp 0x11956
jmp 0x11953
jmp 0x118eb
movq %rax, %rbx
jmp 0x11962
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
jne 0x11929
jmp 0x11935
jmp 0x11916
jmp 0x11953
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x11956
movq -0x38(%rbp), %rsi
jmp 0x11949
jmp 0x11953
movq %rax, %rbx
jmp 0x11935
jmp 0x11953
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x11935
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43f0
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x11956
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x43f0
jmp 0x11956
movq %rax, %rbx
leaq -0x290(%rbp), %rdi
callq 0x40f0
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x1197b
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x43f0
movq %rbx, %rdi
callq 0x4740