	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kfd_doorbell_mmap              ## -- Begin function kfd_doorbell_mmap
	.p2align	4, 0x90
_kfd_doorbell_mmap:                     ## @kfd_doorbell_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	%rdx, %r13
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	(%rdx), %rbx
	subq	8(%rdx), %rbx
	callq	_kfd_doorbell_process_slice
	cmpq	%rax, %rbx
	jne	LBB0_1
## %bb.2:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_kfd_get_process_doorbells
	movq	_VM_IO@GOTPCREL(%rip), %rcx
	movq	_VM_DONTCOPY@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movq	_VM_DONTEXPAND@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movq	_VM_NORESERVE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movq	_VM_DONTDUMP@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movl	%eax, %r15d
	movq	_VM_PFNMAP@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	orl	%edx, 16(%r13)
	movl	20(%r13), %edi
	callq	_pgprot_noncached
	movl	%eax, 20(%r13)
	movq	8(%r13), %r12
	movl	16(%r13), %ebx
	movq	%r14, %rdi
	callq	_kfd_doorbell_process_slice
	leaq	L_.str(%rip), %rdi
	movq	%r12, %rsi
	movl	%r15d, %edx
	movl	%ebx, %ecx
	movq	%rax, %r8
	callq	_pr_debug
	movq	8(%r13), %r12
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %r15d
	movq	%r14, %rdi
	callq	_kfd_doorbell_process_slice
	movl	20(%r13), %r8d
	movq	%r13, %rdi
	movq	%r12, %rsi
	movl	%r15d, %edx
	movq	%rax, %rcx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_io_remap_pfn_range             ## TAILCALL
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_VM_IO,4,2                      ## @VM_IO
	.comm	_VM_DONTCOPY,4,2                ## @VM_DONTCOPY
	.comm	_VM_DONTEXPAND,4,2              ## @VM_DONTEXPAND
	.comm	_VM_NORESERVE,4,2               ## @VM_NORESERVE
	.comm	_VM_DONTDUMP,4,2                ## @VM_DONTDUMP
	.comm	_VM_PFNMAP,4,2                  ## @VM_PFNMAP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Mapping doorbell page\n     target user address == 0x%08llX\n     physical address    == 0x%08llX\n     vm_flags            == 0x%04lX\n     size                == 0x%04lX\n"

	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kfd_doorbell_mmap              ; -- Begin function kfd_doorbell_mmap
	.p2align	2
_kfd_doorbell_mmap:                     ; @kfd_doorbell_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
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	ldp	x8, x9, [x2]
	sub	x22, x8, x9
	bl	_kfd_doorbell_process_slice
	cmp	x22, x0
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x20
	mov	x1, x21
	bl	_kfd_get_process_doorbells
	mov	x21, x0
Lloh0:
	adrp	x8, _VM_IO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VM_IO@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _VM_DONTCOPY@GOTPAGE
Lloh4:
	ldr	x9, [x9, _VM_DONTCOPY@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh6:
	adrp	x9, _VM_DONTEXPAND@GOTPAGE
Lloh7:
	ldr	x9, [x9, _VM_DONTEXPAND@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh9:
	adrp	x9, _VM_NORESERVE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _VM_NORESERVE@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh12:
	adrp	x9, _VM_DONTDUMP@GOTPAGE
Lloh13:
	ldr	x9, [x9, _VM_DONTDUMP@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh15:
	adrp	x9, _VM_PFNMAP@GOTPAGE
Lloh16:
	ldr	x9, [x9, _VM_PFNMAP@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldp	w9, w0, [x19, #16]
	orr	w8, w8, w9
	str	w8, [x19, #16]
	bl	_pgprot_noncached
	str	w0, [x19, #20]
	ldr	x22, [x19, #8]
	ldr	w23, [x19, #16]
	mov	x0, x20
	bl	_kfd_doorbell_process_slice
	mov	x4, x0
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x22
	mov	x2, x21
	mov	x3, x23
	bl	_pr_debug
	ldr	x22, [x19, #8]
Lloh20:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	asr	w21, w21, w8
	mov	x0, x20
	bl	_kfd_doorbell_process_slice
	mov	x3, x0
	ldr	w4, [x19, #20]
	mov	x0, x19
	mov	x1, x22
	mov	x2, 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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_io_remap_pfn_range
LBB0_2:
Lloh23:
	adrp	x8, _EINVAL@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w0, w8
	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	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_VM_IO,4,2                      ; @VM_IO
	.comm	_VM_DONTCOPY,4,2                ; @VM_DONTCOPY
	.comm	_VM_DONTEXPAND,4,2              ; @VM_DONTEXPAND
	.comm	_VM_NORESERVE,4,2               ; @VM_NORESERVE
	.comm	_VM_DONTDUMP,4,2                ; @VM_DONTDUMP
	.comm	_VM_PFNMAP,4,2                  ; @VM_PFNMAP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Mapping doorbell page\n     target user address == 0x%08llX\n     physical address    == 0x%08llX\n     vm_flags            == 0x%04lX\n     size                == 0x%04lX\n"

	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
.subsections_via_symbols
