// File: /workspace/github_c_makefile_star2_O3/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 0x5530
cmpl $-0x1, %eax
je 0x10dd2
movl %eax, %ebx
movl $0x1, %edi
movl $0x78, %esi
callq 0x53b0
testq %rax, %rax
je 0x10dcb
movl %ebx, 0x20(%rax)
movq 0xbd81(%rip), %rdx      # 0x1c8b8
testq %rdx, %rdx
je 0x10d7d
movq %rdx, %rcx
cmpl %ebx, 0x20(%rcx)
jg 0x10b52
jge 0x10dc3
addq $0x8, %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
jne 0x10b43
movaps 0x584f(%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 0x10d9b
movq %rdx, %rcx
movl 0x20(%rdx), %esi
cmpl %esi, %ebx
jl 0x10b95
jle 0x10dd4
leaq 0x8(%rcx), %rdx
movq (%rdx), %rdx
testq %rdx, %rdx
jne 0x10b81
xorl %edx, %edx
cmpl %esi, %ebx
setge %dl
movq %rcx, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movl $0x1, 0x18(%rax)
movq %rax, (%rcx,%rdx,8)
leaq 0xbcf8(%rip), %rdx      # 0x1c8b8
xorl %esi, %esi
movq %rax, %r8
cmpl $0x1, 0x18(%rcx)
jne 0x10d74
movq 0x10(%rcx), %rdi
movq (%rdi), %r9
cmpq %r9, %rcx
je 0x10c00
testq %r9, %r9
je 0x10bed
cmpl $0x1, 0x18(%r9)
jne 0x10bed
movl %esi, 0x18(%r9)
jmp 0x10c14
movq (%rcx), %r9
cmpq %r8, %r9
je 0x10c3a
movq %rcx, %r9
movq %r8, %rcx
jmp 0x10ca9
movq 0x8(%rdi), %r10
testq %r10, %r10
je 0x10c26
cmpl $0x1, 0x18(%r10)
jne 0x10c26
movl %esi, 0x18(%r10)
movl %esi, 0x18(%rcx)
movl $0x1, 0x18(%rdi)
movq %rdi, %rcx
jmp 0x10d64
movq 0x8(%rcx), %r10
cmpq %r8, %r10
je 0x10c5c
movq %rcx, %r10
movq %r8, %rcx
jmp 0x10d1c
movq 0x8(%r9), %r10
movq %r10, (%rcx)
testq %r10, %r10
je 0x10c85
movq %rcx, 0x10(%r10)
movq 0x10(%rcx), %r10
movq %r10, 0x10(%r9)
movq %rdx, %r11
testq %r10, %r10
jne 0x10c8d
jmp 0x10c9b
movq (%r10), %r9
movq %r9, 0x8(%rcx)
testq %r9, %r9
je 0x10cf6
movq %rcx, 0x10(%r9)
movq 0x10(%rcx), %r9
movq %r9, 0x10(%r10)
movq %rdx, %r11
testq %r9, %r9
jne 0x10cfe
jmp 0x10d0c
movq %rdi, 0x10(%r9)
movq 0x10(%rcx), %r10
xorl %r11d, %r11d
cmpq (%r10), %rcx
setne %r11b
leaq (%r10,%r11,8), %r11
movq %r9, (%r11)
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 0x10ccc
movq %rdi, 0x10(%r9)
movq 0x10(%rdi), %r9
movq %r9, 0x10(%r8)
movq %rdx, %r10
testq %r9, %r9
je 0x10cea
xorl %r10d, %r10d
cmpq (%r9), %rdi
setne %r10b
leaq (%r9,%r10,8), %r10
movq %r8, (%r10)
movq %rdi, (%r8)
movq %r8, 0x10(%rdi)
jmp 0x10d64
movq %rdi, 0x10(%r10)
movq 0x10(%rcx), %r9
xorl %r11d, %r11d
cmpq (%r9), %rcx
setne %r11b
leaq (%r9,%r11,8), %r11
movq %r10, (%r11)
movq %rcx, (%r10)
movq %r10, 0x10(%rcx)
movq (%rdi), %r9
movq %r8, %r10
movl $0x0, 0x18(%r10)
movl $0x1, 0x18(%rdi)
movq 0x8(%r9), %r8
movq %r8, (%rdi)
testq %r8, %r8
je 0x10d3b
movq %rdi, 0x10(%r8)
movq 0x10(%rdi), %r8
movq %r8, 0x10(%r9)
movq %rdx, %r10
testq %r8, %r8
je 0x10d59
xorl %r10d, %r10d
cmpq (%r8), %rdi
setne %r10b
leaq (%r8,%r10,8), %r10
movq %r9, (%r10)
movq %rdi, 0x8(%r9)
movq %r9, 0x10(%rdi)
movq %rcx, %r8
movq 0x10(%rcx), %rcx
testq %rcx, %rcx
jne 0x10bc5
movq 0xbb3d(%rip), %rcx      # 0x1c8b8
jmp 0x10dba
movaps 0x562c(%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
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movl $0x1, 0x18(%rax)
movq %rax, 0xbb01(%rip)      # 0x1c8b8
movq %rax, %rcx
movl $0x0, 0x18(%rcx)
jmp 0x10dd4
movq %rax, %rdi
callq 0x50b0
movl %ebx, %edi
callq 0x55c0
xorl %eax, %eax
popq %rbx
retq