// File: /workspace/github_c_makefile_star2_O1/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_font_atlas_add
NK_API struct nk_font*
nk_font_atlas_add(struct nk_font_atlas *atlas, const struct nk_font_config *config)
{
    struct nk_font *font = 0;
    struct nk_font_config *cfg;

    NK_ASSERT(atlas);
    NK_ASSERT(atlas->permanent.alloc);
    NK_ASSERT(atlas->permanent.free);
    NK_ASSERT(atlas->temporary.alloc);
    NK_ASSERT(atlas->temporary.free);

    NK_ASSERT(config);
    NK_ASSERT(config->ttf_blob);
    NK_ASSERT(config->ttf_size);
    NK_ASSERT(config->size > 0.0f);

    if (!atlas || !config || !config->ttf_blob || !config->ttf_size || config->size <= 0.0f||
        !atlas->permanent.alloc || !atlas->permanent.free ||
        !atlas->temporary.alloc || !atlas->temporary.free)
        return 0;

    /* allocate font config  */
    cfg = (struct nk_font_config*)
        atlas->permanent.alloc(atlas->permanent.userdata,0, sizeof(struct nk_font_config));
    NK_MEMCPY(cfg, config, sizeof(*config));
    cfg->n = cfg;
    cfg->p = cfg;

    if (!config->merge_mode) {
        /* insert font config into list */
        if (!atlas->config) {
            atlas->config = cfg;
            cfg->next = 0;
        } else {
            struct nk_font_config *i = atlas->config;
            while (i->next) i = i->next;
            i->next = cfg;
            cfg->next = 0;
        }
        /* allocate new font */
        font = (struct nk_font*)
            atlas->permanent.alloc(atlas->permanent.userdata,0, sizeof(struct nk_font));
        NK_ASSERT(font);
        nk_zero(font, sizeof(*font));
        if (!font) return 0;
        font->config = cfg;

        /* insert font into list */
        if (!atlas->fonts) {
            atlas->fonts = font;
            font->next = 0;
        } else {
            struct nk_font *i = atlas->fonts;
            while (i->next) i = i->next;
            i->next = font;
            font->next = 0;
        }
        cfg->font = &font->info;
    } else {
        /* extend previously added font */
        struct nk_font *f = 0;
        struct nk_font_config *c = 0;
        NK_ASSERT(atlas->font_num);
        f = atlas->fonts;
        c = f->config;
        cfg->font = &f->info;

        cfg->n = c;
        cfg->p = c->p;
        c->p->n = cfg;
        c->p = cfg;
    }
    /* create own copy of .TTF font blob */
    if (!config->ttf_data_owned_by_atlas) {
        cfg->ttf_blob = atlas->permanent.alloc(atlas->permanent.userdata,0, cfg->ttf_size);
        NK_ASSERT(cfg->ttf_blob);
        if (!cfg->ttf_blob) {
            atlas->font_num++;
            return 0;
        }
        NK_MEMCPY(cfg->ttf_blob, config->ttf_blob, cfg->ttf_size);
        cfg->ttf_data_owned_by_atlas = 1;
    }
    atlas->font_num++;
    return font;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
testq %rdi, %rdi
jne 0x33d48
movq 0x542cd(%rip), %r15     # 0x87ff0
movq (%r15), %rdi
leaq 0x3e05f(%rip), %rsi     # 0x71d8c
leaq 0x3e076(%rip), %rdx     # 0x71daa
movl $0x4443, %ecx           # imm = 0x4443
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
cmpq $0x0, 0x18(%rbx)
jne 0x33d7b
movq 0x5429a(%rip), %r15     # 0x87ff0
movq (%r15), %rdi
leaq 0x3e02c(%rip), %rsi     # 0x71d8c
leaq 0x3e043(%rip), %rdx     # 0x71daa
movl $0x4444, %ecx           # imm = 0x4444
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
cmpq $0x0, 0x20(%rbx)
jne 0x33dae
movq 0x54267(%rip), %r15     # 0x87ff0
movq (%r15), %rdi
leaq 0x3dff9(%rip), %rsi     # 0x71d8c
leaq 0x3e010(%rip), %rdx     # 0x71daa
movl $0x4445, %ecx           # imm = 0x4445
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
cmpq $0x0, 0x30(%rbx)
jne 0x33de1
movq 0x54234(%rip), %r15     # 0x87ff0
movq (%r15), %rdi
leaq 0x3dfc6(%rip), %rsi     # 0x71d8c
leaq 0x3dfdd(%rip), %rdx     # 0x71daa
movl $0x4446, %ecx           # imm = 0x4446
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
cmpq $0x0, 0x38(%rbx)
jne 0x33e14
movq 0x54201(%rip), %r15     # 0x87ff0
movq (%r15), %rdi
leaq 0x3df93(%rip), %rsi     # 0x71d8c
leaq 0x3dfaa(%rip), %rdx     # 0x71daa
movl $0x4447, %ecx           # imm = 0x4447
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
testq %r14, %r14
jne 0x33e45
movq 0x541d0(%rip), %r15     # 0x87ff0
movq (%r15), %rdi
leaq 0x3df62(%rip), %rsi     # 0x71d8c
leaq 0x3df79(%rip), %rdx     # 0x71daa
movl $0x4449, %ecx           # imm = 0x4449
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
cmpq $0x0, 0x8(%r14)
jne 0x33e78
movq 0x5419d(%rip), %r15     # 0x87ff0
movq (%r15), %rdi
leaq 0x3df2f(%rip), %rsi     # 0x71d8c
leaq 0x3df46(%rip), %rdx     # 0x71daa
movl $0x444a, %ecx           # imm = 0x444A
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
cmpq $0x0, 0x10(%r14)
jne 0x33eab
movq 0x5416a(%rip), %r15     # 0x87ff0
movq (%r15), %rdi
leaq 0x3defc(%rip), %rsi     # 0x71d8c
leaq 0x3df13(%rip), %rdx     # 0x71daa
movl $0x444b, %ecx           # imm = 0x444B
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
movss 0x20(%r14), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
ja 0x33ee5
movq 0x54130(%rip), %r15     # 0x87ff0
movq (%r15), %rdi
leaq 0x3dec2(%rip), %rsi     # 0x71d8c
leaq 0x3ded9(%rip), %rdx     # 0x71daa
movl $0x444c, %ecx           # imm = 0x444C
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
testq %r14, %r14
sete %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
jne 0x3411e
cmpq $0x0, 0x8(%r14)
je 0x3411e
cmpq $0x0, 0x10(%r14)
je 0x3411e
xorps %xmm0, %xmm0
ucomiss 0x20(%r14), %xmm0
jae 0x3411e
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x3411e
cmpq $0x0, 0x20(%rbx)
je 0x3411e
cmpq $0x0, 0x30(%rbx)
je 0x3411e
cmpq $0x0, 0x38(%rbx)
je 0x3411e
movq 0x10(%rbx), %rdi
movl $0x58, %edx
xorl %esi, %esi
callq *%rax
movq %rax, %r15
movl $0x58, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x258b3
movq %r15, 0x48(%r15)
movq %r15, 0x50(%r15)
cmpb $0x0, 0x19(%r14)
je 0x33fe4
cmpl $0x0, 0x188(%rbx)
jne 0x33fb1
movq 0x54066(%rip), %r12     # 0x87ff0
movq (%r12), %rdi
leaq 0x3ddf7(%rip), %rsi     # 0x71d8c
leaq 0x3de0e(%rip), %rdx     # 0x71daa
movl $0x447c, %ecx           # imm = 0x447C
xorl %eax, %eax
callq 0x12d80
movq (%r12), %rdi
callq 0x13780
movq 0x178(%rbx), %rax
movq 0x78(%rax), %rcx
addq $0x30, %rax
movq %rax, 0x38(%r15)
movq %rcx, 0x48(%r15)
movq 0x50(%rcx), %rax
movq %rax, 0x50(%r15)
movq 0x50(%rcx), %rax
movq %r15, 0x48(%rax)
movq %r15, 0x50(%rcx)
xorl %r12d, %r12d
jmp 0x340aa
movq 0x180(%rbx), %rax
testq %rax, %rax
je 0x33ffd
movq %rax, %rcx
movq (%rax), %rax
testq %rax, %rax
jne 0x33ff0
jmp 0x34004
leaq 0x180(%rbx), %rcx
movq %r15, (%rcx)
movq $0x0, (%r15)
movq 0x10(%rbx), %rdi
movl $0x80, %edx
xorl %esi, %esi
callq *0x18(%rbx)
movq %rax, %r12
testq %rax, %rax
je 0x3404f
movl $0x80, %esi
movq %r12, %rdi
callq 0x25316
movq %r15, 0x78(%r12)
movq 0x178(%rbx), %rax
testq %rax, %rax
je 0x3408d
movq %rax, %rcx
movq (%rax), %rax
testq %rax, %rax
jne 0x34042
jmp 0x34094
movq 0x53f9a(%rip), %rbx     # 0x87ff0
movq (%rbx), %rdi
leaq 0x3dd2c(%rip), %rsi     # 0x71d8c
leaq 0x3dd43(%rip), %rdx     # 0x71daa
movl $0x4468, %ecx           # imm = 0x4468
xorl %eax, %eax
callq 0x12d80
movq (%rbx), %rdi
callq 0x13780
movl $0x80, %esi
movq %r12, %rdi
callq 0x25316
jmp 0x3411e
leaq 0x178(%rbx), %rcx
movq %r12, (%rcx)
movq $0x0, (%r12)
movq %r12, %rax
addq $0x30, %rax
movq %rax, 0x38(%r15)
cmpb $0x0, 0x18(%r14)
jne 0x34110
movq 0x10(%r15), %rdx
movq 0x10(%rbx), %rdi
xorl %esi, %esi
callq *0x18(%rbx)
movq %rax, 0x8(%r15)
testq %rax, %rax
jne 0x340f5
movq 0x53f22(%rip), %r13     # 0x87ff0
movq (%r13), %rdi
leaq 0x3dcb3(%rip), %rsi     # 0x71d8c
leaq 0x3dcca(%rip), %rdx     # 0x71daa
movl $0x4489, %ecx           # imm = 0x4489
xorl %eax, %eax
callq 0x12d80
movq (%r13), %rdi
callq 0x13780
movq 0x8(%r15), %rdi
testq %rdi, %rdi
je 0x34118
movq 0x8(%r14), %rsi
movq 0x10(%r15), %rdx
callq 0x258b3
movb $0x1, 0x18(%r15)
incl 0x188(%rbx)
jmp 0x34121
incl 0x188(%rbx)
xorl %r12d, %r12d
movq %r12, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq