// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/config.cpp
// Function: Config::readConfig()
bool Config::readConfig()
{
    FILE *f = fopen(full_path.c_str(), "rb");
    if (f == nullptr) {
        fprintf(stderr, "Unable to open config file '%s'.\n", full_path.c_str());
        return false;
    }

    while (feof(f) == 0) {
      char line[MAX_LINE] = {0};
      bool instring = false;
      std::string key;
      std::string val;
      std::string *current = &key;

      if (fgets(&line[0], MAX_LINE, f) == nullptr) {
        break;
      }

      char *tmp = &line[0];

      while (*tmp != '\0' && *tmp != '\n' && *tmp != '\r') {
        if (*tmp == '=') {
          current = &val;
        } else if (*tmp == '#') {
          break;
        } else if (*tmp == '"') {
          instring = !instring;
        } else if (*tmp != ' ' || instring) {
          current->append(tmp, 1);
        }

        tmp++;
      }

      if (key.length() > 0) {
        config[key] = val;
      }
    }

    fclose(f);
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rdi, 0x28(%rsp)
movq 0x30(%rdi), %rdi
leaq 0x71d0(%rip), %rsi      # 0x1148d
callq 0x66d0
movq %rax, %rbx
testq %rax, %rax
je 0xa425
leaq 0x30(%rsp), %r12
movq %rbx, %rdi
callq 0x68d0
testl %eax, %eax
jne 0xa405
movl $0x12c, %edx            # imm = 0x12C
leaq 0x50(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x6350
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x10(%rsp)
movb %cl, 0x18(%rsp)
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movb %cl, 0x40(%rsp)
movq %r14, %rdi
movl $0x12c, %esi            # imm = 0x12C
movq %rbx, %rdx
callq 0x6920
movq %rax, %rbp
testq %rax, %rax
je 0xa3c4
xorl %r14d, %r14d
leaq 0x8(%rsp), %r13
leaq 0x50(%rsp), %r15
movzbl (%r15), %eax
cmpl $0x21, %eax
jle 0xa360
cmpl $0x22, %eax
je 0xa372
cmpl $0x3d, %eax
jne 0xa378
movq %r12, %r13
jmp 0xa39d
cmpl $0x1f, %eax
jle 0xa37f
cmpl $0x20, %eax
jne 0xa38d
testb $0x1, %r14b
jne 0xa38d
jmp 0xa39d
xorb $0x1, %r14b
jmp 0xa39d
cmpl $0x23, %eax
jne 0xa38d
jmp 0xa3a2
testl %eax, %eax
je 0xa3a2
cmpl $0xa, %eax
je 0xa3a2
cmpl $0xd, %eax
je 0xa3a2
movl $0x1, %edx
movq %r13, %rdi
movq %r15, %rsi
callq 0x60a0
incq %r15
jmp 0xa348
cmpq $0x0, 0x10(%rsp)
je 0xa3c4
movq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xa950
movq %rax, %rdi
movq %r12, %rsi
callq 0x6340
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xa3e0
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x65c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xa3fc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x65c0
testq %rbp, %rbp
jne 0xa2d3
movq %rbx, %rdi
callq 0x65a0
testq %rbx, %rbx
setne %al
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x28(%rsp), %rdi
addq $0x30, %rdi
callq 0x6e29
jmp 0xa40d
jmp 0xa437
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xa456
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x65c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xa472
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x65c0
movq %rbx, %rdi
callq 0x6a80