	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdma_txinit_ahg
_sdma_txinit_ahg:                       ## @sdma_txinit_ahg
	.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
	testq	%rdx, %rdx
	je	LBB0_1
## %bb.3:
	movq	%rdx, %r14
	movq	_MAX_SDMA_PKT_SIZE@GOTPCREL(%rip), %rax
	cmpq	%rdx, (%rax)
	jge	LBB0_5
## %bb.4:
	movq	_EMSGSIZE@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_1:
	movq	_ENODATA@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_10
LBB0_5:
	movq	%r8, %r15
	movq	%rcx, %r12
	movq	%rsi, %r13
	movq	%rdi, %rbx
	movq	%r9, -48(%rbp)                  ## 8-byte Spill
	movq	8(%rdi), %rdi
	callq	_ARRAY_SIZE
	movl	%eax, 80(%rbx)
	movq	8(%rbx), %rax
	movq	%rax, 72(%rbx)
	leaq	64(%rbx), %rdi
	callq	_INIT_LIST_HEAD
	movq	$0, 56(%rbx)
	movq	%r13, 48(%rbx)
	movq	24(%rbp), %rax
	movq	%rax, (%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 32(%rbx)
	movq	%r14, 16(%rbx)
	movq	%r14, 24(%rbx)
	movq	_SDMA_DESC0_FIRST_DESC_FLAG@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	8(%rbx), %rax
	movq	(%rax), %rax
	movl	%ecx, (%rax)
	movl	$0, 4(%rax)
	movq	_SDMA_TXREQ_F_AHG_COPY@GOTPCREL(%rip), %rcx
	testq	%r13, (%rcx)
	je	LBB0_7
## %bb.6:
	movq	_SDMA_DESC1_HEADER_INDEX_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %r12d
	movq	_SDMA_DESC1_HEADER_INDEX_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %r12d
	movq	_SDMA_AHG_COPY@GOTPCREL(%rip), %rcx
	movq	_SDMA_DESC1_HEADER_MODE_MASK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	andl	(%rcx), %edx
	movq	_SDMA_DESC1_HEADER_MODE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	orl	%r12d, %edx
	movl	%edx, 4(%rax)
	xorl	%r14d, %r14d
	jmp	LBB0_10
LBB0_7:
	xorl	%r14d, %r14d
	testq	%r15, %r15
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	je	LBB0_10
## %bb.8:
	movq	_SDMA_TXREQ_F_USE_AHG@GOTPCREL(%rip), %rax
	andq	(%rax), %r13
	je	LBB0_10
## %bb.9:
	movq	16(%rbp), %r8
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	callq	__sdma_txreq_ahgadd
LBB0_10:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODATA,4,2                    ## @ENODATA
	.comm	_MAX_SDMA_PKT_SIZE,8,3          ## @MAX_SDMA_PKT_SIZE
	.comm	_EMSGSIZE,4,2                   ## @EMSGSIZE
	.comm	_SDMA_DESC0_FIRST_DESC_FLAG,4,2 ## @SDMA_DESC0_FIRST_DESC_FLAG
	.comm	_SDMA_TXREQ_F_AHG_COPY,8,3      ## @SDMA_TXREQ_F_AHG_COPY
	.comm	_SDMA_DESC1_HEADER_INDEX_MASK,4,2 ## @SDMA_DESC1_HEADER_INDEX_MASK
	.comm	_SDMA_DESC1_HEADER_INDEX_SHIFT,4,2 ## @SDMA_DESC1_HEADER_INDEX_SHIFT
	.comm	_SDMA_AHG_COPY,8,3              ## @SDMA_AHG_COPY
	.comm	_SDMA_DESC1_HEADER_MODE_MASK,4,2 ## @SDMA_DESC1_HEADER_MODE_MASK
	.comm	_SDMA_DESC1_HEADER_MODE_SHIFT,4,2 ## @SDMA_DESC1_HEADER_MODE_SHIFT
	.comm	_SDMA_TXREQ_F_USE_AHG,8,3       ## @SDMA_TXREQ_F_USE_AHG
	.no_dead_strip	_sdma_txinit_ahg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sdma_txinit_ahg
_sdma_txinit_ahg:                       ; @sdma_txinit_ahg
	.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
	cbz	x2, LBB0_3
; %bb.1:
	mov	x26, x2
Lloh0:
	adrp	x8, _MAX_SDMA_PKT_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_SDMA_PKT_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x2
	b.ge	LBB0_5
; %bb.2:
Lloh3:
	adrp	x8, _EMSGSIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EMSGSIZE@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh5:
	adrp	x8, _ENODATA@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENODATA@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_5:
	mov	x25, x7
	mov	x20, x6
	mov	x21, x5
	mov	x22, x4
	mov	x19, x3
	mov	x24, x1
	mov	x23, x0
	ldr	x0, [x0, #8]
	bl	_ARRAY_SIZE
	str	w0, [x23, #80]
	ldr	x8, [x23, #8]
	str	x8, [x23, #72]
	add	x0, x23, #64
	bl	_INIT_LIST_HEAD
	stp	x24, xzr, [x23, #48]
	str	x25, [x23]
	stp	xzr, xzr, [x23, #32]
	stp	x26, x26, [x23, #16]
Lloh7:
	adrp	x8, _SDMA_DESC0_FIRST_DESC_FLAG@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SDMA_DESC0_FIRST_DESC_FLAG@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x8]
	ldr	x8, [x23, #8]
	ldr	x8, [x8]
	stp	w9, wzr, [x8]
Lloh10:
	adrp	x9, _SDMA_TXREQ_F_AHG_COPY@GOTPAGE
Lloh11:
	ldr	x9, [x9, _SDMA_TXREQ_F_AHG_COPY@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	tst	x9, x24
	b.eq	LBB0_7
; %bb.6:
	mov	w0, #0
Lloh13:
	adrp	x9, _SDMA_DESC1_HEADER_INDEX_MASK@GOTPAGE
Lloh14:
	ldr	x9, [x9, _SDMA_DESC1_HEADER_INDEX_MASK@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	and	w9, w9, w19
Lloh16:
	adrp	x10, _SDMA_DESC1_HEADER_INDEX_SHIFT@GOTPAGE
Lloh17:
	ldr	x10, [x10, _SDMA_DESC1_HEADER_INDEX_SHIFT@GOTPAGEOFF]
Lloh18:
	ldr	w10, [x10]
Lloh19:
	adrp	x11, _SDMA_AHG_COPY@GOTPAGE
Lloh20:
	ldr	x11, [x11, _SDMA_AHG_COPY@GOTPAGEOFF]
	lsl	w9, w9, w10
Lloh21:
	ldr	w10, [x11]
Lloh22:
	adrp	x11, _SDMA_DESC1_HEADER_MODE_MASK@GOTPAGE
Lloh23:
	ldr	x11, [x11, _SDMA_DESC1_HEADER_MODE_MASK@GOTPAGEOFF]
Lloh24:
	ldr	w11, [x11]
	and	w10, w11, w10
Lloh25:
	adrp	x11, _SDMA_DESC1_HEADER_MODE_SHIFT@GOTPAGE
Lloh26:
	ldr	x11, [x11, _SDMA_DESC1_HEADER_MODE_SHIFT@GOTPAGEOFF]
Lloh27:
	ldr	w11, [x11]
	lsl	w10, w10, w11
	orr	w9, w10, w9
	str	w9, [x8, #4]
	b	LBB0_10
LBB0_7:
	mov	w0, #0
	cbz	x22, LBB0_10
; %bb.8:
Lloh28:
	adrp	x8, _SDMA_TXREQ_F_USE_AHG@GOTPAGE
Lloh29:
	ldr	x8, [x8, _SDMA_TXREQ_F_USE_AHG@GOTPAGEOFF]
Lloh30:
	ldr	x8, [x8]
	and	x8, x8, x24
	cbz	x8, LBB0_10
; %bb.9:
	mov	x0, x23
	mov	x1, x22
	mov	x2, x19
	mov	x3, x21
	mov	x4, x20
	bl	__sdma_txreq_ahgadd
	mov	w0, #0
LBB0_10:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODATA,4,2                    ; @ENODATA
	.comm	_MAX_SDMA_PKT_SIZE,8,3          ; @MAX_SDMA_PKT_SIZE
	.comm	_EMSGSIZE,4,2                   ; @EMSGSIZE
	.comm	_SDMA_DESC0_FIRST_DESC_FLAG,4,2 ; @SDMA_DESC0_FIRST_DESC_FLAG
	.comm	_SDMA_TXREQ_F_AHG_COPY,8,3      ; @SDMA_TXREQ_F_AHG_COPY
	.comm	_SDMA_DESC1_HEADER_INDEX_MASK,4,2 ; @SDMA_DESC1_HEADER_INDEX_MASK
	.comm	_SDMA_DESC1_HEADER_INDEX_SHIFT,4,2 ; @SDMA_DESC1_HEADER_INDEX_SHIFT
	.comm	_SDMA_AHG_COPY,8,3              ; @SDMA_AHG_COPY
	.comm	_SDMA_DESC1_HEADER_MODE_MASK,4,2 ; @SDMA_DESC1_HEADER_MODE_MASK
	.comm	_SDMA_DESC1_HEADER_MODE_SHIFT,4,2 ; @SDMA_DESC1_HEADER_MODE_SHIFT
	.comm	_SDMA_TXREQ_F_USE_AHG,8,3       ; @SDMA_TXREQ_F_USE_AHG
	.no_dead_strip	_sdma_txinit_ahg
.subsections_via_symbols
