// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_draw.cpp
// Function: ImFontAtlas::AddFontFromFileTTF(char const*, float, ImFontConfig const*, unsigned short const*)
ImFont* ImFontAtlas::AddFontFromFileTTF(const char* filename, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges)
{
    IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!");
    size_t data_size = 0;
    void* data = ImFileLoadToMemory(filename, "rb", &data_size, 0);
    if (!data)
    {
        IM_ASSERT_USER_ERROR(0, "Could not load font file!");
        return NULL;
    }
    ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig();
    if (font_cfg.Name[0] == '\0')
    {
        // Store a short copy of filename into into the font name for convenience
        const char* p;
        for (p = filename + strlen(filename); p > filename && p[-1] != '/' && p[-1] != '\\'; p--) {}
        ImFormatString(font_cfg.Name, IM_ARRAYSIZE(font_cfg.Name), "%s, %.0fpx", p, size_pixels);
    }
    return AddFontFromMemoryTTF(data, (int)data_size, size_pixels, &font_cfg, glyph_ranges);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movss %xmm0, -0x2c(%rbp)
cmpb $0x1, (%rdi)
je 0x7d37b
movq %rcx, %rbx
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %r14
leaq -0x38(%rbp), %rdx
movq $0x0, (%rdx)
leaq 0x3d616(%rip), %rsi     # 0xba870
movq %r12, %rdi
xorl %ecx, %ecx
callq 0x42a14
testq %rax, %rax
je 0x7d39a
movq %rax, %r15
testq %r13, %r13
je 0x7d28b
leaq -0xc0(%rbp), %rdi
movl $0x88, %edx
movq %r13, %rsi
callq 0xc080
jmp 0x7d2ff
xorl %eax, %eax
movq %rax, -0xc0(%rbp)
movl $0x0, -0xb8(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, -0x9c(%rbp)
movb $0x1, -0xb4(%rbp)
movaps 0x4b69a(%rip), %xmm1    # 0xc8950
movups %xmm1, -0xb0(%rbp)
movb %al, -0xa0(%rbp)
movq %rax, -0x88(%rbp)
movabsq $0x7f7fffff00000000, %rcx # imm = 0x7F7FFFFF00000000
movq %rcx, -0x80(%rbp)
movb %al, -0x78(%rbp)
movabsq $0x3f80000000000000, %rcx # imm = 0x3F80000000000000
movq %rcx, -0x74(%rbp)
movw $0xffff, -0x6c(%rbp)    # imm = 0xFFFF
movups %xmm0, -0x6a(%rbp)
movups %xmm0, -0x5a(%rbp)
movq %rax, -0x4a(%rbp)
movq %rax, -0x40(%rbp)
cmpb $0x0, -0x6a(%rbp)
jne 0x7d34c
leaq -0x6a(%rbp), %r13
movq %r12, %rdi
callq 0xc350
addq %r12, %rax
movq %rax, %rcx
cmpq %r12, %rax
jbe 0x7d32e
movzbl -0x1(%rcx), %edx
cmpl $0x5c, %edx
je 0x7d32e
leaq -0x1(%rcx), %rax
cmpl $0x2f, %edx
jne 0x7d314
xorps %xmm0, %xmm0
cvtss2sd -0x2c(%rbp), %xmm0
leaq 0x52393(%rip), %rdx     # 0xcf6d0
movl $0x28, %esi
movq %r13, %rdi
movb $0x1, %al
callq 0x427cb
movl -0x38(%rbp), %edx
leaq -0xc0(%rbp), %rcx
movq %r14, %rdi
movq %r15, %rsi
movss -0x2c(%rbp), %xmm0
movq %rbx, %r8
callq 0x7d3ba
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x52112(%rip), %rdi     # 0xcf494
leaq 0x51e4d(%rip), %rsi     # 0xcf1d6
leaq 0x522b9(%rip), %rcx     # 0xcf649
movl $0x7af, %edx            # imm = 0x7AF
callq 0xc140
leaq 0x5230c(%rip), %rdi     # 0xcf6ad
leaq 0x51e2e(%rip), %rsi     # 0xcf1d6
leaq 0x5229a(%rip), %rcx     # 0xcf649
movl $0x7b4, %edx            # imm = 0x7B4
callq 0xc140
nop