// File: /workspace/github_c_makefile_star2_O3/aremmell[P]libsir/src/sirinternal.c
// Function: sir_dispatch
bool _sir_dispatch(const sirinit* si, sir_level level, sirbuf* buf) {
    bool retval       = true;
    size_t dispatched = 0;
    size_t wanted     = 0;

#if !defined(SIR_NO_TEXT_STYLING)
    static const bool styling = true;
#else
    static const bool styling = false;
#endif

    if (_sir_bittest(si->d_stdout.levels, level)) {
        const char* writef = _sir_format(styling, si->d_stdout.opts, buf);
        bool wrote         = _sir_validstrnofail(writef) &&
            _sir_write_stdout(writef, buf->output_len);
        _sir_eqland(retval, wrote);

        if (wrote)
            dispatched++;
        wanted++;
    }

    if (_sir_bittest(si->d_stderr.levels, level)) {
        const char* writef = _sir_format(styling, si->d_stderr.opts, buf);
        bool wrote         = _sir_validstrnofail(writef) &&
            _sir_write_stderr(writef, buf->output_len);
        _sir_eqland(retval, wrote);

        if (wrote)
            dispatched++;
        wanted++;
    }

#if !defined(SIR_NO_SYSTEM_LOGGERS)
    if (_sir_bittest(si->d_syslog.levels, level)) {
        if (_sir_syslog_write(level, buf, &si->d_syslog))
            dispatched++;
        wanted++;
    }
#endif

    _SIR_LOCK_SECTION(const sirfcache, sfc, SIRMI_FILECACHE, false);
    size_t fdispatched = 0;
    size_t fwanted     = 0;
    _sir_eqland(retval, _sir_fcache_dispatch(sfc, level, buf, &fdispatched, &fwanted));
    _SIR_UNLOCK_SECTION(SIRMI_FILECACHE);

    dispatched += fdispatched;
    wanted += fwanted;

#if !defined(SIR_NO_PLUGINS)
    _SIR_LOCK_SECTION(const sir_plugincache, spc, SIRMI_PLUGINCACHE, false);
    size_t pdispatched = 0;
    size_t pwanted     = 0;
    _sir_eqland(retval, _sir_plugin_cache_dispatch(spc, level, buf, &pdispatched, &pwanted));
    _SIR_UNLOCK_SECTION(SIRMI_PLUGINCACHE);

    dispatched += pdispatched;
    wanted += pwanted;
#endif

    if (0 == wanted) {
        _sir_selflog("error: no destinations registered for level %04"PRIx16, level);
        return _sir_seterror(_SIR_E_NODEST);
    }

    return retval && (dispatched == wanted);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r15
movl (%rdi), %eax
notl %eax
testl %eax, %esi
jne 0x7064
movl 0x4(%r15), %esi
movl $0x1, %edi
movq %rbx, %rdx
callq 0x7222
movl $0x1, %r14d
testq %rax, %rax
je 0x706f
cmpb $0x0, (%rax)
je 0x706f
movq 0x6f8c(%rip), %rcx      # 0xdfd8
movq (%rcx), %rdi
movq %rax, %rsi
callq 0x8920
movl %eax, %r12d
movzbl %al, %r13d
andl $0x1, %r13d
jmp 0x7075
movb $0x1, %r12b
xorl %r14d, %r14d
xorl %r13d, %r13d
jmp 0x7075
xorl %r13d, %r13d
xorl %r12d, %r12d
movl 0x8(%r15), %eax
notl %eax
testw %ax, %bp
jne 0x70bb
movl 0xc(%r15), %esi
movl $0x1, %edi
movq %rbx, %rdx
callq 0x7222
testq %rax, %rax
je 0x70c2
cmpb $0x0, (%rax)
je 0x70c2
movq 0x6f56(%rip), %rcx      # 0xdff8
movq (%rcx), %rdi
movq %rax, %rsi
callq 0x8920
andb %al, %r12b
movzbl %al, %eax
andl $0x1, %eax
addq %rax, %r13
jmp 0x70c5
movq %r12, 0x8(%rsp)
jmp 0x70cd
xorl %r12d, %r12d
movq %r12, 0x8(%rsp)
incq %r14
movl 0x10(%r15), %eax
notl %eax
movzwl %bp, %r12d
testw %ax, %bp
jne 0x70f7
addq $0x10, %r15
movl %r12d, %edi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x7514
movzbl %al, %eax
addq %rax, %r13
incq %r14
leaq 0x76a2(%rip), %rdi      # 0xe7a0
callq 0x7790
testb %al, %al
je 0x71bb
movq %r13, 0x10(%rsp)
xorl %eax, %eax
leaq 0x30(%rsp), %r15
movq %rax, (%r15)
leaq 0x28(%rsp), %r13
movq %rax, (%r13)
leaq 0x769e(%rip), %rdi      # 0xe7c8
movl %r12d, %esi
movq %rbx, %rdx
movq %r15, %rcx
movq %r13, %r8
callq 0x4ae4
movb %al, 0x7(%rsp)
leaq 0x765a(%rip), %rdi      # 0xe7a0
callq 0x782e
movq (%r15), %rbp
movq (%r13), %r13
leaq 0x76f7(%rip), %rdi      # 0xe850
callq 0x7790
testb %al, %al
je 0x71d5
addq %r14, %r13
xorl %eax, %eax
leaq 0x18(%rsp), %rcx
movq %rax, (%rcx)
leaq 0x20(%rsp), %r15
movq %rax, (%r15)
leaq 0x76fa(%rip), %rdi      # 0xe878
movl %r12d, %esi
movq %rbx, %rdx
movq %r15, %r8
callq 0x80e2
movl %eax, %ebx
leaq 0x76bb(%rip), %rdi      # 0xe850
callq 0x782e
addq (%r15), %r13
je 0x7203
addq 0x10(%rsp), %rbp
addq 0x18(%rsp), %rbp
andb 0x7(%rsp), %bl
andb 0x8(%rsp), %bl
cmpq %r13, %rbp
sete %al
andb %bl, %al
jmp 0x71f4
leaq 0x2ab2(%rip), %rsi      # 0x9c74
leaq 0x29dd(%rip), %rdx      # 0x9ba6
movl $0x800f0000, %edi       # imm = 0x800F0000
movl $0x2f0, %ecx            # imm = 0x2F0
jmp 0x71ed
leaq 0x2a98(%rip), %rsi      # 0x9c74
leaq 0x29c3(%rip), %rdx      # 0x9ba6
movl $0x800f0000, %edi       # imm = 0x800F0000
movl $0x2fa, %ecx            # imm = 0x2FA
callq 0x31c0
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2a6a(%rip), %rsi      # 0x9c74
leaq 0x2995(%rip), %rdx      # 0x9ba6
movl $0x800d0000, %edi       # imm = 0x800D0000
movl $0x306, %ecx            # imm = 0x306
callq 0x31c0
jmp 0x71f4