	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hl_cb_mmap                     ## -- Begin function hl_cb_mmap
	.p2align	4, 0x90
_hl_cb_mmap:                            ## @hl_cb_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, %r13
	movq	%rdi, %rsi
	movq	8(%rdi), %r12
	movl	32(%r13), %ebx
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_hl_cb_get
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	(%r13), %rbx
	subq	8(%r13), %rbx
	movl	8(%rax), %edi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ALIGN
	cmpq	%rax, %rbx
	jne	LBB0_3
## %bb.4:
	movq	%r14, %r15
	addq	$4, %r15
	movq	%r15, %rdi
	callq	_spin_lock
	cmpl	$0, (%r14)
	je	LBB0_6
## %bb.5:
	movl	8(%r12), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_8
LBB0_1:
	movl	8(%r12), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%r12d, %r12d
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_10
LBB0_3:
	movl	8(%r12), %edi
	movq	(%r13), %rdx
	subq	8(%r13), %rdx
	movl	8(%r14), %ecx
	leaq	L_.str.1(%rip), %rsi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_9
LBB0_6:
	movl	$1, (%r14)
	movq	%r15, %rdi
	callq	_spin_unlock
	movq	_cb_vm_ops@GOTPCREL(%rip), %rax
	movq	%rax, 24(%r13)
	movq	%r14, 16(%r13)
	movq	16(%r14), %rdi
	callq	_virt_to_phys
	movq	(%r12), %rbx
	movq	16(%r14), %rdx
	movl	8(%r14), %r8d
	movq	%r12, %rdi
	movq	%r13, %rsi
	movl	%eax, %ecx
	callq	*(%rbx)
	testl	%eax, %eax
	je	LBB0_11
## %bb.7:
	movl	%eax, %r12d
	movq	%r15, %rdi
	callq	_spin_lock
	movl	$0, (%r14)
LBB0_8:
	movq	%r15, %rdi
	callq	_spin_unlock
LBB0_9:
	movq	%r14, %rdi
	callq	_hl_cb_put
LBB0_10:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movl	8(%r14), %eax
	movl	%eax, 12(%r14)
	xorl	%r12d, %r12d
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CB mmap failed, no match to handle %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"CB mmap failed, mmap size 0x%lx != 0x%x cb size\n"

L_.str.2:                               ## @.str.2
	.asciz	"CB mmap failed, CB already mmaped to user\n"

	.comm	_cb_vm_ops,4,2                  ## @cb_vm_ops
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hl_cb_mmap                     ; -- Begin function hl_cb_mmap
	.p2align	2
_hl_cb_mmap:                            ; @hl_cb_mmap
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x21, x1
	mov	x1, x0
	ldr	x22, [x0, #8]
	ldr	w20, [x21, #32]
	mov	x0, x22
	mov	x2, x20
	bl	_hl_cb_get
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x0
	ldp	x8, x9, [x21]
	sub	x20, x8, x9
	ldr	w0, [x0, #8]
Lloh0:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_ALIGN
	cmp	x20, x0
	b.ne	LBB0_5
; %bb.2:
	add	x20, x19, #4
	mov	x0, x20
	bl	_spin_lock
	ldr	w8, [x19]
	cbz	w8, LBB0_6
; %bb.3:
	ldr	w0, [x22, #8]
Lloh3:
	adrp	x1, l_.str.2@PAGE
Lloh4:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_8
LBB0_4:
	ldr	w0, [x22, #8]
	str	x20, [sp]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_10
LBB0_5:
	ldr	w0, [x22, #8]
	ldp	x8, x9, [x21]
	sub	x8, x8, x9
	ldr	w9, [x19, #8]
	stp	x8, x9, [sp]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_9
LBB0_6:
	mov	w8, #1
	str	w8, [x19]
	mov	x0, x20
	bl	_spin_unlock
Lloh18:
	adrp	x8, _cb_vm_ops@GOTPAGE
Lloh19:
	ldr	x8, [x8, _cb_vm_ops@GOTPAGEOFF]
	stp	x19, x8, [x21, #16]
	ldr	x0, [x19, #16]
	bl	_virt_to_phys
	mov	x3, x0
	ldr	x8, [x22]
	ldr	x8, [x8]
	ldr	x2, [x19, #16]
	ldr	w4, [x19, #8]
	mov	x0, x22
	mov	x1, x21
	blr	x8
	mov	x21, x0
	cbz	w0, LBB0_11
; %bb.7:
	mov	x0, x20
	bl	_spin_lock
	str	wzr, [x19]
LBB0_8:
	mov	x0, x20
	bl	_spin_unlock
LBB0_9:
	mov	x0, x19
	bl	_hl_cb_put
LBB0_10:
	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
	add	sp, sp, #64
	ret
LBB0_11:
	ldr	w8, [x19, #8]
	str	w8, [x19, #12]
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CB mmap failed, no match to handle %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"CB mmap failed, mmap size 0x%lx != 0x%x cb size\n"

l_.str.2:                               ; @.str.2
	.asciz	"CB mmap failed, CB already mmaped to user\n"

	.comm	_cb_vm_ops,4,2                  ; @cb_vm_ops
.subsections_via_symbols
