	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wined3d_fence_issue            ## -- Begin function wined3d_fence_issue
	.p2align	4, 0x90
_wined3d_fence_issue:                   ## @wined3d_fence_issue
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	16(%rdi), %rsi
	testq	%rsi, %rsi
	je	LBB0_4
## %bb.1:
	movq	%r15, %rdi
	callq	_context_reacquire
	movq	%rax, %r14
	testq	%rax, %rax
	jne	LBB0_5
## %bb.2:
	movq	16(%r12), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	_ARB_SYNC@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpl	$0, (%rax,%rcx,4)
	jne	LBB0_4
## %bb.3:
	movq	%r12, %rdi
	callq	_context_free_fence
LBB0_4:
	movq	%r15, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_context_acquire
	movq	%rax, %r14
LBB0_5:
	movq	(%r14), %rbx
	cmpq	$0, 16(%r12)
	jne	LBB0_7
## %bb.6:
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_context_alloc_fence
LBB0_7:
	movq	(%rbx), %rax
	movq	_ARB_SYNC@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_11
## %bb.8:
	movq	8(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.9:
	callq	_glDeleteSync
	movl	%eax, %edi
	callq	_GL_EXTCALL
LBB0_10:
	leaq	L_.str(%rip), %rdi
	callq	_checkGLcall
	movq	_GL_SYNC_GPU_COMMANDS_COMPLETE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_glFenceSync
	movl	%eax, %edi
	callq	_GL_EXTCALL
	movq	%rax, 8(%r12)
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_15
LBB0_11:
	movq	_APPLE_FENCE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_13
## %bb.12:
	movl	(%r12), %edi
	callq	_glSetFenceAPPLE
	movl	%eax, %edi
	callq	_GL_EXTCALL
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_15
LBB0_13:
	movq	_NV_FENCE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_16
## %bb.14:
	movl	(%r12), %edi
	movq	_GL_ALL_COMPLETED_NV@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_glSetFenceNV
	movl	%eax, %edi
	callq	_GL_EXTCALL
	leaq	L_.str.3(%rip), %rdi
LBB0_15:
	callq	_checkGLcall
LBB0_16:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_context_release                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ARB_SYNC,8,3                   ## @ARB_SYNC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"glDeleteSync"

	.comm	_GL_SYNC_GPU_COMMANDS_COMPLETE,4,2 ## @GL_SYNC_GPU_COMMANDS_COMPLETE
L_.str.1:                               ## @.str.1
	.asciz	"glFenceSync"

	.comm	_APPLE_FENCE,8,3                ## @APPLE_FENCE
L_.str.2:                               ## @.str.2
	.asciz	"glSetFenceAPPLE"

	.comm	_NV_FENCE,8,3                   ## @NV_FENCE
	.comm	_GL_ALL_COMPLETED_NV,4,2        ## @GL_ALL_COMPLETED_NV
L_.str.3:                               ## @.str.3
	.asciz	"glSetFenceNV"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wined3d_fence_issue            ; -- Begin function wined3d_fence_issue
	.p2align	2
_wined3d_fence_issue:                   ; @wined3d_fence_issue
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x21, x1
	mov	x20, x0
	ldr	x1, [x0, #16]
Lloh0:
	adrp	x22, _ARB_SYNC@GOTPAGE
Lloh1:
	ldr	x22, [x22, _ARB_SYNC@GOTPAGEOFF]
	cbz	x1, LBB0_4
; %bb.1:
	mov	x0, x21
	bl	_context_reacquire
	mov	x19, x0
	cbnz	x0, LBB0_5
; %bb.2:
	ldr	x8, [x20, #16]
	ldr	x8, [x8]
	ldr	x8, [x8]
	ldr	x9, [x22]
	ldr	w8, [x8, x9, lsl #2]
	cbnz	w8, LBB0_4
; %bb.3:
	mov	x0, x20
	bl	_context_free_fence
LBB0_4:
	mov	x0, x21
	mov	x1, #0
	mov	w2, #0
	bl	_context_acquire
	mov	x19, x0
LBB0_5:
	ldr	x21, [x19]
	ldr	x8, [x20, #16]
	cbnz	x8, LBB0_7
; %bb.6:
	mov	x0, x19
	mov	x1, x20
	bl	_context_alloc_fence
LBB0_7:
	ldr	x8, [x21]
	ldr	x9, [x22]
	ldr	x9, [x8, x9, lsl #3]
	cbz	x9, LBB0_11
; %bb.8:
	ldr	x0, [x20, #8]
	cbz	x0, LBB0_10
; %bb.9:
	bl	_glDeleteSync
	bl	_GL_EXTCALL
LBB0_10:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_checkGLcall
Lloh4:
	adrp	x8, _GL_SYNC_GPU_COMMANDS_COMPLETE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _GL_SYNC_GPU_COMMANDS_COMPLETE@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	mov	w1, #0
	bl	_glFenceSync
	bl	_GL_EXTCALL
	str	x0, [x20, #8]
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_15
LBB0_11:
Lloh9:
	adrp	x9, _APPLE_FENCE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _APPLE_FENCE@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	ldr	x9, [x8, x9, lsl #3]
	cbz	x9, LBB0_13
; %bb.12:
	ldr	w0, [x20]
	bl	_glSetFenceAPPLE
	bl	_GL_EXTCALL
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_15
LBB0_13:
Lloh14:
	adrp	x9, _NV_FENCE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _NV_FENCE@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	ldr	x8, [x8, x9, lsl #3]
	cbz	x8, LBB0_16
; %bb.14:
	ldr	w0, [x20]
Lloh17:
	adrp	x8, _GL_ALL_COMPLETED_NV@GOTPAGE
Lloh18:
	ldr	x8, [x8, _GL_ALL_COMPLETED_NV@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	bl	_glSetFenceNV
	bl	_GL_EXTCALL
Lloh20:
	adrp	x0, l_.str.3@PAGE
Lloh21:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_15:
	bl	_checkGLcall
LBB0_16:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_context_release
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_ARB_SYNC,8,3                   ; @ARB_SYNC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"glDeleteSync"

	.comm	_GL_SYNC_GPU_COMMANDS_COMPLETE,4,2 ; @GL_SYNC_GPU_COMMANDS_COMPLETE
l_.str.1:                               ; @.str.1
	.asciz	"glFenceSync"

	.comm	_APPLE_FENCE,8,3                ; @APPLE_FENCE
l_.str.2:                               ; @.str.2
	.asciz	"glSetFenceAPPLE"

	.comm	_NV_FENCE,8,3                   ; @NV_FENCE
	.comm	_GL_ALL_COMPLETED_NV,4,2        ; @GL_ALL_COMPLETED_NV
l_.str.3:                               ; @.str.3
	.asciz	"glSetFenceNV"

.subsections_via_symbols
