// File: /workspace/github_cpp_makefile_star2_O1/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 0xa1bf2
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, %ebx
movq %rdi, %r15
leaq 0x18899(%rip), %rdi     # 0xba289
xorl %esi, %esi
callq 0x58541
testb %al, %al
je 0xa1be4
leaq 0x5c2ca(%rip), %rax     # 0xfdcd0
movq (%rax), %rax
movq %rax, -0x30(%rbp)
testl $0x6000000, %ebx        # imm = 0x6000000
jne 0xa1b88
movl %ebx, -0x38(%rbp)
andl $0x2, %ebx
movl %ebx, -0x3c(%rbp)
movq -0x30(%rbp), %rbx
movss 0x1980(%rbx), %xmm0
mulss 0x15ea2(%rip), %xmm0    # 0xb78d8
movss %xmm0, -0x34(%rbp)
callq 0x57404
addss 0x15b0(%rbx), %xmm0
movss -0x34(%rbp), %xmm2
movaps %xmm2, %xmm1
subss %xmm0, %xmm1
maxss 0x15588(%rip), %xmm1    # 0xb6fe4
leaq -0x50(%rbp), %rax
movss %xmm2, (%rax)
movaps %xmm2, %xmm0
movss %xmm1, 0x4(%rax)
callq 0x56dd7
xorl %r13d, %r13d
leaq -0x60(%rbp), %r12
cmpl $0x1, %r13d
jne 0xa1aac
leaq 0x5c24b(%rip), %rax     # 0xfdcd0
movq (%rax), %rax
movq 0x1ae0(%rax), %rax
cmpb $0x0, 0x93(%rax)
jne 0xa1aac
cmpl $0x1, 0x1bc(%rax)
movl $0x0, %edi
adcl $0x5, %edi
callq 0x95266
xorl %ebx, %ebx
cmpl $0x1, %r13d
sete %bl
movl %r13d, %edi
callq 0x55f53
xorl %eax, %eax
testl %r13d, %r13d
sete %al
shll $0x19, %eax
addl -0x3c(%rbp), %eax
shll $0x1a, %ebx
leal (%rbx,%rax), %r14d
addl $0x1a8, %r14d           # imm = 0x1A8
callq 0x56ab2
movlps %xmm0, -0x48(%rbp)
leaq 0x32dbe(%rip), %rdi     # 0xd48a7
xorl %esi, %esi
xorl %edx, %edx
leaq -0x50(%rbp), %rcx
callq 0x962c5
testb %al, %al
je 0xa1b1c
movq -0x30(%rbp), %rdx
movl 0x306c(%rdx), %eax
movl $0xf9ffffff, %ecx       # imm = 0xF9FFFFFF
andl %ecx, %eax
movl %r14d, %ecx
andl $0x6000000, %ecx        # imm = 0x6000000
orl %eax, %ecx
movl %ecx, 0x306c(%rdx)
leaq -0x48(%rbp), %rdi
callq 0x56ace
xorl %eax, %eax
movl %r14d, %edx
andl $0x2, %edx
sete %al
leaq 0xc(,%rax,4), %rbx
addl %edx, %edx
leaq -0x54(,%rax,4), %rdi
addq %rbp, %rdi
xorl %esi, %esi
callq 0xc260
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0xc080
leaq 0x32d53(%rip), %rdi     # 0xd48b4
movq %r12, %rsi
movl %r14d, %edx
xorl %ecx, %ecx
callq 0x9fca1
callq 0x56188
incl %r13d
cmpl $0x1, %r13d
je 0xa1a78
callq 0x571b8
movl -0x38(%rbp), %ebx
testl $0x10002, %ebx          # imm = 0x10002
jne 0xa1bdf
testl $0x6000000, %ebx        # imm = 0x6000000
jne 0xa1bc3
leaq 0x5c131(%rip), %rax     # 0xfdcd0
movq (%rax), %rax
movq 0x1ae0(%rax), %rax
cmpb $0x0, 0x93(%rax)
jne 0xa1bc3
xorl %edi, %edi
cmpl $0x1, 0x1bc(%rax)
adcl $0x5, %edi
callq 0x95266
movq -0x30(%rbp), %rsi
addq $0x306c, %rsi           # imm = 0x306C
leaq 0x1f26e(%rip), %rdi     # 0xc0e43
movl $0x10000, %edx          # imm = 0x10000
callq 0xa8dad
callq 0x5847b
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq