	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function destroy_queue_cpsch
_destroy_queue_cpsch:                   ## @destroy_queue_cpsch
	.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, %r14
	movq	%rsi, %r12
	movq	%rdi, %r13
	callq	_dqm_lock
	cmpq	$0, 8(%r12)
	je	LBB0_2
## %bb.1:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	%r13, %rdi
	callq	_dqm_unlock
	jmp	LBB0_12
LBB0_2:
	movq	16(%r13), %rbx
	movq	8(%r14), %rdi
	callq	_get_mqd_type_from_queue_type
	movq	(%rbx,%rax,8), %r15
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_deallocate_doorbell
	movq	8(%r14), %rax
	movq	_KFD_QUEUE_TYPE_SDMA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	decl	12(%r13)
	jmp	LBB0_6
LBB0_4:
	movq	_KFD_QUEUE_TYPE_SDMA_XGMI@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.5:
	decl	8(%r13)
LBB0_6:
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_deallocate_sdma_queue
LBB0_7:
	leaq	24(%r14), %rdi
	callq	_list_del
	decl	4(%r12)
	cmpq	$0, 16(%r14)
	je	LBB0_8
## %bb.9:
	decl	4(%r13)
	movq	_KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_execute_queues_cpsch
	movl	%eax, %ebx
	movq	_ETIME@GOTPCREL(%rip), %rax
	movl	%ebx, %ecx
	addl	(%rax), %ecx
	jne	LBB0_11
## %bb.10:
	movl	$1, (%r12)
	jmp	LBB0_11
LBB0_8:
	xorl	%ebx, %ebx
LBB0_11:
	movl	(%r13), %esi
	decl	%esi
	movl	%esi, (%r13)
	leaq	L_.str(%rip), %rdi
	callq	_pr_debug
	movq	%r13, %rdi
	callq	_dqm_unlock
	movl	(%r14), %edx
	movl	4(%r14), %esi
	movq	%r15, %rdi
	callq	*(%r15)
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_KFD_QUEUE_TYPE_SDMA,8,3        ## @KFD_QUEUE_TYPE_SDMA
	.comm	_KFD_QUEUE_TYPE_SDMA_XGMI,8,3   ## @KFD_QUEUE_TYPE_SDMA_XGMI
	.comm	_KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES,4,2 ## @KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES
	.comm	_ETIME,4,2                      ## @ETIME
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Total of %d queues are accountable so far\n"

	.no_dead_strip	_destroy_queue_cpsch
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function destroy_queue_cpsch
_destroy_queue_cpsch:                   ; @destroy_queue_cpsch
	.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	x20, x2
	mov	x22, x1
	mov	x19, x0
	bl	_dqm_lock
	ldr	x8, [x22, #8]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w23, w8
	mov	x0, x19
	bl	_dqm_unlock
	b	LBB0_12
LBB0_2:
	ldr	x21, [x19, #16]
	ldr	x0, [x20, #8]
	bl	_get_mqd_type_from_queue_type
	ldr	x21, [x21, x0, lsl #3]
	mov	x0, x22
	mov	x1, x20
	bl	_deallocate_doorbell
	ldr	x8, [x20, #8]
Lloh3:
	adrp	x9, _KFD_QUEUE_TYPE_SDMA@GOTPAGE
Lloh4:
	ldr	x9, [x9, _KFD_QUEUE_TYPE_SDMA@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
	ldr	w8, [x19, #12]
	sub	w8, w8, #1
	str	w8, [x19, #12]
	b	LBB0_6
LBB0_4:
Lloh6:
	adrp	x9, _KFD_QUEUE_TYPE_SDMA_XGMI@GOTPAGE
Lloh7:
	ldr	x9, [x9, _KFD_QUEUE_TYPE_SDMA_XGMI@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.5:
	ldr	w8, [x19, #8]
	sub	w8, w8, #1
	str	w8, [x19, #8]
LBB0_6:
	mov	x0, x19
	mov	x1, x20
	bl	_deallocate_sdma_queue
LBB0_7:
	add	x0, x20, #24
	bl	_list_del
	ldr	w8, [x22, #4]
	sub	w8, w8, #1
	str	w8, [x22, #4]
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_10
; %bb.8:
	ldr	w8, [x19, #4]
	sub	w8, w8, #1
	str	w8, [x19, #4]
Lloh9:
	adrp	x8, _KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES@GOTPAGE
Lloh10:
	ldr	x8, [x8, _KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_execute_queues_cpsch
	mov	x23, x0
Lloh12:
	adrp	x8, _ETIME@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ETIME@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_11
; %bb.9:
	mov	w8, #1
	str	w8, [x22]
	b	LBB0_11
LBB0_10:
	mov	w23, #0
LBB0_11:
	ldr	w8, [x19]
	sub	w1, w8, #1
	str	w1, [x19]
Lloh15:
	adrp	x0, l_.str@PAGE
Lloh16:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
	mov	x0, x19
	bl	_dqm_unlock
	ldr	x8, [x21]
	ldp	w2, w1, [x20]
	mov	x0, x21
	blr	x8
LBB0_12:
	mov	x0, x23
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_KFD_QUEUE_TYPE_SDMA,8,3        ; @KFD_QUEUE_TYPE_SDMA
	.comm	_KFD_QUEUE_TYPE_SDMA_XGMI,8,3   ; @KFD_QUEUE_TYPE_SDMA_XGMI
	.comm	_KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES,4,2 ; @KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES
	.comm	_ETIME,4,2                      ; @ETIME
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Total of %d queues are accountable so far\n"

	.no_dead_strip	_destroy_queue_cpsch
.subsections_via_symbols
