	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kfd_doorbell_init              ## -- Begin function kfd_doorbell_init
	.p2align	4, 0x90
_kfd_doorbell_init:                     ## @kfd_doorbell_init
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movl	32(%rdi), %ebx
	callq	_kfd_doorbell_process_slice
	movl	%ebx, %edi
	movq	%rax, %rsi
	callq	_roundup
	movq	%rax, %r15
	movq	16(%r12), %rbx
	movq	%r12, %rdi
	callq	_kfd_doorbell_process_slice
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_rounddown
	movq	%rax, %rbx
	subq	%r15, %rbx
	jbe	LBB0_9
## %bb.1:
	movq	%r12, %rdi
	callq	_kfd_doorbell_process_slice
	movq	%rax, %rcx
	orq	%rbx, %rax
	shrq	$32, %rax
	je	LBB0_2
## %bb.3:
	movq	%rbx, %rax
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %r14
	jmp	LBB0_4
LBB0_9:
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_2:
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %r14d
LBB0_4:
	movq	_max_doorbell_slices@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_6
## %bb.5:
	cmpq	%rcx, %r14
	jae	LBB0_7
LBB0_6:
	movq	%r14, (%rax)
LBB0_7:
	movq	24(%r12), %rbx
	addq	%r15, %rbx
	movq	%rbx, 40(%r12)
	shrq	$2, %r15
	movq	%r15, (%r12)
	movq	%r12, %rdi
	callq	_kfd_doorbell_process_slice
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_ioremap
	movq	%rax, 8(%r12)
	testq	%rax, %rax
	je	LBB0_8
## %bb.11:
	leaq	L_.str(%rip), %rdi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_pr_debug
	movq	40(%r12), %rsi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
	movq	(%r12), %rsi
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
	leaq	L_.str.3(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_pr_debug
	movq	40(%r12), %rsi
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
	movq	16(%r12), %rsi
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
	movq	8(%r12), %rsi
	leaq	L_.str.6(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
	jmp	LBB0_12
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_10:
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_12:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.comm	_max_doorbell_slices,8,3        ## @max_doorbell_slices
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Doorbell initialization:\n"

L_.str.1:                               ## @.str.1
	.asciz	"doorbell base           == 0x%08lX\n"

L_.str.2:                               ## @.str.2
	.asciz	"doorbell_id_offset      == 0x%08lX\n"

L_.str.3:                               ## @.str.3
	.asciz	"doorbell_process_limit  == 0x%08lX\n"

L_.str.4:                               ## @.str.4
	.asciz	"doorbell_kernel_offset  == 0x%08lX\n"

L_.str.5:                               ## @.str.5
	.asciz	"doorbell aperture size  == 0x%08lX\n"

L_.str.6:                               ## @.str.6
	.asciz	"doorbell kernel address == %p\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kfd_doorbell_init              ; -- Begin function kfd_doorbell_init
	.p2align	2
_kfd_doorbell_init:                     ; @kfd_doorbell_init
	.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	x19, x0
	ldr	w20, [x0, #32]
	bl	_kfd_doorbell_process_slice
	mov	x1, x0
	mov	x0, x20
	bl	_roundup
	mov	x20, x0
	ldr	x21, [x19, #16]
	mov	x0, x19
	bl	_kfd_doorbell_process_slice
	mov	x1, x0
	mov	x0, x21
	bl	_rounddown
	subs	x21, x0, x20
	b.ls	LBB0_6
; %bb.1:
	mov	x0, x19
	bl	_kfd_doorbell_process_slice
Lloh0:
	adrp	x8, _max_doorbell_slices@GOTPAGE
Lloh1:
	ldr	x8, [x8, _max_doorbell_slices@GOTPAGEOFF]
	ldr	x9, [x8]
	udiv	x22, x21, x0
	cbz	x9, LBB0_3
; %bb.2:
	cmp	x22, x9
	b.hs	LBB0_4
LBB0_3:
	str	x22, [x8]
LBB0_4:
	ldr	x8, [x19, #24]
	add	x21, x8, x20
	str	x21, [x19, #40]
	lsr	x8, x20, #2
	str	x8, [x19]
	mov	x0, x19
	bl	_kfd_doorbell_process_slice
	mov	x1, x0
	mov	x0, x21
	bl	_ioremap
	str	x0, [x19, #8]
	cbz	x0, LBB0_7
; %bb.5:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
	ldr	x8, [x19, #40]
	str	x8, [sp]
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_debug
	ldr	x8, [x19]
	str	x8, [sp]
Lloh6:
	adrp	x0, l_.str.2@PAGE
Lloh7:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_debug
	str	x22, [sp]
Lloh8:
	adrp	x0, l_.str.3@PAGE
Lloh9:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_debug
	ldr	x8, [x19, #40]
	str	x8, [sp]
Lloh10:
	adrp	x0, l_.str.4@PAGE
Lloh11:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pr_debug
	ldr	x8, [x19, #16]
	str	x8, [sp]
Lloh12:
	adrp	x0, l_.str.5@PAGE
Lloh13:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_pr_debug
	ldr	x8, [x19, #8]
	str	x8, [sp]
Lloh14:
	adrp	x0, l_.str.6@PAGE
Lloh15:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_pr_debug
	mov	w0, #0
	b	LBB0_9
LBB0_6:
Lloh16:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh18:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.comm	_max_doorbell_slices,8,3        ; @max_doorbell_slices
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Doorbell initialization:\n"

l_.str.1:                               ; @.str.1
	.asciz	"doorbell base           == 0x%08lX\n"

l_.str.2:                               ; @.str.2
	.asciz	"doorbell_id_offset      == 0x%08lX\n"

l_.str.3:                               ; @.str.3
	.asciz	"doorbell_process_limit  == 0x%08lX\n"

l_.str.4:                               ; @.str.4
	.asciz	"doorbell_kernel_offset  == 0x%08lX\n"

l_.str.5:                               ; @.str.5
	.asciz	"doorbell aperture size  == 0x%08lX\n"

l_.str.6:                               ; @.str.6
	.asciz	"doorbell kernel address == %p\n"

.subsections_via_symbols
