// File: /workspace/github_cpp_makefile_star2_O1/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, %r15d
movl %r8d, 0x14(%rsp)
movl %ecx, 0xc(%rsp)
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %r14
movl 0x58(%rsp), %eax
movl %eax, 0x10(%rsp)
movl 0x50(%rsp), %ebp
movl $0x50, %esi
callq 0x1070
testq %rax, %rax
je 0xf483
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 %r12, %rsi
callq 0x1180
movl %r15d, %ecx
movq %rax, %r15
movq %rax, 0x20(%rbx)
movq %r12, 0x28(%rbx)
movq %r13, 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 %ebp, 0x38(%rbx)
movl 0x10(%rsp), %eax
movl %eax, 0x3c(%rbx)
movq %r12, %rdi
callq 0xed64
testq %rax, %rax
je 0xf4a8
movq %r14, %rdi
movq %r15, %rsi
callq 0x1190
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1190
leaq 0x10a5ae(%rip), %rsi    # 0x119a0d
leaq 0x10a5c1(%rip), %rdx    # 0x119a27
movq %r14, %rdi
movl $0x66, %ecx
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1170
movl $0xfffffffa, %edi       # imm = 0xFFFFFFFA
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
movq 0x1954c59(%rip), %rcx   # 0x1964108
testq %rcx, %rcx
je 0xf4e6
movq %rcx, %r14
movq 0x20(%rcx), %rsi
movq %r15, %rdi
callq 0x1100
movq %r14, %rcx
testl %eax, %eax
js 0xf4d4
je 0xf6c7
leaq 0x8(%r14), %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
jne 0xf4b4
notl %eax
shrl $0x1c, %eax
andl $-0x8, %eax
jmp 0xf4ee
movl $0x8, %eax
xorl %r14d, %r14d
movq %r14, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movl $0x1, 0x18(%rbx)
testq %r14, %r14
je 0xf6b2
movq %rbx, (%r14,%rax)
leaq 0x1954bf5(%rip), %rax   # 0x1964108
xorl %ecx, %ecx
cmpl $0x1, 0x18(%r14)
jne 0xf6b9
movq 0x10(%r14), %rdx
movq (%rdx), %rsi
cmpq %rsi, %r14
je 0xf547
testq %rsi, %rsi
je 0xf537
cmpl $0x1, 0x18(%rsi)
je 0xf556
movq (%r14), %rsi
cmpq %rbx, %rsi
je 0xf584
movq %r14, %rsi
movq %rbx, %r14
jmp 0xf5c4
movq 0x8(%rdx), %rsi
testq %rsi, %rsi
je 0xf56c
cmpl $0x1, 0x18(%rsi)
jne 0xf56c
movl %ecx, 0x18(%rsi)
movl %ecx, 0x18(%r14)
movl $0x1, 0x18(%rdx)
movq %rdx, %r14
jmp 0xf6a0
movq 0x8(%r14), %rsi
cmpq %rbx, %rsi
je 0xf613
movq %r14, %rsi
movq %rbx, %r14
jmp 0xf652
movq 0x8(%rsi), %rdi
movq %rdi, (%r14)
testq %rdi, %rdi
je 0xf594
movq %r14, 0x10(%rdi)
movq 0x10(%r14), %r8
movq %r8, 0x10(%rsi)
movq %rax, %rdi
testq %r8, %r8
je 0xf5b6
movq 0x10(%r14), %rdi
xorl %r8d, %r8d
cmpq (%rdi), %r14
setne %r8b
leaq (%rdi,%r8,8), %rdi
movq %rsi, (%rdi)
movq %r14, 0x8(%rsi)
movq %rsi, 0x10(%r14)
movq %rbx, %rsi
movl $0x0, 0x18(%rsi)
movl $0x1, 0x18(%rdx)
movq 0x8(%rdx), %rsi
movq (%rsi), %rdi
movq %rdi, 0x8(%rdx)
testq %rdi, %rdi
je 0xf5e6
movq %rdx, 0x10(%rdi)
movq 0x10(%rdx), %r8
movq %r8, 0x10(%rsi)
movq %rax, %rdi
testq %r8, %r8
je 0xf608
movq 0x10(%rdx), %rdi
xorl %r8d, %r8d
cmpq (%rdi), %rdx
setne %r8b
leaq (%rdi,%r8,8), %rdi
movq %rsi, (%rdi)
movq %rdx, (%rsi)
jmp 0xf69c
movq (%rsi), %rdi
movq %rdi, 0x8(%r14)
testq %rdi, %rdi
je 0xf623
movq %r14, 0x10(%rdi)
movq 0x10(%r14), %r8
movq %r8, 0x10(%rsi)
movq %rax, %rdi
testq %r8, %r8
je 0xf645
movq 0x10(%r14), %rdi
xorl %r8d, %r8d
cmpq (%rdi), %r14
setne %r8b
leaq (%rdi,%r8,8), %rdi
movq %rsi, (%rdi)
movq %r14, (%rsi)
movq %rsi, 0x10(%r14)
movq %rbx, %rsi
movl $0x0, 0x18(%rsi)
movl $0x1, 0x18(%rdx)
movq (%rdx), %rsi
movq 0x8(%rsi), %rdi
movq %rdi, (%rdx)
testq %rdi, %rdi
je 0xf673
movq %rdx, 0x10(%rdi)
movq 0x10(%rdx), %r8
movq %r8, 0x10(%rsi)
movq %rax, %rdi
testq %r8, %r8
je 0xf695
movq 0x10(%rdx), %rdi
xorl %r8d, %r8d
cmpq (%rdi), %rdx
setne %r8b
leaq (%rdi,%r8,8), %rdi
movq %rsi, (%rdi)
movq %rdx, 0x8(%rsi)
movq %rsi, 0x10(%rdx)
movq %r14, %rbx
movq 0x10(%r14), %r14
testq %r14, %r14
jne 0xf515
jmp 0xf6b9
movq %rbx, 0x1954a4f(%rip)   # 0x1964108
movq 0x1954a48(%rip), %rax   # 0x1964108
movl $0x0, 0x18(%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq