	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hl_mmu_map                     ## -- Begin function hl_mmu_map
	.p2align	4, 0x90
_hl_mmu_map:                            ## @hl_mmu_map
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %r15
	xorl	%r13d, %r13d
	cmpl	$0, 4(%r15)
	je	LBB0_14
## %bb.1:
	movl	%ecx, %r12d
	movl	%edx, %ebx
	movq	_PAGE_SIZE_2MB@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%r12d, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	LBB0_4
## %bb.2:
	movq	_PAGE_SIZE_4KB@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%r12d, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	LBB0_4
## %bb.3:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r12d, %edx
	callq	_dev_err
	movq	_EFAULT@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_14
LBB0_4:
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	leal	-1(%rcx), %edi
	andl	%ebx, %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_WARN_ONCE
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movl	%r12d, %eax
	cltd
	idivl	%r14d
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	jle	LBB0_14
## %bb.5:
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %esi
	movl	%ebx, %edx
	movl	%r14d, %ecx
	callq	__hl_mmu_map
	testl	%eax, %eax
	jne	LBB0_7
## %bb.12:                              ##   in Loop: Header=BB0_6 Depth=1
	addl	%r14d, %r12d
	addl	%r14d, %ebx
	incl	%r15d
	cmpl	%r15d, -60(%rbp)                ## 4-byte Folded Reload
	jne	LBB0_6
## %bb.13:
	xorl	%r13d, %r13d
	jmp	LBB0_14
LBB0_7:
	movl	%eax, %r13d
	testl	%r15d, %r15d
	je	LBB0_14
## %bb.8:
	leaq	L_.str.2(%rip), %r12
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	addl	-56(%rbp), %ebx                 ## 4-byte Folded Reload
	decl	%r15d
	je	LBB0_14
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	callq	__hl_mmu_unmap
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	(%r14), %edi
	movq	%r12, %rsi
	movl	%ebx, %edx
	callq	_dev_warn_ratelimited
	jmp	LBB0_11
LBB0_14:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SIZE_2MB,4,2              ## @PAGE_SIZE_2MB
	.comm	_PAGE_SIZE_4KB,4,2              ## @PAGE_SIZE_4KB
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"page size of %u is not 4KB nor 2MB aligned, can't map\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
L_.str.1:                               ## @.str.1
	.asciz	"Mapping 0x%llx with page size of 0x%x is erroneous! Address must be divisible by page size"

L_.str.2:                               ## @.str.2
	.asciz	"failed to unmap va: 0x%llx\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hl_mmu_map                     ; -- Begin function hl_mmu_map
	.p2align	2
_hl_mmu_map:                            ; @hl_mmu_map
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	ldr	x24, [x0]
	ldr	w8, [x24, #4]
	cbz	w8, LBB0_8
; %bb.1:
	mov	x23, x3
	mov	x22, x2
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _PAGE_SIZE_2MB@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SIZE_2MB@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	sdiv	w8, w3, w21
	msub	w8, w8, w21, w3
	cbz	w8, LBB0_4
; %bb.2:
Lloh3:
	adrp	x8, _PAGE_SIZE_4KB@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PAGE_SIZE_4KB@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x8]
	sdiv	w8, w23, w21
	msub	w8, w8, w21, w23
	cbz	w8, LBB0_4
; %bb.3:
	ldr	w0, [x24]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x23
	bl	_dev_err
Lloh8:
	adrp	x8, _EFAULT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_9
LBB0_4:
	sub	w8, w21, #1
	and	w0, w8, w22
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x22
	mov	x3, x21
	bl	_WARN_ONCE
	sdiv	w26, w23, w21
	cmp	w26, #1
	b.lt	LBB0_8
; %bb.5:
	mov	w27, #0
	mov	w25, #0
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	add	w1, w19, w27
	add	w2, w22, w27
	mov	x0, x20
	mov	x3, x21
	bl	__hl_mmu_map
	cbnz	w0, LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	w25, w25, #1
	add	w27, w27, w21
	cmp	w26, w25
	b.ne	LBB0_6
LBB0_8:
	mov	w23, #0
LBB0_9:
	mov	x0, x23
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_10:
	mov	x23, x0
	cbz	w25, LBB0_9
; %bb.11:
Lloh13:
	adrp	x22, l_.str.2@PAGE
Lloh14:
	add	x22, x22, l_.str.2@PAGEOFF
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	add	w19, w19, w21
	subs	w25, w25, #1
	b.eq	LBB0_9
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x19
	bl	__hl_mmu_unmap
	cbz	x0, LBB0_12
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w0, [x24]
	mov	x1, x22
	mov	x2, x19
	bl	_dev_warn_ratelimited
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE_2MB,4,2              ; @PAGE_SIZE_2MB
	.comm	_PAGE_SIZE_4KB,4,2              ; @PAGE_SIZE_4KB
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"page size of %u is not 4KB nor 2MB aligned, can't map\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
l_.str.1:                               ; @.str.1
	.asciz	"Mapping 0x%llx with page size of 0x%x is erroneous! Address must be divisible by page size"

l_.str.2:                               ; @.str.2
	.asciz	"failed to unmap va: 0x%llx\n"

.subsections_via_symbols
