// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl 0x10827(%rip), %ecx     # 0x1c888
leal 0x1(%rcx), %eax
cmpl $0x2, %eax
ja 0xc07c
movl $0x1, 0x10815(%rip)     # 0x1c888
pushq $-0x1
popq %r14
pushq $0x1
popq %rcx
jmp 0xc080
leal -0x1(%rcx), %r14d
pushq $-0x1
popq %rbp
pushq $0x1
popq %r15
cmpl %r14d, %ecx
je 0xc2e6
movl %ecx, %ebx
cmpl $-0x1, %ecx
jne 0xc0a4
movl $0x1, 0x107e7(%rip)     # 0x1c888
movl %r15d, %ebx
movl %ebx, %edi
callq 0xc314
leal 0x1(%rbx), %ecx
movl %ecx, 0x107d4(%rip)     # 0x1c888
testq %rax, %rax
jne 0xc087
pushq $0x28
popq %rdi
callq 0x54b0
testq %rax, %rax
je 0xc2e6
movl %ebx, 0x20(%rax)
leaq 0x107bc(%rip), %rsi     # 0x1c890
xorl %ecx, %ecx
xorl %edx, %edx
movq (%rsi), %rdi
testq %rdi, %rdi
je 0xc0fd
movq %rdi, %rsi
movq %rdi, %rcx
cmpl 0x20(%rdi), %ebx
setl %dl
jl 0xc0d8
jle 0xc2e4
leaq 0x8(%rdi), %rsi
movq %rdi, %rcx
jmp 0xc0d8
movq %rcx, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movl $0x1, 0x18(%rax)
notb %dl
movzbl %dl, %edx
andl $0x1, %edx
testq %rcx, %rcx
leaq (%rcx,%rdx,8), %rsi
leaq 0x1076c(%rip), %rdx     # 0x1c890
cmoveq %rdx, %rsi
movq %rax, (%rsi)
testq %rcx, %rcx
je 0xc2d9
cmpl $0x1, 0x18(%rcx)
jne 0xc2d9
movq 0x10(%rcx), %rsi
movq (%rsi), %rdi
cmpq %rdi, %rcx
je 0xc16e
testq %rdi, %rdi
je 0xc15b
cmpl $0x1, 0x18(%rdi)
jne 0xc15b
andl $0x0, 0x18(%rdi)
jmp 0xc183
movq (%rcx), %rdi
cmpq %rax, %rdi
je 0xc1aa
movq %rcx, %rdi
movq %rax, %rcx
jmp 0xc219
movq 0x8(%rsi), %r8
testq %r8, %r8
je 0xc196
cmpl $0x1, 0x18(%r8)
jne 0xc196
andl $0x0, 0x18(%r8)
andl $0x0, 0x18(%rcx)
movl $0x1, 0x18(%rsi)
movq %rsi, %rcx
jmp 0xc2cd
movq 0x8(%rcx), %r8
cmpq %rax, %r8
je 0xc1cc
movq %rcx, %r8
movq %rax, %rcx
jmp 0xc288
movq 0x8(%rdi), %r8
movq %r8, (%rcx)
testq %r8, %r8
je 0xc1f5
movq %rcx, 0x10(%r8)
movq 0x10(%rcx), %r8
movq %r8, 0x10(%rdi)
movq %rdx, %r9
testq %r8, %r8
jne 0xc1fd
jmp 0xc20b
movq (%r8), %rdi
movq %rdi, 0x8(%rcx)
testq %rdi, %rdi
je 0xc262
movq %rcx, 0x10(%rdi)
movq 0x10(%rcx), %rdi
movq %rdi, 0x10(%r8)
movq %rdx, %r9
testq %rdi, %rdi
jne 0xc26a
jmp 0xc278
movq %rsi, 0x10(%rdi)
movq 0x10(%rcx), %r8
xorl %r9d, %r9d
cmpq (%r8), %rcx
setne %r9b
leaq (%r8,%r9,8), %r9
movq %rdi, (%r9)
movq %rcx, 0x8(%rdi)
movq %rdi, 0x10(%rcx)
movq %rax, %rdi
andl $0x0, 0x18(%rdi)
movl $0x1, 0x18(%rsi)
movq 0x8(%rsi), %rax
movq (%rax), %rdi
movq %rdi, 0x8(%rsi)
testq %rdi, %rdi
je 0xc238
movq %rsi, 0x10(%rdi)
movq 0x10(%rsi), %rdi
movq %rdi, 0x10(%rax)
movq %rdx, %r8
testq %rdi, %rdi
je 0xc256
xorl %r8d, %r8d
cmpq (%rdi), %rsi
setne %r8b
leaq (%rdi,%r8,8), %r8
movq %rax, (%r8)
movq %rsi, (%rax)
movq %rax, 0x10(%rsi)
jmp 0xc2cd
movq %rsi, 0x10(%r8)
movq 0x10(%rcx), %rdi
xorl %r9d, %r9d
cmpq (%rdi), %rcx
setne %r9b
leaq (%rdi,%r9,8), %r9
movq %r8, (%r9)
movq %rcx, (%r8)
movq %r8, 0x10(%rcx)
movq (%rsi), %rdi
movq %rax, %r8
andl $0x0, 0x18(%r8)
movl $0x1, 0x18(%rsi)
movq 0x8(%rdi), %rax
movq %rax, (%rsi)
testq %rax, %rax
je 0xc2a4
movq %rsi, 0x10(%rax)
movq 0x10(%rsi), %rax
movq %rax, 0x10(%rdi)
movq %rdx, %r8
testq %rax, %rax
je 0xc2c2
xorl %r8d, %r8d
cmpq (%rax), %rsi
setne %r8b
leaq (%rax,%r8,8), %r8
movq %rdi, (%r8)
movq %rsi, 0x8(%rdi)
movq %rdi, 0x10(%rsi)
movq %rcx, %rax
movq 0x10(%rcx), %rcx
jmp 0xc12b
movq 0x105b0(%rip), %rax     # 0x1c890
andl $0x0, 0x18(%rax)
movl %ebx, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq