// File: /workspace/github_c_makefile_star2_O1/stetre[P]moongl/src/sync.c
// Function: FenceSync
static int FenceSync(lua_State *L)
    {
    node_t *node;
    GLsync sync; 
    GLbitfield flags = 0;
    GLenum condition = checkcondition(L, 1);
    sync = glFenceSync(condition, flags);
    CheckError(L);
    if(sync==0) /* paranoia... */
        return luaL_error(L, "cannot create sync");
    if((node=node_new(sync))==NULL)
        {
        glDeleteSync(sync);
        CheckError(L);
        return luaL_error(L, "cannot create sync");
        }
    lua_pushinteger(L, node->id);
    return 1;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x3d, %esi
movl $0x1, %edx
callq 0x11160
movq 0x1fd40(%rip), %rcx     # 0x563e0
movl %eax, %edi
xorl %esi, %esi
callq *(%rcx)
movq %rax, %r14
movq %rbx, %rdi
callq 0x11880
testq %r14, %r14
je 0x369c0
movl 0x212b8(%rip), %eax     # 0x57978
leal 0x1(%rax), %ecx
cmpl $0x2, %ecx
ja 0x366d9
movl $0x1, 0x212a6(%rip)     # 0x57978
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x366db
decl %eax
movl 0x21296(%rip), %r15d    # 0x57978
cmpl %eax, %r15d
jne 0x366ef
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x36745
movq 0x2128a(%rip), %rcx     # 0x57980
cmpl $-0x1, %r15d
jne 0x3670c
movl $0x1, 0x21272(%rip)     # 0x57978
movl $0x1, %r15d
testq %rcx, %rcx
je 0x3673b
movq %rcx, %rdx
cmpl %r15d, 0x20(%rdx)
jg 0x36720
jge 0x3672a
addq $0x8, %rdx
movq (%rdx), %rdx
testq %rdx, %rdx
jne 0x36714
jmp 0x3673b
incl %r15d
movl %r15d, 0x21244(%rip)    # 0x57978
cmpl %eax, %r15d
jne 0x366f6
jmp 0x366e7
leal 0x1(%r15), %eax
movl %eax, 0x21233(%rip)     # 0x57978
cmpl $-0x1, %r15d
je 0x367a6
movl $0x30, %edi
callq 0x11270
testq %rax, %rax
je 0x367a6
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movl %r15d, 0x20(%rax)
movq %r14, 0x28(%rax)
movq 0x21209(%rip), %rdx     # 0x57980
testq %rdx, %rdx
je 0x367ad
movq %rdx, %rcx
movl 0x20(%rdx), %esi
cmpl %esi, %r15d
jl 0x36791
jle 0x36990
leaq 0x8(%rcx), %rdx
movq (%rdx), %rdx
testq %rdx, %rdx
jne 0x3677c
xorl %edx, %edx
cmpl %esi, %r15d
setge %dl
shll $0x3, %edx
jmp 0x367b4
xorl %eax, %eax
jmp 0x36990
movl $0x8, %edx
xorl %ecx, %ecx
movq %rcx, 0x10(%rax)
movups %xmm0, (%rax)
movl $0x1, 0x18(%rax)
testq %rcx, %rcx
je 0x3697b
movq %rax, (%rcx,%rdx)
leaq 0x211aa(%rip), %rdx     # 0x57980
xorl %esi, %esi
movq %rax, %r8
cmpl $0x1, 0x18(%rcx)
jne 0x36982
movq 0x10(%rcx), %rdi
movq (%rdi), %r9
cmpq %r9, %rcx
je 0x3680d
testq %r9, %r9
je 0x367fd
cmpl $0x1, 0x18(%r9)
je 0x3681d
movq (%rcx), %r9
cmpq %r8, %r9
je 0x3684b
movq %rcx, %r9
movq %r8, %rcx
jmp 0x3688b
movq 0x8(%rdi), %r9
testq %r9, %r9
je 0x36833
cmpl $0x1, 0x18(%r9)
jne 0x36833
movl %esi, 0x18(%r9)
movl %esi, 0x18(%rcx)
movl $0x1, 0x18(%rdi)
movq %rdi, %rcx
jmp 0x36969
movq 0x8(%rcx), %r9
cmpq %r8, %r9
je 0x368db
movq %rcx, %r9
movq %r8, %rcx
jmp 0x3691a
movq 0x8(%r9), %r10
movq %r10, (%rcx)
testq %r10, %r10
je 0x3685b
movq %rcx, 0x10(%r10)
movq 0x10(%rcx), %r11
movq %r11, 0x10(%r9)
movq %rdx, %r10
testq %r11, %r11
je 0x3687d
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 0x368ae
movq %rdi, 0x10(%r9)
movq 0x10(%rdi), %r10
movq %r10, 0x10(%r8)
movq %rdx, %r9
testq %r10, %r10
je 0x368d0
movq 0x10(%rdi), %r9
xorl %r10d, %r10d
cmpq (%r9), %rdi
setne %r10b
leaq (%r9,%r10,8), %r9
movq %r8, (%r9)
movq %rdi, (%r8)
jmp 0x36965
movq (%r9), %r10
movq %r10, 0x8(%rcx)
testq %r10, %r10
je 0x368eb
movq %rcx, 0x10(%r10)
movq 0x10(%rcx), %r11
movq %r11, 0x10(%r9)
movq %rdx, %r10
testq %r11, %r11
je 0x3690d
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 0x3693c
movq %rdi, 0x10(%r9)
movq 0x10(%rdi), %r10
movq %r10, 0x10(%r8)
movq %rdx, %r9
testq %r10, %r10
je 0x3695e
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 0x367db
jmp 0x36982
movq %rax, 0x20ffe(%rip)     # 0x57980
movq 0x20ff7(%rip), %rcx     # 0x57980
movl $0x0, 0x18(%rcx)
testq %rax, %rax
je 0x369ac
movslq 0x20(%rax), %rsi
movq %rbx, %rdi
callq 0x113c0
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
movq 0x2053d(%rip), %rax     # 0x56ef0
movq %r14, %rdi
callq *(%rax)
movq %rbx, %rdi
callq 0x11880
leaq 0x14b5b(%rip), %rsi     # 0x4b522
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x11ae0