// File: /workspace/github_c_makefile_star2_O0/0x0203[P]schack_poc/./nuklear_xlib.h
// Function: nk_xfont_create
NK_API XFont*
nk_xfont_create(Display *dpy, const char *name)
{
    int n;
    char *def, **missing;
    XFont *font = (XFont*)calloc(1, sizeof(XFont));
    font->set = XCreateFontSet(dpy, name, &missing, &n, &def);
    if(missing) {
        while(n--)
            fprintf(stderr, "missing fontset: %s\n", missing[n]);
        XFreeStringList(missing);
    }
    if(font->set) {
        XFontStruct **xfonts;
        char **font_names;
        XExtentsOfFontSet(font->set);
        n = XFontsOfFontSet(font->set, &xfonts, &font_names);
        while(n--) {
            font->ascent = NK_MAX(font->ascent, (*xfonts)->ascent);
            font->descent = NK_MAX(font->descent,(*xfonts)->descent);
            xfonts++;
        }
    } else {
        if(!(font->xfont = XLoadQueryFont(dpy, name))
        && !(font->xfont = XLoadQueryFont(dpy, "fixed"))) {
            free(font);
            return 0;
        }
        font->ascent = font->xfont->ascent;
        font->descent = font->xfont->descent;
    }
    font->height = font->ascent + font->descent;
    return font;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x1, %edi
movl $0x38, %esi
callq 0x3460
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x30(%rbp), %rdx
leaq -0x1c(%rbp), %rcx
leaq -0x28(%rbp), %r8
callq 0x3290
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
cmpq $0x0, -0x30(%rbp)
je 0x2ff7f
jmp 0x2ff40
movl -0x1c(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x1c(%rbp)
cmpl $0x0, %eax
je 0x2ff76
movq 0x24099(%rip), %rax     # 0x53ff0
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x17b9b(%rip), %rsi     # 0x47b08
movb $0x0, %al
callq 0x3550
jmp 0x2ff40
movq -0x30(%rbp), %rdi
callq 0x3430
movq -0x38(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x3003f
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x30e0
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x3400
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x1c(%rbp)
cmpl $0x0, %eax
je 0x3003d
movq -0x38(%rbp), %rax
movl (%rax), %eax
movq -0x40(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x58(%rcx), %eax
jge 0x2ffe4
movq -0x40(%rbp), %rax
movq (%rax), %rax
movl 0x58(%rax), %eax
movl %eax, -0x4c(%rbp)
jmp 0x2ffed
movq -0x38(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, (%rax)
movq -0x38(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x40(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x5c(%rcx), %eax
jge 0x30018
movq -0x40(%rbp), %rax
movq (%rax), %rax
movl 0x5c(%rax), %eax
movl %eax, -0x50(%rbp)
jmp 0x30022
movq -0x38(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x40(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x40(%rbp)
jmp 0x2ffb3
jmp 0x300ae
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x33f0
movq -0x38(%rbp), %rcx
movq %rax, 0x18(%rcx)
cmpq $0x0, %rax
jne 0x3008b
movq -0x10(%rbp), %rdi
leaq 0x17ab8(%rip), %rsi     # 0x47b1d
callq 0x33f0
movq -0x38(%rbp), %rcx
movq %rax, 0x18(%rcx)
cmpq $0x0, %rax
jne 0x3008b
movq -0x38(%rbp), %rdi
callq 0x31f0
movq $0x0, -0x8(%rbp)
jmp 0x300ca
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movl 0x58(%rax), %ecx
movq -0x38(%rbp), %rax
movl %ecx, (%rax)
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movl 0x5c(%rax), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x38(%rbp), %rax
movl (%rax), %ecx
movq -0x38(%rbp), %rax
addl 0x4(%rax), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)