// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x98, %rsp
movw %si, %ax
movq %rdi, 0x88(%rsp)
movw %ax, 0x86(%rsp)
movq %rdx, 0x78(%rsp)
movb $0x1, 0x77(%rsp)
movq $0x0, 0x68(%rsp)
movq $0x0, 0x60(%rsp)
movq 0x88(%rsp), %rax
movzwl (%rax), %edi
movzwl 0x86(%rsp), %esi
callq 0xbf30
testb $0x1, %al
jne 0xbb37
jmp 0xbbeb
movq 0x88(%rsp), %rax
movl 0x4(%rax), %esi
movq 0x78(%rsp), %rdx
movl $0x1, %edi
callq 0xbf50
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rdi
xorl %esi, %esi
leaq 0x5831(%rip), %rdx      # 0x11395
leaq 0x552b(%rip), %rcx      # 0x11096
movl $0x2d4, %r8d            # imm = 0x2D4
callq 0xa720
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xf(%rsp)
jne 0xbb85
jmp 0xbb9f
movq 0x58(%rsp), %rdi
movq 0x78(%rsp), %rax
movq 0x2158(%rax), %rsi
callq 0xc470
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
andb $0x1, %al
movb %al, 0x57(%rsp)
xorl %eax, %eax
testb $0x1, 0x57(%rsp)
movb %al, 0xe(%rsp)
je 0xbbbe
movb 0x77(%rsp), %al
movb %al, 0xe(%rsp)
movb 0xe(%rsp), %al
andb $0x1, %al
movb %al, 0x77(%rsp)
testb $0x1, 0x57(%rsp)
je 0xbbdd
movq 0x68(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x68(%rsp)
movq 0x60(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x60(%rsp)
movq 0x88(%rsp), %rax
movzwl 0x8(%rax), %edi
movzwl 0x86(%rsp), %esi
callq 0xbf30
testb $0x1, %al
jne 0xbc0d
jmp 0xbcc1
movq 0x88(%rsp), %rax
movl 0xc(%rax), %esi
movq 0x78(%rsp), %rdx
movl $0x1, %edi
callq 0xbf50
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rdi
xorl %esi, %esi
leaq 0x575b(%rip), %rdx      # 0x11395
leaq 0x5455(%rip), %rcx      # 0x11096
movl $0x2df, %r8d            # imm = 0x2DF
callq 0xa720
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xd(%rsp)
jne 0xbc5b
jmp 0xbc75
movq 0x48(%rsp), %rdi
movq 0x78(%rsp), %rax
movq 0x2158(%rax), %rsi
callq 0xc4a0
movb %al, 0xd(%rsp)
movb 0xd(%rsp), %al
andb $0x1, %al
movb %al, 0x47(%rsp)
xorl %eax, %eax
testb $0x1, 0x47(%rsp)
movb %al, 0xc(%rsp)
je 0xbc94
movb 0x77(%rsp), %al
movb %al, 0xc(%rsp)
movb 0xc(%rsp), %al
andb $0x1, %al
movb %al, 0x77(%rsp)
testb $0x1, 0x47(%rsp)
je 0xbcb3
movq 0x68(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x68(%rsp)
movq 0x60(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x60(%rsp)
movq 0x88(%rsp), %rax
movzwl 0x10(%rax), %edi
movzwl 0x86(%rsp), %esi
callq 0xbf30
testb $0x1, %al
jne 0xbce0
jmp 0xbd23
movw 0x86(%rsp), %ax
movq 0x78(%rsp), %rsi
movq 0x88(%rsp), %rdx
addq $0x10, %rdx
movzwl %ax, %edi
callq 0xc4d0
testb $0x1, %al
jne 0xbd07
jmp 0xbd15
movq 0x68(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x68(%rsp)
movq 0x60(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x60(%rsp)
movl $0x1, %edi
callq 0x9650
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x38(%rsp)
jne 0xbd64
movl $0x800f0000, %edi       # imm = 0x800F0000
leaq 0x564f(%rip), %rsi      # 0x11395
leaq 0x5349(%rip), %rdx      # 0x11096
movl $0x2f0, %ecx            # imm = 0x2F0
callq 0x3940
movb $0x0, 0x97(%rsp)
jmp 0xbf19
jmp 0xbd66
movq $0x0, 0x30(%rsp)
movq $0x0, 0x28(%rsp)
movq 0x38(%rsp), %rdi
movw 0x86(%rsp), %ax
movq 0x78(%rsp), %rdx
leaq 0x30(%rsp), %rcx
leaq 0x28(%rsp), %r8
movzwl %ax, %esi
callq 0x67d0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xb(%rsp)
jne 0xbdab
jmp 0xbdb3
movb 0x77(%rsp), %al
movb %al, 0xb(%rsp)
movb 0xb(%rsp), %al
andb $0x1, %al
movb %al, 0x77(%rsp)
movl $0x1, %edi
callq 0x9aa0
movq 0x30(%rsp), %rax
addq 0x68(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x28(%rsp), %rax
addq 0x60(%rsp), %rax
movq %rax, 0x60(%rsp)
movl $0x2, %edi
callq 0x9650
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0xbe26
movl $0x800f0000, %edi       # imm = 0x800F0000
leaq 0x558d(%rip), %rsi      # 0x11395
leaq 0x5287(%rip), %rdx      # 0x11096
movl $0x2fa, %ecx            # imm = 0x2FA
callq 0x3940
movb $0x0, 0x97(%rsp)
jmp 0xbf19
jmp 0xbe28
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movq 0x20(%rsp), %rdi
movw 0x86(%rsp), %ax
movq 0x78(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x10(%rsp), %r8
movzwl %ax, %esi
callq 0xe170
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xa(%rsp)
jne 0xbe6d
jmp 0xbe75
movb 0x77(%rsp), %al
movb %al, 0xa(%rsp)
movb 0xa(%rsp), %al
andb $0x1, %al
movb %al, 0x77(%rsp)
movl $0x2, %edi
callq 0x9aa0
movq 0x18(%rsp), %rax
addq 0x68(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x10(%rsp), %rax
addq 0x60(%rsp), %rax
movq %rax, 0x60(%rsp)
xorl %eax, %eax
cmpq 0x60(%rsp), %rax
jne 0xbeee
movzwl 0x86(%rsp), %esi
leaq 0x54e4(%rip), %rdi      # 0x113a3
movb $0x0, %al
callq 0x9730
movl $0x800d0000, %edi       # imm = 0x800D0000
leaq 0x54c3(%rip), %rsi      # 0x11395
leaq 0x51bd(%rip), %rdx      # 0x11096
movl $0x306, %ecx            # imm = 0x306
callq 0x3940
andb $0x1, %al
movb %al, 0x97(%rsp)
jmp 0xbf19
xorl %eax, %eax
testb $0x1, 0x77(%rsp)
movb %al, 0x9(%rsp)
je 0xbf0c
movq 0x68(%rsp), %rax
cmpq 0x60(%rsp), %rax
sete %al
movb %al, 0x9(%rsp)
movb 0x9(%rsp), %al
andb $0x1, %al
movb %al, 0x97(%rsp)
movb 0x97(%rsp), %al
andb $0x1, %al
addq $0x98, %rsp
retq
nopw (%rax,%rax)