// File: /workspace/github_cpp_makefile_star2_O1/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 0x1f1e7
movl %r12d, %edi
callq 0x74a0
testl %eax, %eax
je 0x1f289
leal -0xe000(%r12), %eax
cmpl $0x1900, %eax           # imm = 0x1900
jb 0x1f2eb
testb $0xf, %r13b
je 0x1f27e
testb $0x1, %r13b
sete %al
leal -0x3a(%r12), %ecx
cmpl $-0xa, %ecx
setae %cl
orb %al, %cl
jne 0x1f239
xorl %eax, %eax
cmpl $0x2f, %r12d
ja 0x1f2ed
movl %r12d, %ecx
movabsq $0xec0000000000, %rdx   # imm = 0xEC0000000000
btq %rcx, %rdx
jae 0x1f2ed
testb $0x2, %r13b
je 0x1f25b
leal -0x30(%r12), %eax
cmpl $0xa, %eax
jb 0x1f25b
movl %r12d, %eax
andl $-0x21, %eax
addl $-0x41, %eax
cmpl $0x5, %eax
ja 0x1f2eb
leal -0x61(%r12), %eax
testb $0x4, %r13b
sete %cl
cmpl $0x1a, %eax
setae %al
orb %cl, %al
jne 0x1f278
addl $-0x20, %r12d
movl %r12d, (%rbx)
testb $0x8, %r13b
jne 0x1f2fc
btl $0x9, %r13d
jb 0x1f2b7
movb $0x1, %al
jmp 0x1f2ed
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 0x1f1fa
orb %al, %cl
jne 0x1f2eb
jmp 0x1f1fa
xorps %xmm0, %xmm0
leaq -0x60(%rbp), %rdi
movaps %xmm0, (%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, 0x20(%rdi)
movq $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 0x1f319
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 0x1f2ed
cmpl $0x20, %r12d
je 0x1f2ed
cmpl $0x3000, %r12d          # imm = 0x3000
jne 0x1f27e
jmp 0x1f2ed
movzwl -0x4e(%rbp), %eax
movl %eax, (%rbx)
testl %eax, %eax
jne 0x1f285
jmp 0x1f2eb