// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movss 0x10(%rbp), %xmm12
testq %rsi, %rsi
je 0x81f44
movss 0x40(%rsi), %xmm10
movss 0x44(%rsi), %xmm9
minss %xmm12, %xmm9
movaps %xmm12, %xmm11
cmpltss %xmm10, %xmm11
movaps %xmm11, %xmm8
andnps %xmm9, %xmm8
andps %xmm10, %xmm11
orps %xmm8, %xmm11
ucomiss %xmm12, %xmm11
jne 0x81ef0
jnp 0x81f1b
movaps %xmm11, %xmm8
subss %xmm12, %xmm8
mulss 0x35102(%rip), %xmm8    # 0xb7004
cmpb $0x0, 0x20(%rsi)
je 0x81f11
cvttps2dq %xmm8, %xmm8
cvtdq2ps %xmm8, %xmm8
addss %xmm8, %xmm0
addss %xmm8, %xmm2
cmpb $0x0, 0x20(%rsi)
jne 0x81f27
movaps %xmm11, %xmm12
jmp 0x81f3e
movss 0x350d4(%rip), %xmm8    # 0xb7004
addss %xmm11, %xmm8
cvttps2dq %xmm8, %xmm8
cvtdq2ps %xmm8, %xmm12
addss 0x24(%rsi), %xmm12
movl 0x28(%rbx), %r13d
movl 0x2c(%rbx), %eax
leal 0x1(%r13), %r12d
cmpl %r13d, %eax
jg 0x82023
testl %eax, %eax
je 0x81f6e
movl %eax, %r14d
shrl $0x1f, %r14d
addl %eax, %r14d
sarl %r14d
addl %eax, %r14d
jmp 0x81f74
movl $0x8, %r14d
cmpl %r12d, %r14d
cmovlel %r12d, %r14d
cmpl %r14d, %eax
jge 0x82023
movaps %xmm12, -0x50(%rbp)
movl %edx, -0x2c(%rbp)
movaps %xmm0, -0x60(%rbp)
movaps %xmm1, -0x70(%rbp)
movaps %xmm2, -0x80(%rbp)
movaps %xmm3, -0x90(%rbp)
movss %xmm4, -0x30(%rbp)
movss %xmm6, -0x34(%rbp)
movss %xmm5, -0x38(%rbp)
movss %xmm7, -0x3c(%rbp)
movslq %r14d, %rax
shlq $0x3, %rax
leaq (%rax,%rax,4), %rdi
callq 0x424fb
movq %rax, %r15
movq 0x30(%rbx), %rsi
testq %rsi, %rsi
je 0x81fec
movslq 0x28(%rbx), %rax
shlq $0x3, %rax
leaq (%rax,%rax,4), %rdx
movq %r15, %rdi
callq 0xc080
movq 0x30(%rbx), %rdi
callq 0x425d4
movq %r15, 0x30(%rbx)
movl %r14d, 0x2c(%rbx)
movss -0x3c(%rbp), %xmm7
movss -0x38(%rbp), %xmm5
movss -0x34(%rbp), %xmm6
movss -0x30(%rbp), %xmm4
movaps -0x90(%rbp), %xmm3
movaps -0x80(%rbp), %xmm2
movaps -0x70(%rbp), %xmm1
movaps -0x60(%rbp), %xmm0
movl -0x2c(%rbp), %edx
movaps -0x50(%rbp), %xmm12
movl %r12d, 0x28(%rbx)
testl %r13d, %r13d
js 0x820f6
movq 0x30(%rbx), %rax
movl %r12d, %ecx
leaq (%rcx,%rcx,4), %rcx
movzwl %dx, %edx
movaps %xmm0, %xmm9
cmpneqps %xmm2, %xmm9
movaps %xmm1, %xmm8
cmpneqps %xmm3, %xmm8
andps %xmm9, %xmm8
movd %xmm8, %esi
shll $0x1f, %esi
orl %edx, %esi
movl %esi, -0x28(%rax,%rcx,8)
movss %xmm0, -0x20(%rax,%rcx,8)
movss %xmm1, -0x1c(%rax,%rcx,8)
movss %xmm2, -0x18(%rax,%rcx,8)
movss %xmm3, -0x14(%rax,%rcx,8)
movss %xmm4, -0x10(%rax,%rcx,8)
movss %xmm5, -0xc(%rax,%rcx,8)
movss %xmm6, -0x8(%rax,%rcx,8)
movss %xmm7, -0x4(%rax,%rcx,8)
movss %xmm12, -0x24(%rax,%rcx,8)
movq 0x40(%rbx), %rax
xorps %xmm0, %xmm0
cvtsi2ssl 0x14(%rax), %xmm0
addss 0x468eb(%rip), %xmm0    # 0xc8998
movb $0x1, 0x56(%rbx)
subss %xmm4, %xmm6
xorps %xmm1, %xmm1
cvtsi2ssl 0x28(%rax), %xmm1
mulss %xmm6, %xmm1
addss %xmm0, %xmm1
cvttss2si %xmm1, %ecx
subss %xmm5, %xmm7
xorps %xmm1, %xmm1
cvtsi2ssl 0x2c(%rax), %xmm1
mulss %xmm7, %xmm1
addss %xmm0, %xmm1
cvttss2si %xmm1, %eax
imull %ecx, %eax
addl %eax, 0x64(%rbx)
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4d8dd(%rip), %rdi     # 0xcf9da
leaq 0x39587(%rip), %rsi     # 0xbb68b
leaq 0x4ed19(%rip), %rcx     # 0xd0e24
movl $0x666, %edx            # imm = 0x666
callq 0xc140