// File: /workspace/github_cpp_makefile_star2_O3/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 0x80437
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
movb 0x20(%rsi), %al
jne 0x803e7
jnp 0x80410
movaps %xmm11, %xmm8
subss %xmm12, %xmm8
mulss 0x34c0b(%rip), %xmm8    # 0xb5004
testb $0x1, %al
je 0x80406
cvttps2dq %xmm8, %xmm8
cvtdq2ps %xmm8, %xmm8
addss %xmm8, %xmm0
addss %xmm8, %xmm2
testb $0x1, %al
jne 0x8041a
movaps %xmm11, %xmm12
jmp 0x80431
movss 0x34be1(%rip), %xmm8    # 0xb5004
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 0x8050d
testl %eax, %eax
movss %xmm7, -0x3c(%rbp)
movss %xmm5, -0x38(%rbp)
movss %xmm6, -0x34(%rbp)
movss %xmm4, -0x30(%rbp)
movaps %xmm3, -0x90(%rbp)
movaps %xmm2, -0x80(%rbp)
movaps %xmm1, -0x70(%rbp)
movaps %xmm0, -0x60(%rbp)
movl %edx, -0x2c(%rbp)
movaps %xmm12, -0x50(%rbp)
je 0x80490
movl %eax, %r14d
shrl $0x1f, %r14d
addl %eax, %r14d
sarl %r14d
addl %eax, %r14d
jmp 0x80496
movl $0x8, %r14d
cmpl %r12d, %r14d
cmovlel %r12d, %r14d
movslq %r14d, %rax
shlq $0x3, %rax
leaq (%rax,%rax,4), %rdi
callq 0x41c63
movq %rax, %r15
movq 0x30(%rbx), %rsi
testq %rsi, %rsi
je 0x804d6
movslq 0x28(%rbx), %rax
shlq $0x3, %rax
leaq (%rax,%rax,4), %rdx
movq %r15, %rdi
callq 0xc080
movq 0x30(%rbx), %rdi
callq 0x41d3c
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 0x805e0
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 0x463d1(%rip), %xmm0    # 0xc6968
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 0x4d3c3(%rip), %rdi     # 0xcd9aa
leaq 0x3909d(%rip), %rsi     # 0xb968b
leaq 0x4e7f8(%rip), %rcx     # 0xceded
movl $0x666, %edx            # imm = 0x666
callq 0xc140