	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function destroy_queue_nocpsch_locked
_destroy_queue_nocpsch_locked:          ## @destroy_queue_nocpsch_locked
	.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, %rbx
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	24(%rdi), %r12
	movq	(%rdx), %rdi
	callq	_get_mqd_type_from_queue_type
	movq	(%r12,%rax,8), %r12
	movq	(%rbx), %rsi
	movq	_KFD_QUEUE_TYPE_COMPUTE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	jne	LBB0_10
## %bb.1:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_deallocate_hqd
	jmp	LBB0_2
LBB0_10:
	movq	_KFD_QUEUE_TYPE_SDMA@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	jne	LBB0_13
## %bb.11:
	decl	16(%r14)
	jmp	LBB0_12
LBB0_13:
	movq	_KFD_QUEUE_TYPE_SDMA_XGMI@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	jne	LBB0_15
## %bb.14:
	decl	12(%r14)
LBB0_12:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_deallocate_sdma_queue
LBB0_2:
	decl	8(%r14)
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_deallocate_doorbell
	movq	_KFD_PREEMPT_TYPE_WAVEFRONT_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_KFD_UNMAP_LATENCY_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	32(%rbx), %r8d
	movl	24(%rbx), %esi
	movl	28(%rbx), %r9d
	movq	%r12, %rdi
	callq	*(%r12)
	movl	%eax, %r13d
	movq	_ETIME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r13d, %eax
	jne	LBB0_4
## %bb.3:
	movl	$1, (%r15)
LBB0_4:
	movl	20(%rbx), %edx
	movl	24(%rbx), %esi
	movq	%r12, %rdi
	callq	*8(%r12)
	leaq	16(%rbx), %rdi
	callq	_list_del
	leaq	16(%r15), %rdi
	callq	_list_empty
	testq	%rax, %rax
	je	LBB0_8
## %bb.5:
	cmpl	$0, (%r15)
	je	LBB0_7
## %bb.6:
	movl	4(%r14), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_warn
	movl	4(%r14), %edi
	movq	8(%r15), %rax
	movl	(%rax), %esi
	callq	_dbgdev_wave_reset_wavefronts
	movl	$0, (%r15)
LBB0_7:
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	callq	_deallocate_vmid
LBB0_8:
	decl	4(%r15)
	cmpq	$0, 8(%rbx)
	je	LBB0_16
## %bb.9:
	decl	(%r14)
LBB0_16:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	leaq	L_.str(%rip), %rdi
	callq	_pr_debug
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_KFD_QUEUE_TYPE_COMPUTE,8,3     ## @KFD_QUEUE_TYPE_COMPUTE
	.comm	_KFD_QUEUE_TYPE_SDMA,8,3        ## @KFD_QUEUE_TYPE_SDMA
	.comm	_KFD_QUEUE_TYPE_SDMA_XGMI,8,3   ## @KFD_QUEUE_TYPE_SDMA_XGMI
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"q->properties.type %d is invalid\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_KFD_PREEMPT_TYPE_WAVEFRONT_RESET,4,2 ## @KFD_PREEMPT_TYPE_WAVEFRONT_RESET
	.comm	_KFD_UNMAP_LATENCY_MS,4,2       ## @KFD_UNMAP_LATENCY_MS
	.comm	_ETIME,4,2                      ## @ETIME
L_.str.1:                               ## @.str.1
	.asciz	"Resetting wave fronts (nocpsch) on dev %p\n"

	.no_dead_strip	_destroy_queue_nocpsch_locked
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function destroy_queue_nocpsch_locked
_destroy_queue_nocpsch_locked:          ; @destroy_queue_nocpsch_locked
	.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	x21, x1
	mov	x19, x0
	ldr	x22, [x0, #24]
	ldr	x0, [x2]
	bl	_get_mqd_type_from_queue_type
	ldr	x22, [x22, x0, lsl #3]
	ldr	x1, [x20]
Lloh0:
	adrp	x8, _KFD_QUEUE_TYPE_COMPUTE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _KFD_QUEUE_TYPE_COMPUTE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x1, x8
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x19
	mov	x1, x20
	bl	_deallocate_hqd
	b	LBB0_7
LBB0_2:
Lloh3:
	adrp	x8, _KFD_QUEUE_TYPE_SDMA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _KFD_QUEUE_TYPE_SDMA@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x1, x8
	b.ne	LBB0_4
; %bb.3:
	ldr	w8, [x19, #16]
	sub	w8, w8, #1
	str	w8, [x19, #16]
	b	LBB0_6
LBB0_4:
Lloh6:
	adrp	x8, _KFD_QUEUE_TYPE_SDMA_XGMI@GOTPAGE
Lloh7:
	ldr	x8, [x8, _KFD_QUEUE_TYPE_SDMA_XGMI@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cmp	x1, x8
	b.ne	LBB0_16
; %bb.5:
	ldr	w8, [x19, #12]
	sub	w8, w8, #1
	str	w8, [x19, #12]
LBB0_6:
	mov	x0, x19
	mov	x1, x20
	bl	_deallocate_sdma_queue
LBB0_7:
	ldr	w8, [x19, #8]
	sub	w8, w8, #1
	str	w8, [x19, #8]
	mov	x0, x21
	mov	x1, x20
	bl	_deallocate_doorbell
	ldr	x8, [x22]
Lloh9:
	adrp	x9, _KFD_PREEMPT_TYPE_WAVEFRONT_RESET@GOTPAGE
Lloh10:
	ldr	x9, [x9, _KFD_PREEMPT_TYPE_WAVEFRONT_RESET@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x9]
Lloh12:
	adrp	x9, _KFD_UNMAP_LATENCY_MS@GOTPAGE
Lloh13:
	ldr	x9, [x9, _KFD_UNMAP_LATENCY_MS@GOTPAGEOFF]
Lloh14:
	ldr	w3, [x9]
	ldp	w5, w4, [x20, #28]
	ldr	w1, [x20, #24]
	mov	x0, x22
	blr	x8
	mov	x23, x0
Lloh15:
	adrp	x8, _ETIME@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ETIME@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_9
; %bb.8:
	mov	w8, #1
	str	w8, [x21]
LBB0_9:
	ldr	x8, [x22, #8]
	ldp	w2, w1, [x20, #20]
	mov	x0, x22
	blr	x8
	add	x0, x20, #16
	bl	_list_del
	add	x0, x21, #16
	bl	_list_empty
	cbz	x0, LBB0_13
; %bb.10:
	ldr	w8, [x21]
	cbz	w8, LBB0_12
; %bb.11:
	ldr	w1, [x19, #4]
Lloh18:
	adrp	x0, l_.str.1@PAGE
Lloh19:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_warn
	ldr	w0, [x19, #4]
	ldr	x8, [x21, #8]
	ldr	w1, [x8]
	bl	_dbgdev_wave_reset_wavefronts
	str	wzr, [x21]
LBB0_12:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_deallocate_vmid
LBB0_13:
	ldr	w8, [x21, #4]
	sub	w8, w8, #1
	str	w8, [x21, #4]
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_15
; %bb.14:
	ldr	w8, [x19]
	sub	w8, w8, #1
	str	w8, [x19]
LBB0_15:
	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
LBB0_16:
Lloh20:
	adrp	x0, l_.str@PAGE
Lloh21:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
Lloh22:
	adrp	x8, _EINVAL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_15
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_KFD_QUEUE_TYPE_COMPUTE,8,3     ; @KFD_QUEUE_TYPE_COMPUTE
	.comm	_KFD_QUEUE_TYPE_SDMA,8,3        ; @KFD_QUEUE_TYPE_SDMA
	.comm	_KFD_QUEUE_TYPE_SDMA_XGMI,8,3   ; @KFD_QUEUE_TYPE_SDMA_XGMI
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"q->properties.type %d is invalid\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_KFD_PREEMPT_TYPE_WAVEFRONT_RESET,4,2 ; @KFD_PREEMPT_TYPE_WAVEFRONT_RESET
	.comm	_KFD_UNMAP_LATENCY_MS,4,2       ; @KFD_UNMAP_LATENCY_MS
	.comm	_ETIME,4,2                      ; @ETIME
l_.str.1:                               ; @.str.1
	.asciz	"Resetting wave fronts (nocpsch) on dev %p\n"

	.no_dead_strip	_destroy_queue_nocpsch_locked
.subsections_via_symbols
