	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdma_set_watermarklevel_for_p2p
_sdma_set_watermarklevel_for_p2p:       ## @sdma_set_watermarklevel_for_p2p
	.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	%rdi, %rbx
	movq	40(%rdi), %r14
	movq	_SDMA_WATERMARK_LEVEL_LWML@GOTPCREL(%rip), %rax
	movl	(%rdi), %r15d
	movl	4(%rdi), %edi
	movl	(%rax), %r12d
	andl	%r15d, %r12d
	movq	_SDMA_WATERMARK_LEVEL_HWML@GOTPCREL(%rip), %r13
	andl	(%r13), %r15d
	leal	31(%rdi), %eax
	testl	%edi, %edi
	cmovnsl	%edi, %eax
	andl	$-32, %eax
	subl	%eax, %edi
	movq	32(%rbx), %rsi
	addq	$4, %rsi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_set_bit
	movl	8(%rbx), %edi
	leal	31(%rdi), %eax
	testl	%edi, %edi
	cmovnsl	%edi, %eax
	andl	$-32, %eax
	subl	%eax, %edi
	movq	32(%rbx), %rsi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_set_bit
	cmpl	$32, 4(%rbx)
	jl	LBB0_2
## %bb.1:
	movq	_SDMA_WATERMARK_LEVEL_LWE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%rbx)
LBB0_2:
	sarl	$16, %r15d
	cmpl	$32, 8(%rbx)
	jl	LBB0_4
## %bb.3:
	movq	_SDMA_WATERMARK_LEVEL_HWE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%rbx)
LBB0_4:
	cmpl	%r15d, %r12d
	jle	LBB0_6
## %bb.5:
	movl	(%r13), %eax
	movq	_SDMA_WATERMARK_LEVEL_LWML@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	notl	%eax
	andl	(%rbx), %eax
	shll	$16, %r12d
	orl	%r12d, %r15d
	orl	%eax, %r15d
	movl	%r15d, (%rbx)
	movq	32(%rbx), %rax
	movl	(%rax), %edi
	movl	4(%rax), %esi
	callq	_swap
LBB0_6:
	movq	16(%rbx), %rcx
	movq	(%r14), %rax
	cmpq	%rax, %rcx
	jl	LBB0_9
## %bb.7:
	cmpq	8(%r14), %rcx
	jg	LBB0_9
## %bb.8:
	movq	_SDMA_WATERMARK_LEVEL_SP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, (%rbx)
LBB0_9:
	movq	24(%rbx), %rcx
	cmpq	%rax, %rcx
	jl	LBB0_12
## %bb.10:
	cmpq	8(%r14), %rcx
	jg	LBB0_12
## %bb.11:
	movq	_SDMA_WATERMARK_LEVEL_DP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%rbx)
LBB0_12:
	movq	_SDMA_WATERMARK_LEVEL_CONT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SDMA_WATERMARK_LEVEL_LWML,4,2  ## @SDMA_WATERMARK_LEVEL_LWML
	.comm	_SDMA_WATERMARK_LEVEL_HWML,4,2  ## @SDMA_WATERMARK_LEVEL_HWML
	.comm	_SDMA_WATERMARK_LEVEL_LWE,4,2   ## @SDMA_WATERMARK_LEVEL_LWE
	.comm	_SDMA_WATERMARK_LEVEL_HWE,4,2   ## @SDMA_WATERMARK_LEVEL_HWE
	.comm	_SDMA_WATERMARK_LEVEL_SP,4,2    ## @SDMA_WATERMARK_LEVEL_SP
	.comm	_SDMA_WATERMARK_LEVEL_DP,4,2    ## @SDMA_WATERMARK_LEVEL_DP
	.comm	_SDMA_WATERMARK_LEVEL_CONT,4,2  ## @SDMA_WATERMARK_LEVEL_CONT
	.no_dead_strip	_sdma_set_watermarklevel_for_p2p
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sdma_set_watermarklevel_for_p2p
_sdma_set_watermarklevel_for_p2p:       ; @sdma_set_watermarklevel_for_p2p
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
Lloh0:
	adrp	x21, _SDMA_WATERMARK_LEVEL_LWML@GOTPAGE
Lloh1:
	ldr	x21, [x21, _SDMA_WATERMARK_LEVEL_LWML@GOTPAGEOFF]
Lloh2:
	adrp	x22, _SDMA_WATERMARK_LEVEL_HWML@GOTPAGE
Lloh3:
	ldr	x22, [x22, _SDMA_WATERMARK_LEVEL_HWML@GOTPAGEOFF]
	ldr	w23, [x21]
	ldr	w8, [x22]
	ldp	w24, w9, [x0]
	and	w25, w8, w24
	negs	w8, w9
	and	w8, w8, #0x1f
	and	w9, w9, #0x1f
	csneg	w0, w9, w8, mi
	ldp	x8, x20, [x19, #32]
	add	x1, x8, #4
	bl	_set_bit
	ldr	w8, [x19, #8]
	negs	w9, w8
	and	w9, w9, #0x1f
	and	w8, w8, #0x1f
	csneg	w0, w8, w9, mi
	ldr	x1, [x19, #32]
	bl	_set_bit
	ldr	w8, [x19, #4]
	cmp	w8, #32
	b.lt	LBB0_2
; %bb.1:
Lloh4:
	adrp	x8, _SDMA_WATERMARK_LEVEL_LWE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SDMA_WATERMARK_LEVEL_LWE@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_2:
	and	w8, w23, w24
	asr	w9, w25, #16
	ldr	w10, [x19, #8]
	cmp	w10, #32
	b.lt	LBB0_4
; %bb.3:
Lloh7:
	adrp	x10, _SDMA_WATERMARK_LEVEL_HWE@GOTPAGE
Lloh8:
	ldr	x10, [x10, _SDMA_WATERMARK_LEVEL_HWE@GOTPAGEOFF]
Lloh9:
	ldr	w10, [x10]
	ldr	w11, [x19]
	orr	w10, w11, w10
	str	w10, [x19]
LBB0_4:
	cmp	w8, w9
	b.le	LBB0_6
; %bb.5:
	ldr	w10, [x21]
	ldr	w11, [x22]
	orr	w10, w11, w10
	ldr	w11, [x19]
	bic	w10, w11, w10
	orr	w8, w9, w8, lsl #16
	orr	w8, w8, w10
	str	w8, [x19]
	ldr	x8, [x19, #32]
	ldp	w0, w1, [x8]
	bl	_swap
LBB0_6:
	ldr	x9, [x19, #16]
	ldr	x8, [x20]
	cmp	x9, x8
	b.lt	LBB0_9
; %bb.7:
	ldr	x10, [x20, #8]
	cmp	x9, x10
	b.gt	LBB0_9
; %bb.8:
Lloh10:
	adrp	x9, _SDMA_WATERMARK_LEVEL_SP@GOTPAGE
Lloh11:
	ldr	x9, [x9, _SDMA_WATERMARK_LEVEL_SP@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	ldr	w10, [x19]
	orr	w9, w10, w9
	str	w9, [x19]
LBB0_9:
	ldr	x9, [x19, #24]
	cmp	x9, x8
	b.lt	LBB0_12
; %bb.10:
	ldr	x8, [x20, #8]
	cmp	x9, x8
	b.gt	LBB0_12
; %bb.11:
Lloh13:
	adrp	x8, _SDMA_WATERMARK_LEVEL_DP@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SDMA_WATERMARK_LEVEL_DP@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_12:
Lloh16:
	adrp	x8, _SDMA_WATERMARK_LEVEL_CONT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SDMA_WATERMARK_LEVEL_CONT@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_SDMA_WATERMARK_LEVEL_LWML,4,2  ; @SDMA_WATERMARK_LEVEL_LWML
	.comm	_SDMA_WATERMARK_LEVEL_HWML,4,2  ; @SDMA_WATERMARK_LEVEL_HWML
	.comm	_SDMA_WATERMARK_LEVEL_LWE,4,2   ; @SDMA_WATERMARK_LEVEL_LWE
	.comm	_SDMA_WATERMARK_LEVEL_HWE,4,2   ; @SDMA_WATERMARK_LEVEL_HWE
	.comm	_SDMA_WATERMARK_LEVEL_SP,4,2    ; @SDMA_WATERMARK_LEVEL_SP
	.comm	_SDMA_WATERMARK_LEVEL_DP,4,2    ; @SDMA_WATERMARK_LEVEL_DP
	.comm	_SDMA_WATERMARK_LEVEL_CONT,4,2  ; @SDMA_WATERMARK_LEVEL_CONT
	.no_dead_strip	_sdma_set_watermarklevel_for_p2p
.subsections_via_symbols
