// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonfonts/src/fonts.c
// Function: font_new
static int font_new(lua_State *L, const char *name, createfunc_t create,
    unsigned int first_char, unsigned int num_chars, 
    unsigned int width, unsigned int height, unsigned int height_pow2, unsigned int line_spacing)
    {
    rec_t *rec;
    if((rec = (rec_t*)Malloc(L, sizeof(rec_t))) == NULL) 
        return luaL_error(L, errstring(ERR_MEMORY));

    memset(rec, 0, sizeof(rec_t));
    rec->name= Strdup(L, name);
    rec->font.name = name;
    rec->font.create = create;
    rec->font.num_chars = num_chars;
    rec->font.first_char = first_char;
    rec->font.width = width;
    rec->font.height = height;
    rec->font.height_pow2 = height_pow2;
    rec->font.line_spacing = line_spacing;

    if(search(name))
        {
        Free(L, rec->name);
        Free(L, rec); 
        return unexpected(L); /* duplicate value */
        }
    insert(rec);
    return 0;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %r12d
movl %r8d, 0x14(%rsp)
movl %ecx, 0xc(%rsp)
movq %rdx, %rbp
movq %rsi, %r15
movq %rdi, %r14
movl 0x58(%rsp), %eax
movl %eax, 0x10(%rsp)
movl 0x50(%rsp), %r13d
pushq $0x50
popq %rsi
callq 0x1070
testq %rax, %rax
je 0xdc27
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %r14, %rdi
movq %r15, %rsi
callq 0x1180
movl %r12d, %ecx
movq %rax, %r12
movq %rax, 0x20(%rbx)
movq %r15, 0x28(%rbx)
movq %rbp, 0x48(%rbx)
movl 0xc(%rsp), %eax
movl %eax, 0x44(%rbx)
movl $0x20, 0x40(%rbx)
movl 0x14(%rsp), %eax
movl %eax, 0x30(%rbx)
movl %ecx, 0x34(%rbx)
movl %r13d, 0x38(%rbx)
movl 0x10(%rsp), %eax
movl %eax, 0x3c(%rbx)
movq %r15, %rdi
callq 0xd588
testq %rax, %rax
je 0xdc4a
movq %r14, %rdi
movq %r12, %rsi
callq 0x1190
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1190
leaq 0x98db8(%rip), %rsi     # 0xa69bd
leaq 0x98dcb(%rip), %rdx     # 0xa69d7
pushq $0x66
popq %rcx
movq %r14, %rdi
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1170
pushq $-0x6
popq %rdi
callq 0x1050
movq %r14, %rdi
movq %rax, %rsi
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1170
pushq $0x8
popq %r15
leaq 0x18be4b3(%rip), %rsi   # 0x18cc108
xorl %ecx, %ecx
movq %r15, %rdx
movq (%rsi), %r14
testq %r14, %r14
je 0xdc8b
movq %rbx, %rdi
movq %r14, %rsi
callq 0xd57b
movq %r14, %rsi
movq %r14, %rcx
movl $0x0, %edx
testl %eax, %eax
js 0xdc5a
je 0xde5b
leaq 0x8(%r14), %rsi
movq %r14, %rcx
jmp 0xdc57
movq %rcx, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movl $0x1, 0x18(%rbx)
addq %rcx, %rdx
testq %rcx, %rcx
leaq 0x18be45f(%rip), %rax   # 0x18cc108
cmoveq %rax, %rdx
movq %rbx, (%rdx)
testq %rcx, %rcx
je 0xde50
cmpl $0x1, 0x18(%rcx)
jne 0xde50
movq 0x10(%rcx), %rdx
movq (%rdx), %rsi
cmpq %rsi, %rcx
je 0xdcf3
testq %rsi, %rsi
je 0xdce0
cmpl $0x1, 0x18(%rsi)
jne 0xdce0
andl $0x0, 0x18(%rsi)
jmp 0xdd06
movq (%rcx), %rsi
cmpq %rbx, %rsi
je 0xdd2d
movq %rcx, %rsi
movq %rbx, %rcx
jmp 0xdd95
movq 0x8(%rdx), %rdi
testq %rdi, %rdi
je 0xdd19
cmpl $0x1, 0x18(%rdi)
jne 0xdd19
andl $0x0, 0x18(%rdi)
andl $0x0, 0x18(%rcx)
movl $0x1, 0x18(%rdx)
movq %rdx, %rcx
jmp 0xde44
movq 0x8(%rcx), %rdi
cmpq %rbx, %rdi
je 0xdd4f
movq %rcx, %rdi
movq %rbx, %rcx
jmp 0xde00
movq 0x8(%rsi), %rdi
movq %rdi, (%rcx)
testq %rdi, %rdi
je 0xdd71
movq %rcx, 0x10(%rdi)
movq 0x10(%rcx), %rdi
movq %rdi, 0x10(%rsi)
movq %rax, %r8
testq %rdi, %rdi
jne 0xdd79
jmp 0xdd87
movq (%rdi), %rsi
movq %rsi, 0x8(%rcx)
testq %rsi, %rsi
je 0xddda
movq %rcx, 0x10(%rsi)
movq 0x10(%rcx), %rsi
movq %rsi, 0x10(%rdi)
movq %rax, %r8
testq %rsi, %rsi
jne 0xdde2
jmp 0xddf0
movq %rdx, 0x10(%rsi)
movq 0x10(%rcx), %rdi
xorl %r8d, %r8d
cmpq (%rdi), %rcx
setne %r8b
leaq (%rdi,%r8,8), %r8
movq %rsi, (%r8)
movq %rcx, 0x8(%rsi)
movq %rsi, 0x10(%rcx)
movq %rbx, %rsi
andl $0x0, 0x18(%rsi)
movl $0x1, 0x18(%rdx)
movq 0x8(%rdx), %rsi
movq (%rsi), %rdi
movq %rdi, 0x8(%rdx)
testq %rdi, %rdi
je 0xddb4
movq %rdx, 0x10(%rdi)
movq 0x10(%rdx), %rdi
movq %rdi, 0x10(%rsi)
movq %rax, %r8
testq %rdi, %rdi
je 0xddd2
xorl %r8d, %r8d
cmpq (%rdi), %rdx
setne %r8b
leaq (%rdi,%r8,8), %r8
movq %rsi, (%r8)
movq %rdx, (%rsi)
jmp 0xde40
movq %rdx, 0x10(%rdi)
movq 0x10(%rcx), %rsi
xorl %r8d, %r8d
cmpq (%rsi), %rcx
setne %r8b
leaq (%rsi,%r8,8), %r8
movq %rdi, (%r8)
movq %rcx, (%rdi)
movq %rdi, 0x10(%rcx)
movq (%rdx), %rsi
movq %rbx, %rdi
andl $0x0, 0x18(%rdi)
movl $0x1, 0x18(%rdx)
movq 0x8(%rsi), %rdi
movq %rdi, (%rdx)
testq %rdi, %rdi
je 0xde1b
movq %rdx, 0x10(%rdi)
movq 0x10(%rdx), %rdi
movq %rdi, 0x10(%rsi)
movq %rax, %r8
testq %rdi, %rdi
je 0xde39
xorl %r8d, %r8d
cmpq (%rdi), %rdx
setne %r8b
leaq (%rdi,%r8,8), %r8
movq %rsi, (%r8)
movq %rdx, 0x8(%rsi)
movq %rsi, 0x10(%rdx)
movq %rcx, %rbx
movq 0x10(%rcx), %rcx
jmp 0xdcb0
movq 0x18be2b1(%rip), %rax   # 0x18cc108
andl $0x0, 0x18(%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq