	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function update_queue
_update_queue:                          ## @update_queue
	.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, %r12
	movq	%rdi, %r14
	callq	_dqm_lock
	movl	40(%r12), %edi
	movq	32(%r12), %rsi
	callq	_kfd_get_process_device_data
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	16(%r14), %rbx
	movq	(%r12), %rdi
	callq	_get_mqd_type_from_queue_type
	movq	(%rbx,%rax,8), %r15
	movl	8(%r12), %r13d
	movq	(%r14), %rax
	movq	_KFD_SCHED_POLICY_NO_HWS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.6:
	testl	%r13d, %r13d
	je	LBB0_12
## %bb.7:
	movq	(%r12), %rax
	movq	_KFD_QUEUE_TYPE_COMPUTE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_10
## %bb.8:
	movq	_KFD_QUEUE_TYPE_SDMA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_10
## %bb.9:
	movq	_KFD_QUEUE_TYPE_SDMA_XGMI@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
LBB0_10:
	movl	24(%r12), %esi
	movq	_KFD_PREEMPT_TYPE_WAVEFRONT_DRAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_KFD_UNMAP_LATENCY_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	16(%r12), %r9d
	movl	20(%r12), %r8d
	movq	%r15, %rdi
	callq	*(%r15)
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_err
	jmp	LBB0_27
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_27
LBB0_4:
	movq	_KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_unmap_queues_cpsch
	testl	%eax, %eax
	je	LBB0_12
## %bb.5:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	jmp	LBB0_27
LBB0_12:
	movl	24(%r12), %esi
	movq	%r15, %rdi
	movq	%r12, %rdx
	callq	*16(%r15)
	movl	8(%r12), %eax
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	movl	$1, %ecx
	testl	%r13d, %r13d
	je	LBB0_16
LBB0_14:
	testl	%eax, %eax
	jne	LBB0_17
## %bb.15:
	movl	$-1, %ecx
	testl	%r13d, %r13d
	je	LBB0_17
LBB0_16:
	addl	%ecx, 8(%r14)
LBB0_17:
	movq	(%r14), %rcx
	movq	_KFD_SCHED_POLICY_NO_HWS@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_18
## %bb.19:
	xorl	%ebx, %ebx
	testl	%eax, %eax
	je	LBB0_27
## %bb.20:
	movq	(%r12), %rax
	movq	_KFD_QUEUE_TYPE_COMPUTE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_23
## %bb.21:
	movq	_KFD_QUEUE_TYPE_SDMA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_23
## %bb.22:
	movq	_KFD_QUEUE_TYPE_SDMA_XGMI@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_27
LBB0_23:
	movq	32(%r12), %rax
	movq	(%rax), %rax
	movq	_current@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	setne	%dil
	leaq	L_.str.2(%rip), %rsi
	callq	_WARN
	testq	%rax, %rax
	je	LBB0_25
## %bb.24:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_18:
	movq	%r14, %rdi
	callq	_map_queues_cpsch
LBB0_26:
	movl	%eax, %ebx
LBB0_27:
	movq	%r14, %rdi
	callq	_dqm_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_25:
	movl	24(%r12), %esi
	movl	16(%r12), %ecx
	movl	20(%r12), %edx
	movq	(%rbx), %rax
	movq	(%rax), %r9
	movq	%r15, %rdi
	movq	%r12, %r8
	callq	*8(%r15)
	jmp	LBB0_26
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_KFD_SCHED_POLICY_NO_HWS,8,3    ## @KFD_SCHED_POLICY_NO_HWS
	.comm	_KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES,4,2 ## @KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unmap queue failed\n"

	.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
	.comm	_KFD_PREEMPT_TYPE_WAVEFRONT_DRAIN,4,2 ## @KFD_PREEMPT_TYPE_WAVEFRONT_DRAIN
	.comm	_KFD_UNMAP_LATENCY_MS,4,2       ## @KFD_UNMAP_LATENCY_MS
L_.str.1:                               ## @.str.1
	.asciz	"destroy mqd failed\n"

	.comm	_current,8,3                    ## @current
L_.str.2:                               ## @.str.2
	.asciz	"should only run in user thread"

	.comm	_EFAULT,4,2                     ## @EFAULT
	.no_dead_strip	_update_queue
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function update_queue
_update_queue:                          ; @update_queue
	.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, x1
	mov	x19, x0
	bl	_dqm_lock
	ldr	w0, [x20, #40]
	ldr	x1, [x20, #32]
	bl	_kfd_get_process_device_data
	cbz	x0, LBB0_6
; %bb.1:
	ldr	x21, [x19, #16]
	ldr	x0, [x20]
	bl	_get_mqd_type_from_queue_type
	ldr	x21, [x21, x0, lsl #3]
	ldr	w24, [x20, #8]
	ldr	x8, [x19]
Lloh0:
	adrp	x23, _KFD_SCHED_POLICY_NO_HWS@GOTPAGE
Lloh1:
	ldr	x23, [x23, _KFD_SCHED_POLICY_NO_HWS@GOTPAGEOFF]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.2:
	cbz	w24, LBB0_10
; %bb.3:
	ldr	x8, [x20]
Lloh2:
	adrp	x9, _KFD_QUEUE_TYPE_COMPUTE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _KFD_QUEUE_TYPE_COMPUTE@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
Lloh5:
	adrp	x10, _KFD_QUEUE_TYPE_SDMA@GOTPAGE
Lloh6:
	ldr	x10, [x10, _KFD_QUEUE_TYPE_SDMA@GOTPAGEOFF]
Lloh7:
	ldr	x10, [x10]
Lloh8:
	adrp	x11, _KFD_QUEUE_TYPE_SDMA_XGMI@GOTPAGE
Lloh9:
	ldr	x11, [x11, _KFD_QUEUE_TYPE_SDMA_XGMI@GOTPAGEOFF]
Lloh10:
	ldr	x11, [x11]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	ccmp	x8, x11, #4, ne
	b.ne	LBB0_10
; %bb.4:
	ldr	x8, [x21]
	ldp	w4, w1, [x20, #20]
Lloh11:
	adrp	x9, _KFD_PREEMPT_TYPE_WAVEFRONT_DRAIN@GOTPAGE
Lloh12:
	ldr	x9, [x9, _KFD_PREEMPT_TYPE_WAVEFRONT_DRAIN@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x9]
Lloh14:
	adrp	x9, _KFD_UNMAP_LATENCY_MS@GOTPAGE
Lloh15:
	ldr	x9, [x9, _KFD_UNMAP_LATENCY_MS@GOTPAGEOFF]
Lloh16:
	ldr	w3, [x9]
	ldr	w5, [x20, #16]
	mov	x0, x21
	blr	x8
	cbz	w0, LBB0_10
; %bb.5:
	mov	x22, x0
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
	b	LBB0_25
LBB0_6:
Lloh19:
	adrp	x8, _ENODEV@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_25
LBB0_8:
Lloh21:
	adrp	x8, _KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES@GOTPAGE
Lloh22:
	ldr	x8, [x8, _KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_unmap_queues_cpsch
	cbz	w0, LBB0_10
; %bb.9:
	mov	x22, x0
Lloh24:
	adrp	x0, l_.str@PAGE
Lloh25:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	b	LBB0_25
LBB0_10:
	ldr	x8, [x21, #16]
	ldr	w1, [x20, #24]
	mov	x0, x21
	mov	x2, x20
	blr	x8
	ldr	w8, [x20, #8]
	cbz	w8, LBB0_13
; %bb.11:
	cbnz	w24, LBB0_13
; %bb.12:
	mov	w9, #1
	b	LBB0_16
LBB0_13:
	cbnz	w8, LBB0_17
; %bb.14:
	cbz	w24, LBB0_17
; %bb.15:
	mov	w9, #-1
LBB0_16:
	ldr	w10, [x19, #8]
	add	w9, w10, w9
	str	w9, [x19, #8]
LBB0_17:
	ldr	x9, [x19]
	ldr	x10, [x23]
	cmp	x9, x10
	b.ne	LBB0_23
; %bb.18:
	cbz	w8, LBB0_22
; %bb.19:
	ldr	x8, [x20]
Lloh26:
	adrp	x9, _KFD_QUEUE_TYPE_COMPUTE@GOTPAGE
Lloh27:
	ldr	x9, [x9, _KFD_QUEUE_TYPE_COMPUTE@GOTPAGEOFF]
Lloh28:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_26
; %bb.20:
Lloh29:
	adrp	x9, _KFD_QUEUE_TYPE_SDMA@GOTPAGE
Lloh30:
	ldr	x9, [x9, _KFD_QUEUE_TYPE_SDMA@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_26
; %bb.21:
Lloh32:
	adrp	x9, _KFD_QUEUE_TYPE_SDMA_XGMI@GOTPAGE
Lloh33:
	ldr	x9, [x9, _KFD_QUEUE_TYPE_SDMA_XGMI@GOTPAGEOFF]
Lloh34:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_26
LBB0_22:
	mov	w22, #0
	b	LBB0_25
LBB0_23:
	mov	x0, x19
	bl	_map_queues_cpsch
LBB0_24:
	mov	x22, x0
LBB0_25:
	mov	x0, x19
	bl	_dqm_unlock
	mov	x0, x22
	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_26:
	ldr	x8, [x20, #32]
	ldr	x8, [x8]
Lloh35:
	adrp	x22, _current@GOTPAGE
Lloh36:
	ldr	x22, [x22, _current@GOTPAGEOFF]
	ldr	x9, [x22]
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, ne
Lloh37:
	adrp	x1, l_.str.2@PAGE
Lloh38:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_WARN
	cbz	x0, LBB0_28
; %bb.27:
Lloh39:
	adrp	x8, _EFAULT@GOTPAGE
Lloh40:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
	b	LBB0_7
LBB0_28:
	ldr	x8, [x21, #8]
	ldp	w2, w1, [x20, #20]
	ldr	w3, [x20, #16]
	ldr	x9, [x22]
	ldr	x5, [x9]
	mov	x0, x21
	mov	x4, x20
	blr	x8
	b	LBB0_24
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_KFD_SCHED_POLICY_NO_HWS,8,3    ; @KFD_SCHED_POLICY_NO_HWS
	.comm	_KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES,4,2 ; @KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unmap queue failed\n"

	.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
	.comm	_KFD_PREEMPT_TYPE_WAVEFRONT_DRAIN,4,2 ; @KFD_PREEMPT_TYPE_WAVEFRONT_DRAIN
	.comm	_KFD_UNMAP_LATENCY_MS,4,2       ; @KFD_UNMAP_LATENCY_MS
l_.str.1:                               ; @.str.1
	.asciz	"destroy mqd failed\n"

	.comm	_current,8,3                    ; @current
l_.str.2:                               ; @.str.2
	.asciz	"should only run in user thread"

	.comm	_EFAULT,4,2                     ; @EFAULT
	.no_dead_strip	_update_queue
.subsections_via_symbols
