	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function user_sdma_txadd
_user_sdma_txadd:                       ## @user_sdma_txadd
	.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
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movq	%rdx, %r14
	movq	%rsi, -104(%rbp)                ## 8-byte Spill
	movq	%rdi, %r15
	movq	16(%rbp), %rax
	movq	(%rax), %rax
	movq	%r8, -80(%rbp)                  ## 8-byte Spill
	movl	(%r8), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	%r9, -72(%rbp)                  ## 8-byte Spill
	movl	(%r9), %ecx
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
	movq	24(%rdx), %rbx
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	leaq	(%rbx,%rax), %r12
	movq	(%rdx), %rdi
	addq	%r12, %rdi
	movq	24(%r15), %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	callq	_offset_in_page
	movq	_PAGE_MASK@GOTPCREL(%rip), %rcx
	andq	(%rcx), %rbx
	addq	(%r14), %r12
	subq	%rbx, %r12
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shrq	%cl, %r12
	movq	%rax, %r13
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	16(%r15), %rsi
	addq	%rsi, %rax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%ecx, %edx
	subl	%r13d, %edx
	cmpq	%rcx, %rax
	cmoval	%edx, %esi
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	movq	%r14, %r15
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, %r14d
	subl	%eax, %edi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_min
	movl	%eax, %ebx
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	16(%r15), %rax
	movl	%r12d, %ecx
	movl	(%rax,%rcx,4), %edx
	movq	-104(%rbp), %rsi                ## 8-byte Reload
	movq	%r13, %rcx
	movl	%ebx, %r8d
	callq	_sdma_txadd_page
	movl	%eax, %r13d
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %edx
	callq	_SDMA_DBG
	jmp	LBB0_9
LBB0_2:
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movl	%ebx, %eax
	addl	%ebx, %r14d
	xorl	%edi, %edi
	cmpl	-48(%rbp), %r14d                ## 4-byte Folded Reload
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	jae	LBB0_3
## %bb.4:
	cmpl	%r12d, 8(%r15)
	movq	%rcx, %r12
	jne	LBB0_6
## %bb.5:
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	4(%rdx), %ecx
	decl	%ecx
	xorl	%edi, %edi
	cmpl	%ecx, (%rdx)
	setl	%dil
	jmp	LBB0_6
LBB0_3:
	movq	%rcx, %r12
LBB0_6:
	addq	%rax, %r12
	addl	%esi, %ebx
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	addq	%r12, (%r15)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	incl	(%rax)
	xorl	%r12d, %r12d
LBB0_8:
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	16(%rbp), %rcx
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%edx, (%rax)
	movl	%ebx, (%rsi)
	movq	%r12, (%rcx)
LBB0_9:
	movl	%r13d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_MASK,8,3                  ## @PAGE_MASK
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SDMA txreq add page failed %d\n"

	.no_dead_strip	_user_sdma_txadd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function user_sdma_txadd
_user_sdma_txadd:                       ; @user_sdma_txadd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x28, x3
	mov	x23, x2
	mov	x24, x1
	mov	x22, x0
	stp	x5, x6, [sp, #32]               ; 16-byte Folded Spill
	ldr	x25, [x6]
	str	x4, [sp, #16]                   ; 8-byte Folded Spill
	ldr	w19, [x4]
	ldr	w8, [x5]
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	ldr	x21, [x0, #24]
	ldr	x20, [x2, #24]
	ldr	x8, [x2]
	add	x26, x20, x25
	add	x0, x26, x8
	bl	_offset_in_page
	mov	x27, x0
Lloh0:
	adrp	x8, _PAGE_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_MASK@GOTPAGEOFF]
	ldr	x9, [x23]
Lloh2:
	ldr	x8, [x8]
	and	x8, x8, x20
Lloh3:
	adrp	x10, _PAGE_SHIFT@GOTPAGE
Lloh4:
	ldr	x10, [x10, _PAGE_SHIFT@GOTPAGEOFF]
	add	x9, x26, x9
	sub	x8, x9, x8
Lloh5:
	ldr	x9, [x10]
	lsr	x20, x8, x9
	ldr	x8, [x22, #16]
Lloh6:
	adrp	x9, _PAGE_SIZE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PAGE_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	sub	w10, w9, w27
	add	x11, x8, x0
	cmp	x11, x9
	csel	w1, w10, w8, hi
	str	w28, [sp, #28]                  ; 4-byte Folded Spill
	sub	w0, w28, w19
	bl	_min
	mov	x26, x0
	ldr	w0, [x21]
	ldr	x8, [x23, #16]
	ldr	w2, [x8, w20, uxtw #2]
	mov	x1, x24
	mov	x3, x27
	mov	x4, x26
	bl	_sdma_txadd_page
	mov	x24, x0
	cbz	w0, LBB0_2
; %bb.1:
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	mov	x2, x24
	bl	_SDMA_DBG
	b	LBB0_9
LBB0_2:
	ldr	w11, [sp, #12]                  ; 4-byte Folded Reload
	ldr	x27, [sp, #16]                  ; 8-byte Folded Reload
	ldp	x21, x28, [sp, #32]             ; 16-byte Folded Reload
	add	w19, w26, w19
	ldr	w8, [sp, #28]                   ; 4-byte Folded Reload
	cmp	w19, w8
	b.hs	LBB0_5
; %bb.3:
	ldr	w8, [x23, #8]
	cmp	w8, w20
	b.ne	LBB0_5
; %bb.4:
	ldp	w8, w9, [x22]
	sub	w9, w9, #1
	cmp	w8, w9
	cset	w0, lt
	b	LBB0_6
LBB0_5:
	mov	w0, #0
LBB0_6:
	add	x25, x25, w26, uxtw
	add	w20, w26, w11
	bl	_unlikely
	cbz	x0, LBB0_8
; %bb.7:
	ldr	x8, [x23]
	add	x8, x8, x25
	str	x8, [x23]
	ldr	w8, [x22]
	add	w8, w8, #1
	str	w8, [x22]
	mov	x25, #0
LBB0_8:
	str	w19, [x27]
	str	w20, [x21]
	str	x25, [x28]
LBB0_9:
	mov	x0, x24
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_MASK,8,3                  ; @PAGE_MASK
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SDMA txreq add page failed %d\n"

	.no_dead_strip	_user_sdma_txadd
.subsections_via_symbols
