	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function genwqe_mmap
_genwqe_mmap:                           ## @genwqe_mmap
	.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	(%rsi), %rbx
	subq	8(%rsi), %rbx
	jne	LBB0_3
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_3:
	movq	%rsi, %r13
	movq	(%rdi), %r12
	movq	(%r12), %r15
	movq	%rbx, %rdi
	callq	_get_order
	movq	_MAX_ORDER@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jg	LBB0_4
## %bb.5:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$40, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.6:
	movq	%rax, %r14
	movq	_GENWQE_MAPPING_RAW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_genwqe_mapping_init
	movq	8(%r13), %rax
	movq	%rax, 32(%r14)
	movq	%rbx, (%r14)
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_DIV_ROUND_UP
	movl	%eax, 24(%r14)
	movq	%r14, %rdx
	addq	$8, %rdx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	___genwqe_alloc_consistent
	movq	%rax, 16(%r14)
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	_CAP_SYS_ADMIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_capable
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	cmpq	$4, %rbx
	jbe	LBB0_10
## %bb.11:
	movl	8(%r14), %eax
	movq	16(%r14), %rdi
	movl	%eax, (%rdi)
	jmp	LBB0_12
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_15:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_14
LBB0_10:
	movq	16(%r14), %rdi
LBB0_12:
	callq	_virt_to_phys
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shrq	%cl, %rax
	movq	8(%r13), %rsi
	movl	32(%r13), %r8d
	movq	%r13, %rdi
	movq	%rax, %rdx
	movq	%rbx, %rcx
	callq	_remap_pfn_range
	testl	%eax, %eax
	je	LBB0_16
## %bb.13:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	(%r14), %rsi
	movq	16(%r14), %rdx
	movl	8(%r14), %ecx
	movq	%r15, %rdi
	callq	___genwqe_free_consistent
LBB0_14:
	negl	%ebx
	movq	%r14, %rdi
	callq	_kfree
	jmp	LBB0_15
LBB0_16:
	movq	%r12, 24(%r13)
	movq	_genwqe_vma_ops@GOTPCREL(%rip), %rax
	movq	%rax, 16(%r13)
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	___genwqe_add_mapping
	xorl	%ebx, %ebx
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MAX_ORDER,8,3                  ## @MAX_ORDER
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_GENWQE_MAPPING_RAW,4,2         ## @GENWQE_MAPPING_RAW
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_CAP_SYS_ADMIN,4,2              ## @CAP_SYS_ADMIN
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_genwqe_vma_ops,4,2             ## @genwqe_vma_ops
	.no_dead_strip	_genwqe_mmap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function genwqe_mmap
_genwqe_mmap:                           ; @genwqe_mmap
	.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
	ldp	x8, x9, [x1]
	subs	x23, x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_8
LBB0_2:
	mov	x20, x1
	ldr	x22, [x0]
	ldr	x21, [x22]
	mov	x0, x23
	bl	_get_order
Lloh2:
	adrp	x8, _MAX_ORDER@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MAX_ORDER@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x0, x8
	b.gt	LBB0_7
; %bb.3:
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	w0, #40
	bl	_kzalloc
	cbz	x0, LBB0_7
; %bb.4:
	mov	x19, x0
Lloh8:
	adrp	x8, _GENWQE_MAPPING_RAW@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GENWQE_MAPPING_RAW@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	bl	_genwqe_mapping_init
	ldr	x8, [x20, #8]
	str	x8, [x19, #32]
	str	x23, [x19]
Lloh11:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_DIV_ROUND_UP
	str	w0, [x19, #24]
	add	x2, x19, #8
	mov	x0, x21
	mov	x1, x23
	bl	___genwqe_alloc_consistent
	str	x0, [x19, #16]
	cbz	x0, LBB0_10
; %bb.5:
Lloh14:
	adrp	x8, _CAP_SYS_ADMIN@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CAP_SYS_ADMIN@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	_capable
	cmp	x0, #0
	ccmp	x23, #4, #0, ne
	b.hi	LBB0_11
; %bb.6:
	ldr	x0, [x19, #16]
	b	LBB0_12
LBB0_7:
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_9:
	mov	x0, x20
	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_10:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh21:
	ldr	w20, [x8]
	b	LBB0_14
LBB0_11:
	ldr	w8, [x19, #8]
	ldr	x0, [x19, #16]
	str	w8, [x0]
LBB0_12:
	bl	_virt_to_phys
Lloh22:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh23:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	lsr	x2, x0, x8
	ldr	x1, [x20, #8]
	ldr	w4, [x20, #32]
	mov	x0, x20
	mov	x3, x23
	bl	_remap_pfn_range
	cbz	w0, LBB0_15
; %bb.13:
Lloh25:
	adrp	x8, _EFAULT@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh27:
	ldr	w20, [x8]
	ldr	x1, [x19]
	ldr	x2, [x19, #16]
	ldr	w3, [x19, #8]
	mov	x0, x21
	bl	___genwqe_free_consistent
LBB0_14:
	neg	w20, w20
	mov	x0, x19
	bl	_kfree
	b	LBB0_9
LBB0_15:
Lloh28:
	adrp	x8, _genwqe_vma_ops@GOTPAGE
Lloh29:
	ldr	x8, [x8, _genwqe_vma_ops@GOTPAGEOFF]
	stp	x8, x22, [x20, #16]
	mov	x0, x22
	mov	x1, x19
	bl	___genwqe_add_mapping
	mov	w20, #0
	b	LBB0_9
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MAX_ORDER,8,3                  ; @MAX_ORDER
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_GENWQE_MAPPING_RAW,4,2         ; @GENWQE_MAPPING_RAW
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_CAP_SYS_ADMIN,4,2              ; @CAP_SYS_ADMIN
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_genwqe_vma_ops,4,2             ; @genwqe_vma_ops
	.no_dead_strip	_genwqe_mmap
.subsections_via_symbols
