	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function update_mqd_sdma
_update_mqd_sdma:                       ## @update_mqd_sdma
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdx, %r14
	movq	%rsi, %rdi
	callq	_get_sdma_mqd
	movl	(%r14), %ecx
	movl	4(%r14), %edx
	movl	%ecx, %esi
	sarl	$2, %esi
	bsfl	%esi, %esi
	cmpl	$4, %ecx
	movl	$-1, %edi
	cmovael	%esi, %edi
	movq	_SDMA0_RLC0_RB_CNTL__RB_SIZE__SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edi
	movq	_SDMA0_RLC0_RB_CNTL__RB_VMID__SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	movq	%rax, %rbx
	orl	%edi, %edx
	movq	_SDMA0_RLC0_RB_CNTL__RPTR_WRITEBACK_ENABLE__SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	btsl	%eax, %edx
	movq	_SDMA0_RLC0_RB_CNTL__RPTR_WRITEBACK_TIMER__SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	$6, %eax
	shll	%cl, %eax
	orl	%edx, %eax
	movl	%eax, (%rbx)
	movl	8(%r14), %edi
	sarl	$8, %edi
	callq	_lower_32_bits
	movq	%rax, 48(%rbx)
	movl	8(%r14), %edi
	sarl	$8, %edi
	callq	_upper_32_bits
	movq	%rax, 40(%rbx)
	movl	48(%r14), %edi
	callq	_lower_32_bits
	movq	%rax, 32(%rbx)
	movl	48(%r14), %edi
	callq	_upper_32_bits
	movq	%rax, 24(%rbx)
	movl	12(%r14), %eax
	movq	_SDMA0_RLC0_DOORBELL_OFFSET__OFFSET__SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	movl	%eax, 4(%rbx)
	movl	40(%r14), %eax
	movl	%eax, 16(%rbx)
	movl	36(%r14), %eax
	movl	%eax, 12(%rbx)
	movq	_SDMA_RLC_DUMMY_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	xorl	%eax, %eax
	cmpl	$0, (%r14)
	jle	LBB0_4
## %bb.1:
	cmpl	$0, 8(%r14)
	je	LBB0_4
## %bb.2:
	cmpq	$0, 24(%r14)
	jle	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	cmpl	$0, 32(%r14)
	sete	%al
LBB0_4:
	movl	%eax, 16(%r14)
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SDMA0_RLC0_RB_CNTL__RB_SIZE__SHIFT,4,2 ## @SDMA0_RLC0_RB_CNTL__RB_SIZE__SHIFT
	.comm	_SDMA0_RLC0_RB_CNTL__RB_VMID__SHIFT,4,2 ## @SDMA0_RLC0_RB_CNTL__RB_VMID__SHIFT
	.comm	_SDMA0_RLC0_RB_CNTL__RPTR_WRITEBACK_ENABLE__SHIFT,4,2 ## @SDMA0_RLC0_RB_CNTL__RPTR_WRITEBACK_ENABLE__SHIFT
	.comm	_SDMA0_RLC0_RB_CNTL__RPTR_WRITEBACK_TIMER__SHIFT,4,2 ## @SDMA0_RLC0_RB_CNTL__RPTR_WRITEBACK_TIMER__SHIFT
	.comm	_SDMA0_RLC0_DOORBELL_OFFSET__OFFSET__SHIFT,4,2 ## @SDMA0_RLC0_DOORBELL_OFFSET__OFFSET__SHIFT
	.comm	_SDMA_RLC_DUMMY_DEFAULT,4,2     ## @SDMA_RLC_DUMMY_DEFAULT
	.no_dead_strip	_update_mqd_sdma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function update_mqd_sdma
_update_mqd_sdma:                       ; @update_mqd_sdma
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x2
	mov	x0, x1
	bl	_get_sdma_mqd
	mov	x20, x0
	ldp	w8, w9, [x19]
	asr	w10, w8, #2
	rbit	w10, w10
	clz	w10, w10
	cmp	w8, #4
	csinv	w8, w10, wzr, hs
Lloh0:
	adrp	x10, _SDMA0_RLC0_RB_CNTL__RB_SIZE__SHIFT@GOTPAGE
Lloh1:
	ldr	x10, [x10, _SDMA0_RLC0_RB_CNTL__RB_SIZE__SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
	lsl	w8, w8, w10
Lloh3:
	adrp	x10, _SDMA0_RLC0_RB_CNTL__RB_VMID__SHIFT@GOTPAGE
Lloh4:
	ldr	x10, [x10, _SDMA0_RLC0_RB_CNTL__RB_VMID__SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w8, w8, w9
Lloh6:
	adrp	x9, _SDMA0_RLC0_RB_CNTL__RPTR_WRITEBACK_ENABLE__SHIFT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SDMA0_RLC0_RB_CNTL__RPTR_WRITEBACK_ENABLE__SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	mov	w10, #1
	lsl	w9, w10, w9
	orr	w8, w8, w9
Lloh9:
	adrp	x9, _SDMA0_RLC0_RB_CNTL__RPTR_WRITEBACK_TIMER__SHIFT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _SDMA0_RLC0_RB_CNTL__RPTR_WRITEBACK_TIMER__SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	mov	w10, #6
	lsl	w9, w10, w9
	orr	w8, w8, w9
	str	w8, [x0]
	ldr	w8, [x19, #8]
	asr	w0, w8, #8
	bl	_lower_32_bits
	str	x0, [x20, #48]
	ldr	w8, [x19, #8]
	asr	w0, w8, #8
	bl	_upper_32_bits
	str	x0, [x20, #40]
	ldr	w0, [x19, #48]
	bl	_lower_32_bits
	str	x0, [x20, #32]
	ldr	w0, [x19, #48]
	bl	_upper_32_bits
	str	x0, [x20, #24]
Lloh12:
	adrp	x8, _SDMA0_RLC0_DOORBELL_OFFSET__OFFSET__SHIFT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SDMA0_RLC0_DOORBELL_OFFSET__OFFSET__SHIFT@GOTPAGEOFF]
	ldr	w9, [x19, #12]
Lloh14:
	ldr	w8, [x8]
	lsl	w8, w9, w8
	str	w8, [x20, #4]
	ldur	d0, [x19, #36]
	stur	d0, [x20, #12]
Lloh15:
	adrp	x8, _SDMA_RLC_DUMMY_DEFAULT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SDMA_RLC_DUMMY_DEFAULT@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	str	w8, [x20, #8]
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.1:
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_5
; %bb.2:
	ldr	x8, [x19, #24]
	cmp	x8, #1
	b.lt	LBB0_4
; %bb.3:
	ldr	w8, [x19, #32]
	cmp	w8, #0
	cset	w8, eq
	b	LBB0_5
LBB0_4:
	mov	w8, #0
LBB0_5:
	str	w8, [x19, #16]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_SDMA0_RLC0_RB_CNTL__RB_SIZE__SHIFT,4,2 ; @SDMA0_RLC0_RB_CNTL__RB_SIZE__SHIFT
	.comm	_SDMA0_RLC0_RB_CNTL__RB_VMID__SHIFT,4,2 ; @SDMA0_RLC0_RB_CNTL__RB_VMID__SHIFT
	.comm	_SDMA0_RLC0_RB_CNTL__RPTR_WRITEBACK_ENABLE__SHIFT,4,2 ; @SDMA0_RLC0_RB_CNTL__RPTR_WRITEBACK_ENABLE__SHIFT
	.comm	_SDMA0_RLC0_RB_CNTL__RPTR_WRITEBACK_TIMER__SHIFT,4,2 ; @SDMA0_RLC0_RB_CNTL__RPTR_WRITEBACK_TIMER__SHIFT
	.comm	_SDMA0_RLC0_DOORBELL_OFFSET__OFFSET__SHIFT,4,2 ; @SDMA0_RLC0_DOORBELL_OFFSET__OFFSET__SHIFT
	.comm	_SDMA_RLC_DUMMY_DEFAULT,4,2     ; @SDMA_RLC_DUMMY_DEFAULT
	.no_dead_strip	_update_mqd_sdma
.subsections_via_symbols
