// File: /workspace/github_cpp_makefile_star2_O2/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 $0xa8, %rsp
movss %xmm0, -0x2c(%rbp)
cmpb $0x1, (%rdi)
je 0x66471
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %rbx
movq %rcx, %r14
leaq -0x40(%rbp), %rdx
andq $0x0, (%rdx)
leaq 0x3954f(%rip), %rsi     # 0x9f8a0
movq %r12, %rdi
xorl %ecx, %ecx
callq 0x348c2
testq %rax, %rax
je 0x66490
movq %rax, %r15
movq %rbx, -0x38(%rbp)
testq %r13, %r13
je 0x66397
leaq -0xc8(%rbp), %rbx
movl $0x88, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0xc080
cmpb $0x0, 0x56(%rbx)
jne 0x66441
leaq -0x72(%rbp), %r13
jmp 0x66403
leaq -0x72(%rbp), %r13
andq $0x0, -0x56(%r13)
andl $0x0, -0x4e(%r13)
movb $0x1, -0x4a(%r13)
movaps 0x478af(%rip), %xmm0    # 0xadc60
movups %xmm0, -0x46(%r13)
xorl %eax, %eax
movb %al, -0x36(%r13)
andq $0x0, -0x1e(%r13)
movabsq $0x7f7fffff00000000, %rcx # imm = 0x7F7FFFFF00000000
movq %rcx, -0x16(%r13)
xorps %xmm0, %xmm0
movups %xmm0, -0x32(%r13)
movb %al, -0xe(%r13)
movabsq $0x3f80000000000000, %rax # imm = 0x3F80000000000000
movq %rax, -0xa(%r13)
orw $-0x1, -0x2(%r13)
movups %xmm0, (%r13)
andq $0x0, 0x20(%r13)
movups %xmm0, 0x10(%r13)
andq $0x0, 0x2a(%r13)
movq %r12, %rdi
callq 0xc380
addq %r12, %rax
movq %rax, %rcx
cmpq %r12, %rax
jbe 0x66428
movzbl -0x1(%rcx), %edx
cmpl $0x5c, %edx
je 0x66428
leaq -0x1(%rcx), %rax
cmpl $0x2f, %edx
jne 0x6640e
cvtss2sd -0x2c(%rbp), %xmm0
leaq 0x4e59c(%rip), %rdx     # 0xb49d0
pushq $0x28
popq %rsi
movq %r13, %rdi
movb $0x1, %al
callq 0x3468c
movl -0x40(%rbp), %edx
leaq -0xc8(%rbp), %rcx
movq -0x38(%rbp), %rdi
movq %r15, %rsi
movss -0x2c(%rbp), %xmm0
movq %r14, %r8
callq 0x664b0
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4e31c(%rip), %rdi     # 0xb4794
leaq 0x4e057(%rip), %rsi     # 0xb44d6
leaq 0x4e4c3(%rip), %rcx     # 0xb4949
movl $0x7af, %edx            # imm = 0x7AF
callq 0xc140
leaq 0x4e516(%rip), %rdi     # 0xb49ad
leaq 0x4e038(%rip), %rsi     # 0xb44d6
leaq 0x4e4a4(%rip), %rcx     # 0xb4949
movl $0x7b4, %edx            # imm = 0x7B4
callq 0xc140
nop