	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vkms_gem_vmap                  ## -- Begin function vkms_gem_vmap
	.p2align	4, 0x90
_vkms_gem_vmap:                         ## @vkms_gem_vmap
	.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
	movq	%rdi, %r14
	callq	_drm_gem_to_vkms_gem
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_mutex_lock
	cmpq	$0, 24(%rbx)
	je	LBB0_1
LBB0_3:
	incl	16(%rbx)
	xorl	%r15d, %r15d
	jmp	LBB0_5
LBB0_1:
	movl	(%r14), %r15d
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	%rbx, %rdi
	callq	__get_pages
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_2
## %bb.6:
	movq	%r12, %rdi
	callq	_PTR_ERR
	movl	%eax, %r15d
LBB0_5:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	%r13d, %ecx
	shrl	%cl, %r15d
	movq	_VM_MAP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_PAGE_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_vmap
	movq	%rax, 24(%rbx)
	testq	%rax, %rax
	jne	LBB0_3
## %bb.4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	movq	8(%rbx), %rsi
	movq	%r14, %rdi
	xorl	%edx, %edx
	movl	$1, %ecx
	callq	_drm_gem_put_pages
	movq	$0, 8(%rbx)
	jmp	LBB0_5
	.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
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vkms_gem_vmap                  ; -- Begin function vkms_gem_vmap
	.p2align	2
_vkms_gem_vmap:                         ; @vkms_gem_vmap
	.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	x20, x0
	bl	_drm_gem_to_vkms_gem
	mov	x19, x0
	bl	_mutex_lock
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_2
LBB0_1:
	mov	w21, #0
	ldr	w8, [x19, #16]
	add	w8, w8, #1
	str	w8, [x19, #16]
	b	LBB0_4
LBB0_2:
	ldr	w22, [x20]
Lloh0:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
	mov	x0, x19
	bl	__get_pages
	mov	x21, x0
	bl	_IS_ERR
	cbz	x0, LBB0_5
; %bb.3:
	mov	x0, x21
	bl	_PTR_ERR
	mov	x21, x0
LBB0_4:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x21
	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
LBB0_5:
	lsr	w1, w22, w23
Lloh3:
	adrp	x8, _VM_MAP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VM_MAP@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
Lloh6:
	adrp	x8, _PAGE_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PAGE_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	mov	x0, x21
	bl	_vmap
	str	x0, [x19, #24]
	cbnz	x0, LBB0_1
; %bb.6:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w21, w8
	ldr	x1, [x19, #8]
	mov	x0, x20
	mov	w2, #0
	mov	w3, #1
	bl	_drm_gem_put_pages
	str	xzr, [x19, #8]
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.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
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
