// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
pushq $0x3d
popq %rsi
pushq $0x1
popq %rbp
movl %ebp, %edx
callq 0x11150
movq 0x21a47(%rip), %rcx     # 0x553e0
movl %eax, %edi
xorl %esi, %esi
callq *(%rcx)
movq %rax, %r15
movq %rbx, %rdi
callq 0x11870
testq %r15, %r15
je 0x33a66
movl 0x22fbf(%rip), %ecx     # 0x56978
leal 0x1(%rcx), %eax
cmpl $0x2, %eax
ja 0x339d4
movl $0x1, 0x22fad(%rip)     # 0x56978
pushq $-0x1
popq %r12
pushq $0x1
popq %rcx
jmp 0x339d8
leal -0x1(%rcx), %r12d
cmpl %r12d, %ecx
je 0x33a52
movl %ecx, %r14d
cmpl $-0x1, %ecx
jne 0x339f2
movl $0x1, 0x22f89(%rip)     # 0x56978
movl %ebp, %r14d
movl %r14d, %edi
callq 0x343b5
leal 0x1(%r14), %ecx
movl %ecx, 0x22f74(%rip)     # 0x56978
testq %rax, %rax
jne 0x339d8
pushq $0x1
popq %rdi
pushq $0x30
popq %rsi
callq 0x11970
testq %rax, %rax
je 0x33a52
movl %r14d, 0x20(%rax)
movq %r15, 0x28(%rax)
leaq 0x22f58(%rip), %rsi     # 0x56980
xorl %ecx, %ecx
xorl %edx, %edx
movq (%rsi), %rdi
testq %rdi, %rdi
je 0x33a7f
movq %rdi, %rsi
movq %rdi, %rcx
cmpl 0x20(%rdi), %r14d
setl %dl
jl 0x33a2c
jle 0x33c60
leaq 0x8(%rdi), %rsi
movq %rdi, %rcx
jmp 0x33a2c
movq 0x22497(%rip), %rax     # 0x55ef0
movq %r15, %rdi
callq *(%rax)
movq %rbx, %rdi
callq 0x11870
leaq 0x13add(%rip), %rsi     # 0x4754a
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x11ae0
movq %rcx, 0x10(%rax)
movl $0x1, 0x18(%rax)
notb %dl
movzbl %dl, %edx
andl $0x1, %edx
testq %rcx, %rcx
leaq (%rcx,%rdx,8), %rsi
leaq 0x22ee0(%rip), %rdx     # 0x56980
cmoveq %rdx, %rsi
movq %rax, (%rsi)
testq %rcx, %rcx
je 0x33c55
cmpl $0x1, 0x18(%rcx)
jne 0x33c55
movq 0x10(%rcx), %rsi
movq (%rsi), %rdi
cmpq %rdi, %rcx
je 0x33aea
testq %rdi, %rdi
je 0x33ad7
cmpl $0x1, 0x18(%rdi)
jne 0x33ad7
andl $0x0, 0x18(%rdi)
jmp 0x33aff
movq (%rcx), %rdi
cmpq %rax, %rdi
je 0x33b26
movq %rcx, %rdi
movq %rax, %rcx
jmp 0x33b95
movq 0x8(%rsi), %r8
testq %r8, %r8
je 0x33b12
cmpl $0x1, 0x18(%r8)
jne 0x33b12
andl $0x0, 0x18(%r8)
andl $0x0, 0x18(%rcx)
movl $0x1, 0x18(%rsi)
movq %rsi, %rcx
jmp 0x33c49
movq 0x8(%rcx), %r8
cmpq %rax, %r8
je 0x33b48
movq %rcx, %r8
movq %rax, %rcx
jmp 0x33c04
movq 0x8(%rdi), %r8
movq %r8, (%rcx)
testq %r8, %r8
je 0x33b71
movq %rcx, 0x10(%r8)
movq 0x10(%rcx), %r8
movq %r8, 0x10(%rdi)
movq %rdx, %r9
testq %r8, %r8
jne 0x33b79
jmp 0x33b87
movq (%r8), %rdi
movq %rdi, 0x8(%rcx)
testq %rdi, %rdi
je 0x33bde
movq %rcx, 0x10(%rdi)
movq 0x10(%rcx), %rdi
movq %rdi, 0x10(%r8)
movq %rdx, %r9
testq %rdi, %rdi
jne 0x33be6
jmp 0x33bf4
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 0x33bb4
movq %rsi, 0x10(%rdi)
movq 0x10(%rsi), %rdi
movq %rdi, 0x10(%rax)
movq %rdx, %r8
testq %rdi, %rdi
je 0x33bd2
xorl %r8d, %r8d
cmpq (%rdi), %rsi
setne %r8b
leaq (%rdi,%r8,8), %r8
movq %rax, (%r8)
movq %rsi, (%rax)
movq %rax, 0x10(%rsi)
jmp 0x33c49
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 0x33c20
movq %rsi, 0x10(%rax)
movq 0x10(%rsi), %rax
movq %rax, 0x10(%rdi)
movq %rdx, %r8
testq %rax, %rax
je 0x33c3e
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 0x33aa7
movq 0x22d24(%rip), %rax     # 0x56980
andl $0x0, 0x18(%rax)
movslq %r14d, %rsi
movq %rbx, %rdi
callq 0x113b0
pushq $0x1
popq %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq