// File: Stygain[P]bandwidth-monitor/src/settings.cpp
// Function: Settings::Initialize()
void Settings::Initialize()
{
	if (this->settingsFileExists)
	{
		std::ifstream settingsFile(this->settingsFileName);

		// Read the file
		settingsFile >> this->root;

		settingsFile.close();
	}
	else
	{
		// Initialize the default settings locally
		this->root["sortingColumn"] = -1;
		this->root["zeroOnStart"] = 1;
		this->root["graphs"][0] = 0;
		this->root["graphs"][1] = 1;
		this->root["graphs"][2] = 2;
		this->root["graphs"][3] = 3;

		// Call save
		this->SaveSettings();
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3a0, %rsp            # imm = 0x3A0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x318(%rbp)
testb $0x1, 0x28(%rax)
je 0x13baa
movq -0x318(%rbp), %rsi
addq $0x29, %rsi
leaq -0x210(%rbp), %rdi
movq %rdi, -0x320(%rbp)
movl $0x8, %edx
callq 0x35f0
movq -0x320(%rbp), %rdi
movq -0x318(%rbp), %rsi
callq 0x3610
jmp 0x13b68
leaq -0x210(%rbp), %rdi
callq 0x30b0
jmp 0x13b76
leaq -0x210(%rbp), %rdi
callq 0x30e0
jmp 0x13ece
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
leaq -0x210(%rbp), %rdi
callq 0x30e0
jmp 0x13ed7
leaq -0x248(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x3230
movq -0x318(%rbp), %rdi
leaq 0x26ef(%rip), %rsi      # 0x162b8
callq 0x3140
movq %rax, -0x328(%rbp)
jmp 0x13bd7
movq -0x328(%rbp), %rdi
leaq -0x248(%rbp), %rsi
movq %rsi, -0x338(%rbp)
callq 0x33f0
movq -0x338(%rbp), %rdi
callq 0x31d0
leaq -0x270(%rbp), %rdi
movl $0x1, %esi
callq 0x3230
movq -0x318(%rbp), %rdi
leaq 0x26aa(%rip), %rsi      # 0x162c6
callq 0x3140
movq %rax, -0x330(%rbp)
jmp 0x13c2a
movq -0x330(%rbp), %rdi
leaq -0x270(%rbp), %rsi
movq %rsi, -0x348(%rbp)
callq 0x33f0
movq -0x348(%rbp), %rdi
callq 0x31d0
leaq -0x298(%rbp), %rdi
xorl %esi, %esi
callq 0x3230
movq -0x318(%rbp), %rdi
leaq 0x261f(%rip), %rsi      # 0x1628b
callq 0x3140
movq %rax, -0x340(%rbp)
jmp 0x13c7a
movq -0x340(%rbp), %rdi
xorl %esi, %esi
callq 0x3380
movq %rax, -0x350(%rbp)
jmp 0x13c91
movq -0x350(%rbp), %rdi
leaq -0x298(%rbp), %rsi
movq %rsi, -0x360(%rbp)
callq 0x33f0
movq -0x360(%rbp), %rdi
callq 0x31d0
leaq -0x2c0(%rbp), %rdi
movl $0x1, %esi
callq 0x3230
movq -0x318(%rbp), %rdi
leaq 0x25b5(%rip), %rsi      # 0x1628b
callq 0x3140
movq %rax, -0x358(%rbp)
jmp 0x13ce4
movq -0x358(%rbp), %rdi
movl $0x1, %esi
callq 0x3380
movq %rax, -0x368(%rbp)
jmp 0x13cfe
movq -0x368(%rbp), %rdi
leaq -0x2c0(%rbp), %rsi
movq %rsi, -0x378(%rbp)
callq 0x33f0
movq -0x378(%rbp), %rdi
callq 0x31d0
leaq -0x2e8(%rbp), %rdi
movl $0x2, %esi
callq 0x3230
movq -0x318(%rbp), %rdi
leaq 0x2548(%rip), %rsi      # 0x1628b
callq 0x3140
movq %rax, -0x370(%rbp)
jmp 0x13d51
movq -0x370(%rbp), %rdi
movl $0x2, %esi
callq 0x3380
movq %rax, -0x380(%rbp)
jmp 0x13d6b
movq -0x380(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
movq %rsi, -0x390(%rbp)
callq 0x33f0
movq -0x390(%rbp), %rdi
callq 0x31d0
leaq -0x310(%rbp), %rdi
movl $0x3, %esi
callq 0x3230
movq -0x318(%rbp), %rdi
leaq 0x24db(%rip), %rsi      # 0x1628b
callq 0x3140
movq %rax, -0x388(%rbp)
jmp 0x13dbe
movq -0x388(%rbp), %rdi
movl $0x3, %esi
callq 0x3380
movq %rax, -0x398(%rbp)
jmp 0x13dd8
movq -0x398(%rbp), %rdi
leaq -0x310(%rbp), %rsi
callq 0x33f0
leaq -0x310(%rbp), %rdi
callq 0x31d0
movq -0x318(%rbp), %rdi
callq 0x13ef0
jmp 0x13ece
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
leaq -0x248(%rbp), %rdi
callq 0x31d0
jmp 0x13ed7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
leaq -0x270(%rbp), %rdi
callq 0x31d0
jmp 0x13ed7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
leaq -0x298(%rbp), %rdi
callq 0x31d0
jmp 0x13ed7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
leaq -0x2c0(%rbp), %rdi
callq 0x31d0
jmp 0x13ed7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
leaq -0x2e8(%rbp), %rdi
callq 0x31d0
jmp 0x13ed7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
leaq -0x310(%rbp), %rdi
callq 0x31d0
jmp 0x13ed7
addq $0x3a0, %rsp            # imm = 0x3A0
popq %rbp
retq
movq -0x218(%rbp), %rdi
callq 0x35c0
nopw %cs:(%rax,%rax)