// File: /workspace/github_cpp_makefile_star2_O3/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 0x7ba6d
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %rbx
movq %rcx, %r14
leaq -0x40(%rbp), %rdx
movq $0x0, (%rdx)
leaq 0x3cf28(%rip), %rsi     # 0xb8870
movq %r12, %rdi
xorl %ecx, %ecx
callq 0x42188
testq %rax, %rax
je 0x7ba8c
movq %rax, %r15
movq %rbx, -0x38(%rbp)
testq %r13, %r13
je 0x7b98e
leaq -0xc8(%rbp), %rbx
movl $0x88, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0xc080
cmpb $0x0, 0x56(%rbx)
jne 0x7ba3d
leaq -0x72(%rbp), %r13
jmp 0x7b9fa
xorl %eax, %eax
leaq -0x72(%rbp), %r13
movq %rax, -0x56(%r13)
movl $0x0, -0x4e(%r13)
movb $0x1, -0x4a(%r13)
movaps 0x4af84(%rip), %xmm0    # 0xc6930
movups %xmm0, -0x46(%r13)
movb %al, -0x36(%r13)
movq %rax, -0x1e(%r13)
movabsq $0x7f7fffff00000000, %rcx # imm = 0x7F7FFFFF00000000
movq %rcx, -0x16(%r13)
xorps %xmm0, %xmm0
movups %xmm0, -0x32(%r13)
movb %al, -0xe(%r13)
movabsq $0x3f80000000000000, %rcx # imm = 0x3F80000000000000
movq %rcx, -0xa(%r13)
movw $0xffff, -0x2(%r13)     # imm = 0xFFFF
movups %xmm0, (%r13)
movups %xmm0, 0x10(%r13)
movq %rax, 0x20(%r13)
movq %rax, 0x2a(%r13)
movq %r12, %rdi
callq 0xc350
addq %r12, %rax
movq %rax, %rcx
cmpq %r12, %rax
jbe 0x7ba1f
movzbl -0x1(%rcx), %edx
cmpl $0x5c, %edx
je 0x7ba1f
leaq -0x1(%rcx), %rax
cmpl $0x2f, %edx
jne 0x7ba05
xorps %xmm0, %xmm0
cvtss2sd -0x2c(%rbp), %xmm0
leaq 0x51c72(%rip), %rdx     # 0xcd6a0
movl $0x28, %esi
movq %r13, %rdi
movb $0x1, %al
callq 0x41f22
movl -0x40(%rbp), %edx
leaq -0xc8(%rbp), %rcx
movq -0x38(%rbp), %rdi
movq %r15, %rsi
movss -0x2c(%rbp), %xmm0
movq %r14, %r8
callq 0x7baac
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x519f0(%rip), %rdi     # 0xcd464
leaq 0x5172b(%rip), %rsi     # 0xcd1a6
leaq 0x51b97(%rip), %rcx     # 0xcd619
movl $0x7af, %edx            # imm = 0x7AF
callq 0xc140
leaq 0x51bea(%rip), %rdi     # 0xcd67d
leaq 0x5170c(%rip), %rsi     # 0xcd1a6
leaq 0x51b78(%rip), %rcx     # 0xcd619
movl $0x7b4, %edx            # imm = 0x7B4
callq 0xc140
nop