// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::ColorTooltip(char const*, float const*, int)
void ImGui::ColorTooltip(const char* text, const float* col, ImGuiColorEditFlags flags)
{
    ImGuiContext& g = *GImGui;

    BeginTooltipEx(0, ImGuiTooltipFlags_OverridePreviousTooltip);
    const char* text_end = text ? FindRenderedTextEnd(text, NULL) : text;
    if (text_end > text)
    {
        TextEx(text, text_end);
        Separator();
    }

    ImVec2 sz(g.FontSize * 3 + g.Style.FramePadding.y * 2, g.FontSize * 3 + g.Style.FramePadding.y * 2);
    ImVec4 cf(col[0], col[1], col[2], (flags & ImGuiColorEditFlags_NoAlpha) ? 1.0f : col[3]);
    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]);
    ColorButton("##preview", cf, (flags & (ImGuiColorEditFlags__InputMask | ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_AlphaPreview | ImGuiColorEditFlags_AlphaPreviewHalf)) | ImGuiColorEditFlags_NoTooltip, sz);
    SameLine();
    if ((flags & ImGuiColorEditFlags_InputRGB) || !(flags & ImGuiColorEditFlags__InputMask))
    {
        if (flags & ImGuiColorEditFlags_NoAlpha)
            Text("#%02X%02X%02X\nR: %d, G: %d, B: %d\n(%.3f, %.3f, %.3f)", cr, cg, cb, cr, cg, cb, col[0], col[1], col[2]);
        else
            Text("#%02X%02X%02X%02X\nR:%d, G:%d, B:%d, A:%d\n(%.3f, %.3f, %.3f, %.3f)", cr, cg, cb, ca, cr, cg, cb, ca, col[0], col[1], col[2], col[3]);
    }
    else if (flags & ImGuiColorEditFlags_InputHSV)
    {
        if (flags & ImGuiColorEditFlags_NoAlpha)
            Text("H: %.3f, S: %.3f, V: %.3f", col[0], col[1], col[2]);
        else
            Text("H: %.3f, S: %.3f, V: %.3f, A: %.3f", col[0], col[1], col[2], col[3]);
    }
    EndTooltip();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %edx, -0x2c(%rbp)
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x5bf9c(%rip), %rax     # 0xfdcd0
movq (%rax), %r14
xorl %r12d, %r12d
xorl %edi, %edi
movl $0x1, %esi
callq 0x57b95
testq %r15, %r15
je 0xa1d58
movq %r15, %rdi
xorl %esi, %esi
callq 0x44e8b
movq %rax, %r12
cmpq %r15, %r12
jbe 0xa1d9a
xorl %r13d, %r13d
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x91b8c
leaq 0x5bf5c(%rip), %rax     # 0xfdcd0
movq (%rax), %rax
movq 0x1ae0(%rax), %rax
cmpb $0x0, 0x93(%rax)
jne 0xa1d9a
cmpl $0x1, 0x1bc(%rax)
adcl $0x5, %r13d
movl %r13d, %edi
callq 0x95266
movss 0x1980(%r14), %xmm0
movss 0x159c(%r14), %xmm1
mulss 0x1523c(%rip), %xmm0    # 0xb6ff0
addss %xmm1, %xmm1
addss %xmm1, %xmm0
movss (%rbx), %xmm3
movss 0x4(%rbx), %xmm4
movss 0x8(%rbx), %xmm2
movss 0x15212(%rip), %xmm1    # 0xb6fe4
movl -0x2c(%rbp), %r14d
testb $0x2, %r14b
jne 0xa1de1
movss 0xc(%rbx), %xmm1
shufps $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movaps %xmm3, -0x60(%rbp)
movss %xmm3, -0x3c(%rbp)
movaps %xmm4, -0x50(%rbp)
movss %xmm4, -0x38(%rbp)
movaps %xmm2, -0x70(%rbp)
movss %xmm2, -0x34(%rbp)
movss %xmm1, -0x30(%rbp)
xorps %xmm3, %xmm3
movl $0xff, %r15d
testb $0x2, %r14b
jne 0xa1e42
movss 0xc(%rbx), %xmm1
movss 0x151c3(%rip), %xmm2    # 0xb6fe4
minss %xmm1, %xmm2
cmpltss %xmm3, %xmm1
andnps %xmm2, %xmm1
mulss 0x15a13(%rip), %xmm1    # 0xb7848
addss 0x151c7(%rip), %xmm1    # 0xb7004
cvttss2si %xmm1, %r15d
movl %r14d, %edx
andl $0x18060002, %edx       # imm = 0x18060002
orl $0x40, %edx
leaq 0x32945(%rip), %rdi     # 0xd479a
leaq -0x3c(%rbp), %rsi
callq 0x9f744
movss 0x1516a(%rip), %xmm1    # 0xb6fd0
xorps %xmm0, %xmm0
callq 0x569e1
movl %r14d, %eax
xorps %xmm0, %xmm0
cvtss2sd (%rbx), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x4(%rbx), %xmm1
andl $0x18000000, %eax       # imm = 0x18000000
xorps %xmm2, %xmm2
cvtss2sd 0x8(%rbx), %xmm2
cmpl $0x10000000, %eax       # imm = 0x10000000
jne 0xa1eb9
testb $0x2, %r14b
jne 0xa1f62
xorps %xmm3, %xmm3
cvtss2sd 0xc(%rbx), %xmm3
leaq 0x32988(%rip), %rdi     # 0xd4835
movb $0x4, %al
callq 0x92024
jmp 0xa1f8f
movss 0x15123(%rip), %xmm4    # 0xb6fe4
movaps %xmm4, %xmm3
movaps -0x60(%rbp), %xmm6
minss %xmm6, %xmm3
xorps %xmm8, %xmm8
cmpltss %xmm8, %xmm6
andnps %xmm3, %xmm6
movaps %xmm4, %xmm3
movaps -0x50(%rbp), %xmm7
minss %xmm7, %xmm3
cmpltss %xmm8, %xmm7
andnps %xmm3, %xmm7
movaps -0x70(%rbp), %xmm5
minss %xmm5, %xmm4
cmpltss %xmm8, %xmm5
andnps %xmm4, %xmm5
movss 0x15942(%rip), %xmm3    # 0xb7848
mulss %xmm3, %xmm6
movss 0x150f2(%rip), %xmm4    # 0xb7004
mulss %xmm3, %xmm7
mulss %xmm3, %xmm5
addss %xmm4, %xmm6
addss %xmm4, %xmm7
cvttss2si %xmm6, %esi
cvttss2si %xmm7, %edx
addss %xmm4, %xmm5
cvttss2si %xmm5, %ecx
testb $0x2, %r14b
jne 0xa1f72
xorps %xmm3, %xmm3
cvtss2sd 0xc(%rbx), %xmm3
subq $0x8, %rsp
leaq 0x3288e(%rip), %rdi     # 0xd47d9
movl %r15d, %r8d
movl %esi, %r9d
movb $0x4, %al
pushq %r15
pushq %rcx
pushq %rdx
callq 0x92024
addq $0x20, %rsp
jmp 0xa1f8f
leaq 0x328b2(%rip), %rdi     # 0xd481b
movb $0x3, %al
callq 0x92024
jmp 0xa1f8f
subq $0x8, %rsp
leaq 0x32827(%rip), %rdi     # 0xd47a4
movl %esi, %r8d
movl %edx, %r9d
movb $0x3, %al
pushq %rcx
callq 0x92024
addq $0x10, %rsp
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x57cdf