	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function drm_gem_shmem_vmap_locked
_drm_gem_shmem_vmap_locked:             ## @drm_gem_shmem_vmap_locked
	.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, %rbx
	movq	8(%rdi), %rax
	leaq	1(%rax), %rcx
	movq	%rcx, 8(%rdi)
	testq	%rax, %rax
	jle	LBB0_3
## %bb.1:
	movq	(%rbx), %rax
LBB0_2:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%rbx, %rdi
	callq	_drm_gem_shmem_get_pages
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_4
LBB0_9:
	movq	$0, 8(%rbx)
	movl	%r14d, %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_4:
	movq	32(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movl	(%rax), %edi
	callq	_dma_buf_vmap
	jmp	LBB0_7
LBB0_6:
	movl	16(%rbx), %r14d
	movl	24(%rbx), %r15d
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %r15d
	movq	_VM_MAP@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_PAGE_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_pgprot_writecombine
	movl	%r14d, %edi
	movl	%r15d, %esi
	movl	%r12d, %edx
	movl	%eax, %ecx
	callq	_vmap
LBB0_7:
	movq	%rax, (%rbx)
	testq	%rax, %rax
	jne	LBB0_2
## %bb.8:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG_KMS
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	movq	%rbx, %rdi
	callq	_drm_gem_shmem_put_pages
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_VM_MAP,4,2                     ## @VM_MAP
	.comm	_PAGE_KERNEL,4,2                ## @PAGE_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to vmap pages\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_drm_gem_shmem_vmap_locked
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function drm_gem_shmem_vmap_locked
_drm_gem_shmem_vmap_locked:             ; @drm_gem_shmem_vmap_locked
	.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	x8, [x0, #8]
	add	x9, x8, #1
	str	x9, [x0, #8]
	cmp	x8, #1
	b.lt	LBB0_3
; %bb.1:
	ldr	x0, [x19]
LBB0_2:
	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_3:
	mov	x0, x19
	bl	_drm_gem_shmem_get_pages
	mov	x20, x0
	cbz	w0, LBB0_5
LBB0_4:
	str	xzr, [x19, #8]
	mov	x0, x20
	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	_ERR_PTR
LBB0_5:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_7
; %bb.6:
	ldr	w0, [x8]
	bl	_dma_buf_vmap
	str	x0, [x19]
	cbnz	x0, LBB0_2
	b	LBB0_8
LBB0_7:
	ldr	w20, [x19, #16]
	ldr	w8, [x19, #24]
Lloh0:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	asr	w21, w8, w9
Lloh3:
	adrp	x8, _VM_MAP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VM_MAP@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
Lloh6:
	adrp	x8, _PAGE_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PAGE_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_pgprot_writecombine
	mov	x3, x0
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	bl	_vmap
	str	x0, [x19]
	cbnz	x0, LBB0_2
LBB0_8:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_KMS
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w20, w8
	mov	x0, x19
	bl	_drm_gem_shmem_put_pages
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_VM_MAP,4,2                     ; @VM_MAP
	.comm	_PAGE_KERNEL,4,2                ; @PAGE_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to vmap pages\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_drm_gem_shmem_vmap_locked
.subsections_via_symbols
