	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_msm_gem_cpu_prep               ## -- Begin function msm_gem_cpu_prep
	.p2align	4, 0x90
_msm_gem_cpu_prep:                      ## @msm_gem_cpu_prep
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_MSM_PREP_WRITE@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	testl	%esi, (%rax)
	setne	%bl
	movq	_MSM_PREP_NOSYNC@GOTPCREL(%rip), %rax
	testl	%esi, (%rax)
	je	LBB0_2
## %bb.1:
	xorl	%r15d, %r15d
	jmp	LBB0_3
LBB0_2:
	movq	%rdx, %rdi
	callq	_timeout_to_jiffies
	movq	%rax, %r15
LBB0_3:
	movl	(%r14), %edi
	movl	%ebx, %esi
	movl	$1, %edx
	movq	%r15, %rcx
	callq	_dma_resv_wait_timeout_rcu
	testq	%rax, %rax
	je	LBB0_4
## %bb.8:
	movq	%rax, %rcx
	sarq	$63, %rax
	andl	%ecx, %eax
	jmp	LBB0_9
LBB0_4:
	testq	%r15, %r15
	jne	LBB0_5
## %bb.6:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	jmp	LBB0_7
LBB0_5:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
LBB0_7:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MSM_PREP_WRITE,4,2             ## @MSM_PREP_WRITE
	.comm	_MSM_PREP_NOSYNC,4,2            ## @MSM_PREP_NOSYNC
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_msm_gem_cpu_prep               ; -- Begin function msm_gem_cpu_prep
	.p2align	2
_msm_gem_cpu_prep:                      ; @msm_gem_cpu_prep
	.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	x20, x0
Lloh0:
	adrp	x8, _MSM_PREP_WRITE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MSM_PREP_WRITE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w1
	cset	w19, ne
Lloh3:
	adrp	x8, _MSM_PREP_NOSYNC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MSM_PREP_NOSYNC@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w1
	b.eq	LBB0_2
; %bb.1:
	mov	x21, #0
	b	LBB0_3
LBB0_2:
	mov	x0, x2
	bl	_timeout_to_jiffies
	mov	x21, x0
LBB0_3:
	ldr	w0, [x20]
	mov	x1, x19
	mov	w2, #1
	mov	x3, x21
	bl	_dma_resv_wait_timeout_rcu
	cbz	x0, LBB0_5
; %bb.4:
	cmp	x0, #0
	csel	x0, x0, xzr, lt
	b	LBB0_6
LBB0_5:
Lloh6:
	adrp	x8, _EBUSY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh8:
	adrp	x9, _ETIMEDOUT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _ETIMEDOUT@GOTPAGEOFF]
	cmp	x21, #0
	csel	x8, x8, x9, eq
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
                                        ; kill: def $w0 killed $w0 killed $x0
	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
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_MSM_PREP_WRITE,4,2             ; @MSM_PREP_WRITE
	.comm	_MSM_PREP_NOSYNC,4,2            ; @MSM_PREP_NOSYNC
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
.subsections_via_symbols
