	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pvr2_context_destroy
_pvr2_context_destroy:                  ## @pvr2_context_destroy
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	_PVR2_TRACE_CTXT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdx
	callq	_pvr2_trace
	movl	16(%rbx), %edi
	callq	_pvr2_hdw_destroy
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_pvr2_context_set_notify
	movq	_pvr2_context_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	(%rbx), %rcx
	movq	8(%rbx), %rax
	testq	%rcx, %rcx
	jne	LBB0_2
## %bb.1:
	movq	_pvr2_context_exist_last@GOTPCREL(%rip), %rcx
LBB0_2:
	movq	%rax, (%rcx)
	movq	(%rbx), %rcx
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%rcx, (%rax)
	movq	_pvr2_context_exist_first@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	testq	%rcx, %rcx
	jne	LBB0_7
LBB0_6:
	movq	_pvr2_context_sync_data@GOTPCREL(%rip), %rdi
	callq	_wake_up
LBB0_7:
	movq	_pvr2_context_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_kfree                          ## TAILCALL
LBB0_4:
	movq	_pvr2_context_exist_first@GOTPCREL(%rip), %rax
	movq	%rcx, (%rax)
	testq	%rcx, %rcx
	jne	LBB0_7
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_PVR2_TRACE_CTXT,4,2            ## @PVR2_TRACE_CTXT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pvr2_context %p (destroy)"

	.comm	_pvr2_context_mutex,4,2         ## @pvr2_context_mutex
	.comm	_pvr2_context_exist_last,8,3    ## @pvr2_context_exist_last
	.comm	_pvr2_context_exist_first,8,3   ## @pvr2_context_exist_first
	.comm	_pvr2_context_sync_data,4,2     ## @pvr2_context_sync_data
	.no_dead_strip	_pvr2_context_destroy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pvr2_context_destroy
_pvr2_context_destroy:                  ; @pvr2_context_destroy
	.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, x0
Lloh0:
	adrp	x8, _PVR2_TRACE_CTXT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PVR2_TRACE_CTXT@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_pvr2_trace
	ldr	w0, [x19, #16]
	bl	_pvr2_hdw_destroy
	mov	x0, x19
	mov	w1, #0
	bl	_pvr2_context_set_notify
Lloh5:
	adrp	x0, _pvr2_context_mutex@GOTPAGE
Lloh6:
	ldr	x0, [x0, _pvr2_context_mutex@GOTPAGEOFF]
	bl	_mutex_lock
	ldp	x8, x9, [x19]
Lloh7:
	adrp	x10, _pvr2_context_exist_last@GOTPAGE
Lloh8:
	ldr	x10, [x10, _pvr2_context_exist_last@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x10, x8, eq
	str	x9, [x8]
	ldr	x8, [x19]
	cbz	x9, LBB0_4
; %bb.1:
	str	x8, [x9]
Lloh9:
	adrp	x8, _pvr2_context_exist_first@GOTPAGE
Lloh10:
	ldr	x8, [x8, _pvr2_context_exist_first@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cbnz	x8, LBB0_3
LBB0_2:
Lloh12:
	adrp	x0, _pvr2_context_sync_data@GOTPAGE
Lloh13:
	ldr	x0, [x0, _pvr2_context_sync_data@GOTPAGEOFF]
	bl	_wake_up
LBB0_3:
Lloh14:
	adrp	x0, _pvr2_context_mutex@GOTPAGE
Lloh15:
	ldr	x0, [x0, _pvr2_context_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_kfree
LBB0_4:
Lloh16:
	adrp	x9, _pvr2_context_exist_first@GOTPAGE
Lloh17:
	ldr	x9, [x9, _pvr2_context_exist_first@GOTPAGEOFF]
Lloh18:
	str	x8, [x9]
	cbnz	x8, LBB0_3
	b	LBB0_2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotStr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_PVR2_TRACE_CTXT,4,2            ; @PVR2_TRACE_CTXT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pvr2_context %p (destroy)"

	.comm	_pvr2_context_mutex,4,2         ; @pvr2_context_mutex
	.comm	_pvr2_context_exist_last,8,3    ; @pvr2_context_exist_last
	.comm	_pvr2_context_exist_first,8,3   ; @pvr2_context_exist_first
	.comm	_pvr2_context_sync_data,4,2     ; @pvr2_context_sync_data
	.no_dead_strip	_pvr2_context_destroy
.subsections_via_symbols
