// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0xc(%rbp), %eax
andl $0x700000, %eax         # imm = 0x700000
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0xd(%rbp)
movl -0xc(%rbp), %eax
andl $0x1800000, %eax        # imm = 0x1800000
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0xe(%rbp)
testb $0x1, -0xd(%rbp)
jne 0x14d0d8
testb $0x1, -0xe(%rbp)
je 0x14d0ea
leaq 0x281c8(%rip), %rdi     # 0x1752a7
xorl %esi, %esi
callq 0xde5f0
testb $0x1, %al
jne 0x14d0ef
jmp 0x14d5c5
leaq 0xc5e4a(%rip), %rax     # 0x212f40
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl 0x306c(%rax), %eax
movl %eax, -0x1c(%rbp)
testb $0x1, -0xd(%rbp)
je 0x14d1b8
movl -0x1c(%rbp), %eax
andl $0x100000, %eax         # imm = 0x100000
cmpl $0x0, %eax
setne %al
movzbl %al, %esi
andl $0x1, %esi
leaq 0x42b84(%rip), %rdi     # 0x18fcb3
callq 0x13cdf0
testb $0x1, %al
jne 0x14d13a
jmp 0x14d14a
movl -0x1c(%rbp), %eax
andl $0xff8fffff, %eax       # imm = 0xFF8FFFFF
orl $0x100000, %eax         # imm = 0x100000
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
andl $0x200000, %eax         # imm = 0x200000
cmpl $0x0, %eax
setne %al
movzbl %al, %esi
andl $0x1, %esi
leaq 0x42b52(%rip), %rdi     # 0x18fcb7
callq 0x13cdf0
testb $0x1, %al
jne 0x14d170
jmp 0x14d180
movl -0x1c(%rbp), %eax
andl $0xff8fffff, %eax       # imm = 0xFF8FFFFF
orl $0x200000, %eax         # imm = 0x200000
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
andl $0x400000, %eax         # imm = 0x400000
cmpl $0x0, %eax
setne %al
movzbl %al, %esi
andl $0x1, %esi
leaq 0x25338(%rip), %rdi     # 0x1724d3
callq 0x13cdf0
testb $0x1, %al
jne 0x14d1a6
jmp 0x14d1b6
movl -0x1c(%rbp), %eax
andl $0xff8fffff, %eax       # imm = 0xFF8FFFFF
orl $0x400000, %eax         # imm = 0x400000
movl %eax, -0x1c(%rbp)
jmp 0x14d1b8
testb $0x1, -0xe(%rbp)
je 0x14d237
testb $0x1, -0xd(%rbp)
je 0x14d1c9
callq 0x13dec0
movl -0x1c(%rbp), %eax
andl $0x800000, %eax         # imm = 0x800000
cmpl $0x0, %eax
setne %al
movzbl %al, %esi
andl $0x1, %esi
leaq 0x42ad7(%rip), %rdi     # 0x18fcbb
callq 0x13cdf0
testb $0x1, %al
jne 0x14d1ef
jmp 0x14d1ff
movl -0x1c(%rbp), %eax
andl $0xfe7fffff, %eax       # imm = 0xFE7FFFFF
orl $0x800000, %eax         # imm = 0x800000
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
andl $0x1000000, %eax        # imm = 0x1000000
cmpl $0x0, %eax
setne %al
movzbl %al, %esi
andl $0x1, %esi
leaq 0x42aa8(%rip), %rdi     # 0x18fcc2
callq 0x13cdf0
testb $0x1, %al
jne 0x14d225
jmp 0x14d235
movl -0x1c(%rbp), %eax
andl $0xfe7fffff, %eax       # imm = 0xFE7FFFFF
orl $0x1000000, %eax        # imm = 0x1000000
movl %eax, -0x1c(%rbp)
jmp 0x14d237
testb $0x1, -0xd(%rbp)
jne 0x14d243
testb $0x1, -0xe(%rbp)
je 0x14d248
callq 0x13dec0
leaq -0x24(%rbp), %rdi
movss 0x24d2c(%rip), %xmm0    # 0x171f80
xorps %xmm1, %xmm1
callq 0xbf4c0
leaq 0x42a6a(%rip), %rdi     # 0x18fccd
leaq -0x24(%rbp), %rsi
callq 0x13a930
testb $0x1, %al
jne 0x14d272
jmp 0x14d280
leaq 0x2fe5a(%rip), %rdi     # 0x17d0d3
xorl %esi, %esi
callq 0xdde00
leaq 0x2fe4c(%rip), %rdi     # 0x17d0d3
xorl %esi, %esi
callq 0xde5f0
testb $0x1, %al
jne 0x14d297
jmp 0x14d5b3
movq -0x8(%rbp), %rax
movss (%rax), %xmm0
callq 0x13bfc0
movss 0x254b0(%rip), %xmm1    # 0x17275c
mulss %xmm1, %xmm0
movss 0x24d20(%rip), %xmm1    # 0x171fd8
addss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movss 0x4(%rax), %xmm0
callq 0x13bfc0
movss 0x25483(%rip), %xmm1    # 0x17275c
mulss %xmm1, %xmm0
movss 0x24cf3(%rip), %xmm1    # 0x171fd8
addss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movss 0x8(%rax), %xmm0
callq 0x13bfc0
movss 0x25456(%rip), %xmm1    # 0x17275c
mulss %xmm1, %xmm0
movss 0x24cc6(%rip), %xmm1    # 0x171fd8
addss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0x30(%rbp)
movl -0xc(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x14d335
movl $0xff, %eax
movl %eax, -0xa4(%rbp)
jmp 0x14d365
movq -0x8(%rbp), %rax
movss 0xc(%rax), %xmm0
callq 0x13bfc0
movss 0x25411(%rip), %xmm1    # 0x17275c
mulss %xmm1, %xmm0
movss 0x24c81(%rip), %xmm1    # 0x171fd8
addss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0xa4(%rbp)
movl -0xa4(%rbp), %eax
movl %eax, -0x34(%rbp)
leaq -0x80(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x8(%rbp), %rax
movss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0xc0(%rbp)
movq -0x8(%rbp), %rax
movss 0x4(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0xb8(%rbp)
movq -0x8(%rbp), %rax
movss 0x8(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0xb0(%rbp)
movl -0xc(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x14d3d4
movss 0x23872(%rip), %xmm0    # 0x170c3c
movss %xmm0, -0xcc(%rbp)
jmp 0x14d3e5
movq -0x8(%rbp), %rax
movss 0xc(%rax), %xmm0
movss %xmm0, -0xcc(%rbp)
movsd -0xb0(%rbp), %xmm2
movsd -0xb8(%rbp), %xmm1
movsd -0xc0(%rbp), %xmm0
movq -0xc8(%rbp), %rdi
movss -0xcc(%rbp), %xmm3
cvtss2sd %xmm3, %xmm3
movl $0x40, %esi
leaq 0x428bb(%rip), %rdx     # 0x18fcd7
movb $0x4, %al
callq 0xc4d30
leaq -0x80(%rbp), %rax
movq %rax, -0xd8(%rbp)
leaq -0x88(%rbp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0xbf4c0
movq -0xd8(%rbp), %rdi
xorl %edx, %edx
leaq -0x88(%rbp), %rcx
movl %edx, %esi
callq 0x13f2b0
testb $0x1, %al
jne 0x14d45d
jmp 0x14d466
leaq -0x80(%rbp), %rdi
callq 0xcaaa0
leaq -0x80(%rbp), %rdi
movl -0x28(%rbp), %ecx
movl -0x2c(%rbp), %r8d
movl -0x30(%rbp), %r9d
movl -0x34(%rbp), %eax
movl $0x40, %esi
leaq 0x42870(%rip), %rdx     # 0x18fcf4
movl %eax, (%rsp)
movb $0x0, %al
callq 0xc4d30
leaq -0x80(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq -0x90(%rbp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0xbf4c0
movq -0xe0(%rbp), %rdi
xorl %edx, %edx
leaq -0x90(%rbp), %rcx
movl %edx, %esi
callq 0x13f2b0
testb $0x1, %al
jne 0x14d4c8
jmp 0x14d4d1
leaq -0x80(%rbp), %rdi
callq 0xcaaa0
leaq -0x80(%rbp), %rdi
movl -0x28(%rbp), %ecx
movl -0x2c(%rbp), %r8d
movl -0x30(%rbp), %r9d
movl $0x40, %esi
leaq 0x425bb(%rip), %rdx     # 0x18faa7
movb $0x0, %al
callq 0xc4d30
leaq -0x80(%rbp), %rax
movq %rax, -0xe8(%rbp)
leaq -0x98(%rbp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0xbf4c0
movq -0xe8(%rbp), %rdi
xorl %edx, %edx
leaq -0x98(%rbp), %rcx
movl %edx, %esi
callq 0x13f2b0
testb $0x1, %al
jne 0x14d52d
jmp 0x14d536
leaq -0x80(%rbp), %rdi
callq 0xcaaa0
movl -0xc(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x14d5ae
leaq -0x80(%rbp), %rdi
movl -0x28(%rbp), %ecx
movl -0x2c(%rbp), %r8d
movl -0x30(%rbp), %r9d
movl -0x34(%rbp), %eax
movl $0x40, %esi
leaq 0x42536(%rip), %rdx     # 0x18fa95
movl %eax, (%rsp)
movb $0x0, %al
callq 0xc4d30
leaq -0x80(%rbp), %rax
movq %rax, -0xf0(%rbp)
leaq -0xa0(%rbp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0xbf4c0
movq -0xf0(%rbp), %rdi
xorl %edx, %edx
leaq -0xa0(%rbp), %rcx
movl %edx, %esi
callq 0x13f2b0
testb $0x1, %al
jne 0x14d5a3
jmp 0x14d5ac
leaq -0x80(%rbp), %rdi
callq 0xcaaa0
jmp 0x14d5ae
callq 0xde4e0
movl -0x1c(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x306c(%rax)
callq 0xde4e0
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nop