// File: /workspace/github_cpp_makefile_star2_O3/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 0x9dd6f
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 0x1a91f(%rip), %rdi     # 0xb8289
xorl %esi, %esi
callq 0x573f5
testb %al, %al
je 0x9dd61
leaq 0x5e350(%rip), %r13     # 0xfbcd0
movq (%r13), %r15
movl 0x306c(%r15), %r12d
testl $0x700000, %ebx         # imm = 0x700000
je 0x9d9a7
movq %r15, %rax
testl $0x1800000, %ebx        # imm = 0x1800000
jne 0x9dac0
jmp 0x9da60
movq %r15, -0x38(%rbp)
movl %r12d, %esi
shrl $0x14, %esi
andl $0x1, %esi
leaq 0x34d4a(%rip), %rdi     # 0xd2705
callq 0x92c36
movl $0xff8fffff, %r13d      # imm = 0xFF8FFFFF
movl %r12d, %ecx
andl %r13d, %r12d
leal 0x100000(%r12), %r15d
testb %al, %al
cmovel %ecx, %r15d
movl %r15d, %esi
shrl $0x15, %esi
andl $0x1, %esi
leaq 0x34d1f(%rip), %rdi     # 0xd2709
callq 0x92c36
orl $0x200000, %r12d        # imm = 0x200000
testb %al, %al
cmovel %r15d, %r12d
movl %r12d, %esi
shrl $0x16, %esi
andl $0x1, %esi
leaq 0x17ad3(%rip), %rdi     # 0xb54df
callq 0x92c36
andl %r12d, %r13d
orl $0x400000, %r13d        # imm = 0x400000
testb %al, %al
cmovel %r12d, %r13d
movl %r13d, %r12d
leaq 0x5e2a5(%rip), %r13     # 0xfbcd0
movq (%r13), %rax
testl $0x1800000, %ebx        # imm = 0x1800000
jne 0x9dabc
movq 0x1ae0(%rax), %rax
cmpb $0x0, 0x93(%rax)
jne 0x9da5c
xorl %edi, %edi
cmpl $0x1, 0x1bc(%rax)
adcl $0x5, %edi
callq 0x935bd
movq -0x38(%rbp), %r15
movq %r15, -0x38(%rbp)
movl %r12d, %esi
shrl $0x17, %esi
andl $0x1, %esi
leaq 0x34c99(%rip), %rdi     # 0xd270d
callq 0x92c36
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 0x34c71(%rip), %rdi     # 0xd2714
callq 0x92c36
orl $0x1000000, %r15d       # imm = 0x1000000
testb %al, %al
cmovel %r12d, %r15d
movq (%r13), %rax
movl %r15d, %r12d
movq -0x38(%rbp), %r15
movq 0x1ae0(%rax), %rax
cmpb $0x0, 0x93(%rax)
jne 0x9dae1
xorl %edi, %edi
cmpl $0x1, 0x1bc(%rax)
adcl $0x5, %edi
callq 0x935bd
movl $0xbf800000, %eax       # imm = 0xBF800000
leaq -0x90(%rbp), %rsi
movq %rax, (%rsi)
leaq 0x34c28(%rip), %rdi     # 0xd271f
xorl %edx, %edx
callq 0x911cc
testb %al, %al
je 0x9db10
leaq 0x22055(%rip), %rdi     # 0xbfb5e
xorl %esi, %esi
callq 0x56c96
leaq 0x22047(%rip), %rdi     # 0xbfb5e
xorl %esi, %esi
callq 0x573f5
testb %al, %al
je 0x9dd55
movss (%r14), %xmm0
movss 0x4(%r14), %xmm1
movss 0x174ab(%rip), %xmm5    # 0xb4fe4
movaps %xmm5, %xmm3
minss %xmm0, %xmm3
xorps %xmm7, %xmm7
movaps %xmm0, %xmm2
cmpltss %xmm7, %xmm2
andnps %xmm3, %xmm2
movss 0x17cf2(%rip), %xmm3    # 0xb5848
mulss %xmm3, %xmm2
movss 0x174a1(%rip), %xmm9    # 0xb5004
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 0x9dbec
movss 0xc(%r14), %xmm9
minss %xmm9, %xmm5
xorps %xmm3, %xmm3
cvtss2sd %xmm9, %xmm3
cmpltss %xmm7, %xmm9
andnps %xmm5, %xmm9
mulss 0x17c6f(%rip), %xmm9    # 0xb5848
addss 0x17422(%rip), %xmm9    # 0xb5004
cvttss2si %xmm9, %eax
movl %eax, -0x2c(%rbp)
jmp 0x9dbfb
movsd 0x1d49c(%rip), %xmm3    # 0xbb090
movl $0xff, -0x2c(%rbp)
cvttss2si %xmm2, %r14d
cvttss2si %xmm4, %eax
movl %eax, -0x30(%rbp)
cvttss2si %xmm8, %r12d
cvtss2sd %xmm0, %xmm0
cvtss2sd %xmm1, %xmm1
xorps %xmm2, %xmm2
cvtss2sd %xmm6, %xmm2
leaq 0x34b07(%rip), %rdx     # 0xd2729
leaq -0x90(%rbp), %r13
movl $0x40, %esi
movq %r13, %rdi
movb $0x4, %al
callq 0x41f22
leaq -0x44(%rbp), %rcx
movq $0x0, (%rcx)
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x94650
testb %al, %al
je 0x9dc5f
leaq -0x90(%rbp), %rdi
callq 0x46769
movl -0x2c(%rbp), %eax
movl %eax, (%rsp)
leaq 0x34ada(%rip), %rdx     # 0xd2746
movl $0x40, %esi
movq %r13, %rdi
movl %r14d, %ecx
movl -0x30(%rbp), %r8d
movl %r12d, %r9d
xorl %eax, %eax
callq 0x41f22
leaq -0x44(%rbp), %rcx
movq $0x0, (%rcx)
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x94650
testb %al, %al
je 0x9dcac
leaq -0x90(%rbp), %rdi
callq 0x46769
leaq 0x34846(%rip), %rdx     # 0xd24f9
movl $0x40, %esi
movq %r13, %rdi
movl %r14d, %ecx
movl -0x30(%rbp), %r8d
movl %r12d, %r9d
xorl %eax, %eax
callq 0x41f22
leaq -0x44(%rbp), %rcx
movq $0x0, (%rcx)
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x94650
testb %al, %al
je 0x9dcf3
leaq -0x90(%rbp), %rdi
callq 0x46769
testb $0x2, %bl
jne 0x9dd4c
movl -0x2c(%rbp), %eax
movl %eax, (%rsp)
leaq 0x347e2(%rip), %rdx     # 0xd24e7
leaq -0x90(%rbp), %rbx
movl $0x40, %esi
movq %rbx, %rdi
movl %r14d, %ecx
movl -0x30(%rbp), %r8d
movl %r12d, %r9d
xorl %eax, %eax
callq 0x41f22
leaq -0x44(%rbp), %rcx
movq $0x0, (%rcx)
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x94650
testb %al, %al
je 0x9dd4c
leaq -0x90(%rbp), %rdi
callq 0x46769
callq 0x5732f
movl -0x3c(%rbp), %r12d
movl %r12d, 0x306c(%r15)
callq 0x5732f
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq