// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui_draw.cpp
// Function: ImFontAtlas::AddFont(ImFontConfig const*)
ImFont* ImFontAtlas::AddFont(const ImFontConfig* font_cfg)
{
    IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!");
    IM_ASSERT(font_cfg->FontData != NULL && font_cfg->FontDataSize > 0);
    IM_ASSERT(font_cfg->SizePixels > 0.0f);

    // Create new font
    if (!font_cfg->MergeMode)
        Fonts.push_back(IM_NEW(ImFont));
    else
        IM_ASSERT(!Fonts.empty() && "Cannot use MergeMode for the first font"); // When using MergeMode make sure that a font has already been added before. You can use ImGui::GetIO().Fonts->AddFontDefault() to add the default imgui font.

    ConfigData.push_back(*font_cfg);
    ImFontConfig& new_font_cfg = ConfigData.back();
    if (new_font_cfg.DstFont == NULL)
        new_font_cfg.DstFont = Fonts.back();
    if (!new_font_cfg.FontDataOwnedByAtlas)
    {
        new_font_cfg.FontData = IM_ALLOC(new_font_cfg.FontDataSize);
        new_font_cfg.FontDataOwnedByAtlas = true;
        memcpy(new_font_cfg.FontData, font_cfg->FontData, (size_t)new_font_cfg.FontDataSize);
    }

    if (new_font_cfg.DstFont->EllipsisChar == (ImWchar)-1)
        new_font_cfg.DstFont->EllipsisChar = font_cfg->EllipsisChar;

    // Invalidate texture
    ClearTexData();
    return new_font_cfg.DstFont;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpb $0x1, (%rdi)
je 0x661c1
movq %rsi, %r14
cmpq $0x0, (%rsi)
je 0x661a2
cmpl $0x0, 0x8(%r14)
jle 0x661a2
movss 0x14(%r14), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x661e0
movq %rdi, %rbx
cmpb $0x0, 0x48(%r14)
je 0x660c2
cmpl $0x0, 0x40(%rbx)
jne 0x66111
leaq 0x4e84d(%rip), %rdi     # 0xb48f7
leaq 0x4e425(%rip), %rsi     # 0xb44d6
leaq 0x4e7b5(%rip), %rcx     # 0xb486d
movl $0x772, %edx            # imm = 0x772
callq 0xc140
pushq $0x70
popq %rdi
callq 0x3440d
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
andq $0x0, 0x30(%rax)
movl $0xffff003f, 0x52(%rax) # imm = 0xFFFF003F
movb $0x0, 0x56(%rax)
movups %xmm0, 0x38(%rax)
movups %xmm0, 0x42(%rax)
movl $0x3f800000, 0x58(%rax) # imm = 0x3F800000
andq $0x0, 0x5c(%rax)
andq $0x0, 0x62(%rax)
leaq 0x40(%rbx), %rdi
leaq -0x20(%rbp), %rsi
movq %rax, (%rsi)
callq 0x4b72e
leaq 0x60(%rbx), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x6f6fa
movq %r15, %rdi
callq 0x6f756
movq %rax, %r15
movq 0x80(%rax), %rax
testq %rax, %rax
jne 0x6614a
leaq 0x40(%rbx), %rdi
callq 0x4b7aa
movq (%rax), %rax
movq %rax, 0x80(%r15)
cmpb $0x0, 0xc(%r15)
jne 0x66178
movslq 0x8(%r15), %rdi
callq 0x3440d
movq %rax, (%r15)
movb $0x1, 0xc(%r15)
movq (%r14), %rsi
movslq 0x8(%r15), %rdx
movq %rax, %rdi
callq 0xc080
movq 0x80(%r15), %rax
cmpw $-0x1, 0x54(%rax)
jne 0x66188
movzwl 0x54(%r14), %ecx
movw %cx, 0x54(%rax)
movq %rbx, %rdi
callq 0x65cf0
movq 0x80(%r15), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4e6f7(%rip), %rdi     # 0xb48a0
leaq 0x4e326(%rip), %rsi     # 0xb44d6
leaq 0x4e6b6(%rip), %rcx     # 0xb486d
movl $0x76b, %edx            # imm = 0x76B
callq 0xc140
leaq 0x4e5cc(%rip), %rdi     # 0xb4794
leaq 0x4e307(%rip), %rsi     # 0xb44d6
leaq 0x4e697(%rip), %rcx     # 0xb486d
movl $0x76a, %edx            # imm = 0x76A
callq 0xc140
leaq 0x4e6f4(%rip), %rdi     # 0xb48db
leaq 0x4e2e8(%rip), %rsi     # 0xb44d6
leaq 0x4e678(%rip), %rcx     # 0xb486d
movl $0x76c, %edx            # imm = 0x76C
callq 0xc140
nop