// File: /workspace/github_cpp_makefile_star2_O2/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 0x86065
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x195f1(%rip), %rdi     # 0x9f2b9
xorl %esi, %esi
callq 0x44c84
testb %al, %al
je 0x86057
leaq 0x5e002(%rip), %rax     # 0xe3ce0
movq (%rax), %r15
movl 0x306c(%r15), %r12d
testl $0x700000, %ebx         # imm = 0x700000
je 0x85d01
testl $0x1800000, %ebx        # imm = 0x1800000
jne 0x85dee
jmp 0x85d94
movq %r15, -0x38(%rbp)
movl %r12d, %esi
shrl $0x14, %esi
andl $0x1, %esi
leaq 0x33d60(%rip), %rdi     # 0xb9a75
callq 0x7bea5
movl %r12d, %ecx
movl $0xff8fffff, %r12d      # imm = 0xFF8FFFFF
movl %ecx, %r13d
andl %r12d, %r13d
leal 0x100000(%r13), %r15d
testb %al, %al
cmovel %ecx, %r15d
movl %r15d, %esi
shrl $0x15, %esi
andl $0x1, %esi
leaq 0x33d33(%rip), %rdi     # 0xb9a79
callq 0x7bea5
orl $0x200000, %r13d        # imm = 0x200000
testb %al, %al
cmovel %r15d, %r13d
movl %r13d, %esi
shrl $0x16, %esi
andl $0x1, %esi
leaq 0x1678b(%rip), %rdi     # 0x9c4f3
callq 0x7bea5
andl %r13d, %r12d
orl $0x400000, %r12d        # imm = 0x400000
testb %al, %al
cmovel %r13d, %r12d
testl $0x1800000, %ebx        # imm = 0x1800000
je 0x85d8b
movq -0x38(%rbp), %r15
jmp 0x85dee
callq 0x7cad7
movq -0x38(%rbp), %r15
movl %r12d, %esi
shrl $0x17, %esi
andl $0x1, %esi
leaq 0x33cd9(%rip), %rdi     # 0xb9a7d
callq 0x7bea5
movq %r15, %r13
movl %r12d, %r15d
andl $0xfe7fffff, %r15d      # imm = 0xFE7FFFFF
movl %r12d, %ecx
leal 0x800000(%r15), %r12d
testb %al, %al
cmovel %ecx, %r12d
movl %r12d, %esi
shrl $0x18, %esi
andl $0x1, %esi
leaq 0x33cae(%rip), %rdi     # 0xb9a84
callq 0x7bea5
orl $0x1000000, %r15d       # imm = 0x1000000
testb %al, %al
cmovel %r12d, %r15d
movl %r15d, %r12d
movq %r13, %r15
callq 0x7cad7
movl $0xbf800000, %eax       # imm = 0xBF800000
leaq -0x90(%rbp), %rsi
movq %rax, (%rsi)
leaq 0x33c86(%rip), %rdi     # 0xb9a8f
callq 0x7a64b
testb %al, %al
je 0x85e20
leaq 0x21075(%rip), %rdi     # 0xa6e8e
xorl %esi, %esi
callq 0x446ff
leaq 0x21067(%rip), %rdi     # 0xa6e8e
xorl %esi, %esi
callq 0x44c84
testb %al, %al
je 0x8604b
movss (%r14), %xmm0
movss 0x4(%r14), %xmm1
movss 0x161af(%rip), %xmm5    # 0x9bff8
movaps %xmm5, %xmm3
minss %xmm0, %xmm3
xorps %xmm7, %xmm7
movaps %xmm0, %xmm2
cmpltss %xmm7, %xmm2
andnps %xmm3, %xmm2
movss 0x16a0e(%rip), %xmm3    # 0x9c874
mulss %xmm3, %xmm2
movss 0x161a5(%rip), %xmm9    # 0x9c018
addss %xmm9, %xmm2
movaps %xmm5, %xmm6
minss %xmm1, %xmm6
movaps %xmm1, %xmm4
cmpltss %xmm7, %xmm4
andnps %xmm6, %xmm4
mulss %xmm3, %xmm4
addss %xmm9, %xmm4
movss 0x8(%r14), %xmm6
movaps %xmm5, %xmm10
minss %xmm6, %xmm10
movaps %xmm6, %xmm8
cmpltss %xmm7, %xmm8
andnps %xmm10, %xmm8
mulss %xmm3, %xmm8
addss %xmm9, %xmm8
testb $0x2, %bl
movl %r12d, -0x3c(%rbp)
jne 0x85ef9
movss 0xc(%r14), %xmm9
minss %xmm9, %xmm5
cvtss2sd %xmm9, %xmm3
cmpltss %xmm7, %xmm9
andnps %xmm5, %xmm9
mulss 0x1698e(%rip), %xmm9    # 0x9c874
addss 0x16129(%rip), %xmm9    # 0x9c018
cvttss2si %xmm9, %eax
movl %eax, -0x2c(%rbp)
jmp 0x85f08
movsd 0x1c4bf(%rip), %xmm3    # 0xa23c0
movl $0xff, -0x2c(%rbp)
cvttss2si %xmm2, %r14d
cvttss2si %xmm4, %eax
movl %eax, -0x38(%rbp)
cvttss2si %xmm8, %r12d
cvtss2sd %xmm0, %xmm0
cvtss2sd %xmm1, %xmm1
cvtss2sd %xmm6, %xmm2
leaq 0x33b6d(%rip), %rdx     # 0xb9a99
leaq -0x90(%rbp), %r13
pushq $0x40
popq %rsi
movq %r13, %rdi
movb $0x4, %al
callq 0x3468c
leaq -0x44(%rbp), %rcx
andq $0x0, (%rcx)
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x7d81c
testb %al, %al
je 0x85f64
leaq -0x90(%rbp), %rdi
callq 0x37a0c
movl -0x2c(%rbp), %eax
movl %eax, (%rsp)
leaq 0x33b45(%rip), %rdx     # 0xb9ab6
pushq $0x40
popq %rsi
movq %r13, %rdi
movl %r14d, %ecx
movl -0x38(%rbp), %r8d
movl %r12d, %r9d
xorl %eax, %eax
callq 0x3468c
leaq -0x44(%rbp), %rcx
andq $0x0, (%rcx)
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x7d81c
testb %al, %al
je 0x85fac
leaq -0x90(%rbp), %rdi
callq 0x37a0c
leaq 0x338b6(%rip), %rdx     # 0xb9869
pushq $0x40
popq %rsi
movq %r13, %rdi
movl %r14d, %ecx
movl -0x38(%rbp), %r8d
movl %r12d, %r9d
xorl %eax, %eax
callq 0x3468c
leaq -0x44(%rbp), %rcx
andq $0x0, (%rcx)
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x7d81c
testb %al, %al
je 0x85fee
leaq -0x90(%rbp), %rdi
callq 0x37a0c
testb $0x2, %bl
jne 0x86042
movl -0x2c(%rbp), %eax
movl %eax, (%rsp)
leaq 0x33857(%rip), %rdx     # 0xb9857
leaq -0x90(%rbp), %rbx
pushq $0x40
popq %rsi
movq %rbx, %rdi
movl %r14d, %ecx
movl -0x38(%rbp), %r8d
movl %r12d, %r9d
xorl %eax, %eax
callq 0x3468c
leaq -0x44(%rbp), %rcx
andq $0x0, (%rcx)
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x7d81c
testb %al, %al
je 0x86042
leaq -0x90(%rbp), %rdi
callq 0x37a0c
callq 0x44bbe
movl -0x3c(%rbp), %r12d
movl %r12d, 0x306c(%r15)
callq 0x44bbe
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq