	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function submit_unlock_unpin_bo
_submit_unlock_unpin_bo:                ## @submit_unlock_unpin_bo
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rdi, %r12
	movq	(%rdi), %rax
	movslq	%esi, %rcx
	leaq	(%rcx,%rcx,2), %rbx
	movq	16(%rax,%rbx,8), %r15
	movl	(%rax,%rbx,8), %eax
	movq	_BO_PINNED@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_2
## %bb.1:
	movl	8(%r12), %esi
	movq	%r15, %rdi
	callq	_msm_gem_unpin_iova
	movq	(%r12), %rax
	movl	(%rax,%rbx,8), %eax
LBB0_2:
	movq	_BO_LOCKED@GOTPCREL(%rip), %r13
	testl	%eax, (%r13)
	je	LBB0_4
## %bb.3:
	movq	(%r15), %rdi
	callq	_ww_mutex_unlock
LBB0_4:
	movq	(%r12), %rdx
	leaq	(%rdx,%rbx,8), %rax
	movl	(%rdx,%rbx,8), %ecx
	testl	%r14d, %r14d
	je	LBB0_7
## %bb.5:
	movq	_BO_VALID@GOTPCREL(%rip), %rsi
	testl	%ecx, (%rsi)
	jne	LBB0_7
## %bb.6:
	movq	$0, 8(%rdx,%rbx,8)
LBB0_7:
	movq	_BO_PINNED@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%r13), %edx
	notl	%edx
	andl	%edx, %ecx
	movl	%ecx, (%rax)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BO_PINNED,4,2                  ## @BO_PINNED
	.comm	_BO_LOCKED,4,2                  ## @BO_LOCKED
	.comm	_BO_VALID,4,2                   ## @BO_VALID
	.no_dead_strip	_submit_unlock_unpin_bo
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function submit_unlock_unpin_bo
_submit_unlock_unpin_bo:                ; @submit_unlock_unpin_bo
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x2
                                        ; kill: def $w1 killed $w1 def $x1
	mov	x20, x0
	ldr	x8, [x0]
	sxtw	x22, w1
	mov	w9, #24
	smaddl	x8, w1, w9, x8
	ldr	x21, [x8, #16]
	ldr	w8, [x8]
Lloh0:
	adrp	x23, _BO_PINNED@GOTPAGE
Lloh1:
	ldr	x23, [x23, _BO_PINNED@GOTPAGEOFF]
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	ldr	w1, [x20, #8]
	mov	x0, x21
	bl	_msm_gem_unpin_iova
	ldr	x8, [x20]
	mov	w9, #24
	mul	x9, x22, x9
	ldr	w8, [x8, x9]
LBB0_2:
Lloh2:
	adrp	x24, _BO_LOCKED@GOTPAGE
Lloh3:
	ldr	x24, [x24, _BO_LOCKED@GOTPAGEOFF]
	ldr	w9, [x24]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	ldr	x0, [x21]
	bl	_ww_mutex_unlock
LBB0_4:
	ldr	x10, [x20]
	mov	w8, #24
	madd	x8, x22, x8, x10
	ldr	w9, [x8]
	cbz	w19, LBB0_7
; %bb.5:
Lloh4:
	adrp	x11, _BO_VALID@GOTPAGE
Lloh5:
	ldr	x11, [x11, _BO_VALID@GOTPAGEOFF]
Lloh6:
	ldr	w11, [x11]
	tst	w11, w9
	b.ne	LBB0_7
; %bb.6:
	mov	w11, #24
	madd	x10, x22, x11, x10
	str	xzr, [x10, #8]
LBB0_7:
	ldr	w10, [x24]
	ldr	w11, [x23]
	orr	w10, w11, w10
	bic	w9, w9, w10
	str	w9, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_BO_PINNED,4,2                  ; @BO_PINNED
	.comm	_BO_LOCKED,4,2                  ; @BO_LOCKED
	.comm	_BO_VALID,4,2                   ; @BO_VALID
	.no_dead_strip	_submit_unlock_unpin_bo
.subsections_via_symbols
