// File: soybin[P]idyll/src/config.cpp
// Function: config::getInt(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int getInt(std::string name) {
		// file handle
		std::ifstream file("config.txt");

		// create file in case it doesn't exist
		if (!file.good()) {
			std::cout << "[-] Couldn't find 'config.txt' file.\n";
			file.close();
			reset();
			return getInt(name);
		}

		for (std::string line; std::getline(file, line); ) {
			if (line[0] == '#') continue;
			size_t found = line.find(name);
			if (found != std::string::npos) {
				try {
					// check to see if there's any non-numeric character
					for (auto& c : line.substr(found + name.size())) {
						if ((c < '0' || c > '9') && c != ' ') {
							throw 1;
						}
					}
					// get int from line substring
					return std::stoi(line.substr(found + name.size()));
				} catch (...) {
					std::cout << "[-] Invalid value for variable '" << name << "' in config.txt file.\n";
					file.close();
					reset();
					return getInt(name);
				}
			}
		}

		std::cout << "[-] Variable '" << name << "' was not found in 'config.txt' file.\n";
		file.close();
		reset();
		return getInt(name);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x390, %rsp            # imm = 0x390
movq %rdi, -0x328(%rbp)
movq %rdi, -0x10(%rbp)
leaq 0x126d0(%rip), %rsi     # 0x1d36d
leaq -0x218(%rbp), %rdi
movl $0x8, %edx
callq 0x4610
movq -0x218(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x218(%rbp,%rax), %rdi
callq 0x4570
movb %al, -0x319(%rbp)
jmp 0xacce
movb -0x319(%rbp), %al
testb $0x1, %al
jne 0xad8f
jmp 0xacde
movq 0x1c2cb(%rip), %rdi     # 0x26fb0
leaq 0x1268c(%rip), %rsi     # 0x1d378
callq 0x4350
jmp 0xacf3
leaq -0x218(%rbp), %rdi
callq 0x4090
jmp 0xad01
callq 0xb290
jmp 0xad08
movq -0x328(%rbp), %rsi
leaq -0x248(%rbp), %rdi
callq 0x4130
jmp 0xad1d
leaq -0x248(%rbp), %rdi
callq 0xac80
movl %eax, -0x32c(%rbp)
jmp 0xad31
movl -0x32c(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x248(%rbp), %rdi
callq 0x41f0
movl $0x1, -0x24c(%rbp)
jmp 0xb254
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0xb26c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x248(%rbp), %rdi
callq 0x41f0
jmp 0xb26c
leaq -0x270(%rbp), %rdi
callq 0x4490
leaq -0x218(%rbp), %rdi
leaq -0x270(%rbp), %rsi
callq 0x4080
movq %rax, -0x338(%rbp)
jmp 0xadb7
movq -0x338(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x4450
movb %al, -0x339(%rbp)
jmp 0xadd5
movb -0x339(%rbp), %al
testb $0x1, %al
jne 0xae07
jmp 0xade1
movl $0x2, -0x24c(%rbp)
jmp 0xb15b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0xb177
xorl %eax, %eax
movl %eax, %esi
leaq -0x270(%rbp), %rdi
callq 0x4680
movq %rax, -0x348(%rbp)
jmp 0xae20
movq -0x348(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0xae34
jmp 0xad9b
movq -0x328(%rbp), %rsi
leaq -0x270(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
callq 0x4690
movq %rax, -0x278(%rbp)
cmpq $-0x1, -0x278(%rbp)
je 0xb156
movq -0x328(%rbp), %rdi
movq -0x278(%rbp), %rax
movq %rax, -0x350(%rbp)
callq 0x4260
movq -0x350(%rbp), %rdx
addq %rax, %rdx
leaq -0x2a0(%rbp), %rdi
leaq -0x270(%rbp), %rsi
movq $-0x1, %rcx
callq 0x4380
jmp 0xaea0
leaq -0x2a0(%rbp), %rax
movq %rax, -0x280(%rbp)
movq -0x280(%rbp), %rdi
callq 0x4300
movq %rax, -0x2a8(%rbp)
movq -0x280(%rbp), %rdi
callq 0x41c0
movq %rax, -0x2b0(%rbp)
leaq -0x2a8(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0xb570
testb $0x1, %al
jne 0xaf1d
movl $0x4, -0x24c(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x41f0
jmp 0xafbb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0xb05a
leaq -0x2a8(%rbp), %rdi
callq 0xb5b0
movq %rax, -0x2b8(%rbp)
movq -0x2b8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jl 0xaf4e
movq -0x2b8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x39, %eax
jle 0xafa8
movq -0x2b8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
je 0xafa8
movl $0x4, %edi
callq 0x4160
movq %rax, %rdi
movl $0x1, (%rdi)
movq 0x1bfe1(%rip), %rsi     # 0x26f58
xorl %eax, %eax
movl %eax, %edx
callq 0x4590
jmp 0xb28c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x41f0
jmp 0xb05a
jmp 0xafaa
leaq -0x2a8(%rbp), %rdi
callq 0xb5d0
jmp 0xaed4
movq -0x328(%rbp), %rdi
movq -0x278(%rbp), %rax
movq %rax, -0x358(%rbp)
callq 0x4260
movq -0x358(%rbp), %rdx
addq %rax, %rdx
leaq -0x2d8(%rbp), %rdi
leaq -0x270(%rbp), %rsi
movq $-0x1, %rcx
callq 0x4380
jmp 0xaffb
xorl %eax, %eax
movl %eax, %esi
leaq -0x2d8(%rbp), %rdi
movl $0xa, %edx
callq 0xb5f0
movl %eax, -0x35c(%rbp)
jmp 0xb018
movl -0x35c(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x2d8(%rbp), %rdi
callq 0x41f0
movl $0x1, -0x24c(%rbp)
jmp 0xb15b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x2d8(%rbp), %rdi
callq 0x41f0
movq -0x220(%rbp), %rdi
callq 0x4110
movq 0x1bf43(%rip), %rdi     # 0x26fb0
leaq 0x1232a(%rip), %rsi     # 0x1d39e
callq 0x4350
movq %rax, -0x368(%rbp)
jmp 0xb082
movq -0x328(%rbp), %rsi
movq -0x368(%rbp), %rdi
callq 0x4320
movq %rax, -0x370(%rbp)
jmp 0xb09e
movq -0x370(%rbp), %rdi
leaq 0x12313(%rip), %rsi     # 0x1d3bf
callq 0x4350
jmp 0xb0b3
leaq -0x218(%rbp), %rdi
callq 0x4090
jmp 0xb0c1
callq 0xb290
jmp 0xb0c8
movq -0x328(%rbp), %rsi
leaq -0x2f8(%rbp), %rdi
callq 0x4130
jmp 0xb0dd
leaq -0x2f8(%rbp), %rdi
callq 0xac80
movl %eax, -0x374(%rbp)
jmp 0xb0f1
movl -0x374(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x2f8(%rbp), %rdi
callq 0x41f0
movl $0x1, -0x24c(%rbp)
callq 0x4540
jmp 0xb14b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0xb14d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x2f8(%rbp), %rdi
callq 0x41f0
jmp 0xb14d
jmp 0xb15b
callq 0x4540
jmp 0xb154
jmp 0xb177
jmp 0xad9b
leaq -0x270(%rbp), %rdi
callq 0x41f0
movl -0x24c(%rbp), %eax
subl $0x2, %eax
je 0xb188
jmp 0xb254
leaq -0x270(%rbp), %rdi
callq 0x41f0
jmp 0xb26c
movq 0x1be21(%rip), %rdi     # 0x26fb0
leaq 0x12240(%rip), %rsi     # 0x1d3d6
callq 0x4350
movq %rax, -0x380(%rbp)
jmp 0xb1a4
movq -0x328(%rbp), %rsi
movq -0x380(%rbp), %rdi
callq 0x4320
movq %rax, -0x388(%rbp)
jmp 0xb1c0
movq -0x388(%rbp), %rdi
leaq 0x12217(%rip), %rsi     # 0x1d3e5
callq 0x4350
jmp 0xb1d5
leaq -0x218(%rbp), %rdi
callq 0x4090
jmp 0xb1e3
callq 0xb290
jmp 0xb1ea
movq -0x328(%rbp), %rsi
leaq -0x318(%rbp), %rdi
callq 0x4130
jmp 0xb1ff
leaq -0x318(%rbp), %rdi
callq 0xac80
movl %eax, -0x38c(%rbp)
jmp 0xb213
movl -0x38c(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x318(%rbp), %rdi
callq 0x41f0
movl $0x1, -0x24c(%rbp)
jmp 0xb254
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x318(%rbp), %rdi
callq 0x41f0
jmp 0xb26c
leaq -0x218(%rbp), %rdi
callq 0x40b0
movl -0x4(%rbp), %eax
addq $0x390, %rsp            # imm = 0x390
popq %rbp
retq
leaq -0x218(%rbp), %rdi
callq 0x40b0
movq -0x220(%rbp), %rdi
callq 0x45d0
movq %rax, %rdi
callq 0x72b0
nopl (%rax)