// File: /workspace/github_cpp_makefile_star2_O3/Juve45[P]batstat/main.cpp
// Function: load_config()
void load_config() {

	string configfile = CONFIG;
	if(checkfile(LOCAL_CONFIG)) 
		configfile = LOCAL_CONFIG;

	cout << configfile << endl;
	ifstream jsonf(configfile);
	json config = json::parse(jsonf, nullptr, true, true);

	if(config["refresh_rate"].is_number() && 1 <= config["refresh_rate"] && config["refresh_rate"] <= 120) 
		refreshRate = config["refresh_rate"];

	if(config["log_rate"].is_number() && 1 <= config["log_rate"] && config["log_rate"] <= 120)
		LOG_P = config["log_rate"];

	if(config["power_supply_path"].is_string())
		PATH = config["power_supply_path"];

	timeElapsed = -refreshRate;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
leaq -0x38(%rbp), %r15
movq %r15, -0x10(%r15)
movq 0x153c9(%rip), %rsi     # 0x19320
movq 0x153ca(%rip), %rdx     # 0x19328
addq %rsi, %rdx
leaq -0x48(%rbp), %rdi
callq 0x51f6
movq 0x153cf(%rip), %rdi     # 0x19340
leaq 0xd579(%rip), %rsi      # 0x114f1
callq 0x33b0
testq %rax, %rax
je 0x3f9a
movq %rax, %rdi
callq 0x3310
leaq 0x153af(%rip), %rsi     # 0x19340
leaq -0x48(%rbp), %rdi
callq 0x31f0
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x15027(%rip), %rdi     # 0x18fd0
callq 0x3370
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3300
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3220
leaq -0x298(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movl $0x8, %edx
callq 0x34a0
xorps %xmm0, %xmm0
leaq -0x90(%rbp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x10(%rdx)
leaq -0x28(%rbp), %rdi
leaq -0x298(%rbp), %rsi
movl $0x1, %ecx
movl $0x1, %r8d
callq 0x4f00
movq -0x80(%rbp), %rax
testq %rax, %rax
je 0x4033
leaq -0x90(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0xc5fd(%rip), %rsi      # 0x10637
leaq -0x28(%rbp), %rdi
callq 0x5056
movb (%rax), %al
addb $-0x5, %al
cmpb $0x2, %al
ja 0x40b8
leaq 0xc5e5(%rip), %rsi      # 0x10637
leaq -0x28(%rbp), %rdi
callq 0x5056
movl $0x1, %edi
movq %rax, %rsi
callq 0x50bd
testb %al, %al
je 0x40b8
leaq 0xc5c4(%rip), %rsi      # 0x10637
leaq -0x28(%rbp), %rdi
callq 0x5056
movq %rax, %rdi
movl $0x78, %esi
callq 0x5118
testb %al, %al
je 0x40b8
leaq 0xc5a3(%rip), %rsi      # 0x10637
leaq -0x28(%rbp), %rdi
callq 0x5056
leaq -0x68(%rbp), %rsi
movl $0x0, (%rsi)
movq %rax, %rdi
callq 0xf87c
movl -0x68(%rbp), %eax
movl %eax, 0x15228(%rip)     # 0x192e0
leaq 0xc585(%rip), %rsi      # 0x10644
leaq -0x28(%rbp), %rdi
callq 0x5056
movb (%rax), %al
addb $-0x5, %al
cmpb $0x2, %al
ja 0x413d
leaq 0xc56d(%rip), %rsi      # 0x10644
leaq -0x28(%rbp), %rdi
callq 0x5056
movl $0x1, %edi
movq %rax, %rsi
callq 0x50bd
testb %al, %al
je 0x413d
leaq 0xc54c(%rip), %rsi      # 0x10644
leaq -0x28(%rbp), %rdi
callq 0x5056
movq %rax, %rdi
movl $0x78, %esi
callq 0x5118
testb %al, %al
je 0x413d
leaq 0xc52b(%rip), %rsi      # 0x10644
leaq -0x28(%rbp), %rdi
callq 0x5056
leaq -0x68(%rbp), %rsi
movl $0x0, (%rsi)
movq %rax, %rdi
callq 0xf87c
movl -0x68(%rbp), %eax
movl %eax, 0x151a7(%rip)     # 0x192e4
leaq 0xc509(%rip), %rsi      # 0x1064d
leaq -0x28(%rbp), %rdi
callq 0x5056
cmpb $0x3, (%rax)
jne 0x4192
leaq 0xc4f4(%rip), %rsi      # 0x1064d
leaq -0x28(%rbp), %rdi
callq 0x5056
leaq -0x68(%rbp), %rdi
movq %rax, %rsi
callq 0xfb76
leaq 0x1518b(%rip), %rdi     # 0x19300
leaq -0x68(%rbp), %rbx
movq %rbx, %rsi
callq 0x33d0
movq (%rbx), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x4192
callq 0x32f0
xorl %eax, %eax
subl 0x15146(%rip), %eax     # 0x192e0
movl %eax, 0x151dc(%rip)     # 0x1937c
leaq -0x28(%rbp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5332
movq %rbx, %rdi
callq 0x540a
leaq -0x298(%rbp), %rdi
callq 0x30c0
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x41d0
callq 0x32f0
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4201
jmp 0x4210
movq %rax, %rbx
movq -0x80(%rbp), %rax
testq %rax, %rax
je 0x4229
leaq -0x90(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x4229
movq %rax, %rdi
callq 0x51e7
jmp 0x420b
movq %rax, %rbx
jmp 0x4235
movq %rax, %rbx
leaq -0x28(%rbp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x5332
movq %r14, %rdi
callq 0x540a
leaq -0x298(%rbp), %rdi
callq 0x30c0
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x4243
callq 0x32f0
movq %rbx, %rdi
callq 0x3530