	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i915_gem_userptr_get_pages
_i915_gem_userptr_get_pages:            ## @i915_gem_userptr_get_pages
	.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	%rdi, %r12
	movl	24(%rdi), %ebx
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %ebx
	movq	8(%rdi), %rdi
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.1:
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_2
## %bb.15:
	movq	8(%r12), %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_3:
	movq	16(%r12), %rax
	movq	(%rax), %rax
	movq	_current@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
LBB0_4:
	xorl	%r15d, %r15d
	xorl	%r14d, %r14d
LBB0_5:
	movq	%r12, %rdi
	cmpl	%ebx, %r15d
	jge	LBB0_10
## %bb.6:
	callq	___i915_gem_userptr_get_pages_schedule
	movq	%rax, %rbx
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	callq	_ERR_PTR
	cmpq	%rax, %rbx
	jne	LBB0_12
	jmp	LBB0_11
LBB0_2:
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	%r14, %rsi
	movl	%ebx, %edx
	callq	___i915_gem_userptr_alloc_pages
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	jne	LBB0_12
LBB0_11:
	movq	%r12, %rdi
	movl	$1, %esi
	callq	___i915_gem_userptr_set_active
	jmp	LBB0_12
LBB0_7:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movq	___GFP_NORETRY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	___GFP_NOWARN@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movl	%ebx, %edi
	movl	$8, %esi
	callq	_kvmalloc_array
	testq	%rax, %rax
	je	LBB0_4
## %bb.8:
	movq	%rax, %r14
	movl	(%r12), %r15d
	movq	%r12, %rdi
	callq	_i915_gem_object_is_readonly
	xorl	%edx, %edx
	testl	%eax, %eax
	sete	%dl
	movl	%r15d, %edi
	movl	%ebx, %esi
	movq	%r14, %rcx
	callq	___get_user_pages_fast
	movl	%eax, %r15d
	testl	%eax, %eax
	jns	LBB0_5
## %bb.9:
	movl	%r15d, %edi
	callq	_ERR_PTR
	movq	%rax, %rbx
	xorl	%r15d, %r15d
LBB0_12:
	movq	%rbx, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_release_pages
LBB0_14:
	movq	%r14, %rdi
	callq	_kvfree
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR_OR_ZERO                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_current,8,3                    ## @current
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	___GFP_NORETRY,4,2              ## @__GFP_NORETRY
	.comm	___GFP_NOWARN,4,2               ## @__GFP_NOWARN
	.no_dead_strip	_i915_gem_userptr_get_pages
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i915_gem_userptr_get_pages
_i915_gem_userptr_get_pages:            ; @i915_gem_userptr_get_pages
	.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	x19, x0
	ldr	x0, [x0, #8]
	cbz	x0, LBB0_3
; %bb.1:
	bl	_IS_ERR
	cbz	x0, LBB0_7
; %bb.2:
	ldr	x0, [x19, #8]
	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	_PTR_ERR
LBB0_3:
	ldr	w8, [x19, #24]
Lloh0:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	asr	w22, w8, w9
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _current@GOTPAGE
Lloh4:
	ldr	x9, [x9, _current@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_10
; %bb.4:
	mov	w21, #0
	mov	x20, #0
LBB0_5:
	mov	x0, x19
	cmp	w21, w22
	b.ge	LBB0_8
; %bb.6:
	bl	___i915_gem_userptr_get_pages_schedule
	mov	x22, x0
Lloh6:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	bl	_ERR_PTR
	cmp	x22, x0
	b.ne	LBB0_13
	b	LBB0_9
LBB0_7:
Lloh9:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
	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
LBB0_8:
	mov	x1, x20
	mov	x2, x22
	bl	___i915_gem_userptr_alloc_pages
	mov	x22, x0
	bl	_IS_ERR
	cbnz	x0, LBB0_13
LBB0_9:
	mov	x0, x19
	mov	w1, #1
	bl	___i915_gem_userptr_set_active
	b	LBB0_13
LBB0_10:
Lloh12:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, ___GFP_NORETRY@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___GFP_NORETRY@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh18:
	adrp	x9, ___GFP_NOWARN@GOTPAGE
Lloh19:
	ldr	x9, [x9, ___GFP_NOWARN@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x22
	mov	w1, #8
	bl	_kvmalloc_array
	mov	x20, x0
	cbz	x0, LBB0_16
; %bb.11:
	ldr	w21, [x19]
	mov	x0, x19
	bl	_i915_gem_object_is_readonly
	cmp	w0, #0
	cset	w2, eq
	mov	x0, x21
	mov	x1, x22
	mov	x3, x20
	bl	___get_user_pages_fast
	mov	x21, x0
	tbz	w0, #31, LBB0_5
; %bb.12:
	mov	x0, x21
	bl	_ERR_PTR
	mov	x22, x0
	mov	w21, #0
LBB0_13:
	mov	x0, x22
	bl	_IS_ERR
	cbz	x0, LBB0_15
; %bb.14:
	mov	x0, x20
	mov	x1, x21
	bl	_release_pages
LBB0_15:
	mov	x0, x20
	bl	_kvfree
	mov	x0, x22
	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	_PTR_ERR_OR_ZERO
LBB0_16:
	mov	w21, #0
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_current,8,3                    ; @current
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	___GFP_NORETRY,4,2              ; @__GFP_NORETRY
	.comm	___GFP_NOWARN,4,2               ; @__GFP_NOWARN
	.no_dead_strip	_i915_gem_userptr_get_pages
.subsections_via_symbols
