// File: /workspace/github_c_makefile_star2_O1/stetre[P]moonglfw/src/win.c
// Function: moonglfw_win_new
win_t *win_new(void)
    {
    win_t *win;
    int id = id_new();
    if(id == -1)
        return NULL;
    if((win = (win_t*)malloc(sizeof(win_t))) == NULL) 
        { id_free(id); return NULL; }
    memset(win, 0, sizeof(win_t));
    win->id = id;
    if(win_search(win->id))
        { free(win); id_free(id); return NULL; }
    win->WindowPos = LUA_NOREF;
    win->WindowSize = LUA_NOREF;
    win->WindowClose = LUA_NOREF;
    win->WindowRefresh = LUA_NOREF;
    win->WindowFocus = LUA_NOREF;
    win->WindowIconify = LUA_NOREF;
    win->WindowMaximize = LUA_NOREF;
    win->WindowContentScale = LUA_NOREF;
    win->FramebufferSize = LUA_NOREF;
    win->Key = LUA_NOREF;
    win->Char = LUA_NOREF;
    win->CharMods = LUA_NOREF;
    win->MouseButton = LUA_NOREF;
    win->CursorPos = LUA_NOREF;
    win->CursorEnter = LUA_NOREF;
    win->Scroll = LUA_NOREF;
    win->Drop = LUA_NOREF;
    win_insert(win);
    return win;
    }

// Assembly:
pushq %rbx
callq 0x5520
cmpl $-0x1, %eax
je 0x10ac5
movl %eax, %ebx
movl $0x78, %edi
callq 0x54a0
testq %rax, %rax
je 0x10abe
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x60(%rax)
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq $0x0, 0x70(%rax)
movl %ebx, 0x20(%rax)
movq 0xbe87(%rip), %rdx      # 0x1c8b0
testq %rdx, %rdx
je 0x10a8f
movq %rdx, %rcx
cmpl %ebx, 0x20(%rcx)
jg 0x10a3c
jge 0x10ab6
addq $0x8, %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
jne 0x10a31
movaps 0x5965(%rip), %xmm0     # 0x163b0
movups %xmm0, 0x34(%rax)
movups %xmm0, 0x44(%rax)
movups %xmm0, 0x54(%rax)
movups %xmm0, 0x64(%rax)
movl $0xfffffffe, 0x74(%rax) # imm = 0xFFFFFFFE
testq %rdx, %rdx
je 0x10acc
movq %rdx, %rcx
movl 0x20(%rdx), %esi
cmpl %esi, %ebx
jl 0x10a7b
jle 0x10cb2
leaq 0x8(%rcx), %rdx
movq (%rdx), %rdx
testq %rdx, %rdx
jne 0x10a67
xorl %edx, %edx
cmpl %esi, %ebx
setge %dl
shll $0x3, %edx
jmp 0x10ad3
movaps 0x591a(%rip), %xmm0     # 0x163b0
movups %xmm0, 0x34(%rax)
movups %xmm0, 0x44(%rax)
movups %xmm0, 0x54(%rax)
movups %xmm0, 0x64(%rax)
movl $0xfffffffe, 0x74(%rax) # imm = 0xFFFFFFFE
movl $0x8, %edx
xorl %ecx, %ecx
jmp 0x10ad3
movq %rax, %rdi
callq 0x50b0
movl %ebx, %edi
callq 0x55b0
xorl %eax, %eax
jmp 0x10cb2
xorl %ecx, %ecx
movl $0x8, %edx
movq %rcx, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movl $0x1, 0x18(%rax)
testq %rcx, %rcx
je 0x10c9d
movq %rax, (%rcx,%rdx)
leaq 0xbdb8(%rip), %rdx      # 0x1c8b0
xorl %esi, %esi
movq %rax, %r8
cmpl $0x1, 0x18(%rcx)
jne 0x10ca4
movq 0x10(%rcx), %rdi
movq (%rdi), %r9
cmpq %r9, %rcx
je 0x10b2f
testq %r9, %r9
je 0x10b1f
cmpl $0x1, 0x18(%r9)
je 0x10b3f
movq (%rcx), %r9
cmpq %r8, %r9
je 0x10b6d
movq %rcx, %r9
movq %r8, %rcx
jmp 0x10bad
movq 0x8(%rdi), %r9
testq %r9, %r9
je 0x10b55
cmpl $0x1, 0x18(%r9)
jne 0x10b55
movl %esi, 0x18(%r9)
movl %esi, 0x18(%rcx)
movl $0x1, 0x18(%rdi)
movq %rdi, %rcx
jmp 0x10c8b
movq 0x8(%rcx), %r9
cmpq %r8, %r9
je 0x10bfd
movq %rcx, %r9
movq %r8, %rcx
jmp 0x10c3c
movq 0x8(%r9), %r10
movq %r10, (%rcx)
testq %r10, %r10
je 0x10b7d
movq %rcx, 0x10(%r10)
movq 0x10(%rcx), %r11
movq %r11, 0x10(%r9)
movq %rdx, %r10
testq %r11, %r11
je 0x10b9f
movq 0x10(%rcx), %r10
xorl %r11d, %r11d
cmpq (%r10), %rcx
setne %r11b
leaq (%r10,%r11,8), %r10
movq %r9, (%r10)
movq %rcx, 0x8(%r9)
movq %r9, 0x10(%rcx)
movq %r8, %r9
movl $0x0, 0x18(%r9)
movl $0x1, 0x18(%rdi)
movq 0x8(%rdi), %r8
movq (%r8), %r9
movq %r9, 0x8(%rdi)
testq %r9, %r9
je 0x10bd0
movq %rdi, 0x10(%r9)
movq 0x10(%rdi), %r10
movq %r10, 0x10(%r8)
movq %rdx, %r9
testq %r10, %r10
je 0x10bf2
movq 0x10(%rdi), %r9
xorl %r10d, %r10d
cmpq (%r9), %rdi
setne %r10b
leaq (%r9,%r10,8), %r9
movq %r8, (%r9)
movq %rdi, (%r8)
jmp 0x10c87
movq (%r9), %r10
movq %r10, 0x8(%rcx)
testq %r10, %r10
je 0x10c0d
movq %rcx, 0x10(%r10)
movq 0x10(%rcx), %r11
movq %r11, 0x10(%r9)
movq %rdx, %r10
testq %r11, %r11
je 0x10c2f
movq 0x10(%rcx), %r10
xorl %r11d, %r11d
cmpq (%r10), %rcx
setne %r11b
leaq (%r10,%r11,8), %r10
movq %r9, (%r10)
movq %rcx, (%r9)
movq %r9, 0x10(%rcx)
movq %r8, %r9
movl $0x0, 0x18(%r9)
movl $0x1, 0x18(%rdi)
movq (%rdi), %r8
movq 0x8(%r8), %r9
movq %r9, (%rdi)
testq %r9, %r9
je 0x10c5e
movq %rdi, 0x10(%r9)
movq 0x10(%rdi), %r10
movq %r10, 0x10(%r8)
movq %rdx, %r9
testq %r10, %r10
je 0x10c80
movq 0x10(%rdi), %r9
xorl %r10d, %r10d
cmpq (%r9), %rdi
setne %r10b
leaq (%r9,%r10,8), %r9
movq %r8, (%r9)
movq %rdi, 0x8(%r8)
movq %r8, 0x10(%rdi)
movq %rcx, %r8
movq 0x10(%rcx), %rcx
testq %rcx, %rcx
jne 0x10afd
jmp 0x10ca4
movq %rax, 0xbc0c(%rip)      # 0x1c8b0
movq 0xbc05(%rip), %rcx      # 0x1c8b0
movl $0x0, 0x18(%rcx)
popq %rbx
retq