// File: /workspace/github_c_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
testq %rdi, %rdi
jne 0x33881
movq 0x53794(%rip), %r15     # 0x86ff0
movq (%r15), %rdi
leaq 0x3d536(%rip), %rsi     # 0x70d9c
leaq 0x3d54d(%rip), %rdx     # 0x70dba
movl $0x4443, %ecx           # imm = 0x4443
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
cmpq $0x0, 0x18(%rbx)
jne 0x338b4
movq 0x53761(%rip), %r15     # 0x86ff0
movq (%r15), %rdi
leaq 0x3d503(%rip), %rsi     # 0x70d9c
leaq 0x3d51a(%rip), %rdx     # 0x70dba
movl $0x4444, %ecx           # imm = 0x4444
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
cmpq $0x0, 0x20(%rbx)
jne 0x338e7
movq 0x5372e(%rip), %r15     # 0x86ff0
movq (%r15), %rdi
leaq 0x3d4d0(%rip), %rsi     # 0x70d9c
leaq 0x3d4e7(%rip), %rdx     # 0x70dba
movl $0x4445, %ecx           # imm = 0x4445
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
cmpq $0x0, 0x30(%rbx)
jne 0x3391a
movq 0x536fb(%rip), %r15     # 0x86ff0
movq (%r15), %rdi
leaq 0x3d49d(%rip), %rsi     # 0x70d9c
leaq 0x3d4b4(%rip), %rdx     # 0x70dba
movl $0x4446, %ecx           # imm = 0x4446
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
cmpq $0x0, 0x38(%rbx)
jne 0x3394d
movq 0x536c8(%rip), %r15     # 0x86ff0
movq (%r15), %rdi
leaq 0x3d46a(%rip), %rsi     # 0x70d9c
leaq 0x3d481(%rip), %rdx     # 0x70dba
movl $0x4447, %ecx           # imm = 0x4447
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
testq %r14, %r14
jne 0x3397e
movq 0x53697(%rip), %r15     # 0x86ff0
movq (%r15), %rdi
leaq 0x3d439(%rip), %rsi     # 0x70d9c
leaq 0x3d450(%rip), %rdx     # 0x70dba
movl $0x4449, %ecx           # imm = 0x4449
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
cmpq $0x0, 0x8(%r14)
jne 0x339b1
movq 0x53664(%rip), %r15     # 0x86ff0
movq (%r15), %rdi
leaq 0x3d406(%rip), %rsi     # 0x70d9c
leaq 0x3d41d(%rip), %rdx     # 0x70dba
movl $0x444a, %ecx           # imm = 0x444A
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
cmpq $0x0, 0x10(%r14)
jne 0x339e4
movq 0x53631(%rip), %r15     # 0x86ff0
movq (%r15), %rdi
leaq 0x3d3d3(%rip), %rsi     # 0x70d9c
leaq 0x3d3ea(%rip), %rdx     # 0x70dba
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 0x33a1e
movq 0x535f7(%rip), %r15     # 0x86ff0
movq (%r15), %rdi
leaq 0x3d399(%rip), %rsi     # 0x70d9c
leaq 0x3d3b0(%rip), %rdx     # 0x70dba
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 0x33ce8
cmpq $0x0, 0x8(%r14)
je 0x33ce8
cmpq $0x0, 0x10(%r14)
je 0x33ce8
xorps %xmm0, %xmm0
ucomiss 0x20(%r14), %xmm0
jae 0x33ce8
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x33ce8
cmpq $0x0, 0x20(%rbx)
je 0x33ce8
cmpq $0x0, 0x30(%rbx)
je 0x33ce8
cmpq $0x0, 0x38(%rbx)
je 0x33ce8
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 0x25a38
movq %r15, 0x48(%r15)
movq %r15, 0x50(%r15)
cmpb $0x0, 0x19(%r14)
je 0x33b19
cmpl $0x0, 0x188(%rbx)
jne 0x33aea
movq 0x5352d(%rip), %r12     # 0x86ff0
movq (%r12), %rdi
leaq 0x3d2ce(%rip), %rsi     # 0x70d9c
leaq 0x3d2e5(%rip), %rdx     # 0x70dba
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 %r15, 0x48(%rax)
movq %r15, 0x50(%rcx)
xorl %r12d, %r12d
jmp 0x33c71
movq 0x180(%rbx), %rax
testq %rax, %rax
je 0x33b32
movq %rax, %rcx
movq (%rax), %rax
testq %rax, %rax
jne 0x33b25
jmp 0x33b39
leaq 0x180(%rbx), %rcx
movq %r15, (%rcx)
movq $0x0, (%r15)
movq 0x10(%rbx), %rdi
movl $0x80, %edx
xorl %esi, %esi
callq *0x18(%rbx)
testq %rax, %rax
je 0x33bc1
movq %rax, %r12
movq %rax, %r13
andq $0x3, %r13
je 0x33c01
movl $0x4, %ebp
subq %r13, %rbp
movq %r12, %rdi
xorl %esi, %esi
movq %rbp, %rdx
callq 0x12b50
xorps %xmm0, %xmm0
movups %xmm0, (%r12,%rbp)
movups %xmm0, 0x10(%r12,%rbp)
movups %xmm0, 0x20(%r12,%rbp)
movups %xmm0, 0x30(%r12,%rbp)
movups %xmm0, 0x40(%r12,%rbp)
movups %xmm0, 0x50(%r12,%rbp)
movups %xmm0, 0x60(%r12,%rbp)
movups %xmm0, 0x6c(%r12,%rbp)
leaq (%r12,%rbp), %rdi
addq $0x7c, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x12b50
jmp 0x33c36
movq 0x53428(%rip), %rbx     # 0x86ff0
movq (%rbx), %rdi
leaq 0x3d1ca(%rip), %rsi     # 0x70d9c
leaq 0x3d1e1(%rip), %rdx     # 0x70dba
xorl %r12d, %r12d
movl $0x4468, %ecx           # imm = 0x4468
xorl %eax, %eax
callq 0x12d80
movq (%rbx), %rdi
callq 0x13780
movl $0x80, %esi
xorl %edi, %edi
callq 0x2542e
jmp 0x33ceb
xorps %xmm0, %xmm0
movups %xmm0, 0x60(%r12)
movups %xmm0, 0x50(%r12)
movups %xmm0, 0x40(%r12)
movups %xmm0, 0x30(%r12)
movups %xmm0, 0x20(%r12)
movups %xmm0, 0x10(%r12)
movups %xmm0, (%r12)
movq $0x0, 0x70(%r12)
movq %r15, 0x78(%r12)
movq 0x178(%rbx), %rax
testq %rax, %rax
je 0x33c54
movq %rax, %rcx
movq (%rax), %rax
testq %rax, %rax
jne 0x33c47
jmp 0x33c5b
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 0x33cda
movq 0x10(%r15), %rdx
movq 0x10(%rbx), %rdi
xorl %esi, %esi
callq *0x18(%rbx)
movq %rax, 0x8(%r15)
testq %rax, %rax
jne 0x33cc5
movq 0x5335b(%rip), %r13     # 0x86ff0
movq (%r13), %rdi
leaq 0x3d0fc(%rip), %rsi     # 0x70d9c
leaq 0x3d113(%rip), %rdx     # 0x70dba
movl $0x4489, %ecx           # imm = 0x4489
xorl %eax, %eax
callq 0x12d80
movq (%r13), %rdi
callq 0x13780
movq 0x8(%r15), %rax
testq %rax, %rax
je 0x33ce2
movq 0x8(%r14), %rsi
movq 0x10(%r15), %rdx
movq %rax, %rdi
callq 0x25a38
movb $0x1, 0x18(%r15)
incl 0x188(%rbx)
jmp 0x33ceb
incl 0x188(%rbx)
xorl %r12d, %r12d
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq