// File: /workspace/github_cpp_makefile_star2_O3/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::ColorPickerOptionsPopup(float const*, int)
void ImGui::ColorPickerOptionsPopup(const float* ref_col, ImGuiColorEditFlags flags)
{
    bool allow_opt_picker = !(flags & ImGuiColorEditFlags__PickerMask);
    bool allow_opt_alpha_bar = !(flags & ImGuiColorEditFlags_NoAlpha) && !(flags & ImGuiColorEditFlags_AlphaBar);
    if ((!allow_opt_picker && !allow_opt_alpha_bar) || !BeginPopup("context"))
        return;
    ImGuiContext& g = *GImGui;
    if (allow_opt_picker)
    {
        ImVec2 picker_size(g.FontSize * 8, ImMax(g.FontSize * 8 - (GetFrameHeight() + g.Style.ItemInnerSpacing.x), 1.0f)); // FIXME: Picker size copied from main picker function
        PushItemWidth(picker_size.x);
        for (int picker_type = 0; picker_type < 2; picker_type++)
        {
            // Draw small/thumbnail version of each picker type (over an invisible button for selection)
            if (picker_type > 0) Separator();
            PushID(picker_type);
            ImGuiColorEditFlags picker_flags = ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoOptions | ImGuiColorEditFlags_NoLabel | ImGuiColorEditFlags_NoSidePreview | (flags & ImGuiColorEditFlags_NoAlpha);
            if (picker_type == 0) picker_flags |= ImGuiColorEditFlags_PickerHueBar;
            if (picker_type == 1) picker_flags |= ImGuiColorEditFlags_PickerHueWheel;
            ImVec2 backup_pos = GetCursorScreenPos();
            if (Selectable("##selectable", false, 0, picker_size)) // By default, Selectable() is closing popup
                g.ColorEditOptions = (g.ColorEditOptions & ~ImGuiColorEditFlags__PickerMask) | (picker_flags & ImGuiColorEditFlags__PickerMask);
            SetCursorScreenPos(backup_pos);
            ImVec4 previewing_ref_col;
            memcpy(&previewing_ref_col, ref_col, sizeof(float) * ((picker_flags & ImGuiColorEditFlags_NoAlpha) ? 3 : 4));
            ColorPicker4("##previewing_picker", &previewing_ref_col.x, picker_flags);
            PopID();
        }
        PopItemWidth();
    }
    if (allow_opt_alpha_bar)
    {
        if (allow_opt_picker) Separator();
        CheckboxFlags("Alpha Bar", &g.ColorEditOptions, ImGuiColorEditFlags_AlphaBar);
    }
    EndPopup();
}

// Assembly:
testl $0x6000000, %esi        # imm = 0x6000000
setne %al
testl $0x10002, %esi          # imm = 0x10002
setne %cl
testb %cl, %al
jne 0xa02a8
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, %r14d
movq %rdi, %r15
leaq 0x181f5(%rip), %rdi     # 0xb8289
xorl %esi, %esi
callq 0x573f5
testb %al, %al
je 0xa029a
leaq 0x5bc26(%rip), %rax     # 0xfbcd0
movq (%rax), %rbx
testl $0x6000000, %r14d       # imm = 0x6000000
je 0xa00c8
testl $0x10002, %r14d         # imm = 0x10002
jne 0xa0295
jmp 0xa027a
movl %r14d, -0x30(%rbp)
andl $0x2, %r14d
movl %r14d, -0x34(%rbp)
movss 0x1980(%rbx), %xmm0
mulss 0x157f4(%rip), %xmm0    # 0xb58d8
movss %xmm0, -0x2c(%rbp)
callq 0x562ff
movq %rbx, -0x40(%rbp)
addss 0x15b0(%rbx), %xmm0
movss -0x2c(%rbp), %xmm2
movaps %xmm2, %xmm1
subss %xmm0, %xmm1
maxss 0x14ed6(%rip), %xmm1    # 0xb4fe4
leaq -0x50(%rbp), %rax
movss %xmm2, (%rax)
movaps %xmm2, %xmm0
movss %xmm1, 0x4(%rax)
callq 0x55d0a
xorl %r14d, %r14d
movb $0x1, %bl
leaq -0x60(%rbp), %r13
xorl %r12d, %r12d
testb $0x1, %r14b
je 0xa0163
leaq 0x5bb94(%rip), %rax     # 0xfbcd0
movq (%rax), %rax
movq 0x1ae0(%rax), %rax
cmpb $0x0, 0x93(%rax)
jne 0xa0163
cmpl $0x1, 0x1bc(%rax)
movl $0x0, %edi
adcl $0x5, %edi
callq 0x935bd
movl %r12d, %edi
callq 0x54e5e
movzbl %bl, %eax
andl $0x1, %eax
shll $0x19, %eax
addl -0x34(%rbp), %eax
movzbl %r14b, %ecx
andl $0x1, %ecx
shll $0x1a, %ecx
leal (%rcx,%rax), %r12d
addl $0x1a8, %r12d           # imm = 0x1A8
callq 0x559ee
movlps %xmm0, -0x48(%rbp)
leaq 0x325b8(%rip), %rdi     # 0xd2754
xorl %esi, %esi
xorl %edx, %edx
leaq -0x50(%rbp), %rcx
callq 0x94650
testb %al, %al
je 0xa01cf
movq -0x40(%rbp), %rdx
movl 0x306c(%rdx), %eax
movl $0xf9ffffff, %ecx       # imm = 0xF9FFFFFF
andl %ecx, %eax
movl %r12d, %ecx
andl $0x6000000, %ecx        # imm = 0x6000000
orl %eax, %ecx
movl %ecx, 0x306c(%rdx)
leaq -0x48(%rbp), %rdi
callq 0x55a0a
xorl %eax, %eax
movl %r12d, %edx
andl $0x2, %edx
sete %al
leaq 0xc(,%rax,4), %r14
addl %edx, %edx
leaq -0x54(,%rax,4), %rdi
addq %rbp, %rdi
xorl %esi, %esi
callq 0xc260
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xc080
leaq 0x3254d(%rip), %rdi     # 0xd2761
movq %r13, %rsi
movl %r12d, %edx
xorl %ecx, %ecx
callq 0x9e2cd
callq 0x55082
movl $0x1, %r12d
movb $0x1, %r14b
testb $0x1, %bl
movl $0x0, %ebx
jne 0xa012f
callq 0x560da
testl $0x10002, -0x30(%rbp)   # imm = 0x10002
movq -0x40(%rbp), %rbx
jne 0xa0295
leaq 0x5ba7a(%rip), %rax     # 0xfbcd0
movq (%rax), %rax
movq 0x1ae0(%rax), %rax
cmpb $0x0, 0x93(%rax)
jne 0xa027a
xorl %edi, %edi
cmpl $0x1, 0x1bc(%rax)
adcl $0x5, %edi
callq 0x935bd
addq $0x306c, %rbx           # imm = 0x306C
leaq 0x1eb8b(%rip), %rdi     # 0xbee13
movq %rbx, %rsi
movl $0x10000, %edx          # imm = 0x10000
callq 0xa728f
callq 0x5732f
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq