// File: /workspace/github_cpp_makefile_star2_O3/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 0x7238(%rip), %rsi      # 0x1148d
callq 0x66d0
movq %rax, %rbx
testq %rax, %rax
je 0xa3c0
leaq 0x30(%rsp), %r12
movq %rbx, %rdi
callq 0x68d0
testl %eax, %eax
jne 0xa3a0
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 0xa35f
xorl %r14d, %r14d
leaq 0x8(%rsp), %r13
leaq 0x50(%rsp), %r15
movzbl (%r15), %eax
cmpl $0x21, %eax
jle 0xa2f8
cmpl $0x22, %eax
je 0xa30d
cmpl $0x3d, %eax
jne 0xa313
movq %r12, %r13
jmp 0xa338
cmpl $0x1f, %eax
jle 0xa31a
cmpl $0x20, %eax
jne 0xa328
testb $0x1, %r14b
jne 0xa328
xorl %r14d, %r14d
jmp 0xa338
xorb $0x1, %r14b
jmp 0xa338
cmpl $0x23, %eax
jne 0xa328
jmp 0xa33d
testl %eax, %eax
je 0xa33d
cmpl $0xa, %eax
je 0xa33d
cmpl $0xd, %eax
je 0xa33d
movl $0x1, %edx
movq %r13, %rdi
movq %r15, %rsi
callq 0x60a0
incq %r15
jmp 0xa2e0
cmpq $0x0, 0x10(%rsp)
je 0xa35f
movq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xa8ec
movq %rax, %rdi
movq %r12, %rsi
callq 0x6340
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xa37b
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x65c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xa397
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x65c0
testq %rbp, %rbp
jne 0xa26b
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 0xa3a8
jmp 0xa3d2
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xa3f1
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x65c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xa40d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x65c0
movq %rbx, %rdi
callq 0x6a80
nop