// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::ColorEditOptionsPopup(float const*, int)
void ImGui::ColorEditOptionsPopup(const float* col, ImGuiColorEditFlags flags)
{
    bool allow_opt_inputs = !(flags & ImGuiColorEditFlags__DisplayMask);
    bool allow_opt_datatype = !(flags & ImGuiColorEditFlags__DataTypeMask);
    if ((!allow_opt_inputs && !allow_opt_datatype) || !BeginPopup("context"))
        return;
    ImGuiContext& g = *GImGui;
    ImGuiColorEditFlags opts = g.ColorEditOptions;
    if (allow_opt_inputs)
    {
        if (RadioButton("RGB", (opts & ImGuiColorEditFlags_DisplayRGB) != 0)) opts = (opts & ~ImGuiColorEditFlags__DisplayMask) | ImGuiColorEditFlags_DisplayRGB;
        if (RadioButton("HSV", (opts & ImGuiColorEditFlags_DisplayHSV) != 0)) opts = (opts & ~ImGuiColorEditFlags__DisplayMask) | ImGuiColorEditFlags_DisplayHSV;
        if (RadioButton("Hex", (opts & ImGuiColorEditFlags_DisplayHex) != 0)) opts = (opts & ~ImGuiColorEditFlags__DisplayMask) | ImGuiColorEditFlags_DisplayHex;
    }
    if (allow_opt_datatype)
    {
        if (allow_opt_inputs) Separator();
        if (RadioButton("0..255",     (opts & ImGuiColorEditFlags_Uint8) != 0)) opts = (opts & ~ImGuiColorEditFlags__DataTypeMask) | ImGuiColorEditFlags_Uint8;
        if (RadioButton("0.00..1.00", (opts & ImGuiColorEditFlags_Float) != 0)) opts = (opts & ~ImGuiColorEditFlags__DataTypeMask) | ImGuiColorEditFlags_Float;
    }

    if (allow_opt_inputs || allow_opt_datatype)
        Separator();
    if (Button("Copy as..", ImVec2(-1, 0)))
        OpenPopup("Copy");
    if (BeginPopup("Copy"))
    {
        int cr = IM_F32_TO_INT8_SAT(col[0]), cg = IM_F32_TO_INT8_SAT(col[1]), cb = IM_F32_TO_INT8_SAT(col[2]), ca = (flags & ImGuiColorEditFlags_NoAlpha) ? 255 : IM_F32_TO_INT8_SAT(col[3]);
        char buf[64];
        ImFormatString(buf, IM_ARRAYSIZE(buf), "(%.3ff, %.3ff, %.3ff, %.3ff)", col[0], col[1], col[2], (flags & ImGuiColorEditFlags_NoAlpha) ? 1.0f : col[3]);
        if (Selectable(buf))
            SetClipboardText(buf);
        ImFormatString(buf, IM_ARRAYSIZE(buf), "(%d,%d,%d,%d)", cr, cg, cb, ca);
        if (Selectable(buf))
            SetClipboardText(buf);
        ImFormatString(buf, IM_ARRAYSIZE(buf), "#%02X%02X%02X", cr, cg, cb);
        if (Selectable(buf))
            SetClipboardText(buf);
        if (!(flags & ImGuiColorEditFlags_NoAlpha))
        {
            ImFormatString(buf, IM_ARRAYSIZE(buf), "#%02X%02X%02X%02X", cr, cg, cb, ca);
            if (Selectable(buf))
                SetClipboardText(buf);
        }
        EndPopup();
    }

    g.ColorEditOptions = opts;
    EndPopup();
}

// Assembly:
testl $0x700000, %esi         # imm = 0x700000
setne %al
testl $0x1800000, %esi        # imm = 0x1800000
setne %cl
testb %cl, %al
jne 0x9f743
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x1af22(%rip), %rdi     # 0xba289
xorl %esi, %esi
callq 0x58541
testb %al, %al
je 0x9f735
leaq 0x5e953(%rip), %rcx     # 0xfdcd0
movq (%rcx), %rax
movq %rax, -0x40(%rbp)
movl 0x306c(%rax), %r15d
testl $0x700000, %ebx         # imm = 0x700000
jne 0x9f412
movl %r15d, %esi
shrl $0x14, %esi
andl $0x1, %esi
leaq 0x354b5(%rip), %rdi     # 0xd4858
callq 0x948c0
movl %r15d, %r13d
andl $0xff8fffff, %r13d      # imm = 0xFF8FFFFF
leal 0x100000(%r13), %r12d
testb %al, %al
cmovel %r15d, %r12d
movl %r12d, %esi
shrl $0x15, %esi
andl $0x1, %esi
leaq 0x3548d(%rip), %rdi     # 0xd485c
callq 0x948c0
orl $0x200000, %r13d        # imm = 0x200000
testb %al, %al
movl %r13d, %r15d
cmovel %r12d, %r15d
movl %r15d, %esi
shrl $0x16, %esi
andl $0x1, %esi
leaq 0x180eb(%rip), %rdi     # 0xb74df
callq 0x948c0
testb %al, %al
je 0x9f40b
andl $0xff8fffff, %r15d      # imm = 0xFF8FFFFF
orl $0x400000, %r15d        # imm = 0x400000
leaq 0x5e8be(%rip), %rcx     # 0xfdcd0
testl $0x1800000, %ebx        # imm = 0x1800000
jne 0x9f4a3
testl $0x700000, %ebx         # imm = 0x700000
jne 0x9f44a
movq (%rcx), %rax
movq 0x1ae0(%rax), %rax
cmpb $0x0, 0x93(%rax)
jne 0x9f44a
xorl %edi, %edi
cmpl $0x1, 0x1bc(%rax)
adcl $0x5, %edi
callq 0x95266
movl %r15d, %esi
shrl $0x17, %esi
andl $0x1, %esi
leaq 0x35406(%rip), %rdi     # 0xd4860
callq 0x948c0
movl %r15d, %r12d
andl $0xfe7fffff, %r12d      # imm = 0xFE7FFFFF
leal 0x800000(%r12), %r13d
testb %al, %al
cmovel %r15d, %r13d
movl %r13d, %esi
shrl $0x18, %esi
andl $0x1, %esi
leaq 0x353e0(%rip), %rdi     # 0xd4867
callq 0x948c0
orl $0x1000000, %r12d       # imm = 0x1000000
testb %al, %al
cmovel %r13d, %r12d
movl %r12d, %r15d
leaq 0x5e82d(%rip), %rcx     # 0xfdcd0
movq (%rcx), %rax
movq 0x1ae0(%rax), %rax
cmpb $0x0, 0x93(%rax)
jne 0x9f4c7
xorl %edi, %edi
cmpl $0x1, 0x1bc(%rax)
adcl $0x5, %edi
callq 0x95266
movl $0xbf800000, %eax       # imm = 0xBF800000
leaq -0x80(%rbp), %rsi
movq %rax, (%rsi)
leaq 0x35398(%rip), %rdi     # 0xd4872
xorl %edx, %edx
callq 0x92ee7
testb %al, %al
je 0x9f4f3
leaq 0x226a2(%rip), %rdi     # 0xc1b8e
xorl %esi, %esi
callq 0x57da5
leaq 0x22694(%rip), %rdi     # 0xc1b8e
xorl %esi, %esi
callq 0x58541
testb %al, %al
je 0x9f725
movss (%r14), %xmm0
movss 0x4(%r14), %xmm1
movss 0x17ac8(%rip), %xmm3    # 0xb6fe4
movaps %xmm3, %xmm2
minss %xmm0, %xmm2
xorps %xmm8, %xmm8
movaps %xmm0, %xmm4
cmpltss %xmm8, %xmm4
andnps %xmm2, %xmm4
movss 0x1830c(%rip), %xmm9    # 0xb7848
mulss %xmm9, %xmm4
movss 0x17abb(%rip), %xmm2    # 0xb7004
movaps %xmm3, %xmm6
minss %xmm1, %xmm6
movaps %xmm1, %xmm5
cmpltss %xmm8, %xmm5
andnps %xmm6, %xmm5
mulss %xmm9, %xmm5
movss 0x8(%r14), %xmm7
movaps %xmm3, %xmm10
minss %xmm7, %xmm10
movaps %xmm7, %xmm6
cmpltss %xmm8, %xmm6
andnps %xmm10, %xmm6
mulss %xmm9, %xmm6
movl $0xff, -0x2c(%rbp)
testb $0x2, %bl
jne 0x9f5bd
movss 0xc(%r14), %xmm9
minss %xmm9, %xmm3
cmpltss %xmm8, %xmm9
andnps %xmm3, %xmm9
mulss 0x1829c(%rip), %xmm9    # 0xb7848
addss 0x17a4f(%rip), %xmm9    # 0xb7004
cvttss2si %xmm9, %eax
movl %eax, -0x2c(%rbp)
addss %xmm2, %xmm4
addss %xmm2, %xmm5
addss %xmm2, %xmm6
cvtss2sd %xmm0, %xmm0
cvtss2sd %xmm1, %xmm1
xorps %xmm2, %xmm2
cvtss2sd %xmm7, %xmm2
testb $0x2, %bl
jne 0x9f5e8
xorps %xmm3, %xmm3
cvtss2sd 0xc(%r14), %xmm3
jmp 0x9f5f0
movsd 0x1dad0(%rip), %xmm3    # 0xbd0c0
cvttss2si %xmm4, %r14d
cvttss2si %xmm5, %eax
movl %eax, -0x30(%rbp)
cvttss2si %xmm6, %r12d
leaq 0x35274(%rip), %rdx     # 0xd487c
leaq -0x80(%rbp), %r13
movl $0x40, %esi
movq %r13, %rdi
movb $0x4, %al
callq 0x427cb
leaq -0x38(%rbp), %rcx
movq $0x0, (%rcx)
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x962c5
testb %al, %al
je 0x9f63f
leaq -0x80(%rbp), %rdi
callq 0x4728d
movl -0x2c(%rbp), %eax
movl %eax, (%rsp)
leaq 0x3524d(%rip), %rdx     # 0xd4899
movl $0x40, %esi
movq %r13, %rdi
movl %r14d, %ecx
movl -0x30(%rbp), %r8d
movl %r12d, %r9d
xorl %eax, %eax
callq 0x427cb
leaq -0x38(%rbp), %rcx
movq $0x0, (%rcx)
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x962c5
testb %al, %al
je 0x9f689
leaq -0x80(%rbp), %rdi
callq 0x4728d
leaq 0x34fbc(%rip), %rdx     # 0xd464c
movl $0x40, %esi
movq %r13, %rdi
movl %r14d, %ecx
movl -0x30(%rbp), %r8d
movl %r12d, %r9d
xorl %eax, %eax
callq 0x427cb
leaq -0x38(%rbp), %rcx
movq $0x0, (%rcx)
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x962c5
testb %al, %al
je 0x9f6cd
leaq -0x80(%rbp), %rdi
callq 0x4728d
testb $0x2, %bl
jne 0x9f720
movl -0x2c(%rbp), %eax
movl %eax, (%rsp)
leaq 0x34f5b(%rip), %rdx     # 0xd463a
leaq -0x80(%rbp), %rbx
movl $0x40, %esi
movq %rbx, %rdi
movl %r14d, %ecx
movl -0x30(%rbp), %r8d
movl %r12d, %r9d
xorl %eax, %eax
callq 0x427cb
leaq -0x38(%rbp), %rcx
movq $0x0, (%rcx)
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x962c5
testb %al, %al
je 0x9f720
leaq -0x80(%rbp), %rdi
callq 0x4728d
callq 0x5847b
movq -0x40(%rbp), %rax
movl %r15d, 0x306c(%rax)
callq 0x5847b
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq