	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function initialize
_initialize:                            ## @initialize
	.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
	subq	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r13d
	movl	%edx, %ebx
	movq	%rsi, %r15
	movq	%rdi, %r14
	movl	%edx, %eax
	andl	$-2, %eax
	xorl	%edi, %edi
	cmpl	$128, %eax
	setne	%dil
	callq	_WARN_ON
	xorl	%r12d, %r12d
	testq	%rax, %rax
	je	LBB0_1
LBB0_27:
	movl	%r12d, %eax
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%r12d, %r12d
	movl	$128, %esi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_pr_debug
	leaq	-152(%rbp), %rdi
	xorl	%esi, %esi
	movl	$88, %edx
	callq	_memset
	leaq	-64(%rbp), %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	_PM4_TYPE_3@GOTPCREL(%rip), %rax
	movq	_PM4_COUNT_ZERO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%ecx, -64(%rbp)
	movq	%r15, 144(%r14)
	movl	%ecx, 136(%r14)
	cmpl	$129, %ebx
	je	LBB0_2
## %bb.3:
	cmpl	$128, %ebx
	jne	LBB0_28
## %bb.4:
	movq	_KFD_MQD_TYPE_HIQ@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_2:
	movq	_KFD_MQD_TYPE_DIQ@GOTPCREL(%rip), %rax
LBB0_5:
	movq	8(%r15), %rcx
	movq	(%rcx), %rcx
	movq	(%rax), %rax
	movq	(%rcx,%rax,8), %rax
	movq	%rax, 40(%r14)
	testq	%rax, %rax
	je	LBB0_27
## %bb.6:
	leaq	-80(%rbp), %rsi
	movq	%r15, %rdi
	callq	_kfd_get_kernel_doorbell
	movl	%eax, -132(%rbp)
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:
	movq	%r15, %rdi
	movl	%r13d, %esi
	movq	%r14, %rdx
	callq	_kfd_gtt_sa_allocate
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	leaq	L_.str.3(%rip), %rdi
	movl	%r13d, %esi
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_26
LBB0_28:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r12d, %r12d
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_27
LBB0_7:
	leaq	L_.str.2(%rip), %rdi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_27
LBB0_10:
	movq	(%r14), %rax
	movq	8(%rax), %rcx
	movq	%rcx, 120(%r14)
	movq	(%rax), %rax
	movq	%rax, 96(%r14)
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%ebx, %edx
	movl	%r13d, %ecx
	callq	*128(%r14)
	testl	%eax, %eax
	je	LBB0_25
## %bb.11:
	leaq	16(%r14), %rdx
	movq	%r15, %rdi
	movl	$8, %esi
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	callq	_kfd_gtt_sa_allocate
	testl	%eax, %eax
	jne	LBB0_24
## %bb.12:
	movq	16(%r14), %rax
	movq	8(%rax), %rcx
	movq	%rcx, 112(%r14)
	movq	(%rax), %rax
	movq	%rax, 88(%r14)
	movq	(%r15), %rax
	movl	(%rax), %esi
	leaq	24(%r14), %rdx
	movq	%r15, %rdi
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	callq	_kfd_gtt_sa_allocate
	testl	%eax, %eax
	jne	LBB0_23
## %bb.13:
	movq	24(%r14), %rax
	movq	120(%r14), %rdi
	movq	8(%rax), %rcx
	movq	%rcx, 104(%r14)
	movq	(%rax), %rax
	movq	%rax, 80(%r14)
	xorl	%esi, %esi
	movl	%r13d, %edx
	callq	_memset
	movq	112(%r14), %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	104(%r14), %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movl	%r13d, -148(%rbp)
	movabsq	$4294967296, %rax               ## imm = 0x100000000
	movq	%rax, -144(%rbp)
	movl	$100, -136(%rbp)
	movl	%ebx, -152(%rbp)
	movq	$0, -88(%rbp)
	movq	96(%r14), %rax
	movq	%rax, -96(%rbp)
	movups	80(%r14), %xmm0
	movups	%xmm0, -112(%rbp)
	movl	72(%r14), %eax
	movl	%eax, -116(%rbp)
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -120(%rbp)
	movq	$0, -128(%rbp)
	leaq	32(%r14), %r13
	leaq	-152(%rbp), %rsi
	movq	%r13, %rdi
	callq	_init_queue
	testq	%rax, %rax
	jne	LBB0_22
## %bb.14:
	movq	32(%r14), %rax
	movq	%r15, 32(%rax)
	movq	_current@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_kfd_get_process
	movq	32(%r14), %rsi
	movl	%eax, 24(%rsi)
	movq	40(%r14), %rax
	movl	24(%rax), %edi
	addq	$8, %rsi
	callq	*32(%rax)
	movq	32(%r14), %r8
	movl	%eax, (%r8)
	testl	%eax, %eax
	je	LBB0_21
## %bb.15:
	movq	40(%r14), %rdi
	leaq	4(%r8), %rsi
	leaq	20(%r8), %rcx
	addq	$8, %r8
	movl	%eax, %edx
	callq	*16(%rdi)
	cmpl	$128, %ebx
	jne	LBB0_17
## %bb.16:
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
	movq	_KFD_CIK_HIQ_PIPE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	32(%r14), %r8
	movl	%edx, 16(%r8)
	movq	_KFD_CIK_HIQ_QUEUE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, 12(%r8)
	movq	40(%r14), %rdi
	movl	4(%r8), %esi
	addq	$8, %r8
	xorl	%r9d, %r9d
	callq	*8(%rdi)
	jmp	LBB0_19
LBB0_17:
	leaq	48(%r14), %rdx
	movq	%r15, %rdi
	movl	$4, %esi
	callq	_kfd_gtt_sa_allocate
	testl	%eax, %eax
	je	LBB0_18
## %bb.20:
	movq	32(%r14), %rax
	movq	40(%r14), %rdi
	movl	(%rax), %edx
	movl	4(%rax), %esi
	callq	*(%rdi)
	movq	32(%r14), %r8
LBB0_21:
	movq	%r8, %rdi
	callq	_uninit_queue
LBB0_22:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rsi
	movq	%r15, %rdi
	callq	_kfd_gtt_sa_free
LBB0_23:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rsi
	movq	%r15, %rdi
	callq	_kfd_gtt_sa_free
LBB0_24:
	movq	8(%r14), %rsi
	movq	%r15, %rdi
	callq	_kfd_gtt_sa_free
LBB0_25:
	movq	(%r14), %rsi
	movq	%r15, %rdi
	callq	_kfd_gtt_sa_free
LBB0_26:
	movl	-132(%rbp), %esi
	movq	%r15, %rdi
	callq	_kfd_release_kernel_doorbell
	jmp	LBB0_27
LBB0_18:
	movq	48(%r14), %rax
	movq	8(%rax), %rcx
	movq	%rcx, 64(%r14)
	movq	(%rax), %rax
	movq	%rax, 56(%r14)
LBB0_19:
	movq	(%r13), %rdi
	callq	_print_queue
	movl	$1, %r12d
	jmp	LBB0_27
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Initializing queue type %d size %d\n"

	.comm	_IT_NOP,4,2                     ## @IT_NOP
	.comm	_PM4_TYPE_3,4,2                 ## @PM4_TYPE_3
	.comm	_PM4_COUNT_ZERO,4,2             ## @PM4_COUNT_ZERO
	.comm	_KFD_MQD_TYPE_DIQ,8,3           ## @KFD_MQD_TYPE_DIQ
	.comm	_KFD_MQD_TYPE_HIQ,8,3           ## @KFD_MQD_TYPE_HIQ
L_.str.1:                               ## @.str.1
	.asciz	"Invalid queue type %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to initialize doorbell"

L_.str.3:                               ## @.str.3
	.asciz	"Failed to init pq queues size %d\n"

	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_current,4,2                    ## @current
L_.str.4:                               ## @.str.4
	.asciz	"Assigning hiq to hqd\n"

	.comm	_KFD_CIK_HIQ_PIPE,4,2           ## @KFD_CIK_HIQ_PIPE
	.comm	_KFD_CIK_HIQ_QUEUE,4,2          ## @KFD_CIK_HIQ_QUEUE
	.no_dead_strip	_initialize
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function initialize
lCPI0_0:
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_initialize:                            ; @initialize
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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	x22, x3
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	and	w8, w2, #0xfffffffe
	cmp	w8, #128
	cset	w0, ne
	bl	_WARN_ON
	cbz	x0, LBB0_3
LBB0_1:
	mov	w0, #0
LBB0_2:
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
LBB0_3:
	mov	w8, #128
	stp	x8, x22, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
	add	x0, sp, #24
	mov	w1, #0
	mov	w2, #88
	bl	_memset
	add	x0, sp, #16
	mov	w1, #0
	mov	w2, #8
	bl	_memset
Lloh2:
	adrp	x8, _PM4_TYPE_3@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PM4_TYPE_3@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _PM4_COUNT_ZERO@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PM4_COUNT_ZERO@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [sp, #16]
	str	x19, [x20, #144]
	str	w8, [x20, #136]
	cmp	w21, #129
	b.eq	LBB0_6
; %bb.4:
	cmp	w21, #128
	b.ne	LBB0_11
; %bb.5:
Lloh8:
	adrp	x8, _KFD_MQD_TYPE_HIQ@GOTPAGE
Lloh9:
	ldr	x8, [x8, _KFD_MQD_TYPE_HIQ@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh10:
	adrp	x8, _KFD_MQD_TYPE_DIQ@GOTPAGE
Lloh11:
	ldr	x8, [x8, _KFD_MQD_TYPE_DIQ@GOTPAGEOFF]
LBB0_7:
	ldr	x9, [x19, #8]
	ldr	x9, [x9]
	ldr	x8, [x8]
	ldr	x8, [x9, x8, lsl #3]
	str	x8, [x20, #40]
	cbz	x8, LBB0_1
; %bb.8:
	add	x8, sp, #24
	add	x1, x8, #72
	mov	x0, x19
	bl	_kfd_get_kernel_doorbell
	str	w0, [sp, #44]
	cbz	w0, LBB0_12
; %bb.9:
	mov	x0, x19
	mov	x1, x22
	mov	x2, x20
	bl	_kfd_gtt_sa_allocate
	cbz	w0, LBB0_13
; %bb.10:
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	str	x22, [sp]
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_err
	b	LBB0_27
LBB0_11:
	str	x21, [sp]
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
	b	LBB0_1
LBB0_12:
Lloh16:
	adrp	x0, l_.str.2@PAGE
Lloh17:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_err
	b	LBB0_1
LBB0_13:
	ldr	x8, [x20]
	ldr	x9, [x8, #8]
	str	x9, [x20, #120]
	ldr	x8, [x8]
	str	x8, [x20, #96]
	ldr	x8, [x20, #128]
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	mov	x3, x22
	blr	x8
	cbz	w0, LBB0_26
; %bb.14:
	add	x23, x20, #16
	mov	x0, x19
	mov	w1, #8
	mov	x2, x23
	bl	_kfd_gtt_sa_allocate
	cbnz	w0, LBB0_25
; %bb.15:
	ldr	x8, [x20, #16]
	ldr	x9, [x8, #8]
	str	x9, [x20, #112]
	ldr	x8, [x8]
	str	x8, [x20, #88]
	ldr	x8, [x19]
	ldr	w1, [x8]
	add	x24, x20, #24
	mov	x0, x19
	mov	x2, x24
	bl	_kfd_gtt_sa_allocate
	cbnz	w0, LBB0_24
; %bb.16:
	ldr	x8, [x20, #24]
	ldr	x9, [x8, #8]
	str	x9, [x20, #104]
	ldr	x8, [x8]
	str	x8, [x20, #80]
	ldr	x0, [x20, #120]
	mov	w1, #0
	mov	x2, x22
	bl	_memset
	ldr	x0, [x20, #112]
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	ldr	x0, [x20, #104]
	mov	w1, #0
	mov	w2, #8
	bl	_memset
Lloh18:
	adrp	x8, lCPI0_0@PAGE
Lloh19:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [sp, #32]
	mov	w8, #100
	str	w8, [sp, #40]
	stp	w21, w22, [sp, #24]
	ldr	x8, [x20, #96]
	stp	x8, xzr, [sp, #80]
	ldr	q0, [x20, #80]
	stur	q0, [sp, #64]
Lloh20:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
	ldr	w9, [x20, #72]
Lloh22:
	ldr	w8, [x8]
	stp	w8, w9, [sp, #56]
	str	xzr, [sp, #48]
	add	x22, x20, #32
	add	x1, sp, #24
	mov	x0, x22
	bl	_init_queue
	cbnz	x0, LBB0_23
; %bb.17:
	ldr	x8, [x20, #32]
	str	x19, [x8, #32]
Lloh23:
	adrp	x8, _current@GOTPAGE
Lloh24:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	bl	_kfd_get_process
	ldr	x8, [x20, #32]
	str	w0, [x8, #24]
	ldr	x9, [x20, #40]
	ldr	x10, [x9, #32]
	ldr	w0, [x9, #24]
	add	x1, x8, #8
	blr	x10
	mov	x2, x0
	ldr	x0, [x20, #32]
	str	w2, [x0]
	cbz	w2, LBB0_22
; %bb.18:
	ldr	x8, [x20, #40]
	ldr	x9, [x8, #16]
	add	x1, x0, #4
	add	x3, x0, #20
	add	x4, x0, #8
	mov	x0, x8
	blr	x9
	cmp	w21, #128
	b.ne	LBB0_20
; %bb.19:
Lloh26:
	adrp	x0, l_.str.4@PAGE
Lloh27:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pr_debug
Lloh28:
	adrp	x8, _KFD_CIK_HIQ_PIPE@GOTPAGE
Lloh29:
	ldr	x8, [x8, _KFD_CIK_HIQ_PIPE@GOTPAGEOFF]
Lloh30:
	ldr	w2, [x8]
	ldr	x8, [x20, #32]
Lloh31:
	adrp	x9, _KFD_CIK_HIQ_QUEUE@GOTPAGE
Lloh32:
	ldr	x9, [x9, _KFD_CIK_HIQ_QUEUE@GOTPAGEOFF]
Lloh33:
	ldr	w3, [x9]
	stp	w3, w2, [x8, #12]
	ldr	x0, [x20, #40]
	ldr	x9, [x0, #8]
	ldr	w1, [x8, #4]
	add	x4, x8, #8
	mov	x5, #0
	blr	x9
	b	LBB0_29
LBB0_20:
	add	x2, x20, #48
	mov	x0, x19
	mov	w1, #4
	bl	_kfd_gtt_sa_allocate
	cbz	w0, LBB0_28
; %bb.21:
	ldp	x8, x0, [x20, #32]
	ldr	x9, [x0]
	ldp	w2, w1, [x8]
	blr	x9
	ldr	x0, [x20, #32]
LBB0_22:
	bl	_uninit_queue
LBB0_23:
	ldr	x1, [x24]
	mov	x0, x19
	bl	_kfd_gtt_sa_free
LBB0_24:
	ldr	x1, [x23]
	mov	x0, x19
	bl	_kfd_gtt_sa_free
LBB0_25:
	ldr	x1, [x20, #8]
	mov	x0, x19
	bl	_kfd_gtt_sa_free
LBB0_26:
	ldr	x1, [x20]
	mov	x0, x19
	bl	_kfd_gtt_sa_free
LBB0_27:
	ldr	w1, [sp, #44]
	mov	x0, x19
	bl	_kfd_release_kernel_doorbell
	b	LBB0_1
LBB0_28:
	ldr	x8, [x20, #48]
	ldr	x9, [x8, #8]
	str	x9, [x20, #64]
	ldr	x8, [x8]
	str	x8, [x20, #56]
LBB0_29:
	ldr	x0, [x22]
	bl	_print_queue
	mov	w0, #1
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdr	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Initializing queue type %d size %d\n"

	.comm	_IT_NOP,4,2                     ; @IT_NOP
	.comm	_PM4_TYPE_3,4,2                 ; @PM4_TYPE_3
	.comm	_PM4_COUNT_ZERO,4,2             ; @PM4_COUNT_ZERO
	.comm	_KFD_MQD_TYPE_DIQ,8,3           ; @KFD_MQD_TYPE_DIQ
	.comm	_KFD_MQD_TYPE_HIQ,8,3           ; @KFD_MQD_TYPE_HIQ
l_.str.1:                               ; @.str.1
	.asciz	"Invalid queue type %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to initialize doorbell"

l_.str.3:                               ; @.str.3
	.asciz	"Failed to init pq queues size %d\n"

	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_current,4,2                    ; @current
l_.str.4:                               ; @.str.4
	.asciz	"Assigning hiq to hqd\n"

	.comm	_KFD_CIK_HIQ_PIPE,4,2           ; @KFD_CIK_HIQ_PIPE
	.comm	_KFD_CIK_HIQ_QUEUE,4,2          ; @KFD_CIK_HIQ_QUEUE
	.no_dead_strip	_initialize
.subsections_via_symbols
