	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kvmgt_dma_map_guest_page
_kvmgt_dma_map_guest_page:              ## @kvmgt_dma_map_guest_page
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rdx, %rbx
	movq	%rsi, %r13
	movq	%rdi, %r15
	callq	_handle_valid
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %r14
	movq	(%r15), %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	(%r15), %rdi
	movq	%r13, %rsi
	callq	___gvt_cache_find_gfn
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	movq	%rax, %rbx
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	(%rax), %rcx
	cmpq	%r14, %rcx
	jne	LBB0_6
## %bb.10:
	movq	%rbx, %rdi
	addq	$12, %rdi
	callq	_kref_get
	movl	8(%rbx), %eax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	jmp	LBB0_11
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_12
LBB0_3:
	movq	%r12, %rdi
	movq	%r13, %rsi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdx
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %rcx
	callq	_gvt_dma_map_page
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_9
## %bb.4:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_7
LBB0_6:
	movl	8(%rbx), %edx
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_gvt_dma_unmap_page
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	___gvt_cache_remove_entry
	movq	%r12, %rdi
	movq	%r13, %rsi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdx
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %rcx
	callq	_gvt_dma_map_page
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_9
LBB0_7:
	movq	(%r15), %rdi
	movl	(%rbx), %edx
	movq	%r13, %rsi
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	callq	___gvt_cache_add
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_11
## %bb.8:
	movl	(%rbx), %edx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	callq	_gvt_dma_unmap_page
LBB0_9:
	movq	(%r15), %rdi
	callq	_mutex_unlock
	jmp	LBB0_12
LBB0_11:
	movq	(%r15), %rdi
	callq	_mutex_unlock
	xorl	%r14d, %r14d
LBB0_12:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_kvmgt_dma_map_guest_page
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kvmgt_dma_map_guest_page
_kvmgt_dma_map_guest_page:              ; @kvmgt_dma_map_guest_page
	.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, x3
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	bl	_handle_valid
	cbz	w0, LBB0_4
; %bb.1:
	ldr	x23, [x19]
	mov	x0, x23
	bl	_mutex_lock
	ldr	x0, [x19]
	mov	x1, x22
	bl	___gvt_cache_find_gfn
	cbz	x0, LBB0_6
; %bb.2:
	mov	x24, x0
	ldr	x3, [x0]
	cmp	x3, x21
	b.ne	LBB0_5
; %bb.3:
	add	x0, x24, #12
	bl	_kref_get
	ldr	w8, [x24, #8]
	str	w8, [x20]
	b	LBB0_10
LBB0_4:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_11
LBB0_5:
	ldr	w2, [x24, #8]
	mov	x0, x23
	mov	x1, x22
	bl	_gvt_dma_unmap_page
	mov	x0, x23
	mov	x1, x24
	bl	___gvt_cache_remove_entry
LBB0_6:
	mov	x0, x23
	mov	x1, x22
	mov	x2, x20
	mov	x3, x21
	bl	_gvt_dma_map_page
	mov	x24, x0
	cbnz	w0, LBB0_9
; %bb.7:
	ldr	x0, [x19]
	ldr	w2, [x20]
	mov	x1, x22
	mov	x3, x21
	bl	___gvt_cache_add
	mov	x24, x0
	cbz	w0, LBB0_10
; %bb.8:
	ldr	w2, [x20]
	mov	x0, x23
	mov	x1, x22
	mov	x3, x21
	bl	_gvt_dma_unmap_page
LBB0_9:
	ldr	x0, [x19]
	bl	_mutex_unlock
	b	LBB0_11
LBB0_10:
	ldr	x0, [x19]
	bl	_mutex_unlock
	mov	w24, #0
LBB0_11:
	mov	x0, x24
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_kvmgt_dma_map_guest_page
.subsections_via_symbols
