// File: /workspace/github_c_makefile_star2_O3/stetre[P]moonglfw/src/id.c
// Function: moonglfw_id_new
static int key_new(void)
/* returns a free key or -1 if none are found (unlikely) */
    {
    static int keyfree = 0;
    int guard = keyfree-1;
    if((keyfree==-1)||(keyfree==0)||(keyfree==1))
        { keyfree=1; guard=-1; }
    while(1)
        {
        if(keyfree==guard) /* we made a complete round */
            return -1;
        if(keyfree==-1) keyfree=1;
        if(id_search(keyfree)==NULL) return keyfree++;
        keyfree++;
        }
    return -1;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl 0x10238(%rip), %r14d    # 0x1c878
leal 0x1(%r14), %eax
cmpl $0x2, %eax
ja 0xc660
movl $0x1, 0x10225(%rip)     # 0x1c878
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0x1, %r14d
jmp 0xc664
leal -0x1(%r14), %eax
movq 0x10215(%rip), %r15     # 0x1c880
cmpl $-0x1, %r14d
jne 0xc681
movl $0x1, 0x101fd(%rip)     # 0x1c878
movl $0x1, %r14d
testq %r15, %r15
je 0xc8f7
movq %r15, %rcx
cmpl %r14d, 0x20(%rcx)
jg 0xc699
jge 0xc6a3
addq $0x8, %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
jne 0xc68d
jmp 0xc6b7
incl %r14d
movl %r14d, 0x101cb(%rip)    # 0x1c878
cmpl %eax, %r14d
jne 0xc66b
jmp 0xc932
leal 0x1(%r14), %eax
movl %eax, 0x101b7(%rip)     # 0x1c878
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $-0x1, %r14d
je 0xc8ef
movl $0x28, %edi
callq 0x54b0
testq %rax, %rax
je 0xc8ef
movl %r14d, 0x20(%rax)
movq %r15, %rcx
movl 0x20(%r15), %edx
movq %r15, %rsi
cmpl %edx, %r14d
jl 0xc700
jle 0xc8ec
leaq 0x8(%rcx), %rsi
movq (%rsi), %r15
testq %r15, %r15
jne 0xc6e7
xorl %esi, %esi
cmpl %edx, %r14d
setge %sil
movq %rcx, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movl $0x1, 0x18(%rax)
movq %rax, (%rcx,%rsi,8)
leaq 0x10153(%rip), %rdx     # 0x1c880
xorl %esi, %esi
cmpl $0x1, 0x18(%rcx)
jne 0xc8de
movq 0x10(%rcx), %rdi
movq (%rdi), %r8
cmpq %r8, %rcx
je 0xc76a
testq %r8, %r8
je 0xc757
cmpl $0x1, 0x18(%r8)
jne 0xc757
movl %esi, 0x18(%r8)
jmp 0xc77e
movq (%rcx), %r8
cmpq %rax, %r8
je 0xc7a4
movq %rcx, %r8
movq %rax, %rcx
jmp 0xc813
movq 0x8(%rdi), %r9
testq %r9, %r9
je 0xc790
cmpl $0x1, 0x18(%r9)
jne 0xc790
movl %esi, 0x18(%r9)
movl %esi, 0x18(%rcx)
movl $0x1, 0x18(%rdi)
movq %rdi, %rcx
jmp 0xc8ce
movq 0x8(%rcx), %r9
cmpq %rax, %r9
je 0xc7c6
movq %rcx, %r9
movq %rax, %rcx
jmp 0xc886
movq 0x8(%r8), %r9
movq %r9, (%rcx)
testq %r9, %r9
je 0xc7ef
movq %rcx, 0x10(%r9)
movq 0x10(%rcx), %r9
movq %r9, 0x10(%r8)
movq %rdx, %r10
testq %r9, %r9
jne 0xc7f7
jmp 0xc805
movq (%r9), %r8
movq %r8, 0x8(%rcx)
testq %r8, %r8
je 0xc860
movq %rcx, 0x10(%r8)
movq 0x10(%rcx), %r8
movq %r8, 0x10(%r9)
movq %rdx, %r10
testq %r8, %r8
jne 0xc868
jmp 0xc876
movq %rdi, 0x10(%r8)
movq 0x10(%rcx), %r9
xorl %r10d, %r10d
cmpq (%r9), %rcx
setne %r10b
leaq (%r9,%r10,8), %r10
movq %r8, (%r10)
movq %rcx, 0x8(%r8)
movq %r8, 0x10(%rcx)
movq %rax, %r8
movl $0x0, 0x18(%r8)
movl $0x1, 0x18(%rdi)
movq 0x8(%rdi), %rax
movq (%rax), %r8
movq %r8, 0x8(%rdi)
testq %r8, %r8
je 0xc836
movq %rdi, 0x10(%r8)
movq 0x10(%rdi), %r8
movq %r8, 0x10(%rax)
movq %rdx, %r9
testq %r8, %r8
je 0xc854
xorl %r9d, %r9d
cmpq (%r8), %rdi
setne %r9b
leaq (%r8,%r9,8), %r9
movq %rax, (%r9)
movq %rdi, (%rax)
movq %rax, 0x10(%rdi)
jmp 0xc8ce
movq %rdi, 0x10(%r9)
movq 0x10(%rcx), %r8
xorl %r10d, %r10d
cmpq (%r8), %rcx
setne %r10b
leaq (%r8,%r10,8), %r10
movq %r9, (%r10)
movq %rcx, (%r9)
movq %r9, 0x10(%rcx)
movq (%rdi), %r8
movq %rax, %r9
movl $0x0, 0x18(%r9)
movl $0x1, 0x18(%rdi)
movq 0x8(%r8), %rax
movq %rax, (%rdi)
testq %rax, %rax
je 0xc8a5
movq %rdi, 0x10(%rax)
movq 0x10(%rdi), %rax
movq %rax, 0x10(%r8)
movq %rdx, %r9
testq %rax, %rax
je 0xc8c3
xorl %r9d, %r9d
cmpq (%rax), %rdi
setne %r9b
leaq (%rax,%r9,8), %r9
movq %r8, (%r9)
movq %rdi, 0x8(%r8)
movq %r8, 0x10(%rdi)
movq %rcx, %rax
movq 0x10(%rcx), %rcx
testq %rcx, %rcx
jne 0xc72f
movq 0xff9b(%rip), %rax      # 0x1c880
movl $0x0, 0x18(%rax)
movl %r14d, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
leal 0x1(%r14), %eax
movl %eax, 0xff77(%rip)      # 0x1c878
movl $0x28, %edi
callq 0x54b0
testq %rax, %rax
je 0xc932
movl %r14d, 0x20(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movl $0x1, 0x18(%rax)
movq %rax, 0xff50(%rip)      # 0x1c880
jmp 0xc8e5
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0xc8ef