LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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 std::cout;

    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 %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
cmpl $0x1, %edi
je 0xa822
cmpl $0x2, %edi
jne 0xa849
movq 0x1078f(%rip), %r14     # 0x1afa8
leaq 0x7d5b(%rip), %rsi      # 0x1257b
jmp 0xa830
movq 0x1077f(%rip), %r14     # 0x1afa8
leaq 0x7d5f(%rip), %rsi      # 0x1258f
movq %r14, %rdi
callq 0x42f0
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4500
movq 0x10758(%rip), %rdi     # 0x1afa8
leaq 0x7d49(%rip), %rsi      # 0x125a0
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x42f0
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/dinitctl.cc
// Function: print_termination_details(int)
static void print_termination_details(int exit_status)
{
    using std::cout;

    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 %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
andl $0x7f, %ebx
movl %ebx, %eax
shll $0x18, %eax
addl $0x1000000, %eax        # imm = 0x1000000
cmpl $0x2000000, %eax        # imm = 0x2000000
jl 0xa89a
movq 0x10724(%rip), %r14     # 0x1afa8
leaq 0x7cf0(%rip), %rsi      # 0x1257b
movq %r14, %rdi
callq 0x42f0
movq %r14, %rdi
movl %ebx, %esi
jmp 0xa8d8
testl %ebx, %ebx
je 0xa8b8
movq 0x10703(%rip), %rdi     # 0x1afa8
leaq 0x7cf4(%rip), %rsi      # 0x125a0
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x42f0
movl %edi, %ecx
movq 0x106e7(%rip), %r14     # 0x1afa8
leaq 0x7cc7(%rip), %rsi      # 0x1258f
movq %r14, %rdi
movl %ecx, %ebx
callq 0x42f0
movzbl %bh, %esi
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4500
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/dinitctl.cc
// Function: get_service_description_dir[abi:cxx11](int, cpbuffer<1024u>&, unsigned int)
static std::string get_service_description_dir(int socknum, cpbuffer_t &rbuffer, handle_t service_handle)
{
    auto m = membuf()
            .append((char)cp_cmd::QUERYSERVICEDSCDIR)
            .append<char>(0)
            .append(service_handle);

    write_all_x(socknum, m);
    wait_for_reply(rbuffer, socknum);

    if (rbuffer[0] != (char)cp_rply::SVCDSCDIR) {
        throw dinit_protocol_error();
    }
    rbuffer.consume(1);

    fill_buffer_to(rbuffer, socknum, 4);

    uint32_t sdir_len;
    rbuffer.extract(&sdir_len, 0, sizeof(uint32_t));
    rbuffer.consume(4);

    std::string result_str;
    static_assert(sizeof(unsigned) >= sizeof(uint32_t), "");
    unsigned needed = sdir_len;

    while (needed > 0) {
        unsigned available = rbuffer.get_length();

        if (available == 0) {
            fill_some(rbuffer, socknum);
            available = rbuffer.get_length();
        }

        unsigned to_use = std::min(available, needed);
        size_t orig_len = result_str.length();
        result_str.resize(orig_len + to_use);
        rbuffer.extract(&result_str[orig_len], 0, to_use);
        rbuffer.consume(to_use);
        needed -= to_use;
    }

    return result_str;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
movl %ecx, %eax
shrl $0x10, %eax
shlq $0x10, %rcx
orq $0x16, %rcx
leaq 0x10(%rsp), %rsi
movw %ax, 0x4(%rsi)
movl %ecx, (%rsi)
movl %ebp, %edi
callq 0xb5b9
movq %r14, %rdi
movl %ebp, %esi
callq 0xb2a9
movl 0x400(%r14), %eax
leal -0x400(%rax), %ecx
cmpl $0x400, %eax            # imm = 0x400
cmovbl %eax, %ecx
cmpb $0x4d, (%r14,%rcx)
jne 0xaa01
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0xb41c
pushq $0x4
popq %r15
movq %r14, %rdi
movl %ebp, %esi
movl %r15d, %edx
callq 0xb33a
leaq 0xc(%rsp), %r12
movq %r14, %rdi
movq %r12, %rsi
xorl %edx, %edx
movl %r15d, %ecx
callq 0xb3a0
movq %r14, %rdi
movl %r15d, %esi
callq 0xb41c
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movl (%r12), %r13d
testl %r13d, %r13d
je 0xa9ef
movl 0x404(%r14), %r15d
testl %r15d, %r15d
jne 0xa9b5
movq %r14, %rdi
movl %ebp, %esi
callq 0xb999
movl 0x404(%r14), %r15d
cmpl %r15d, %r13d
cmovbl %r13d, %r15d
movq 0x8(%rbx), %r12
leaq (%r15,%r12), %rsi
movq %rbx, %rdi
callq 0x4430
addq (%rbx), %r12
movq %r14, %rdi
movq %r12, %rsi
xorl %edx, %edx
movl %r15d, %ecx
callq 0xb3a0
movq %r14, %rdi
movl %r15d, %esi
callq 0xb41c
subl %r15d, %r13d
jmp 0xa993
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %rdi
callq 0x4190
leaq 0x100f0(%rip), %rsi     # 0x1ab00
movq %rax, %rdi
xorl %edx, %edx
callq 0x44f0
jmp 0xaa1c
movq %rax, %r14
movq %rbx, %rdi
callq 0x4150
movq %r14, %rdi
callq 0x4510
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
xorl %r15d, %r15d
pushq $-0x1
popq %rbx
leaq 0xff89(%rip), %r12      # 0x1ab90
cmpq $0xb0, %r15
je 0xac29
movq (%r15,%r12), %rdi
movq %r14, %rsi
callq 0xb04c
addq $0x10, %r15
testb %al, %al
je 0xac07
movl -0x8(%r15,%r12), %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
pushq $0x2
popq %rdx
callq 0xb33a
movl 0x400(%r14), %eax
leal -0x400(%rax), %ecx
cmpl $0x400, %eax            # imm = 0x400
cmovbl %eax, %ecx
cmpb $0x63, (%r14,%rcx)
jle 0xbab8
leal 0x1(%rax), %ecx
addl $0xfffffc01, %eax       # imm = 0xFFFFFC01
cmpl $0x400, %ecx            # imm = 0x400
cmovbl %ecx, %eax
movzbl (%r14,%rax), %edx
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xb33a
pushq $0x4
popq %rdi
callq 0x4190
andl $0x0, (%rax)
leaq 0xf076(%rip), %rsi      # 0x1ab40
movq %rax, %rdi
xorl %edx, %edx
callq 0x44f0
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/includes/file-input-stack.h
// Function: file_input_stack::push(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, dio::istream&&, int)
void push(std::string file_name, dio::istream &&file, int parent_dir_fd)
    {
        try {
            input_stack.emplace(std::move(file), std::move(file_name), 0, parent_dir_fd);
        }
        catch (...) {
            // we accept ownership of 'parent_dir_fd' at call:
            bp_sys::close(parent_dir_fd);
            throw;
        }
    }

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rax
leaq 0x8(%rsp), %r8
movl %ecx, (%r8)
leaq 0xc(%rsp), %rcx
andl $0x0, (%rcx)
movq %rdx, %rsi
movq %rax, %rdx
callq 0xce94
addq $0x10, %rsp
popq %rbx
retq
movq %rax, %rdi
callq 0x4120
movl 0x8(%rsp), %edi
callq 0x4590
callq 0x4480
movq %rax, %rbx
callq 0x44e0
movq %rbx, %rdi
callq 0x4510
movq %rax, %rdi
callq 0xac53
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
movq %rsi, (%rsp)
movq %rdx, 0x8(%rsp)
movb (%rcx), %al
testb %al, %al
je 0xbfea
movq %rcx, %r14
testq %rdx, %rdx
je 0xbfd8
cmpb $0x2f, %al
jne 0xbff7
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xb124
jmp 0xc067
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xcbe8
jmp 0xc067
cmpb $0x2f, -0x1(%rsi,%rdx)
jne 0xc023
leaq 0x10(%rsp), %r15
movq %rsp, %rsi
movq %r15, %rdi
callq 0xcbe8
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xd555
leaq 0x10(%rsp), %rdi
jmp 0xc062
leaq 0x30(%rsp), %r15
movq %rsp, %rsi
movq %r15, %rdi
callq 0xcbe8
leaq 0x10(%rsp), %rdi
pushq $0x2f
popq %rdx
movq %r15, %rsi
callq 0xcc49
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0xd555
leaq 0x10(%rsp), %rdi
callq 0x4150
leaq 0x30(%rsp), %rdi
callq 0x4150
movq %rbx, %rax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x4150
jmp 0xc086
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
jmp 0xc095
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x4150
movq %rbx, %rdi
callq 0x4510
// File: /workspace/github_cpp_makefile_star2_O2/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:
subq $0x18, %rsp
leaq 0x8(%rsp), %rax
movq %rdi, (%rax)
movq %rsi, 0x8(%rax)
pushq $0x2f
popq %rsi
movq %rax, %rdi
callq 0xde84
cmpq $-0x1, %rax
je 0xc0f1
movq %rax, %rcx
movq 0x8(%rsp), %rax
pushq $0x1
popq %rdx
movq %rcx, %rsi
subq $0x1, %rcx
jb 0xc0f5
leal -0x1(%rsi), %edi
cmpb $0x2f, (%rax,%rdi)
je 0xc0ce
movq 0x10(%rsp), %rcx
cmpq %rsi, %rcx
cmovbq %rcx, %rsi
movq %rsi, %rdx
jmp 0xc0f5
xorl %eax, %eax
xorl %edx, %edx
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r15d
movq %rdx, %r14
movq %rdi, %rbx
movl 0x404(%rdx), %ecx
movl %r15d, %r12d
subl %ecx, %r12d
jbe 0xc198
movl %esi, %ebp
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0xc1da
andq $0x0, 0x400(%r14)
movq %r14, %rdi
movl %ebp, %esi
callq 0xb999
movl 0x400(%r14), %eax
movl 0x404(%r14), %r13d
leal -0x400(%rax), %esi
cmpl $0x400, %eax            # imm = 0x400
cmovbl %eax, %esi
addq %r14, %rsi
cmpl %r13d, %r12d
movl %r13d, %r15d
cmovbl %r12d, %r15d
movq %rbx, %rdi
movq %r15, %rdx
callq 0x4070
movl %r12d, %eax
subl %r15d, %eax
cmpl %r13d, %r12d
movl %eax, %r12d
ja 0xc142
jmp 0xc1a8
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
movl %r15d, %ecx
callq 0xc1da
movq %r14, %rdi
movl %r15d, %esi
callq 0xb41c
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc1c7
movq %rax, %r14
movq %rbx, %rdi
callq 0x4150
movq %r14, %rdi
callq 0x4510
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r15d
movq %rsi, %r14
movl 0x400(%rsi), %eax
leal (%rax,%rdx), %ecx
cmpl $0x400, %ecx            # imm = 0x400
leal -0x400(%rax,%rdx), %eax
cmovbl %ecx, %eax
movq %rdi, %rbx
leal (%rax,%r15), %ecx
addq %rax, %rsi
cmpl $0x401, %ecx            # imm = 0x401
jb 0xc24c
movl $0x400, %r12d           # imm = 0x400
subl %eax, %r12d
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq (%rsi,%r12), %rdx
movq %rbx, %rdi
callq 0xb1e2
movq (%rbx), %rsi
addq 0x8(%rbx), %rsi
movl %r15d, %ecx
addq %r14, %rcx
subq %r12, %rcx
movq %rbx, %rdi
movq %r14, %rdx
callq 0xc284
jmp 0xc261
movl %r15d, %edx
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
addq %rsi, %rdx
movq %rbx, %rdi
callq 0xb1e2
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x4150
movq %r14, %rdi
callq 0x4510
nop
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/includes/dinit-util.h
// Function: readlink_at_str(int, char const*)
inline std::pair<bool, std::vector<char>> readlink_at_str(int dirfd, const char *path) noexcept
{
    struct stat sb;
    if (bp_sys::fstatat(dirfd, path, &sb, AT_SYMLINK_NOFOLLOW) == -1) {
        return {false, {}};
    }

    size_t vec_size = sb.st_size + 1; // add one for nul terminator

    try {
        std::vector<char> vec_str(vec_size);

        try_read_link:

        ssize_t r = bp_sys::readlinkat(dirfd, path, vec_str.data(), vec_size);

        if (r < 0) {
            return {false, {}};
        }

        if ((size_t)r > vec_size) {
            // Our size estimate was off (link changed?), try again
            vec_size = r;
            vec_str.resize(vec_size);
            goto try_read_link;
        }

        // shrink, or even expand (append nul) as necessary
        vec_str.resize(r + 1);

        return {true, std::move(vec_str)};
    }
    catch (std::bad_alloc &) {
        errno = ENOMEM;
        return {false, {}};
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x38(%rsp), %rdx
movl %esi, %edi
movq %r14, %rsi
movl $0x100, %ecx            # imm = 0x100
callq 0x40c0
cmpl $-0x1, %eax
je 0xc5b2
movq 0x68(%rsp), %r15
incq %r15
movq %rsp, %rdi
leaq 0x20(%rsp), %rdx
movq %r15, %rsi
callq 0xc6d8
movq %rsp, %r12
movq (%rsp), %rdx
movl %ebp, %edi
movq %r14, %rsi
movq %r15, %rcx
callq 0x4080
testq %rax, %rax
js 0xc5ce
movq %rax, %r13
cmpq %r15, %rax
jbe 0xc5f6
movq %r12, %rdi
movq %r13, %rsi
callq 0xc72a
movq %r13, %r15
jmp 0xc584
movq %rsp, %rsi
andq $0x0, 0x10(%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsi)
movb $0x0, (%rbx)
leaq 0x8(%rbx), %rdi
callq 0xc756
jmp 0xc625
leaq 0x20(%rsp), %rsi
andq $0x0, 0x10(%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsi)
movb $0x0, (%rbx)
leaq 0x8(%rbx), %rdi
callq 0xc756
leaq 0x20(%rsp), %rdi
callq 0xc7a0
jmp 0xc625
incq %r13
movq %rsp, %rdi
movq %r13, %rsi
callq 0xc72a
movb $0x1, (%rbx)
movaps (%rsp), %xmm0
movups %xmm0, 0x8(%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x18(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
movq %rsp, %rdi
callq 0xc7a0
movq %rbx, %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc65e
movq %rdx, %r15
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0xc7a0
jmp 0xc664
movq %rdx, %r15
movq %rax, %r14
jmp 0xc66c
movq %rdx, %r15
movq %rax, %r14
movq %rsp, %rdi
callq 0xc7a0
movq %r14, %rdi
cmpl $0x2, %r15d
jne 0xc6b4
callq 0x4120
callq 0x4040
movl $0xc, (%rax)
movq %rsp, %rsi
andq $0x0, 0x10(%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsi)
movb $0x0, (%rbx)
leaq 0x8(%rbx), %rdi
callq 0xc756
movq %rsp, %rdi
callq 0xc7a0
callq 0x44e0
jmp 0xc62d
movq %rax, %rdi
callq 0xac53
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movq %rsi, 0x18(%rsp)
movq %rdx, 0x20(%rsp)
movq %rcx, 0x8(%rsp)
movq %r8, 0x10(%rsp)
testq %r8, %r8
je 0xcb25
testq %rdx, %rdx
je 0xcb1e
cmpb $0x2f, (%rcx)
jne 0xcb3d
leaq 0x8(%rsp), %rsi
jmp 0xcb2a
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0xcbe8
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r14
retq
cmpb $0x2f, -0x1(%rsi,%rdx)
jne 0xcb6d
leaq 0x28(%rsp), %r14
leaq 0x18(%rsp), %rsi
movq %r14, %rdi
callq 0xcbe8
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xcc0a
leaq 0x28(%rsp), %rdi
jmp 0xcbb0
leaq 0x48(%rsp), %r14
leaq 0x18(%rsp), %rsi
movq %r14, %rdi
callq 0xcbe8
leaq 0x28(%rsp), %rdi
pushq $0x2f
popq %rdx
movq %r14, %rsi
callq 0xcc49
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0xcc0a
leaq 0x28(%rsp), %rdi
callq 0x4150
leaq 0x48(%rsp), %rdi
callq 0x4150
jmp 0xcb32
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x4150
jmp 0xcbcc
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
jmp 0xcbdb
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x4150
movq %rbx, %rdi
callq 0x4510
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0xa
popq %rbp
movq 0x10(%r14), %r13
movq 0x30(%r14), %r15
cmpq %r13, %r15
je 0xd285
movq %r15, %r12
cmpq 0x38(%r14), %r15
jne 0xd256
movq 0x48(%r14), %rax
movq -0x8(%rax), %r12
movl $0x200, %eax            # imm = 0x200
addq %rax, %r12
incl -0x8(%r12)
addq $-0x40, %r12
movq %r12, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0xff70
testb %al, %al
jne 0xd285
movq %r12, %rdi
pushq $0xe
popq %rsi
callq 0xf9be
movq %r14, %rdi
callq 0xd678
jmp 0xd230
cmpq %r13, %r15
setne %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
cmpq %r14, %rbx
je 0xd36c
movb (%rbx), %bpl
callq 0x4400
movsbl %bpl, %edi
movq %rax, %rsi
callq 0xd729
testb %al, %al
je 0xd36c
incq %rbx
jmp 0xd34a
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rdi
callq 0xac53
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
cmpq %r15, %r14
je 0xd3b9
movb (%r14), %bpl
cmpb $0xa, %bpl
jne 0xd39f
incl (%rbx)
movb (%r14), %bpl
callq 0x4400
movsbl %bpl, %edi
movq %rax, %rsi
callq 0xd729
testb %al, %al
je 0xd3b9
incq %r14
jmp 0xd38c
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0xac53
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
xorl %ecx, %ecx
cmpq %r15, %r14
je 0xdafd
movzbl (%r14), %ebp
movb $0x1, %al
cmpl $0x23, %ebp
je 0xdaf6
cmpl $0xa, %ebp
jne 0xdada
incl (%rbx)
movb (%r14), %bpl
jmp 0xdadf
testb $0x1, %cl
jne 0xdaf6
callq 0x4400
movsbl %bpl, %edi
movq %rax, %rsi
callq 0xd729
testb %al, %al
je 0xdafd
xorl %eax, %eax
incq %r14
movl %eax, %ecx
jmp 0xdabe
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0xac53
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
cmpq %r14, %rbx
je 0xdcef
movb (%rbx), %bpl
callq 0x4400
movsbl %bpl, %edi
movq %rax, %rsi
callq 0xd729
testb %al, %al
jne 0xdcef
incq %rbx
jmp 0xdccd
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rdi
callq 0xac53
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
cmpq %r14, %rbx
je 0xdd49
movb (%rbx), %bpl
callq 0x4400
movsbl %bpl, %edi
movq %rax, %rsi
callq 0xd729
testb %al, %al
je 0xdd49
incq %rbx
jmp 0xdd27
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rdi
callq 0xac53
nop
// File: /workspace/github_cpp_makefile_star2_O2/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:
movq 0xd3a9(%rip), %rax      # 0x1b670
testq %rax, %rax
je 0xe2cd
retq
pushq %rax
leaq 0x519c(%rip), %rdi      # 0x13471
callq 0x43a0
movq %rax, 0xd38f(%rip)      # 0x1b670
testq %rax, %rax
jne 0xe30b
callq 0x41a0
movl %eax, %edi
callq 0x4370
testq %rax, %rax
je 0xe304
movq 0x20(%rax), %rax
movq %rax, 0xd36e(%rip)      # 0x1b670
jmp 0xe30b
movq 0xd365(%rip), %rax      # 0x1b670
addq $0x8, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
movq %rdi, %rbx
testb $0x2, %sil
je 0xf217
cmpq $0x0, 0x8(%rbx)
je 0xf225
testb $0x8, %sil
je 0xf223
cmpl $0x0, 0x10(%rbx)
jne 0xf251
popq %rbx
retq
pushq $0x8
popq %rdi
callq 0x4190
movq 0xbd64(%rip), %rcx      # 0x1af98
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0xbd6e(%rip), %rsi      # 0x1afb0
movq 0xbd3f(%rip), %rdx      # 0x1af88
movq %rax, %rdi
callq 0x44f0
pushq $0x4
popq %rdi
callq 0x4190
movl 0x10(%rbx), %ecx
movl %ecx, (%rax)
leaq 0xbad3(%rip), %rsi      # 0x1ad38
movq %rax, %rdi
xorl %edx, %edx
callq 0x44f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %rbx
pushq $0x1
popq %rsi
movq %rax, %rdi
xorl %eax, %eax
callq 0x4260
movl %eax, (%rbx)
testl %eax, %eax
js 0xf2e9
movq 0xbcd6(%rip), %rsi      # 0x1af78
movl $0x4008, %edi           # imm = 0x4008
callq 0x45b0
testq %rax, %rax
je 0xf2b9
andq $0x0, 0x4000(%rax)
leaq 0x8(%rbx), %rdi
movq %rsp, %r14
andq $0x0, (%r14)
movq %rax, %rsi
callq 0xd06a
movq %r14, %rdi
callq 0xde18
movb $0x1, %al
cmpq $0x0, 0x8(%rbx)
jne 0xf2f5
movl (%rbx), %edi
callq 0x4590
orl $-0x1, (%rbx)
jmp 0xf2f3
callq 0x4040
movl (%rax), %eax
movl %eax, 0x10(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rdi
callq 0xac53
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq 0xbc40(%rip), %rsi      # 0x1af78
movl $0x4008, %edi           # imm = 0x4008
callq 0x45b0
testq %rax, %rax
je 0xf34f
andq $0x0, 0x4000(%rax)
leaq 0x8(%rbx), %rdi
movq %rsp, %r15
andq $0x0, (%r15)
movq %rax, %rsi
callq 0xd06a
movq %r15, %rdi
callq 0xde18
cmpq $0x0, 0x8(%rbx)
je 0xf394
orl $0x1, %ebp
movq %r14, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x4260
movl %eax, %ecx
movl %eax, (%rbx)
movb $0x1, %al
testl %ecx, %ecx
jns 0xf396
callq 0x4040
movl (%rax), %eax
movl %eax, 0x10(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0xac53
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
movq 0xbb94(%rip), %rsi      # 0x1af78
movl $0x4008, %edi           # imm = 0x4008
callq 0x45b0
testq %rax, %rax
je 0xf3fb
andq $0x0, 0x4000(%rax)
leaq 0x8(%rbx), %rdi
leaq 0x8(%rsp), %r12
andq $0x0, (%r12)
movq %rax, %rsi
callq 0xd06a
movq %r12, %rdi
callq 0xde18
cmpq $0x0, 0x8(%rbx)
je 0xf447
orl $0x1, %r14d
movq %r15, %rdi
movl %r14d, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x4260
movl %eax, %ecx
movl %eax, (%rbx)
movb $0x1, %al
testl %ecx, %ecx
jns 0xf449
callq 0x4040
movl (%rax), %eax
movl %eax, 0x10(%rbx)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0xac53
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, (%rdi)
js 0xf4b0
movq %rbx, %rdi
callq 0xf50a
testb %al, %al
je 0xf4c9
leaq 0x8(%rbx), %rdi
xorl %esi, %esi
callq 0xd06a
movl (%rbx), %edi
callq 0x4590
testl %eax, %eax
js 0xf4e6
orl $-0x1, (%rbx)
movb $0x1, %r14b
jmp 0xf4f6
xorl %r14d, %r14d
cmpl $0x0, 0x10(%rbx)
jne 0xf4f6
cmpq $0x0, 0x8(%rbx)
je 0xf4f6
movl $0x9, 0x10(%rbx)
jmp 0xf4f3
movl (%rbx), %edi
callq 0x4590
orl $-0x1, (%rbx)
addq $0x8, %rbx
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %esi, %esi
callq 0xd06a
jmp 0xf4f6
callq 0x4040
movl (%rax), %eax
movl %eax, 0x10(%rbx)
orl $-0x1, (%rbx)
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rdi
callq 0xac53
nop
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/dinit-iostream.cc
// Function: dio::ostream::flush_nx()
bool ostream::flush_nx() noexcept
{
    if (!good()) {
        return false;
    }

    while (buf->get_length() > 0) {
        char *ptr = buf->get_ptr(0);
        unsigned len = buf->get_contiguous_length(ptr);

        unsigned iovs_to_write = 1;
        struct iovec bufv[2];

        bufv[0].iov_base = ptr;
        bufv[0].iov_len = len;
        if (buf->get_length() != len) {
            // buffer's data in streambuf is split into two parts in this case because of cpbuffer nature.
            iovs_to_write = 2;
            bufv[1].iov_base = buf->get_buf_base();
            bufv[1].iov_len = buf->get_length() - len;
        }

        ssize_t r = writev_unintr(fd, bufv, iovs_to_write);
        if (r < 0) {
            io_error = errno;
            return false;
        }
        buf->consume(r);
    }

    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
setne %al
cmpl $0x0, 0x10(%rbx)
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xf5be
pushq $0x1
popq %rbp
movq %rsp, %r14
pushq $0x2
popq %r12
cmpl $0x0, 0x4004(%rdi)
je 0xf5b0
movl 0x4000(%rdi), %eax
leal -0x4000(%rax), %r15d
cmpl $0x4000, %eax           # imm = 0x4000
cmovbl %eax, %r15d
addq %rdi, %r15
movq %r15, %rsi
callq 0xffd4
movq %r15, (%rsp)
movl %eax, %ecx
movq %rcx, 0x8(%rsp)
movq 0x8(%rbx), %rsi
movl 0x4004(%rsi), %ecx
movl %ebp, %edx
subl %eax, %ecx
je 0xf591
movq %rsi, 0x10(%rsp)
movq %rcx, 0x18(%rsp)
movl %r12d, %edx
movl (%rbx), %edi
movq %r14, %rsi
callq 0x10010
testl %eax, %eax
js 0xf5b4
movq 0x8(%rbx), %rdi
movl %eax, %esi
callq 0x1004a
movq 0x8(%rbx), %rdi
jmp 0xf53f
movb $0x1, %al
jmp 0xf5c0
callq 0x4040
movl (%rax), %eax
movl %eax, 0x10(%rbx)
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0xac53
nop
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/dinit-iostream.cc
// Function: dio::ostream::close()
void ostream::close()
{
    bool buf_fail = (fd >= 0 && buf == nullptr);
    bool r = close_nx();
    if (!r) {
        // Failed close_nx leaves an error state bit set, so this will throw:
        throw_exception_on(io_states::io_fail_bit);
        if (buf_fail) {
            throw_exception_on(io_states::buffer_fail_bit);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %ebp
movq 0x8(%rdi), %r14
callq 0xf47a
testb %al, %al
je 0xf5f1
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0xf206
testl %ebp, %ebp
js 0xf5ec
testq %r14, %r14
jne 0xf5ec
pushq $0x2
popq %rsi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xf206
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/dinit-iostream.cc
// Function: dio::ostream::write_buf(char const*, unsigned long)
ssize_t ostream::write_buf(const char *msg, size_t len)
{
    ssize_t r = write_buf_nx(msg, len);
    if (r < 0) {
        // Failed write_buf_nx leaves an error state bit set, so this will always throw:
        throw_exception_on(io_states::buffer_fail_bit | io_states::io_fail_bit);
    }
    return r;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xf0c0
movq %rax, %r14
testq %rax, %rax
jns 0xf90f
pushq $0xa
popq %rsi
movq %rbx, %rdi
callq 0xf206
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/dinit-iostream.cc
// Function: dio::ostream::write_buf(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
ssize_t ostream::write_buf(const std::string &msg)
{
    ssize_t r = write_buf_nx(msg);
    if (r < 0) {
        // Failed write_buf_nx leaves an error state bit set, so this will throw:
        throw_exception_on(io_states::buffer_fail_bit | io_states::io_fail_bit);
    }
    return r;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xf91a
movq %rax, %r14
testq %rax, %rax
jns 0xf949
pushq $0xa
popq %rsi
movq %rbx, %rdi
callq 0xf206
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/dinit-iostream.cc
// Function: dio::istream::load_into_buf(unsigned int)
int istream::load_into_buf(unsigned len) noexcept
{
    int r;
    do {
        r = buf->fill(fd, len);
    } while (r < 0 && errno == EINTR);
    if (r == 0) {
        eof_state = true;
        return -1;
    }
    if (r < 0) {
        io_error = errno;
        return -1;
    }
    return r;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movq 0x8(%rbx), %rdi
movl (%rbx), %esi
movl %ebp, %edx
callq 0x100e6
testl %eax, %eax
jns 0xf9ae
callq 0x4040
movl (%rax), %eax
cmpl $0x4, %eax
je 0xf98c
movl %eax, 0x10(%rbx)
jmp 0xf9b4
jne 0xf9b7
movb $0x1, 0x14(%rbx)
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/dinit-iostream.cc
// Function: dio::istream::throw_exception_on(int)
void istream::throw_exception_on(const int states)
{
    if ((states & io_states::eof_bit) && eof()) {
        throw iostream_eof();
    }
    if ((states & io_states::buffer_fail_bit) && buffer_failure()) {
        throw std::bad_alloc();
    }
    if ((states & io_states::input_fail_bit) && input_failure()) {
        throw std::bad_alloc();
    }
    if ((states & io_states::io_fail_bit) && io_failure()) {
        throw iostream_system_err(io_failure());
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testb $0x1, %sil
je 0xf9ce
cmpb $0x1, 0x14(%rbx)
je 0xfa21
testb $0x2, %sil
je 0xf9db
cmpq $0x0, 0x8(%rbx)
je 0xf9f5
testb $0x4, %sil
je 0xf9e7
cmpb $0x1, 0x15(%rbx)
je 0xf9f5
testb $0x8, %sil
je 0xf9f3
cmpl $0x0, 0x10(%rbx)
jne 0xfa32
popq %rbx
retq
pushq $0x8
popq %rdi
callq 0x4190
movq 0xb594(%rip), %rcx      # 0x1af98
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0xb59e(%rip), %rsi      # 0x1afb0
movq 0xb56f(%rip), %rdx      # 0x1af88
movq %rax, %rdi
callq 0x44f0
pushq $0x1
popq %rdi
callq 0x4190
leaq 0xb320(%rip), %rsi      # 0x1ad50
jmp 0xfa46
pushq $0x4
popq %rdi
callq 0x4190
movl 0x10(%rbx), %ecx
movl %ecx, (%rax)
leaq 0xb2f2(%rip), %rsi      # 0x1ad38
movq %rax, %rdi
xorl %edx, %edx
callq 0x44f0
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/dinit-iostream.cc
// Function: dio::istream::open_nx(char const*)
bool istream::open_nx(const char *path) noexcept
{
    fd = bp_sys::open(path, O_RDONLY);
    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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsi, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x4260
movl %eax, (%rbx)
testl %eax, %eax
js 0xfacd
movq 0xb4f2(%rip), %rsi      # 0x1af78
movl $0x4008, %edi           # imm = 0x4008
callq 0x45b0
testq %rax, %rax
je 0xfa9d
andq $0x0, 0x4000(%rax)
leaq 0x8(%rbx), %rdi
movq %rsp, %r14
andq $0x0, (%r14)
movq %rax, %rsi
callq 0xd06a
movq %r14, %rdi
callq 0xde18
movb $0x1, %al
cmpq $0x0, 0x8(%rbx)
jne 0xfad9
movl (%rbx), %edi
callq 0x4590
orl $-0x1, (%rbx)
jmp 0xfad7
callq 0x4040
movl (%rax), %eax
movl %eax, 0x10(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rdi
callq 0xac53
nop
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/dinit-iostream.cc
// Function: dio::istream::open_nx(char const*, int)
bool istream::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_RDONLY | flags);
    if (fd < 0) {
        io_error = errno;
        return false;
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq 0xb45c(%rip), %rsi      # 0x1af78
movl $0x4008, %edi           # imm = 0x4008
callq 0x45b0
testq %rax, %rax
je 0xfb33
andq $0x0, 0x4000(%rax)
leaq 0x8(%rbx), %rdi
movq %rsp, %r15
andq $0x0, (%r15)
movq %rax, %rsi
callq 0xd06a
movq %r15, %rdi
callq 0xde18
cmpq $0x0, 0x8(%rbx)
je 0xfb75
movq %r14, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x4260
movl %eax, %ecx
movl %eax, (%rbx)
movb $0x1, %al
testl %ecx, %ecx
jns 0xfb77
callq 0x4040
movl (%rax), %eax
movl %eax, 0x10(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0xac53
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/dinit-iostream.cc
// Function: dio::istream::open_nx(char const*, int, unsigned int)
bool istream::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_RDONLY | flags, mode);
    if (fd < 0) {
        io_error = errno;
        return false;
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
movq 0xb3b4(%rip), %rsi      # 0x1af78
movl $0x4008, %edi           # imm = 0x4008
callq 0x45b0
testq %rax, %rax
je 0xfbdb
andq $0x0, 0x4000(%rax)
leaq 0x8(%rbx), %rdi
leaq 0x8(%rsp), %r12
andq $0x0, (%r12)
movq %rax, %rsi
callq 0xd06a
movq %r12, %rdi
callq 0xde18
cmpq $0x0, 0x8(%rbx)
je 0xfc23
movq %r15, %rdi
movl %r14d, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x4260
movl %eax, %ecx
movl %eax, (%rbx)
movb $0x1, %al
testl %ecx, %ecx
jns 0xfc25
callq 0x4040
movl (%rax), %eax
movl %eax, 0x10(%rbx)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0xac53
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/dinit-iostream.cc
// Function: dio::istream::close_nx()
bool istream::close_nx() noexcept
{
    if (fd < 0) {
        // Only mark an error if one has not been recorded yet:
        if (good()) {
            io_error = EBADF;
        }
        return false;
    }

    buf.reset();

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

    fd = -1;
    return good();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, (%rdi)
js 0xfc81
leaq 0x8(%rbx), %rdi
xorl %esi, %esi
callq 0xd06a
movl (%rbx), %edi
callq 0x4590
testl %eax, %eax
js 0xfc96
orl $-0x1, (%rbx)
movq %rbx, %rdi
popq %rbx
jmp 0xfcb0
movq %rbx, %rdi
callq 0xfcb0
testb %al, %al
je 0xfca3
movl $0x9, 0x10(%rbx)
jmp 0xfca3
callq 0x4040
movl (%rax), %eax
movl %eax, 0x10(%rbx)
orl $-0x1, (%rbx)
xorl %eax, %eax
popq %rbx
retq
movq %rax, %rdi
callq 0xac53
nop
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/dinit-iostream.cc
// Function: dio::istream::close()
void istream::close()
{
    bool buf_fail = (fd >= 0 && buf == nullptr);
    bool r = close_nx();
    if (!r) {
        // Failed close_nx leaves an error state bit set, so this will throw:
        throw_exception_on(io_states::io_fail_bit | io_states::eof_bit
                | io_states::input_fail_bit);
        if (buf_fail) {
            throw_exception_on(io_states::buffer_fail_bit);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %ebp
movq 0x8(%rdi), %r14
callq 0xfc56
testb %al, %al
je 0xfcd9
popq %rbx
popq %r14
popq %rbp
retq
pushq $0xd
popq %rsi
movq %rbx, %rdi
callq 0xf9be
testl %ebp, %ebp
js 0xfcd4
testq %r14, %r14
jne 0xfcd4
pushq $0x2
popq %rsi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xf9be
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/dinit-iostream.cc
// Function: dio::istream::getc_nx()
getc_result istream::getc_nx() noexcept
{
    if (!good()) {
        return {false, 0};
    }
    if (buf->get_length() == 0) {
        int r = load_into_buf(1);
        if (r <= 0) return {false, 0};
    }
    char result = *buf->get_ptr(0);
    buf->consume(1);
    return {true, result};
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0xfcb0
testb %al, %al
je 0xfd80
movq 0x8(%rbx), %rdi
cmpl $0x0, 0x4004(%rdi)
jne 0xfd57
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xf984
testl %eax, %eax
jle 0xfd80
movq 0x8(%rbx), %rdi
movl 0x4000(%rdi), %eax
leal -0x4000(%rax), %ecx
cmpl $0x4000, %eax           # imm = 0x4000
cmovbl %eax, %ecx
movzbl (%rdi,%rcx), %ebx
pushq $0x1
popq %rsi
callq 0x1004a
shll $0x8, %ebx
movw $0x1, %ax
jmp 0xfd84
xorl %eax, %eax
xorl %ebx, %ebx
movzwl %ax, %eax
orl %ebx, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/dinit-iostream.cc
// Function: dio::istream::getc()
char istream::getc()
{
    getc_result r = getc_nx();
    if (!r.success) {
        // Failed getc_nx leaves an error state bit set, so this will throw:
        throw_exception_on(io_states::eof_bit | io_states::buffer_fail_bit
                | io_states::input_fail_bit | io_states::io_fail_bit);
    }
    return r.character;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0xfd2a
movl %eax, %ebx
testb $0x1, %bl
jne 0xfdaa
pushq $0xf
popq %rsi
movq %r14, %rdi
callq 0xf9be
shrl $0x8, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/dinit-iostream.cc
// Function: dio::istream::get_line_until_eof(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, char)
void istream::get_line_until_eof(std::string &dest, char delim)
{
    // If we had already hit eof, we fail at this point
    throw_exception_on(io_states::buffer_fail_bit | io_states::input_fail_bit
            | io_states::io_fail_bit | io_states::eof_bit);
    bool r = get_line_nx(dest, delim);
    if (!r) {
        throw_exception_on(io_states::buffer_fail_bit | io_states::input_fail_bit
                | io_states::io_fail_bit);
    }
    // (eof_state may be set, i.e. we reached end-of-file, but that's not an error)
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
pushq $0xf
popq %rsi
callq 0xf9be
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0xfdb8
testb %al, %al
je 0xff60
popq %rbx
popq %r14
popq %rbp
retq
pushq $0xe
popq %rsi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xf9be
nop
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/dinit-iostream.cc
// Function: dio::istream::get_line_until_eof_nx(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, char)
bool istream::get_line_until_eof_nx(std::string &dest, char delim) noexcept
{
    if (!good()) return false;
    bool r = get_line_nx(dest, delim);
    if (!r) {
        // If we hit end-of-file and there is no other error, return success.
        // (We can ignore buffer failure, that can't happen between the initial
        // check above and this point).
        if (io_error != 0 || string_failed) return false;
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
callq 0xfcb0
testb %al, %al
je 0xffa8
movsbl %bpl, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xfdb8
testb %al, %al
je 0xff9c
movb $0x1, %al
jmp 0xffaa
cmpl $0x0, 0x10(%rbx)
jne 0xffa8
cmpb $0x0, 0x15(%rbx)
je 0xff98
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ttalvitie[P]traveling-santa/optimize.cpp
// Function: Vec3::fromLatLong(double, double)
static Vec3 fromLatLong(double la, double lo) {
		la *= DegToRadCoef;
		lo *= DegToRadCoef;
		double x = cos(lo) * cos(la);
		double y = sin(lo) * cos(la);
		double z = sin(la);
		return Vec3(x, y, z);
	}

// Assembly:
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
movsd 0x5c88(%rip), %xmm2     # 0xa5b8
mulsd %xmm2, %xmm0
movsd %xmm0, 0x8(%rsp)
mulsd %xmm1, %xmm2
movsd %xmm2, 0x10(%rsp)
movapd %xmm2, %xmm0
callq 0x2370
movapd %xmm0, 0x40(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x2370
movaps %xmm0, 0x30(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x2030
movaps %xmm0, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x2370
movaps %xmm0, 0x20(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x2030
movapd 0x40(%rsp), %xmm1
unpcklpd 0x10(%rsp), %xmm1       # xmm1 = xmm1[0],mem[0]
movapd 0x30(%rsp), %xmm2
unpcklpd 0x20(%rsp), %xmm2       # xmm2 = xmm2[0],mem[0]
mulpd %xmm1, %xmm2
movupd %xmm2, (%rbx)
movsd %xmm0, 0x10(%rbx)
movq %rbx, %rax
addq $0x50, %rsp
popq %rbx
retq