	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_context_alloc_fence            ## -- Begin function context_alloc_fence
	.p2align	4, 0x90
_context_alloc_fence:                   ## @context_alloc_fence
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movslq	(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	8(%rbx), %rcx
	decq	%rax
	movl	%eax, (%rbx)
	shlq	$4, %rax
	movups	(%rcx,%rax), %xmm0
	movups	%xmm0, 16(%r14)
	jmp	LBB0_10
LBB0_2:
	movq	16(%rbx), %rax
	movq	(%rax), %rax
	movq	_ARB_SYNC@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_4
## %bb.3:
	movq	$0, 24(%r14)
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_TRACE
	jmp	LBB0_10
LBB0_4:
	movq	_APPLE_FENCE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_7
## %bb.5:
	leaq	16(%r14), %rsi
	movl	$1, %edi
	callq	_glGenFencesAPPLE
	movl	%eax, %edi
	callq	_GL_EXTCALL
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_6
LBB0_7:
	movq	_NV_FENCE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_9
## %bb.8:
	leaq	16(%r14), %rsi
	movl	$1, %edi
	callq	_glGenFencesNV
	movl	%eax, %edi
	callq	_GL_EXTCALL
	leaq	L_.str.3(%rip), %rdi
LBB0_6:
	callq	_checkGLcall
	movslq	16(%r14), %rsi
	leaq	L_.str.2(%rip), %rdi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_TRACE
LBB0_10:
	movq	%rbx, 8(%r14)
	addq	$4, %rbx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_list_add_head                  ## TAILCALL
LBB0_9:
	leaq	L_.str.4(%rip), %rdi
	callq	_WARN
	movl	$0, 16(%r14)
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_ARB_SYNC,8,3                   ## @ARB_SYNC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Allocated sync object in context %p.\n"

	.comm	_APPLE_FENCE,8,3                ## @APPLE_FENCE
L_.str.1:                               ## @.str.1
	.asciz	"glGenFencesAPPLE"

L_.str.2:                               ## @.str.2
	.asciz	"Allocated fence %u in context %p.\n"

	.comm	_NV_FENCE,8,3                   ## @NV_FENCE
L_.str.3:                               ## @.str.3
	.asciz	"glGenFencesNV"

L_.str.4:                               ## @.str.4
	.asciz	"Fences not supported, not allocating fence.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_context_alloc_fence            ; -- Begin function context_alloc_fence
	.p2align	2
_context_alloc_fence:                   ; @context_alloc_fence
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	mov	x20, x0
	ldr	w8, [x0]
	cbz	w8, LBB0_2
; %bb.1:
	ldr	x9, [x20, #8]
	sub	w8, w8, #1
	str	w8, [x20]
	ldr	q0, [x9, w8, sxtw #4]
	str	q0, [x19, #16]
	b	LBB0_10
LBB0_2:
	ldr	x8, [x20, #16]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _ARB_SYNC@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ARB_SYNC@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldr	x9, [x8, x9, lsl #3]
	cbz	x9, LBB0_4
; %bb.3:
	str	xzr, [x19, #24]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	b	LBB0_9
LBB0_4:
Lloh5:
	adrp	x9, _APPLE_FENCE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _APPLE_FENCE@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	ldr	x9, [x8, x9, lsl #3]
	cbz	x9, LBB0_6
; %bb.5:
	add	x1, x19, #16
	mov	w0, #1
	bl	_glGenFencesAPPLE
	bl	_GL_EXTCALL
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_6:
Lloh10:
	adrp	x9, _NV_FENCE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _NV_FENCE@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	ldr	x8, [x8, x9, lsl #3]
	cbz	x8, LBB0_11
; %bb.7:
	add	x1, x19, #16
	mov	w0, #1
	bl	_glGenFencesNV
	bl	_GL_EXTCALL
Lloh13:
	adrp	x0, l_.str.3@PAGE
Lloh14:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_8:
	bl	_checkGLcall
	ldrsw	x1, [x19, #16]
	str	x20, [sp]
Lloh15:
	adrp	x0, l_.str.2@PAGE
Lloh16:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_9:
	bl	_TRACE
LBB0_10:
	str	x20, [x19, #8]
	add	x0, x20, #4
	mov	x1, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	b	_list_add_head
LBB0_11:
Lloh17:
	adrp	x0, l_.str.4@PAGE
Lloh18:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_WARN
	str	wzr, [x19, #16]
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_ARB_SYNC,8,3                   ; @ARB_SYNC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Allocated sync object in context %p.\n"

	.comm	_APPLE_FENCE,8,3                ; @APPLE_FENCE
l_.str.1:                               ; @.str.1
	.asciz	"glGenFencesAPPLE"

l_.str.2:                               ; @.str.2
	.asciz	"Allocated fence %u in context %p.\n"

	.comm	_NV_FENCE,8,3                   ; @NV_FENCE
l_.str.3:                               ; @.str.3
	.asciz	"glGenFencesNV"

l_.str.4:                               ; @.str.4
	.asciz	"Fences not supported, not allocating fence.\n"

.subsections_via_symbols
