// File: 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
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movss %xmm0, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0xd8(%rbp)
xorl %eax, %eax
testb $0x1, (%rcx)
movb %al, -0xc9(%rbp)
jne 0x116932
movb $0x1, %al
movb %al, -0xc9(%rbp)
jmp 0x116932
movb -0xc9(%rbp), %al
testb $0x1, %al
jne 0x11693e
jmp 0x116940
jmp 0x11695f
leaq 0x73b9a(%rip), %rdi     # 0x18a4e1
leaq 0x73828(%rip), %rsi     # 0x18a176
movl $0x7af, %edx            # imm = 0x7AF
leaq 0x73d64(%rip), %rcx     # 0x18a6be
callq 0xd180
movq $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x5ef6e(%rip), %rsi     # 0x1758e0
leaq -0x30(%rbp), %rdx
xorl %ecx, %ecx
callq 0xc51c0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x1169a7
leaq 0x73d93(%rip), %rdi     # 0x18a722
leaq 0x737e0(%rip), %rsi     # 0x18a176
movl $0x7b4, %edx            # imm = 0x7B4
leaq 0x73d1c(%rip), %rcx     # 0x18a6be
callq 0xd180
cmpq $0x0, -0x20(%rbp)
je 0x1169c5
movq -0x20(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
movl $0x88, %edx
callq 0xd0a0
jmp 0x1169d1
leaq -0xc0(%rbp), %rdi
callq 0x115bc0
movsbl -0x6a(%rbp), %eax
cmpl $0x0, %eax
jne 0x116a9a
movq -0x10(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x10(%rbp), %rdi
callq 0xd410
movq %rax, %rcx
movq -0xe0(%rbp), %rax
addq %rcx, %rax
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rcx
xorl %eax, %eax
cmpq -0x10(%rbp), %rcx
movb %al, -0xe1(%rbp)
jbe 0x116a4a
movq -0xc8(%rbp), %rax
movsbl -0x1(%rax), %ecx
xorl %eax, %eax
cmpl $0x2f, %ecx
movb %al, -0xe1(%rbp)
je 0x116a4a
movq -0xc8(%rbp), %rax
movsbl -0x1(%rax), %eax
cmpl $0x5c, %eax
setne %al
movb %al, -0xe1(%rbp)
movb -0xe1(%rbp), %al
testb $0x1, %al
jne 0x116a56
jmp 0x116a6c
jmp 0x116a58
movq -0xc8(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0xc8(%rbp)
jmp 0x116a06
leaq -0xc0(%rbp), %rdi
addq $0x56, %rdi
movq -0xc8(%rbp), %rcx
movss -0x14(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movl $0x28, %esi
leaq 0x73cb2(%rip), %rdx     # 0x18a745
movb $0x1, %al
callq 0xc4d30
movq -0xd8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rax
movl %eax, %edx
movss -0x14(%rbp), %xmm0
movq -0x28(%rbp), %r8
leaq -0xc0(%rbp), %rcx
callq 0x116ad0
addq $0xf0, %rsp
popq %rbp
retq
nopl (%rax)