// File: 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
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x48(%rbp)
xorl %eax, %eax
testb $0x1, (%rcx)
movb %al, -0x39(%rbp)
jne 0x1165dc
movb $0x1, %al
movb %al, -0x39(%rbp)
jmp 0x1165dc
movb -0x39(%rbp), %al
testb $0x1, %al
jne 0x1165e5
jmp 0x1165e7
jmp 0x116606
leaq 0x73ef3(%rip), %rdi     # 0x18a4e1
leaq 0x73b81(%rip), %rsi     # 0x18a176
movl $0x76a, %edx            # imm = 0x76A
leaq 0x73fb9(%rip), %rcx     # 0x18a5ba
callq 0xd180
movq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, (%rcx)
movb %al, -0x49(%rbp)
je 0x116623
movq -0x10(%rbp), %rax
cmpl $0x0, 0x8(%rax)
setg %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0x11662c
jmp 0x11662e
jmp 0x11664d
leaq 0x73fb8(%rip), %rdi     # 0x18a5ed
leaq 0x73b3a(%rip), %rsi     # 0x18a176
movl $0x76b, %edx            # imm = 0x76B
leaq 0x73f72(%rip), %rcx     # 0x18a5ba
callq 0xd180
movq -0x10(%rbp), %rax
movss 0x14(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x116660
jmp 0x11667f
leaq 0x73fc1(%rip), %rdi     # 0x18a628
leaq 0x73b08(%rip), %rsi     # 0x18a176
movl $0x76c, %edx            # imm = 0x76C
leaq 0x73f40(%rip), %rcx     # 0x18a5ba
callq 0xd180
movq -0x10(%rbp), %rax
testb $0x1, 0x48(%rax)
jne 0x1166fc
movq -0x48(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x70(%rbp)
movl $0x70, %edi
movq %rdi, -0x68(%rbp)
callq 0xc4820
movq -0x68(%rbp), %rdi
movq %rax, %rsi
movq %rsi, %rax
movq %rax, -0x60(%rbp)
callq 0xe9510
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x58(%rbp)
callq 0x11bd70
jmp 0x1166c7
movq -0x70(%rbp), %rdi
movq -0x58(%rbp), %rax
movq %rax, -0x18(%rbp)
leaq -0x18(%rbp), %rsi
callq 0xebc60
jmp 0x116748
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0xea550
jmp 0x116821
movq -0x48(%rbp), %rdi
addq $0x40, %rdi
callq 0xebd10
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x71(%rbp)
jne 0x11671c
movb $0x1, %al
movb %al, -0x71(%rbp)
jmp 0x11671c
movb -0x71(%rbp), %al
testb $0x1, %al
jne 0x116725
jmp 0x116727
jmp 0x116746
leaq 0x73f3e(%rip), %rdi     # 0x18a66c
leaq 0x73a41(%rip), %rsi     # 0x18a176
movl $0x772, %edx            # imm = 0x772
leaq 0x73e79(%rip), %rcx     # 0x18a5ba
callq 0xd180
jmp 0x116748
movq -0x48(%rbp), %rdi
addq $0x60, %rdi
movq -0x10(%rbp), %rsi
callq 0x127a20
movq -0x48(%rbp), %rdi
addq $0x60, %rdi
callq 0x127a90
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq $0x0, 0x80(%rax)
jne 0x116793
movq -0x48(%rbp), %rdi
addq $0x40, %rdi
callq 0xebd30
movq (%rax), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x80(%rax)
movq -0x38(%rbp), %rax
testb $0x1, 0xc(%rax)
jne 0x1167d7
movq -0x38(%rbp), %rax
movslq 0x8(%rax), %rdi
callq 0xc4820
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
movb $0x1, 0xc(%rax)
movq -0x38(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq -0x38(%rbp), %rax
movslq 0x8(%rax), %rdx
callq 0xd0a0
movq -0x38(%rbp), %rax
movq 0x80(%rax), %rax
movzwl 0x54(%rax), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jne 0x116804
movq -0x10(%rbp), %rax
movw 0x54(%rax), %cx
movq -0x38(%rbp), %rax
movq 0x80(%rax), %rax
movw %cx, 0x54(%rax)
movq -0x48(%rbp), %rdi
callq 0x1160d0
movq -0x38(%rbp), %rax
movq 0x80(%rax), %rax
addq $0x80, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0xd620
nopw (%rax,%rax)