	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_context_alloc_occlusion_query  ## -- Begin function context_alloc_occlusion_query
	.p2align	4, 0x90
_context_alloc_occlusion_query:         ## @context_alloc_occlusion_query
	.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
	leaq	-1(%rax), %rdx
	movl	%edx, (%rbx)
	movq	-8(%rcx,%rax,8), %rax
	movq	%rax, 16(%r14)
	jmp	LBB0_5
LBB0_2:
	movq	16(%rbx), %rax
	movq	(%rax), %rax
	movq	_ARB_OCCLUSION_QUERY@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_4
## %bb.3:
	leaq	16(%r14), %rsi
	movl	$1, %edi
	callq	_glGenQueries
	movl	%eax, %edi
	callq	_GL_EXTCALL
	leaq	L_.str(%rip), %rdi
	callq	_checkGLcall
	movq	16(%r14), %rsi
	leaq	L_.str.1(%rip), %rdi
	movq	%rbx, %rdx
	callq	_TRACE
	jmp	LBB0_5
LBB0_4:
	leaq	L_.str.2(%rip), %rdi
	callq	_WARN
	movq	$0, 16(%r14)
LBB0_5:
	movq	%rbx, 8(%r14)
	addq	$4, %rbx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_list_add_head                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ARB_OCCLUSION_QUERY,8,3        ## @ARB_OCCLUSION_QUERY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"glGenQueries"

L_.str.1:                               ## @.str.1
	.asciz	"Allocated occlusion query %u in context %p.\n"

L_.str.2:                               ## @.str.2
	.asciz	"Occlusion queries not supported, not allocating query id.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_context_alloc_occlusion_query  ; -- Begin function context_alloc_occlusion_query
	.p2align	2
_context_alloc_occlusion_query:         ; @context_alloc_occlusion_query
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.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	x8, [x9, w8, sxtw #3]
	str	x8, [x19, #16]
	b	LBB0_5
LBB0_2:
	ldr	x8, [x20, #16]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _ARB_OCCLUSION_QUERY@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ARB_OCCLUSION_QUERY@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldr	x8, [x8, x9, lsl #3]
	cbz	x8, LBB0_4
; %bb.3:
	add	x1, x19, #16
	mov	w0, #1
	bl	_glGenQueries
	bl	_GL_EXTCALL
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_checkGLcall
	ldr	x1, [x19, #16]
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x2, x20
	bl	_TRACE
	b	LBB0_5
LBB0_4:
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_WARN
	str	xzr, [x19, #16]
LBB0_5:
	str	x20, [x19, #8]
	add	x0, x20, #4
	mov	x1, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_list_add_head
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_ARB_OCCLUSION_QUERY,8,3        ; @ARB_OCCLUSION_QUERY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"glGenQueries"

l_.str.1:                               ; @.str.1
	.asciz	"Allocated occlusion query %u in context %p.\n"

l_.str.2:                               ; @.str.2
	.asciz	"Occlusion queries not supported, not allocating query id.\n"

.subsections_via_symbols
