// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui_draw.cpp
// Function: ImFont::AddGlyph(ImFontConfig const*, unsigned short, float, float, float, float, float, float, float, float, float)
void ImFont::AddGlyph(const ImFontConfig* cfg, ImWchar codepoint, float x0, float y0, float x1, float y1, float u0, float v0, float u1, float v1, float advance_x)
{
    if (cfg != NULL)
    {
        // Clamp & recenter if needed
        const float advance_x_original = advance_x;
        advance_x = ImClamp(advance_x, cfg->GlyphMinAdvanceX, cfg->GlyphMaxAdvanceX);
        if (advance_x != advance_x_original)
        {
            float char_off_x = cfg->PixelSnapH ? ImFloor((advance_x - advance_x_original) * 0.5f) : (advance_x - advance_x_original) * 0.5f;
            x0 += char_off_x;
            x1 += char_off_x;
        }

        // Snap to pixel
        if (cfg->PixelSnapH)
            advance_x = IM_ROUND(advance_x);

        // Bake spacing
        advance_x += cfg->GlyphExtraSpacing.x;
    }

    Glyphs.resize(Glyphs.Size + 1);
    ImFontGlyph& glyph = Glyphs.back();
    glyph.Codepoint = (unsigned int)codepoint;
    glyph.Visible = (x0 != x1) && (y0 != y1);
    glyph.X0 = x0;
    glyph.Y0 = y0;
    glyph.X1 = x1;
    glyph.Y1 = y1;
    glyph.U0 = u0;
    glyph.V0 = v0;
    glyph.U1 = u1;
    glyph.V1 = v1;
    glyph.AdvanceX = advance_x;

    // Compute rough surface usage metrics (+1 to account for average padding, +0.99 to round)
    // We use (U1-U0)*TexWidth instead of X1-X0 to account for oversampling.
    float pad = ContainerAtlas->TexGlyphPadding + 0.99f;
    DirtyLookupTables = true;
    MetricsTotalSurface += (int)((glyph.U1 - glyph.U0) * ContainerAtlas->TexWidth + pad) * (int)((glyph.V1 - glyph.V0) * ContainerAtlas->TexHeight + pad);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movss %xmm7, -0x28(%rbp)
movss %xmm6, -0x20(%rbp)
movss %xmm5, -0x24(%rbp)
movss %xmm4, -0x1c(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm1, -0x70(%rbp)
movl %edx, %r14d
movq %rdi, %rbx
movss 0x10(%rbp), %xmm6
testq %rsi, %rsi
je 0x6a587
movss 0x40(%rsi), %xmm1
movss 0x44(%rsi), %xmm4
minss %xmm6, %xmm4
movaps %xmm6, %xmm5
cmpltss %xmm1, %xmm5
movaps %xmm5, %xmm3
andnps %xmm4, %xmm3
andps %xmm1, %xmm5
orps %xmm3, %xmm5
ucomiss %xmm6, %xmm5
movb 0x20(%rsi), %al
jne 0x6a53b
jnp 0x6a55d
movaps %xmm5, %xmm1
subss %xmm6, %xmm1
mulss 0x31ace(%rip), %xmm1    # 0x9c018
testb $0x1, %al
je 0x6a555
cvttps2dq %xmm1, %xmm1
cvtdq2ps %xmm1, %xmm1
addss %xmm1, %xmm0
addss %xmm1, %xmm2
testb $0x1, %al
je 0x6a574
movss 0x31aaf(%rip), %xmm1    # 0x9c018
addss %xmm5, %xmm1
cvttps2dq %xmm1, %xmm1
cvtdq2ps %xmm1, %xmm5
movaps %xmm0, -0x50(%rbp)
movaps %xmm2, -0x60(%rbp)
addss 0x24(%rsi), %xmm5
movaps %xmm5, -0x40(%rbp)
jmp 0x6a593
movaps %xmm0, -0x50(%rbp)
movaps %xmm2, -0x60(%rbp)
movaps %xmm6, -0x40(%rbp)
leaq 0x28(%rbx), %r15
movl 0x28(%rbx), %esi
incl %esi
movq %r15, %rdi
callq 0x6fcac
movq %r15, %rdi
callq 0x6fc70
movzwl %r14w, %ecx
movaps -0x50(%rbp), %xmm5
movaps %xmm5, %xmm0
movaps -0x60(%rbp), %xmm3
cmpneqps %xmm3, %xmm0
movaps -0x70(%rbp), %xmm4
movaps %xmm4, %xmm1
movaps -0x80(%rbp), %xmm2
cmpneqps %xmm2, %xmm1
andps %xmm0, %xmm1
movd %xmm1, %edx
shll $0x1f, %edx
orl %ecx, %edx
movl %edx, (%rax)
movss %xmm5, 0x8(%rax)
movss %xmm4, 0xc(%rax)
movss %xmm3, 0x10(%rax)
movss %xmm2, 0x14(%rax)
movss -0x1c(%rbp), %xmm1
movss %xmm1, 0x18(%rax)
movss -0x24(%rbp), %xmm3
movss %xmm3, 0x1c(%rax)
movss -0x20(%rbp), %xmm4
movss %xmm4, 0x20(%rax)
movss -0x28(%rbp), %xmm2
movss %xmm2, 0x24(%rax)
movaps -0x40(%rbp), %xmm0
movss %xmm0, 0x4(%rax)
movq 0x40(%rbx), %rax
cvtsi2ssl 0x14(%rax), %xmm0
addss 0x43666(%rip), %xmm0    # 0xadc98
movb $0x1, 0x56(%rbx)
subss %xmm1, %xmm4
cvtsi2ssl 0x28(%rax), %xmm1
mulss %xmm4, %xmm1
addss %xmm0, %xmm1
cvttss2si %xmm1, %ecx
subss %xmm3, %xmm2
cvtsi2ssl 0x2c(%rax), %xmm1
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
cvttss2si %xmm1, %eax
imull %ecx, %eax
addl %eax, 0x64(%rbx)
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq