	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function device_va_to_pa
_device_va_to_pa:                       ## @device_va_to_pa
	.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, %rbx
	movq	16(%rdi), %r12
	testq	%r12, %r12
	je	LBB0_1
## %bb.2:
	movq	%rsi, %r14
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	_HOP4_MASK@GOTPCREL(%rip), %rax
	movq	_OFFSET_MASK@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r13
	orq	(%rax), %r13
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	%r12, %rdi
	callq	_get_hop0_addr
	movq	%r12, %rdi
	movq	%rax, %rsi
	movq	%r14, %rdx
	callq	_get_hop0_pte_addr
	movq	8(%rbx), %rcx
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	*(%rcx)
	movq	%rax, %rdi
	callq	_get_next_hop_addr
	movq	_ULLONG_MAX@GOTPCREL(%rip), %r15
	cmpq	(%r15), %rax
	je	LBB0_10
## %bb.3:
	movq	%r12, %rdi
	movq	%rax, %rsi
	movq	%r14, %rdx
	callq	_get_hop1_pte_addr
	movq	8(%rbx), %rcx
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	*(%rcx)
	movq	%rax, %rdi
	callq	_get_next_hop_addr
	cmpq	(%r15), %rax
	je	LBB0_10
## %bb.4:
	movq	%r12, %rdi
	movq	%rax, %rsi
	movq	%r14, %rdx
	callq	_get_hop2_pte_addr
	movq	8(%rbx), %rcx
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	*(%rcx)
	movq	%rax, %rdi
	callq	_get_next_hop_addr
	cmpq	(%r15), %rax
	je	LBB0_10
## %bb.5:
	movq	%r12, %rdi
	movq	%rax, %rsi
	movq	%r14, %rdx
	callq	_get_hop3_pte_addr
	movq	8(%rbx), %rcx
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	*(%rcx)
	movq	_LAST_MASK@GOTPCREL(%rip), %rcx
	testq	%rax, (%rcx)
	jne	LBB0_8
## %bb.6:
	movq	%rax, %rdi
	callq	_get_next_hop_addr
	cmpq	(%r15), %rax
	je	LBB0_10
## %bb.7:
	movq	%r12, %rdi
	movq	%rax, %rsi
	movq	%r14, %rdx
	callq	_get_hop4_pte_addr
	movq	8(%rbx), %rcx
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	*(%rcx)
	movq	_OFFSET_MASK@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r13
LBB0_8:
	movq	_PAGE_PRESENT_MASK@GOTPCREL(%rip), %rcx
	testq	%rax, (%rcx)
	je	LBB0_10
## %bb.9:
	xorq	%rax, %r14
	andq	%r13, %r14
	xorq	%rax, %r14
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%r14, (%rax)
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_10:
	movl	(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_11:
	movq	%r12, %rdi
	callq	_mutex_unlock
	jmp	LBB0_12
LBB0_1:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HOP4_MASK,8,3                  ## @HOP4_MASK
	.comm	_OFFSET_MASK,8,3                ## @OFFSET_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no ctx available\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ULLONG_MAX,8,3                 ## @ULLONG_MAX
	.comm	_LAST_MASK,8,3                  ## @LAST_MASK
	.comm	_PAGE_PRESENT_MASK,8,3          ## @PAGE_PRESENT_MASK
L_.str.1:                               ## @.str.1
	.asciz	"virt addr 0x%llx is not mapped to phys addr\n"

	.no_dead_strip	_device_va_to_pa
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function device_va_to_pa
_device_va_to_pa:                       ; @device_va_to_pa
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x22, x0
	ldr	x19, [x0, #16]
	cbz	x19, LBB0_6
; %bb.1:
	mov	x21, x2
	mov	x20, x1
Lloh0:
	adrp	x8, _HOP4_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HOP4_MASK@GOTPAGEOFF]
Lloh2:
	ldr	x24, [x8]
Lloh3:
	adrp	x23, _OFFSET_MASK@GOTPAGE
Lloh4:
	ldr	x23, [x23, _OFFSET_MASK@GOTPAGEOFF]
	ldr	x25, [x23]
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x19
	bl	_get_hop0_addr
	mov	x1, x0
	mov	x0, x19
	mov	x2, x20
	bl	_get_hop0_pte_addr
	mov	x1, x0
	ldr	x8, [x22, #8]
	ldr	x8, [x8]
	mov	x0, x22
	blr	x8
	bl	_get_next_hop_addr
Lloh5:
	adrp	x26, _ULLONG_MAX@GOTPAGE
Lloh6:
	ldr	x26, [x26, _ULLONG_MAX@GOTPAGEOFF]
	ldr	x8, [x26]
	cmp	x0, x8
	b.eq	LBB0_11
; %bb.2:
	mov	x1, x0
	mov	x0, x19
	mov	x2, x20
	bl	_get_hop1_pte_addr
	mov	x1, x0
	ldr	x8, [x22, #8]
	ldr	x8, [x8]
	mov	x0, x22
	blr	x8
	bl	_get_next_hop_addr
	ldr	x8, [x26]
	cmp	x0, x8
	b.eq	LBB0_11
; %bb.3:
	mov	x1, x0
	mov	x0, x19
	mov	x2, x20
	bl	_get_hop2_pte_addr
	mov	x1, x0
	ldr	x8, [x22, #8]
	ldr	x8, [x8]
	mov	x0, x22
	blr	x8
	bl	_get_next_hop_addr
	ldr	x8, [x26]
	cmp	x0, x8
	b.eq	LBB0_11
; %bb.4:
	mov	x1, x0
	mov	x0, x19
	mov	x2, x20
	bl	_get_hop3_pte_addr
	mov	x1, x0
	ldr	x8, [x22, #8]
	ldr	x8, [x8]
	mov	x0, x22
	blr	x8
Lloh7:
	adrp	x8, _LAST_MASK@GOTPAGE
Lloh8:
	ldr	x8, [x8, _LAST_MASK@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	tst	x8, x0
	b.eq	LBB0_7
; %bb.5:
	orr	x8, x25, x24
	b	LBB0_9
LBB0_6:
	ldr	w0, [x22]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_13
LBB0_7:
	bl	_get_next_hop_addr
	ldr	x8, [x26]
	cmp	x0, x8
	b.eq	LBB0_11
; %bb.8:
	mov	x1, x0
	mov	x0, x19
	mov	x2, x20
	bl	_get_hop4_pte_addr
	mov	x1, x0
	ldr	x8, [x22, #8]
	ldr	x8, [x8]
	mov	x0, x22
	blr	x8
	ldr	x8, [x23]
LBB0_9:
Lloh15:
	adrp	x9, _PAGE_PRESENT_MASK@GOTPAGE
Lloh16:
	ldr	x9, [x9, _PAGE_PRESENT_MASK@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	tst	x9, x0
	b.eq	LBB0_11
; %bb.10:
	mov	w22, #0
	bic	x9, x0, x8
	and	x8, x8, x20
	orr	x8, x9, x8
	str	x8, [x21]
	b	LBB0_12
LBB0_11:
	ldr	w0, [x22]
	str	x20, [sp]
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_12:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_13:
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_HOP4_MASK,8,3                  ; @HOP4_MASK
	.comm	_OFFSET_MASK,8,3                ; @OFFSET_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no ctx available\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ULLONG_MAX,8,3                 ; @ULLONG_MAX
	.comm	_LAST_MASK,8,3                  ; @LAST_MASK
	.comm	_PAGE_PRESENT_MASK,8,3          ; @PAGE_PRESENT_MASK
l_.str.1:                               ; @.str.1
	.asciz	"virt addr 0x%llx is not mapped to phys addr\n"

	.no_dead_strip	_device_va_to_pa
.subsections_via_symbols
