// File: /workspace/github_cpp_makefile_star2_O3/aaronpuchert[P]throttle/src/conf.cpp
// Function: Conf::Conf(char const*)
Conf::Conf(const char *config_fn) {
	// open the file
	std::ifstream conf_file(config_fn);
	if (!conf_file)
		throw std::runtime_error(std::string("Couldn't open config file '") + config_fn + '\'');

	// Read every line and put it in the list.
	char line[LINE_LENGTH];
	std::string name;

	// parse: first comes the name of the command
	while (conf_file >> name) {
		// if line starts with '#', ignore it
		if (name[0] == '#') {
			conf_file.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
			continue;
		}

		conf_file.ignore(std::numeric_limits<std::streamsize>::max(), '=');
		conf_file.ignore(std::numeric_limits<std::streamsize>::max(), ' ');
		conf_file.getline(line, LINE_LENGTH);

		DEBUG_PRINT("[Conf] " << name << " = " << line);

		// Write into attribute list
		attributes.emplace_back(name, std::string(line));
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x658, %rsp            # imm = 0x658
movq %rsi, %r15
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rdi, 0x40(%rsp)
movq $0x0, 0x10(%rdi)
leaq 0x48(%rsp), %r14
movq %r14, %rdi
movl $0x8, %edx
callq 0x2350
movq 0x48(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x68(%rsp,%rax)
jne 0x381a
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x10(%rsp), %rbx
leaq 0x20(%rsp), %r15
movabsq $0x7fffffffffffffff, %r12 # imm = 0x7FFFFFFFFFFFFFFF
leaq 0x250(%rsp), %r13
movq %rsp, %rbp
movq %r14, %rdi
movq %r15, %rsi
callq 0x2230
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
movq 0x20(%rsp), %rdi
jne 0x37e7
cmpb $0x23, (%rdi)
jne 0x374d
movq %r14, %rdi
movq %r12, %rsi
movl $0xa, %edx
callq 0x2140
jmp 0x3714
movq %r14, %rdi
movq %r12, %rsi
movl $0x3d, %edx
callq 0x2140
movq %r14, %rdi
movq %r12, %rsi
movl $0x20, %edx
callq 0x2140
movq 0x48(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %ecx
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
movq %r13, %rsi
callq 0x2380
movq %rbx, (%rsp)
movq %r13, %rdi
callq 0x20c0
leaq (%rsp,%rax), %rdx
addq $0x250, %rdx            # imm = 0x250
movq %rbp, %rdi
movq %r13, %rsi
callq 0x40b6
movq 0x40(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x4074
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0x3714
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
jmp 0x3714
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x37fe
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x48(%rsp), %rdi
callq 0x2040
addq $0x658, %rsp            # imm = 0x658
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x20f0
movq %rax, %r14
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x18be(%rip), %rsi      # 0x50f6
leaq 0x18d2(%rip), %rdx      # 0x5111
movq %rsp, %rdi
callq 0x40b6
movq %rsp, %rdi
movq %r15, %rsi
callq 0x2370
leaq 0x30(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x3872
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
jmp 0x387f
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
movq 0x8(%rax), %rdx
leaq 0x20(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x250(%rsp), %rdi
movl $0x27, %edx
callq 0x4012
movb $0x1, %bpl
leaq 0x250(%rsp), %rsi
movq %r14, %rdi
callq 0x22c0
xorl %ebp, %ebp
movq 0x4727(%rip), %rsi      # 0x7ff0
movq 0x46f8(%rip), %rdx      # 0x7fc8
movq %r14, %rdi
callq 0x2300
movq %rax, %r15
leaq 0x260(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3904
movq 0x260(%rsp), %rsi
incq %rsi
callq 0x21f0
jmp 0x3904
movq %rax, %r15
movb $0x1, %bpl
movq 0x20(%rsp), %rdi
cmpq %rbx, %rdi
je 0x391b
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21f0
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x3931
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
testb %bpl, %bpl
jne 0x3956
jmp 0x39a1
movq %rax, %r15
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x3956
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
jmp 0x3956
movq %rax, %r15
movq %r14, %rdi
callq 0x2160
jmp 0x39a1
movq %rax, %r15
jmp 0x39ab
jmp 0x3982
movq %rax, %r15
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0x3985
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
jmp 0x3985
movq %rax, %r15
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x39a1
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x48(%rsp), %rdi
callq 0x2040
movq 0x40(%rsp), %rdi
callq 0x2f0e
movq %r15, %rdi
callq 0x2330
nop