	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function init_doorbell_bitmap
_init_doorbell_bitmap:                  ## @init_doorbell_bitmap
	.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, %r15
	movq	%rdi, %r14
	movq	8(%rsi), %rax
	movl	(%rax), %edi
	callq	_KFD_IS_SOC15
	xorl	%ebx, %ebx
	testl	%eax, %eax
	je	LBB0_9
## %bb.1:
	movq	_KFD_MAX_NUM_OF_QUEUES_PER_PROCESS@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movq	_BITS_PER_BYTE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_DIV_ROUND_UP
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_kzalloc
	movl	%eax, (%r14)
	testl	%eax, %eax
	je	LBB0_10
## %bb.2:
	movl	(%r13), %eax
	leal	1(%rax), %ecx
	cmpl	$3, %ecx
	jb	LBB0_9
## %bb.3:
	xorl	%ebx, %ebx
	movq	_KFD_QUEUE_DOORBELL_MIRROR_OFFSET@GOTPCREL(%rip), %r12
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	incl	%ebx
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	cmpl	%ecx, %ebx
	jae	LBB0_8
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	(%r15), %ebx
	jb	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	4(%r15), %ebx
	ja	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r14), %esi
	movl	%ebx, %edi
	callq	_set_bit
	movl	(%r12), %edi
	addl	%ebx, %edi
	movl	(%r14), %esi
	callq	_set_bit
	movl	(%r12), %edx
	addl	%ebx, %edx
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_pr_debug
	movl	(%r13), %eax
	jmp	LBB0_7
LBB0_10:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_8:
	xorl	%ebx, %ebx
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KFD_MAX_NUM_OF_QUEUES_PER_PROCESS,4,2 ## @KFD_MAX_NUM_OF_QUEUES_PER_PROCESS
	.comm	_BITS_PER_BYTE,4,2              ## @BITS_PER_BYTE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_KFD_QUEUE_DOORBELL_MIRROR_OFFSET,4,2 ## @KFD_QUEUE_DOORBELL_MIRROR_OFFSET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"reserved doorbell 0x%03x and 0x%03x\n"

	.no_dead_strip	_init_doorbell_bitmap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function init_doorbell_bitmap
_init_doorbell_bitmap:                  ; @init_doorbell_bitmap
	.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, x1
	mov	x20, x0
	ldr	x8, [x1, #8]
	ldr	w0, [x8]
	bl	_KFD_IS_SOC15
	cbz	w0, LBB0_5
; %bb.1:
Lloh0:
	adrp	x23, _KFD_MAX_NUM_OF_QUEUES_PER_PROCESS@GOTPAGE
Lloh1:
	ldr	x23, [x23, _KFD_MAX_NUM_OF_QUEUES_PER_PROCESS@GOTPAGEOFF]
	ldr	w0, [x23]
Lloh2:
	adrp	x8, _BITS_PER_BYTE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _BITS_PER_BYTE@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	bl	_DIV_ROUND_UP
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_kzalloc
	str	w0, [x20]
	cbz	w0, LBB0_4
; %bb.2:
	ldr	w8, [x23]
	add	w9, w8, #1
	cmp	w9, #3
	b.hs	LBB0_6
LBB0_3:
	mov	w0, #0
	b	LBB0_5
LBB0_4:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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_6:
	mov	w21, #0
Lloh11:
	adrp	x24, _KFD_QUEUE_DOORBELL_MIRROR_OFFSET@GOTPAGE
Lloh12:
	ldr	x24, [x24, _KFD_QUEUE_DOORBELL_MIRROR_OFFSET@GOTPAGEOFF]
Lloh13:
	adrp	x22, l_.str@PAGE
Lloh14:
	add	x22, x22, l_.str@PAGEOFF
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	w21, w21, #1
	cmp	w8, #0
	cinc	w9, w8, lt
	cmp	w21, w9, asr #1
	b.hs	LBB0_3
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x19]
	cmp	w21, w9
	b.lo	LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w9, [x19, #4]
	cmp	w21, w9
	b.hi	LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w1, [x20]
	mov	x0, x21
	bl	_set_bit
	ldr	w8, [x24]
	add	w0, w21, w8
	ldr	w1, [x20]
	bl	_set_bit
	ldr	w8, [x24]
	add	w2, w21, w8
	mov	x0, x22
	mov	x1, x21
	bl	_pr_debug
	ldr	w8, [x23]
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_KFD_MAX_NUM_OF_QUEUES_PER_PROCESS,4,2 ; @KFD_MAX_NUM_OF_QUEUES_PER_PROCESS
	.comm	_BITS_PER_BYTE,4,2              ; @BITS_PER_BYTE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_KFD_QUEUE_DOORBELL_MIRROR_OFFSET,4,2 ; @KFD_QUEUE_DOORBELL_MIRROR_OFFSET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"reserved doorbell 0x%03x and 0x%03x\n"

	.no_dead_strip	_init_doorbell_bitmap
.subsections_via_symbols
