// File: /workspace/github_cpp_makefile_star2_O2/donfreiday[P]gb/./imgui/imgui.cpp
// Function: InputTextFilterCharacter(unsigned int*, int, int (*)(ImGuiTextEditCallbackData*), void*)
static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags flags, ImGuiTextEditCallback callback, void* user_data)
{
    unsigned int c = *p_char;

    if (c < 128 && c != ' ' && !isprint((int)(c & 0xFF)))
    {
        bool pass = false;
        pass |= (c == '\n' && (flags & ImGuiInputTextFlags_Multiline));
        pass |= (c == '\t' && (flags & ImGuiInputTextFlags_AllowTabInput));
        if (!pass)
            return false;
    }

    if (c >= 0xE000 && c <= 0xF8FF) // Filter private Unicode range. I don't imagine anybody would want to input them. GLFW on OSX seems to send private characters for special keys like arrow keys.
        return false;

    if (flags & (ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase | ImGuiInputTextFlags_CharsNoBlank))
    {
        if (flags & ImGuiInputTextFlags_CharsDecimal)
            if (!(c >= '0' && c <= '9') && (c != '.') && (c != '-') && (c != '+') && (c != '*') && (c != '/'))
                return false;

        if (flags & ImGuiInputTextFlags_CharsHexadecimal)
            if (!(c >= '0' && c <= '9') && !(c >= 'a' && c <= 'f') && !(c >= 'A' && c <= 'F'))
                return false;

        if (flags & ImGuiInputTextFlags_CharsUppercase)
            if (c >= 'a' && c <= 'z')
                *p_char = (c += (unsigned int)('A'-'a'));

        if (flags & ImGuiInputTextFlags_CharsNoBlank)
            if (ImCharIsSpace(c))
                return false;
    }

    if (flags & ImGuiInputTextFlags_CallbackCharFilter)
    {
        ImGuiTextEditCallbackData callback_data;
        memset(&callback_data, 0, sizeof(ImGuiTextEditCallbackData));
        callback_data.EventFlag = ImGuiInputTextFlags_CallbackCharFilter;
        callback_data.EventChar = (ImWchar)c;
        callback_data.Flags = flags;
        callback_data.UserData = user_data;
        if (callback(&callback_data) != 0)
            return false;
        *p_char = callback_data.EventChar;
        if (!callback_data.EventChar)
            return false;
    }

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %r15
movq %rdx, %r14
movq %rdi, %rbx
movl (%rdi), %r12d
cmpl $0x7f, %r12d
seta %al
movl %esi, %r13d
cmpl $0x20, %r12d
sete %cl
orb %al, %cl
jne 0x19c24
movl %r12d, %edi
callq 0x7490
testl %eax, %eax
jne 0x19c37
cmpl $0xa, %r12d
sete %dl
movl %r13d, %esi
shrl $0x14, %esi
cmpl $0x9, %r12d
setne %al
btl $0xa, %r13d
setae %cl
testb %dl, %sil
jne 0x19c37
orb %al, %cl
jne 0x19cec
jmp 0x19c37
leal -0xe000(%r12), %eax
cmpl $0x1900, %eax           # imm = 0x1900
jb 0x19cec
testb $0xf, %r13b
je 0x19cb3
testb $0x1, %r13b
sete %al
leal -0x3a(%r12), %ecx
cmpl $-0xa, %ecx
setae %cl
orb %al, %cl
jne 0x19c72
xorl %eax, %eax
cmpl $0x2f, %r12d
ja 0x19cee
movl %r12d, %ecx
movabsq $0xec0000000000, %rdx   # imm = 0xEC0000000000
btq %rcx, %rdx
jae 0x19cee
testb $0x2, %r13b
je 0x19c90
leal -0x30(%r12), %eax
cmpl $0xa, %eax
jb 0x19c90
movl %r12d, %eax
andl $-0x21, %eax
addl $-0x41, %eax
cmpl $0x5, %eax
ja 0x19cec
leal -0x61(%r12), %eax
testb $0x4, %r13b
sete %cl
cmpl $0x1a, %eax
setae %al
orb %cl, %al
jne 0x19cad
addl $-0x20, %r12d
movl %r12d, (%rbx)
testb $0x8, %r13b
jne 0x19cfd
btl $0x9, %r13d
jb 0x19cbe
movb $0x1, %al
jmp 0x19cee
xorps %xmm0, %xmm0
leaq -0x60(%rbp), %rdi
movups %xmm0, 0x10(%rdi)
movups %xmm0, 0x20(%rdi)
andq $0x0, 0x30(%rdi)
movl $0x200, (%rdi)          # imm = 0x200
movw %r12w, 0x12(%rdi)
movl %r13d, 0x4(%rdi)
movq %r15, 0x8(%rdi)
callq *%r14
testl %eax, %eax
je 0x19d16
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
cmpl $0x9, %r12d
je 0x19cee
cmpl $0x20, %r12d
je 0x19cee
cmpl $0x3000, %r12d          # imm = 0x3000
jne 0x19cb3
jmp 0x19cee
movzwl -0x4e(%rbp), %eax
movl %eax, (%rbx)
testl %eax, %eax
jne 0x19cba
jmp 0x19cec