// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/src/sirtextstyle.c
// Function: sir_validtextstyle
bool _sir_validtextstyle(sir_colormode mode, const sir_textstyle* style) {
    if (!_sir_validptr(style) || !_sir_validcolormode(mode))
        return false;

    sir_textcolor fg = SIRCM_16 == mode ? _sir_mkansifgcolor(style->fg) : style->fg;
    sir_textcolor bg = SIRCM_16 == mode ? _sir_mkansibgcolor(style->bg) : style->bg;

    if (!_sir_validtextattr(style->attr) || !_sir_validtextcolor(mode, fg) ||
        !_sir_validtextcolor(mode, bg))
        return false;

    if (SIRTC_DEFAULT != style->fg && SIRTC_DEFAULT != style->bg &&
        style->fg == style->bg) {
        _sir_selflog("error: fg color %08"PRIx32" and bg color %08"PRIx32
                     " are identical; text would be invisible", style->fg,
                     style->bg);
        SIR_ASSERT(SIRTC_DEFAULT != style->fg && SIRTC_DEFAULT != style->bg &&
                style->fg == style->bg);
        return _sir_seterror(_SIR_E_TEXTSTYLE);
    }

    return true;
}

// Assembly:
subq $0x28, %rsp
movl %edi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movl $0x1, %esi
leaq 0x33c1(%rip), %rdx      # 0x120ff
leaq 0x333d(%rip), %rcx      # 0x12082
movl $0xac, %r8d
callq 0xefe0
testb $0x1, %al
jne 0xed56
jmp 0xed76
movl 0x20(%rsp), %edi
leaq 0x339e(%rip), %rsi      # 0x120ff
leaq 0x331a(%rip), %rdx      # 0x12082
movl $0xac, %ecx
callq 0x8350
testb $0x1, %al
jne 0xed80
movb $0x0, 0x27(%rsp)
jmp 0xeece
xorl %eax, %eax
cmpl 0x20(%rsp), %eax
jne 0xed9b
movq 0x18(%rsp), %rax
movl 0x4(%rax), %edi
callq 0xef00
movl %eax, 0xc(%rsp)
jmp 0xeda7
movq 0x18(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %eax
movl %eax, 0x14(%rsp)
xorl %eax, %eax
cmpl 0x20(%rsp), %eax
jne 0xedca
movq 0x18(%rsp), %rax
movl 0x8(%rax), %edi
callq 0xef50
movl %eax, 0x8(%rsp)
jmp 0xedd6
movq 0x18(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0x8(%rsp)
movl 0x8(%rsp), %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movl (%rax), %edi
leaq 0x3313(%rip), %rsi      # 0x120ff
leaq 0x328f(%rip), %rdx      # 0x12082
movl $0xb2, %ecx
callq 0x8150
testb $0x1, %al
jne 0xee03
jmp 0xee4f
movl 0x20(%rsp), %edi
movl 0x14(%rsp), %esi
leaq 0x32ed(%rip), %rdx      # 0x120ff
leaq 0x3269(%rip), %rcx      # 0x12082
movl $0xb2, %r8d
callq 0x81c0
testb $0x1, %al
jne 0xee2a
jmp 0xee4f
movl 0x20(%rsp), %edi
movl 0x10(%rsp), %esi
leaq 0x32c6(%rip), %rdx      # 0x120ff
leaq 0x3242(%rip), %rcx      # 0x12082
movl $0xb3, %r8d
callq 0x81c0
testb $0x1, %al
jne 0xee56
movb $0x0, 0x27(%rsp)
jmp 0xeece
movq 0x18(%rsp), %rcx
movl $0x100, %eax            # imm = 0x100
cmpl 0x4(%rcx), %eax
je 0xeec9
movq 0x18(%rsp), %rcx
movl $0x100, %eax            # imm = 0x100
cmpl 0x8(%rcx), %eax
je 0xeec9
movq 0x18(%rsp), %rax
movl 0x4(%rax), %eax
movq 0x18(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jne 0xeec9
movq 0x18(%rsp), %rax
movl 0x4(%rax), %esi
movq 0x18(%rsp), %rax
movl 0x8(%rax), %edx
leaq 0x3276(%rip), %rdi      # 0x12113
movb $0x0, %al
callq 0xf050
movl $0x80090000, %edi       # imm = 0x80090000
leaq 0x324f(%rip), %rsi      # 0x120ff
leaq 0x31cb(%rip), %rdx      # 0x12082
movl $0xbd, %ecx
callq 0x3940
andb $0x1, %al
movb %al, 0x27(%rsp)
jmp 0xeece
movb $0x1, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopl (%rax)