LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: davmac314[P]dinit/src/dinitctl.cc
// Function: shutdown_dinit(int, cpbuffer<1024u>&, bool)
static int shutdown_dinit(int socknum, cpbuffer_t &rbuffer, bool verbose)
{
    // TODO support no-wait option.
    using namespace std;

    auto m = membuf()
            .append((char)cp_cmd::SHUTDOWN)
            .append(static_cast<char>(shutdown_type_t::HALT));
    write_all_x(socknum, m);

    wait_for_reply(rbuffer, socknum);

    if (rbuffer[0] != (char)cp_rply::ACK) {
        cerr << "dinitctl: control socket protocol error" << endl;
        return 1;
    }

    if (verbose) {
        std::cout << "Shutting down dinit..." << std::endl;
    }

    // Now wait for rollback complete, by waiting for the connection to close:
    try {
        while (true) {
            wait_for_info(rbuffer, socknum);
            rbuffer.consume(rbuffer[1]);
        }
    }
    catch (cp_read_exception &exc) {
        // Assume that the connection closed.
    }

    if (verbose) {
        std::cout << "Connection closed." << std::endl;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %dl, %al
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movb $0xa, -0x16(%rbp)
leaq -0x15(%rbp), %rdi
leaq -0x16(%rbp), %rsi
callq 0x11b60
movb %al, -0x14(%rbp)
movb $0x2, -0x17(%rbp)
leaq -0x14(%rbp), %rdi
leaq -0x17(%rbp), %rsi
callq 0x11b90
movw %ax, -0x13(%rbp)
movl -0x8(%rbp), %edi
leaq -0x13(%rbp), %rsi
callq 0x13390
movq -0x10(%rbp), %rdi
movl -0x8(%rbp), %esi
callq 0x11350
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x113e0
movsbl %al, %eax
cmpl $0x32, %eax
je 0xadb8
movq 0x27257(%rip), %rdi     # 0x31fe8
leaq 0x19971(%rip), %rsi     # 0x24709
callq 0x53d0
movq %rax, %rdi
movq 0x271c1(%rip), %rsi     # 0x31f68
callq 0x5410
movl $0x1, -0x4(%rbp)
jmp 0xae6f
testb $0x1, -0x11(%rbp)
je 0xade0
movq 0x271d3(%rip), %rdi     # 0x31f98
leaq 0x19bab(%rip), %rsi     # 0x24977
callq 0x53d0
movq %rax, %rdi
movq 0x2718d(%rip), %rsi     # 0x31f68
callq 0x5410
jmp 0xade2
jmp 0xade4
movq -0x10(%rbp), %rdi
movl -0x8(%rbp), %esi
callq 0x133d0
jmp 0xadf2
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x113e0
movq -0x38(%rbp), %rdi
movsbl %al, %esi
callq 0x115f0
jmp 0xade2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0xae78
movq -0x20(%rbp), %rdi
callq 0x5150
movq %rax, -0x30(%rbp)
callq 0x5680
testb $0x1, -0x11(%rbp)
je 0xae68
movq 0x2714b(%rip), %rdi     # 0x31f98
leaq 0x19b3a(%rip), %rsi     # 0x2498e
callq 0x53d0
movq %rax, %rdi
movq 0x27105(%rip), %rsi     # 0x31f68
callq 0x5410
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x56f0
nopw %cs:(%rax,%rax)
// File: davmac314[P]dinit/src/dinitctl.cc
// Function: trigger_service(int, cpbuffer<1024u>&, char const*, bool)
static int trigger_service(int socknum, cpbuffer_t &rbuffer, const char *service_name, bool trigger_value)
{
    using namespace std;

    handle_t handle;
    if (!load_service(socknum, rbuffer, service_name, &handle, nullptr, true)) {
        return 1;
    }

    // Issue SET_TRIGGER command.
    {
        auto m = membuf()
                .append((char)cp_cmd::SETTRIGGER)
                .append(handle)
                .append<trigger_val_t>(trigger_value);
        write_all_x(socknum, m);

        wait_for_reply(rbuffer, socknum);
        if (rbuffer[0] == (char)cp_rply::NAK) {
            cerr << "dinitctl: cannot trigger a service that is not of 'triggered' type.\n";
            return 1;
        }
        if (rbuffer[0] != (char)cp_rply::ACK) {
            cerr << "dinitctl: protocol error.\n";
            return 1;
        }
        rbuffer.consume(1);
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %cl, %al
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x20(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
movl $0x1, %r9d
callq 0xc5e0
testb $0x1, %al
jne 0xb5e9
movl $0x1, -0x4(%rbp)
jmp 0xb6c3
movb $0x13, -0x2e(%rbp)
leaq -0x2d(%rbp), %rdi
leaq -0x2e(%rbp), %rsi
callq 0x11b60
movb %al, -0x2c(%rbp)
leaq -0x2c(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x131e0
movl %eax, %ecx
movl %ecx, -0x2b(%rbp)
shrq $0x20, %rax
movb %al, -0x27(%rbp)
movb -0x19(%rbp), %al
andb $0x1, %al
movb %al, -0x2f(%rbp)
leaq -0x2b(%rbp), %rdi
leaq -0x2f(%rbp), %rsi
callq 0x1cae0
movl %eax, %ecx
movl %ecx, -0x26(%rbp)
shrq $0x20, %rax
movw %ax, -0x22(%rbp)
movl -0x8(%rbp), %edi
leaq -0x26(%rbp), %rsi
callq 0x11c10
movq -0x10(%rbp), %rdi
movl -0x8(%rbp), %esi
callq 0x11350
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x113e0
movsbl %al, %eax
cmpl $0x33, %eax
jne 0xb67f
movq 0x2697e(%rip), %rdi     # 0x31fe8
leaq 0x19ade(%rip), %rsi     # 0x2514f
callq 0x53d0
movl $0x1, -0x4(%rbp)
jmp 0xb6c3
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x113e0
movsbl %al, %eax
cmpl $0x32, %eax
je 0xb6ae
movq 0x2694f(%rip), %rdi     # 0x31fe8
leaq 0x19af4(%rip), %rsi     # 0x25194
callq 0x53d0
movl $0x1, -0x4(%rbp)
jmp 0xb6c3
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x115f0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: davmac314[P]dinit/src/dinitctl.cc
// Function: main
int main(int argc, char **argv)
{
    try {
        return dinitctl_main(argc, argv);
    }
    catch (std::bad_alloc &e) {
        std::cerr << "dinitctl: out of memory\n";
    }
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x5940
movl %eax, -0x2c(%rbp)
jmp 0xc557
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xc5bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0xc5c5
movq -0x18(%rbp), %rdi
callq 0x5150
movq %rax, -0x28(%rbp)
movq 0x25a5d(%rip), %rdi     # 0x31fe8
leaq 0x178e6(%rip), %rsi     # 0x23e78
callq 0x53d0
jmp 0xc599
callq 0x5680
movl $0x1, -0x4(%rbp)
jmp 0xc5bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x5680
jmp 0xc5ba
jmp 0xc5c5
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x56f0
movq %rax, %rdi
callq 0x103e0
nopw %cs:(%rax,%rax)
// File: davmac314[P]dinit/src/dinitctl.cc
// Function: print_failure_details(stopped_reason_t, unsigned short, int, int, int)
static void print_failure_details(stopped_reason_t stop_reason, uint16_t launch_stage,
        int exit_status, int exit_si_code, int exit_si_status)
{
    using namespace std;

    switch (stop_reason) {
        case stopped_reason_t::DEPFAILED:
            cout << "Reason: a dependency of the service failed to start. "
                    "Check dinit log.\n";
            break;
        case stopped_reason_t::TIMEDOUT:
            cout << "Reason: start timed out.\n";
            break;
        case stopped_reason_t::EXECFAILED:
            cout << "Reason: execution of service process failed:\n";
            cout << "        Stage: " << exec_stage_descriptions[launch_stage] << "\n";
            cout << "        Error: " << strerror(exit_status) << "\n";
            break;
        case stopped_reason_t::FAILED:
            cout << "Reason: service process terminated before ready: ";
            if (exit_si_code != 0 || exit_si_status != 0) {
                print_termination_details(exit_si_code, exit_si_status);
            }
            else {
                print_termination_details(exit_status);
            }
            cout << "\n";
            break;
        default:
            cout << "Reason unknown/unrecognised. Check dinit log.\n";
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movw %si, %ax
movl %edi, -0x4(%rbp)
movw %ax, -0x6(%rbp)
movl %edx, -0xc(%rbp)
movl %ecx, -0x10(%rbp)
movl %r8d, -0x14(%rbp)
movl -0x4(%rbp), %eax
addl $-0x2, %eax
movl %eax, %ecx
movq %rcx, -0x20(%rbp)
subl $0x3, %eax
ja 0xcc98
movq -0x20(%rbp), %rax
leaq 0x164c8(%rip), %rcx     # 0x23054
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x253fc(%rip), %rdi     # 0x31f98
leaq 0x17795(%rip), %rsi     # 0x24338
callq 0x53d0
jmp 0xccab
movq 0x253e4(%rip), %rdi     # 0x31f98
leaq 0x177c4(%rip), %rsi     # 0x2437f
callq 0x53d0
jmp 0xccab
movq 0x253cc(%rip), %rdi     # 0x31f98
leaq 0x177c6(%rip), %rsi     # 0x24399
callq 0x53d0
movq 0x253b9(%rip), %rdi     # 0x31f98
leaq 0x177e1(%rip), %rsi     # 0x243c7
callq 0x53d0
movq %rax, %rdi
movzwl -0x6(%rbp), %eax
movl %eax, %ecx
leaq 0x25025(%rip), %rax     # 0x31c20
movq (%rax,%rcx,8), %rsi
callq 0x53d0
movq %rax, %rdi
leaq 0x17ea7(%rip), %rsi     # 0x24ab5
callq 0x53d0
movq 0x2537e(%rip), %rdi     # 0x31f98
leaq 0x177b6(%rip), %rsi     # 0x243d7
callq 0x53d0
movq %rax, -0x28(%rbp)
movl -0xc(%rbp), %edi
callq 0x5100
movq -0x28(%rbp), %rdi
movq %rax, %rsi
callq 0x53d0
movq %rax, %rdi
leaq 0x17e6d(%rip), %rsi     # 0x24ab5
callq 0x53d0
jmp 0xccab
movq 0x25342(%rip), %rdi     # 0x31f98
leaq 0x1778a(%rip), %rsi     # 0x243e7
callq 0x53d0
cmpl $0x0, -0x10(%rbp)
jne 0xcc6e
cmpl $0x0, -0x14(%rbp)
je 0xcc7b
movl -0x10(%rbp), %edi
movl -0x14(%rbp), %esi
callq 0xd240
jmp 0xcc83
movl -0xc(%rbp), %edi
callq 0xd2c0
movq 0x2530e(%rip), %rdi     # 0x31f98
leaq 0x17e24(%rip), %rsi     # 0x24ab5
callq 0x53d0
jmp 0xccab
movq 0x252f9(%rip), %rdi     # 0x31f98
leaq 0x17773(%rip), %rsi     # 0x24419
callq 0x53d0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: davmac314[P]dinit/src/dinitctl.cc
// Function: print_termination_details(int, int)
static void print_termination_details(int exit_si_code, int exit_si_status)
{
    using namespace std;

    if (exit_si_code == CLD_KILLED) {
        cout << "signalled - signal ";
        cout << exit_si_status;
    }
    else if (exit_si_code == CLD_EXITED) {
        cout << "exited - status ";
        cout << exit_si_status;
    }
    else {
        cout << "unknown reason";
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
cmpl $0x2, -0x4(%rbp)
jne 0xd278
movq 0x24d3d(%rip), %rdi     # 0x31f98
leaq 0x1730f(%rip), %rsi     # 0x24571
callq 0x53d0
movl -0x8(%rbp), %esi
movq 0x24d27(%rip), %rdi     # 0x31f98
callq 0x56d0
jmp 0xd2b7
cmpl $0x1, -0x4(%rbp)
jne 0xd2a2
movq 0x24d13(%rip), %rdi     # 0x31f98
leaq 0x172f9(%rip), %rsi     # 0x24585
callq 0x53d0
movl -0x8(%rbp), %esi
movq 0x24cfd(%rip), %rdi     # 0x31f98
callq 0x56d0
jmp 0xd2b5
movq 0x24cef(%rip), %rdi     # 0x31f98
leaq 0x172e6(%rip), %rsi     # 0x24596
callq 0x53d0
jmp 0xd2b7
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: davmac314[P]dinit/src/dinitctl.cc
// Function: print_termination_details(int)
static void print_termination_details(int exit_status)
{
    using namespace std;

    if (WIFSIGNALED(exit_status)) {
        cout << "signalled - signal ";
        cout << WTERMSIG(exit_status);
    }
    else if (WIFEXITED(exit_status)) {
        cout << "exited - status ";
        cout << WEXITSTATUS(exit_status);
    }
    else {
        cout << "unknown reason";
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
andl $0x7f, %eax
addl $0x1, %eax
movsbl %al, %eax
sarl %eax
cmpl $0x0, %eax
jle 0xd305
movq 0x24cb3(%rip), %rdi     # 0x31f98
leaq 0x17285(%rip), %rsi     # 0x24571
callq 0x53d0
movl -0x4(%rbp), %esi
andl $0x7f, %esi
movq 0x24c9a(%rip), %rdi     # 0x31f98
callq 0x56d0
jmp 0xd352
movl -0x4(%rbp), %eax
andl $0x7f, %eax
cmpl $0x0, %eax
jne 0xd33d
movq 0x24c81(%rip), %rdi     # 0x31f98
leaq 0x17267(%rip), %rsi     # 0x24585
callq 0x53d0
movl -0x4(%rbp), %esi
andl $0xff00, %esi           # imm = 0xFF00
sarl $0x8, %esi
movq 0x24c62(%rip), %rdi     # 0x31f98
callq 0x56d0
jmp 0xd350
movq 0x24c54(%rip), %rdi     # 0x31f98
leaq 0x1724b(%rip), %rsi     # 0x24596
callq 0x53d0
jmp 0xd352
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: davmac314[P]dinit/src/dinitctl.cc
// Function: get_service_descr_filename[abi:cxx11](int, cpbuffer<1024u>&, unsigned int, char const*)
static std::string get_service_descr_filename(int socknum, cpbuffer_t &rbuffer, handle_t service_handle,
        const char *service_name)
{
    std::string r = get_service_description_dir(socknum, rbuffer, service_handle);
    if (r.empty())
        throw dinit_protocol_error();
    if (r.back() != '/')
        r.append(1, '/');

    // Check for service argument which must be stripped
    auto at_ptr = service_name;
    while (*at_ptr != '\0' && *at_ptr != '@') ++at_ptr;

    r.append(service_name, at_ptr);
    return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x50(%rbp)
movq %rdi, %rax
movq %rax, -0x58(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movb $0x0, -0x29(%rbp)
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %ecx
callq 0xd490
movq -0x50(%rbp), %rdi
callq 0x56a0
testb $0x1, %al
jne 0xd3a7
jmp 0xd3e3
movl $0x1, %edi
callq 0x51c0
movq %rax, %rdi
leaq 0x24725(%rip), %rsi     # 0x31ae0
xorl %eax, %eax
movl %eax, %edx
callq 0x56b0
jmp 0xd484
movq -0x50(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x5280
jmp 0xd47b
movq -0x50(%rbp), %rdi
callq 0x52e0
movsbl (%rax), %eax
cmpl $0x2f, %eax
je 0xd40b
movq -0x50(%rbp), %rdi
movl $0x1, %esi
movl $0x2f, %edx
callq 0x5430
jmp 0xd409
jmp 0xd40b
movq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x59(%rbp)
je 0xd434
movq -0x48(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x40, %eax
setne %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %al
testb $0x1, %al
jne 0xd43d
jmp 0xd44b
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0xd413
movq -0x50(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x15710
jmp 0xd45e
movb $0x1, -0x29(%rbp)
testb $0x1, -0x29(%rbp)
jne 0xd471
movq -0x50(%rbp), %rdi
callq 0x5280
movq -0x58(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x56f0
nopw %cs:(%rax,%rax)
// File: davmac314[P]dinit/src/includes/load-service.h
// Function: dinit_load::signal_name_to_number(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
inline int signal_name_to_number(const std::string &signame) noexcept
{
    int sig = -1;
    for (const auto &signal: signal_to_int_map) {
        if (signal.first == signame) {
            sig = signal.second;
            break;
        }
    }
    return sig;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl $0xffffffff, -0xc(%rbp) # imm = 0xFFFFFFFF
leaq 0x21856(%rip), %rax     # 0x31b70
movq %rax, -0x18(%rbp)
leaq 0x2184b(%rip), %rax     # 0x31b70
movq %rax, -0x20(%rbp)
leaq 0x21840(%rip), %rax     # 0x31b70
addq $0xb0, %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
je 0x10386
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0x10c90
movb %al, -0x31(%rbp)
jmp 0x10361
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x1036a
jmp 0x10376
movq -0x30(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0xc(%rbp)
jmp 0x10386
jmp 0x10378
movq -0x20(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x20(%rbp)
jmp 0x1033a
movl -0xc(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
movq %rax, %rdi
callq 0x103e0
nopw (%rax,%rax)
// File: davmac314[P]dinit/src/includes/dinit-client.h
// Function: wait_for_info(cpbuffer<1024u>&, int)
inline void wait_for_info(cpbuffer_t &rbuffer, int fd)
{
    fill_buffer_to(rbuffer, fd, 2);

    if (rbuffer[0] < 100) {
        throw cp_read_exception(0);
    }

    int pktlen = (unsigned char) rbuffer[1];
    fill_buffer_to(rbuffer, fd, pktlen);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl $0x2, %edx
callq 0x11440
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x113e0
movsbl %al, %eax
cmpl $0x64, %eax
jge 0x1344b
movl $0x4, %edi
callq 0x51c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x28(%rbp)
xorl %esi, %esi
callq 0x11420
jmp 0x13420
movq -0x28(%rbp), %rdi
leaq 0x1e6f5(%rip), %rsi     # 0x31b20
xorl %eax, %eax
movl %eax, %edx
callq 0x56b0
movq -0x28(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x52f0
jmp 0x13474
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x113e0
movzbl %al, %eax
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x20(%rbp), %edx
callq 0x11440
addq $0x30, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x56f0
nopl (%rax)
// File: davmac314[P]dinit/src/includes/dinit-util.h
// Function: combine_paths[abi:cxx11](string_view, char const*)
inline std::string combine_paths(string_view p1, const char *p2)
{
    if (*p2 == 0) return (std::string)p1;
    if (p1.empty()) return std::string(p2);

    if (p2[0] == '/') return p2;

    if (*(p1.rbegin()) == '/') return (std::string)p1 + p2;
    return (std::string)p1 + '/' + p2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0xb0(%rbp)
movq %rdi, %rax
movq %rax, -0xa8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x10(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x13f6d
movq -0xb0(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x178c0
jmp 0x14145
leaq -0x18(%rbp), %rdi
callq 0x15c60
testb $0x1, %al
jne 0x13f7c
jmp 0x13fdb
movq -0x20(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0x21(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x5700
movq -0xb0(%rbp), %rdi
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rdx
callq 0x10f00
jmp 0x13fb3
leaq -0x21(%rbp), %rdi
callq 0x5440
jmp 0x14145
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x21(%rbp), %rdi
callq 0x5440
jmp 0x14155
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
jne 0x14046
movq -0x20(%rbp), %rax
movq %rax, -0xd0(%rbp)
leaq -0x35(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x5700
movq -0xb0(%rbp), %rdi
movq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
callq 0x10f00
jmp 0x1401e
leaq -0x35(%rbp), %rdi
callq 0x5440
jmp 0x14145
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x35(%rbp), %rdi
callq 0x5440
jmp 0x14155
leaq -0x40(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x17970
leaq -0x40(%rbp), %rdi
callq 0x179c0
movsbl (%rax), %eax
cmpl $0x2f, %eax
jne 0x140b9
leaq -0x60(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
leaq -0x18(%rbp), %rsi
callq 0x178c0
movq -0xb0(%rbp), %rdi
movq -0xd8(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x19af0
jmp 0x14091
leaq -0x60(%rbp), %rdi
callq 0x5280
jmp 0x14145
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x5280
jmp 0x14155
leaq -0xa0(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
leaq -0x18(%rbp), %rsi
callq 0x178c0
movq -0xe0(%rbp), %rsi
leaq -0x80(%rbp), %rdi
movl $0x2f, %edx
callq 0x17a90
jmp 0x140e7
movq -0xb0(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq -0x80(%rbp), %rsi
callq 0x19af0
jmp 0x140fd
leaq -0x80(%rbp), %rdi
callq 0x5280
leaq -0xa0(%rbp), %rdi
callq 0x5280
jmp 0x14145
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x14137
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x5280
leaq -0xa0(%rbp), %rdi
callq 0x5280
jmp 0x14155
movq -0xa8(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x56f0
nop
// File: davmac314[P]dinit/src/includes/dinit-util.h
// Function: parent_path(string_view)
inline string_view parent_path(string_view p)
{
    auto spos = p.rfind('/');
    if (spos == std::string::npos) {
        return string_view {};
    }

    // In case there are multiple slashes, remove the duplicates:
    while (spos > 0 && p[spos - 1] == '/') --spos;

    if (spos == 0) {
        // special case (parent is root directory)
        return {p.data(), 1};
    }

    return p.substr(0, spos);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x20(%rbp)
movq %rsi, -0x18(%rbp)
leaq -0x20(%rbp), %rdi
movl $0x2f, %esi
callq 0x1bf70
movq %rax, -0x28(%rbp)
cmpq $-0x1, -0x28(%rbp)
jne 0x141a7
leaq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x5200
leaq -0x10(%rbp), %rdi
callq 0x1b640
jmp 0x14227
jmp 0x141a9
xorl %eax, %eax
cmpq $0x0, -0x28(%rbp)
movb %al, -0x29(%rbp)
jbe 0x141d4
movq -0x28(%rbp), %rax
subq $0x1, %rax
movl %eax, %esi
leaq -0x20(%rbp), %rdi
callq 0x17950
movsbl %al, %eax
cmpl $0x2f, %eax
sete %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0x141dd
jmp 0x141eb
movq -0x28(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x141a9
cmpq $0x0, -0x28(%rbp)
jne 0x1420e
leaq -0x20(%rbp), %rdi
callq 0x1b6e0
movq %rax, %rsi
leaq -0x10(%rbp), %rdi
movl $0x1, %edx
callq 0x15c10
jmp 0x14227
movq -0x28(%rbp), %rdx
leaq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1c030
movq %rax, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: davmac314[P]dinit/src/includes/dinit-client.h
// Function: read_string[abi:cxx11](int, cpbuffer<1024u>&, unsigned int)
inline std::string read_string(int socknum, cpbuffer_t &rbuffer, uint32_t length)
{
    int rb_len = rbuffer.get_length();
    if (uint32_t(rb_len) >= length) {
        std::string r = rbuffer.extract_string(0, length);
        rbuffer.consume(length);
        return r;
    }

    std::string r = rbuffer.extract_string(0, rb_len);
    uint32_t rlen = length - rb_len;
    uint32_t clen;
    do {
        rbuffer.reset();
        fill_some(rbuffer, socknum);
        char *bptr = rbuffer.get_ptr(0);
        clen = rbuffer.get_length();
        clen = std::min(clen, rlen);
        r.append(bptr, clen);
        rlen -= clen;
    } while (rlen > 0);

    rbuffer.consume(clen);

    return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x58(%rbp)
movq %rdi, %rax
movq %rax, -0x50(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x18(%rbp), %rdi
callq 0x12f00
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jb 0x145bf
movq -0x58(%rbp), %rdi
movb $0x0, -0x21(%rbp)
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %ecx
xorl %edx, %edx
callq 0x146d0
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x115f0
movb $0x1, -0x21(%rbp)
testb $0x1, -0x21(%rbp)
jne 0x145ba
movq -0x58(%rbp), %rdi
callq 0x5280
jmp 0x14683
movq -0x58(%rbp), %rdi
movb $0x0, -0x22(%rbp)
movq -0x18(%rbp), %rsi
movl -0x20(%rbp), %ecx
xorl %edx, %edx
callq 0x146d0
movl -0x1c(%rbp), %eax
subl -0x20(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x148a0
jmp 0x145e9
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x12f20
jmp 0x145f7
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x130a0
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
callq 0x12f00
movl %eax, -0x2c(%rbp)
leaq -0x2c(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x11840
movq -0x58(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x48(%rbp), %rsi
movl -0x2c(%rbp), %eax
movl %eax, %edx
callq 0x5080
jmp 0x14638
movl -0x2c(%rbp), %ecx
movl -0x28(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
ja 0x145de
movq -0x18(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x115f0
movb $0x1, -0x22(%rbp)
testb $0x1, -0x22(%rbp)
jne 0x14681
jmp 0x14678
movq -0x58(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x5280
jmp 0x1468d
movq -0x58(%rbp), %rdi
callq 0x5280
jmp 0x14683
movq -0x50(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x56f0
nopw %cs:(%rax,%rax)
// File: davmac314[P]dinit/src/includes/cpbuffer.h
// Function: cpbuffer<1024u>::extract_string[abi:cxx11](unsigned int, unsigned int)
std::string extract_string(unsigned index, unsigned length)
    {
        index += cur_idx;
        if (index >= SIZE) index -= SIZE;
        if (index + length > SIZE) {
            std::string r(buf + index, SIZE - index);
            r.insert(r.end(), buf, buf + length - (SIZE - index));
            return r;
        }
        else {
            return std::string(buf + index, length);
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x68(%rbp)
movq %rdi, %rax
movq %rax, -0x60(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movl 0x400(%rax), %eax
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
cmpl $0x400, -0x14(%rbp)     # imm = 0x400
jb 0x1471c
movl -0x14(%rbp), %eax
subl $0x400, %eax            # imm = 0x400
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addl -0x18(%rbp), %eax
cmpl $0x400, %eax            # imm = 0x400
jbe 0x1481b
movq -0x58(%rbp), %rax
movb $0x0, -0x19(%rbp)
movl -0x14(%rbp), %ecx
movl %ecx, %edx
movl %edx, %ecx
addq %rdx, %rax
movq %rax, -0x80(%rbp)
movl $0x400, %eax            # imm = 0x400
subl %ecx, %eax
movq %rax, -0x78(%rbp)
leaq -0x1a(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0x5700
movq -0x68(%rbp), %rdi
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
movq -0x70(%rbp), %rcx
callq 0x5480
jmp 0x14772
leaq -0x1a(%rbp), %rdi
callq 0x5440
movq -0x68(%rbp), %rdi
callq 0x5240
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x14960
movq -0x68(%rbp), %rdi
movq -0x58(%rbp), %rdx
movl -0x18(%rbp), %eax
movq %rdx, %rcx
addq %rax, %rcx
movl -0x14(%rbp), %esi
movl $0x400, %eax            # imm = 0x400
subl %esi, %eax
subq %rax, %rcx
movq -0x38(%rbp), %rsi
callq 0x148d0
movq %rax, -0x88(%rbp)
jmp 0x147c5
movq -0x88(%rbp), %rax
movq %rax, -0x48(%rbp)
movb $0x1, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
jne 0x14819
jmp 0x14810
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x1a(%rbp), %rdi
callq 0x5440
jmp 0x14895
movq -0x68(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x5280
jmp 0x14895
movq -0x68(%rbp), %rdi
callq 0x5280
jmp 0x14888
movq -0x58(%rbp), %rax
movl -0x14(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
movl -0x18(%rbp), %eax
movq %rax, -0x98(%rbp)
leaq -0x49(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0x5700
movq -0x68(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rdx
movq -0x90(%rbp), %rcx
callq 0x5480
jmp 0x14866
leaq -0x49(%rbp), %rdi
callq 0x5440
jmp 0x14888
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x49(%rbp), %rdi
callq 0x5440
jmp 0x14895
movq -0x60(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x56f0
nop
// File: davmac314[P]dinit/src/includes/dinit-util.h
// Function: combine_paths[abi:cxx11](string_view, string_view)
inline std::string combine_paths(string_view p1, string_view p2)
{
    if (p2.empty()) return (std::string)p1;
    if (p1.empty()) return (std::string)p2;

    if (p2[0] == '/') return p2;

    if (*(p1.rbegin()) == '/') return (std::string)p1 + p2;
    return (std::string)p1 + '/' + p2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0xb0(%rbp)
movq %rdi, %rax
movq %rax, -0xa8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x10(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x20(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x15c60
testb $0x1, %al
jne 0x176ef
jmp 0x17704
movq -0xb0(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x178c0
jmp 0x1784f
leaq -0x18(%rbp), %rdi
callq 0x15c60
testb $0x1, %al
jne 0x17713
jmp 0x17728
movq -0xb0(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x178c0
jmp 0x1784f
leaq -0x28(%rbp), %rdi
xorl %esi, %esi
callq 0x17950
movsbl %al, %eax
cmpl $0x2f, %eax
jne 0x17750
movq -0xb0(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x178c0
jmp 0x1784f
leaq -0x30(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x17970
leaq -0x30(%rbp), %rdi
callq 0x179c0
movsbl (%rax), %eax
cmpl $0x2f, %eax
jne 0x177c3
leaq -0x50(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
leaq -0x18(%rbp), %rsi
callq 0x178c0
movq -0xb0(%rbp), %rdi
movq -0xb8(%rbp), %rsi
leaq -0x28(%rbp), %rdx
callq 0x179f0
jmp 0x1779b
leaq -0x50(%rbp), %rdi
callq 0x5280
jmp 0x1784f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x5280
jmp 0x1785f
leaq -0xa0(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
leaq -0x18(%rbp), %rsi
callq 0x178c0
movq -0xc0(%rbp), %rsi
leaq -0x80(%rbp), %rdi
movl $0x2f, %edx
callq 0x17a90
jmp 0x177f1
movq -0xb0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
leaq -0x28(%rbp), %rdx
callq 0x179f0
jmp 0x17807
leaq -0x80(%rbp), %rdi
callq 0x5280
leaq -0xa0(%rbp), %rdi
callq 0x5280
jmp 0x1784f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x17841
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x5280
leaq -0xa0(%rbp), %rdi
callq 0x5280
jmp 0x1785f
movq -0xa8(%rbp), %rax
addq $0xc0, %rsp
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x56f0
nopl (%rax,%rax)
// File: davmac314[P]dinit/src/includes/file-input-stack.h
// Function: file_input_stack::getline(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool getline(std::string &rline)
    {
        while (!input_stack.empty()) {
            input_file &top = input_stack.top();
            top.line_num++;

            if (top.stream.get_line_until_eof_nx(rline)) {
                return true;
            }

            top.stream.throw_exception_on(dio::buffer_fail_bit | dio::input_fail_bit | dio::io_fail_bit);
            input_stack.pop();
        }
        return false;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x19d40
xorb $-0x1, %al
testb $0x1, %al
jne 0x192d9
jmp 0x1932a
movq -0x28(%rbp), %rdi
callq 0x19d60
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl 0x38(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x38(%rax)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0xa, %edx
callq 0x21bc0
testb $0x1, %al
jne 0x1930b
jmp 0x19311
movb $0x1, -0x1(%rbp)
jmp 0x1932e
movq -0x20(%rbp), %rdi
movl $0xe, %esi
callq 0x20f20
movq -0x28(%rbp), %rdi
callq 0x19d80
jmp 0x192c8
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: davmac314[P]dinit/src/includes/file-input-stack.h
// Function: file_input_stack::getline_same_file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool getline_same_file(std::string &rline)
    {
        if (!input_stack.empty()) {
            input_file &top = input_stack.top();

            if (top.stream.get_line_until_eof_nx(rline)) {
                top.line_num++;
                return true;
            }

            top.stream.throw_exception_on(dio::buffer_fail_bit | dio::input_fail_bit | dio::io_fail_bit);
        }
        return false;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x28(%rbp)
callq 0x19d40
testb $0x1, %al
jne 0x19497
movq -0x28(%rbp), %rdi
callq 0x19d60
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0xa, %edx
callq 0x21bc0
testb $0x1, %al
jne 0x19476
jmp 0x19489
movq -0x20(%rbp), %rax
movl 0x38(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x38(%rax)
movb $0x1, -0x1(%rbp)
jmp 0x1949b
movq -0x20(%rbp), %rdi
movl $0xe, %esi
callq 0x20f20
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: davmac314[P]dinit/src/includes/load-service.h
// Function: dinit_load::skipws(__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>)
inline string_iterator skipws(string_iterator i, string_iterator end) noexcept
{
    using std::locale;
    using std::isspace;

    while (i != end) {
        if (!isspace(*i, locale::classic())) {
            break;
        }
        ++i;
    }
    return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x19700
testb $0x1, %al
jne 0x195c3
jmp 0x19606
leaq -0x10(%rbp), %rdi
callq 0x172b0
movb (%rax), %al
movb %al, -0x21(%rbp)
callq 0x5570
movq %rax, -0x20(%rbp)
jmp 0x195dc
movq -0x20(%rbp), %rsi
movb -0x21(%rbp), %al
movsbl %al, %edi
callq 0x1a3a0
movb %al, -0x22(%rbp)
jmp 0x195f0
movb -0x22(%rbp), %al
testb $0x1, %al
jne 0x195fb
jmp 0x195f9
jmp 0x19606
leaq -0x10(%rbp), %rdi
callq 0x19740
jmp 0x195b0
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
movq %rax, %rdi
callq 0x103e0
// File: davmac314[P]dinit/src/includes/load-service.h
// Function: dinit_load::skipwsln(__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, unsigned int&)
inline string_iterator skipwsln(string_iterator i, string_iterator end, unsigned & count) noexcept
{
    using std::locale;
    using std::isspace;

    while (i != end) {
        if (*i == '\n') ++count;
        if (!isspace(*i, locale::classic())) {
            break;
        }
        ++i;
    }

    return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x19700
testb $0x1, %al
jne 0x19687
jmp 0x196e6
leaq -0x10(%rbp), %rdi
callq 0x172b0
movsbl (%rax), %eax
cmpl $0xa, %eax
jne 0x196a3
movq -0x20(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
leaq -0x10(%rbp), %rdi
callq 0x172b0
movb (%rax), %al
movb %al, -0x29(%rbp)
callq 0x5570
movq %rax, -0x28(%rbp)
jmp 0x196bc
movq -0x28(%rbp), %rsi
movb -0x29(%rbp), %al
movsbl %al, %edi
callq 0x1a3a0
movb %al, -0x2a(%rbp)
jmp 0x196d0
movb -0x2a(%rbp), %al
testb $0x1, %al
jne 0x196db
jmp 0x196d9
jmp 0x196e6
leaq -0x10(%rbp), %rdi
callq 0x19740
jmp 0x19674
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
movq %rax, %rdi
callq 0x103e0
// File: davmac314[P]dinit/src/includes/load-service.h
// Function: dinit_load::skipcomment(__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, unsigned int&)
inline string_iterator skipcomment(string_iterator i, string_iterator end, unsigned & count) noexcept
{
    using std::locale;
    using std::isspace;

    bool comment = false;
    while (i != end) {
        if (*i == '#') {
            comment = true;
        }
        else if (*i == '\n') {
            ++count;
            comment = false;
        }

        if (!comment && !isspace(*i, locale::classic())) break;
        ++i;
    }

    return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movb $0x0, -0x21(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x19700
testb $0x1, %al
jne 0x1ac6e
jmp 0x1acf3
leaq -0x10(%rbp), %rdi
callq 0x172b0
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x1ac85
movb $0x1, -0x21(%rbp)
jmp 0x1aca7
leaq -0x10(%rbp), %rdi
callq 0x172b0
movsbl (%rax), %eax
cmpl $0xa, %eax
jne 0x1aca5
movq -0x20(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movb $0x0, -0x21(%rbp)
jmp 0x1aca7
testb $0x1, -0x21(%rbp)
jne 0x1ace5
leaq -0x10(%rbp), %rdi
callq 0x172b0
movb (%rax), %al
movb %al, -0x31(%rbp)
callq 0x5570
movq %rax, -0x30(%rbp)
jmp 0x1acc6
movq -0x30(%rbp), %rsi
movb -0x31(%rbp), %al
movsbl %al, %edi
callq 0x1a3a0
movb %al, -0x32(%rbp)
jmp 0x1acda
movb -0x32(%rbp), %al
testb $0x1, %al
jne 0x1ace5
jmp 0x1ace3
jmp 0x1acf3
leaq -0x10(%rbp), %rdi
callq 0x19740
jmp 0x1ac58
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
movq %rax, %rdi
callq 0x103e0
nopl (%rax)
// File: davmac314[P]dinit/src/includes/load-service.h
// Function: dinit_load::findws(char const*, char const*)
inline const char *findws(const char *i, const char *end) noexcept
{
    using std::locale;
    using std::isspace;

    while (i != end) {
        if (isspace(*i, locale::classic())) {
            break;
        }
        ++i;
    }
    return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq -0x10(%rbp), %rax
je 0x1b75b
movq -0x8(%rbp), %rax
movb (%rax), %al
movb %al, -0x19(%rbp)
callq 0x5570
movq %rax, -0x18(%rbp)
jmp 0x1b72e
movq -0x18(%rbp), %rsi
movb -0x19(%rbp), %al
movsbl %al, %edi
callq 0x1a3a0
movb %al, -0x1a(%rbp)
jmp 0x1b742
movb -0x1a(%rbp), %al
testb $0x1, %al
jne 0x1b74b
jmp 0x1b74d
jmp 0x1b75b
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x1b710
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
movq %rax, %rdi
callq 0x103e0
nopl (%rax)
// File: davmac314[P]dinit/src/includes/load-service.h
// Function: dinit_load::skipws(char const*, char const*)
inline const char *skipws(const char *i, const char *end) noexcept
{
    using std::locale;
    using std::isspace;

    while (i != end) {
        if (!isspace(*i, locale::classic())) {
            break;
        }
        ++i;
    }
    return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq -0x10(%rbp), %rax
je 0x1b88b
movq -0x8(%rbp), %rax
movb (%rax), %al
movb %al, -0x19(%rbp)
callq 0x5570
movq %rax, -0x18(%rbp)
jmp 0x1b85e
movq -0x18(%rbp), %rsi
movb -0x19(%rbp), %al
movsbl %al, %edi
callq 0x1a3a0
movb %al, -0x1a(%rbp)
jmp 0x1b872
movb -0x1a(%rbp), %al
testb $0x1, %al
jne 0x1b87d
jmp 0x1b87b
jmp 0x1b88b
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x1b840
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
movq %rax, %rdi
callq 0x103e0
nopl (%rax)
// File: davmac314[P]dinit/src/options-processing.cc
// Function: service_dir_opt::get_user_home()
const char *service_dir_opt::get_user_home()
{
    if (user_home_path == nullptr) {
        user_home_path = getenv("HOME");
        if (user_home_path == nullptr) {
            struct passwd * pwuid_p = getpwuid(getuid());
            if (pwuid_p != nullptr) {
                user_home_path = pwuid_p->pw_dir;
            }
        }
    }
    return user_home_path;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
cmpq $0x0, 0x15240(%rip)     # 0x32770
jne 0x1d579
leaq 0x7efb(%rip), %rdi      # 0x25434
callq 0x54f0
movq %rax, 0x1522b(%rip)     # 0x32770
cmpq $0x0, 0x15223(%rip)     # 0x32770
jne 0x1d577
callq 0x51d0
movl %eax, %edi
callq 0x54b0
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x1d575
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x151fb(%rip)     # 0x32770
jmp 0x1d577
jmp 0x1d579
movq 0x151f0(%rip), %rax     # 0x32770
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: davmac314[P]dinit/src/dinit-iostream.cc
// Function: dio::ostream::throw_exception_on(int)
void ostream::throw_exception_on(const int states)
{
    if ((states & io_states::buffer_fail_bit) && buffer_failure()) {
        throw std::bad_alloc();
    }
    if ((states & io_states::io_fail_bit) && io_failure()) {
        throw iostream_system_err(io_failure());
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movl -0xc(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1ff7e
movq -0x28(%rbp), %rdi
callq 0x20000
testb $0x1, %al
jne 0x1ff51
jmp 0x1ff7e
movl $0x8, %edi
callq 0x51c0
movq %rax, %rdi
movq %rdi, -0x30(%rbp)
callq 0x21fe0
movq -0x30(%rbp), %rdi
movq 0x1202e(%rip), %rsi     # 0x31fa0
movq 0x11ff7(%rip), %rdx     # 0x31f70
callq 0x56b0
movl -0xc(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x1ffea
movq -0x28(%rbp), %rdi
callq 0x20030
cmpl $0x0, %eax
je 0x1ffea
movl $0x4, %edi
callq 0x51c0
movq -0x28(%rbp), %rdi
movq %rax, -0x38(%rbp)
movq %rax, -0x40(%rbp)
callq 0x20030
movq -0x38(%rbp), %rdi
movl %eax, %esi
callq 0x22020
jmp 0x1ffbf
movq -0x40(%rbp), %rdi
leaq 0x11d4e(%rip), %rsi     # 0x31d18
xorl %eax, %eax
movl %eax, %edx
callq 0x56b0
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x52f0
jmp 0x1fff0
addq $0x40, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x56f0
nopl (%rax)
// File: davmac314[P]dinit/src/dinit-iostream.cc
// Function: dio::ostream::open_nx(char const*)
bool ostream::open_nx(const char *path) noexcept
{
    fd = bp_sys::open(path, O_WRONLY);
    if (fd < 0) {
        io_error = errno;
        return false;
    }

    buf = std::unique_ptr<streambuf>(new(std::nothrow) streambuf);
    if (!buf) {
        bp_sys::close(fd);
        fd = -1;
        return false;
    }

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl $0x1, %esi
callq 0x5300
movl %eax, -0x30(%rbp)
jmp 0x2007d
movq -0x38(%rbp), %rax
movl -0x30(%rbp), %ecx
movl %ecx, (%rax)
cmpl $0x0, (%rax)
jge 0x200a5
callq 0x5050
movq %rax, %rcx
movq -0x38(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, 0x10(%rax)
movb $0x0, -0x1(%rbp)
jmp 0x2013f
movl $0x4008, %edi           # imm = 0x4008
movq 0x11ea7(%rip), %rsi     # 0x31f58
callq 0x57b0
movq %rax, %rcx
movq %rcx, -0x48(%rbp)
movb $0x0, -0x29(%rbp)
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, -0x40(%rbp)
je 0x200e6
movq -0x48(%rbp), %rdi
movq %rdi, -0x28(%rbp)
movb $0x1, -0x29(%rbp)
callq 0x1bd70
movq -0x48(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x1bda0
movq -0x38(%rbp), %rdi
addq $0x8, %rdi
leaq -0x20(%rbp), %rsi
callq 0x18830
leaq -0x20(%rbp), %rdi
callq 0x1bdd0
movq -0x38(%rbp), %rdi
addq $0x8, %rdi
callq 0x21ce0
testb $0x1, %al
jne 0x2013b
movq -0x38(%rbp), %rax
movl (%rax), %edi
callq 0x5770
jmp 0x2012b
movq -0x38(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movb $0x0, -0x1(%rbp)
jmp 0x2013f
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
movq %rax, %rdi
callq 0x103e0
nopw %cs:(%rax,%rax)
// File: davmac314[P]dinit/src/dinit-iostream.cc
// Function: dio::ostream::open_nx(char const*, int)
bool ostream::open_nx(const char *path, const int flags) noexcept
{
    buf = std::unique_ptr<streambuf>(new(std::nothrow) streambuf);
    if (!buf) return false;

    fd = bp_sys::open(path, O_WRONLY | flags);
    if (fd < 0) {
        io_error = errno;
        return false;
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movl $0x4008, %edi           # imm = 0x4008
movq 0x11d91(%rip), %rsi     # 0x31f58
callq 0x57b0
movq %rax, %rcx
movq %rcx, -0x40(%rbp)
movb $0x0, -0x29(%rbp)
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, -0x38(%rbp)
je 0x201f8
movq -0x40(%rbp), %rdi
movb $0x1, -0x29(%rbp)
callq 0x1bd70
movq -0x40(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x1bda0
movq -0x48(%rbp), %rdi
addq $0x8, %rdi
leaq -0x28(%rbp), %rsi
callq 0x18830
leaq -0x28(%rbp), %rdi
callq 0x1bdd0
movq -0x48(%rbp), %rdi
addq $0x8, %rdi
callq 0x21ce0
testb $0x1, %al
jne 0x20236
movb $0x0, -0x1(%rbp)
jmp 0x20275
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
orl $0x1, %esi
xorl %eax, %eax
callq 0x5300
movl %eax, -0x4c(%rbp)
jmp 0x2024c
movq -0x48(%rbp), %rax
movl -0x4c(%rbp), %ecx
movl %ecx, (%rax)
cmpl $0x0, (%rax)
jge 0x20271
callq 0x5050
movq %rax, %rcx
movq -0x48(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, 0x10(%rax)
movb $0x0, -0x1(%rbp)
jmp 0x20275
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
movq %rax, %rdi
callq 0x103e0
nopl (%rax,%rax)
// File: davmac314[P]dinit/src/dinit-iostream.cc
// Function: dio::ostream::open_nx(char const*, int, unsigned int)
bool ostream::open_nx(const char *path, const int flags, const mode_t mode) noexcept
{
    buf = std::unique_ptr<streambuf>(new(std::nothrow) streambuf);
    if (!buf) return false;

    fd = bp_sys::open(path, O_WRONLY | flags, mode);
    if (fd < 0) {
        io_error = errno;
        return false;
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movl $0x4008, %edi           # imm = 0x4008
movq 0x11c4e(%rip), %rsi     # 0x31f58
callq 0x57b0
movq %rax, %rcx
movq %rcx, -0x40(%rbp)
movb $0x0, -0x29(%rbp)
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, -0x38(%rbp)
je 0x2033b
movq -0x40(%rbp), %rdi
movb $0x1, -0x29(%rbp)
callq 0x1bd70
movq -0x40(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x1bda0
movq -0x48(%rbp), %rdi
addq $0x8, %rdi
leaq -0x28(%rbp), %rsi
callq 0x18830
leaq -0x28(%rbp), %rdi
callq 0x1bdd0
movq -0x48(%rbp), %rdi
addq $0x8, %rdi
callq 0x21ce0
testb $0x1, %al
jne 0x20379
movb $0x0, -0x1(%rbp)
jmp 0x203bb
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
orl $0x1, %esi
movl -0x20(%rbp), %edx
xorl %eax, %eax
callq 0x5300
movl %eax, -0x4c(%rbp)
jmp 0x20392
movq -0x48(%rbp), %rax
movl -0x4c(%rbp), %ecx
movl %ecx, (%rax)
cmpl $0x0, (%rax)
jge 0x203b7
callq 0x5050
movq %rax, %rcx
movq -0x48(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, 0x10(%rax)
movb $0x0, -0x1(%rbp)
jmp 0x203bb
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
movq %rax, %rdi
callq 0x103e0
nop
// File: davmac314[P]dinit/src/dinit-iostream.cc
// Function: dio::ostream::close_nx()
bool ostream::close_nx() noexcept
{
    if (fd < 0) {
        // Only mark an error if none have been recorded yet:
        if (good()) {
            io_error = EBADF;
        }
        return false;
    }

    if (!flush_nx()) {
        // error state was checked/set by flush_nx() call
        bp_sys::close(fd);
        fd = -1;
        buf.reset();
        return false;
    }

    buf.reset();

    if (bp_sys::close(fd) < 0) {
        io_error = errno;
        fd = -1;
        return false; // Failed
    }

    fd = -1;
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpl $0x0, (%rax)
jge 0x2045c
movq -0x18(%rbp), %rdi
callq 0x1fef0
testb $0x1, %al
jne 0x20448
jmp 0x20453
movq -0x18(%rbp), %rax
movl $0x9, 0x10(%rax)
movb $0x0, -0x1(%rbp)
jmp 0x204e7
movq -0x18(%rbp), %rdi
callq 0x20500
testb $0x1, %al
jne 0x20493
movq -0x18(%rbp), %rax
movl (%rax), %edi
callq 0x5770
jmp 0x20476
movq -0x18(%rbp), %rdi
movl $0xffffffff, (%rdi)     # imm = 0xFFFFFFFF
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x22040
movb $0x0, -0x1(%rbp)
jmp 0x204e7
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x22040
movq -0x18(%rbp), %rax
movl (%rax), %edi
callq 0x5770
movl %eax, -0x1c(%rbp)
jmp 0x204b4
movl -0x1c(%rbp), %eax
cmpl $0x0, %eax
jge 0x204d9
callq 0x5050
movq %rax, %rcx
movq -0x18(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, 0x10(%rax)
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movb $0x0, -0x1(%rbp)
jmp 0x204e7
movq -0x18(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
movq %rax, %rdi
callq 0x103e0
nopw (%rax,%rax)