	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function g2d_wait_finish
_g2d_wait_finish:                       ## @g2d_wait_finish
	.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, %rbx
	movq	%rdi, %r12
	movq	16(%rdi), %r15
	callq	_mutex_lock
	movq	8(%r12), %r14
	testq	%r14, %r14
	je	LBB0_17
## %bb.1:
	testq	%rbx, %rbx
	je	LBB0_3
## %bb.2:
	cmpq	%rbx, 16(%r14)
	jne	LBB0_17
LBB0_3:
	movq	%r12, %rdi
	callq	_mutex_unlock
	cmpq	%r14, 8(%r12)
	jne	LBB0_14
## %bb.4:
	movl	$10, %edi
	callq	_mdelay
	cmpq	%r14, 8(%r12)
	jne	LBB0_14
## %bb.5:
	movl	$10, %edi
	callq	_mdelay
	cmpq	%r14, 8(%r12)
	jne	LBB0_14
## %bb.6:
	movl	$10, %edi
	callq	_mdelay
	cmpq	%r14, 8(%r12)
	jne	LBB0_14
## %bb.7:
	movl	$10, %edi
	callq	_mdelay
	cmpq	%r14, 8(%r12)
	jne	LBB0_14
## %bb.8:
	movl	$10, %edi
	callq	_mdelay
	cmpq	%r14, 8(%r12)
	jne	LBB0_14
## %bb.9:
	movl	$10, %edi
	callq	_mdelay
	cmpq	%r14, 8(%r12)
	jne	LBB0_14
## %bb.10:
	movl	$10, %edi
	callq	_mdelay
	cmpq	%r14, 8(%r12)
	jne	LBB0_14
## %bb.11:
	movl	$10, %edi
	callq	_mdelay
	cmpq	%r14, 8(%r12)
	jne	LBB0_14
## %bb.12:
	movl	$10, %edi
	callq	_mdelay
	cmpq	%r14, 8(%r12)
	jne	LBB0_14
## %bb.13:
	movl	$10, %edi
	callq	_mdelay
LBB0_14:
	movq	%r12, %rdi
	callq	_mutex_lock
	cmpq	%r14, 8(%r12)
	jne	LBB0_17
## %bb.15:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	movq	%r12, %rdi
	callq	_g2d_hw_reset
	movq	%r15, %rdi
	callq	_pm_runtime_mark_last_busy
	movq	%r15, %rdi
	callq	_pm_runtime_put_autosuspend
	leaq	8(%r14), %rdi
	callq	_complete
	cmpq	$0, (%r14)
	je	LBB0_17
## %bb.16:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_g2d_free_runqueue_node
LBB0_17:
	movq	%r12, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wait timed out, resetting engine...\n"

	.no_dead_strip	_g2d_wait_finish
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function g2d_wait_finish
_g2d_wait_finish:                       ; @g2d_wait_finish
	.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	x22, x1
	mov	x19, x0
	ldr	x21, [x0, #16]
	bl	_mutex_lock
	ldr	x20, [x19, #8]
	cbz	x20, LBB0_17
; %bb.1:
	cbz	x22, LBB0_3
; %bb.2:
	ldr	x8, [x20, #16]
	cmp	x8, x22
	b.ne	LBB0_17
LBB0_3:
	mov	x0, x19
	bl	_mutex_unlock
	ldr	x8, [x19, #8]
	cmp	x8, x20
	b.ne	LBB0_14
; %bb.4:
	mov	w0, #10
	bl	_mdelay
	ldr	x8, [x19, #8]
	cmp	x8, x20
	b.ne	LBB0_14
; %bb.5:
	mov	w0, #10
	bl	_mdelay
	ldr	x8, [x19, #8]
	cmp	x8, x20
	b.ne	LBB0_14
; %bb.6:
	mov	w0, #10
	bl	_mdelay
	ldr	x8, [x19, #8]
	cmp	x8, x20
	b.ne	LBB0_14
; %bb.7:
	mov	w0, #10
	bl	_mdelay
	ldr	x8, [x19, #8]
	cmp	x8, x20
	b.ne	LBB0_14
; %bb.8:
	mov	w0, #10
	bl	_mdelay
	ldr	x8, [x19, #8]
	cmp	x8, x20
	b.ne	LBB0_14
; %bb.9:
	mov	w0, #10
	bl	_mdelay
	ldr	x8, [x19, #8]
	cmp	x8, x20
	b.ne	LBB0_14
; %bb.10:
	mov	w0, #10
	bl	_mdelay
	ldr	x8, [x19, #8]
	cmp	x8, x20
	b.ne	LBB0_14
; %bb.11:
	mov	w0, #10
	bl	_mdelay
	ldr	x8, [x19, #8]
	cmp	x8, x20
	b.ne	LBB0_14
; %bb.12:
	mov	w0, #10
	bl	_mdelay
	ldr	x8, [x19, #8]
	cmp	x8, x20
	b.ne	LBB0_14
; %bb.13:
	mov	w0, #10
	bl	_mdelay
LBB0_14:
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x19, #8]
	cmp	x8, x20
	b.ne	LBB0_17
; %bb.15:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_err
	mov	x0, x19
	bl	_g2d_hw_reset
	mov	x0, x21
	bl	_pm_runtime_mark_last_busy
	mov	x0, x21
	bl	_pm_runtime_put_autosuspend
	add	x0, x20, #8
	bl	_complete
	ldr	x8, [x20]
	cbz	x8, LBB0_17
; %bb.16:
	mov	x0, x19
	mov	x1, x20
	bl	_g2d_free_runqueue_node
LBB0_17:
	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	_mutex_unlock
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wait timed out, resetting engine...\n"

	.no_dead_strip	_g2d_wait_finish
.subsections_via_symbols
