	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atiixp_build_dma_packets
_atiixp_build_dma_packets:              ## @atiixp_build_dma_packets
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_ATI_MAX_DESCRIPTORS@GOTPCREL(%rip), %rax
	cmpl	%ecx, (%rax)
	jae	LBB0_2
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_14
LBB0_2:
	movl	%r8d, %ebx
	movl	%ecx, %r15d
	movq	%rsi, %r13
	movq	%rdi, %r12
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	leaq	16(%rsi), %r14
	cmpq	$0, 24(%rsi)
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_4
## %bb.3:
	movl	4(%r13), %eax
	cmpl	%r15d, %eax
	je	LBB0_7
	jmp	LBB0_8
LBB0_4:
	movq	_SNDRV_DMA_TYPE_DEV@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	12(%r12), %edi
	callq	_snd_dma_pci_data
	movq	_ATI_DESC_LIST_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%r14d, %edi
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, %esi
	callq	_snd_dma_alloc_pages
	testq	%rax, %rax
	js	LBB0_1
## %bb.5:
	movq	$0, (%r13)
	xorl	%eax, %eax
	cmpl	%r15d, %eax
	jne	LBB0_8
LBB0_7:
	xorl	%eax, %eax
	cmpl	%ebx, (%r13)
	je	LBB0_14
LBB0_8:
	leaq	8(%r12), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	8(%r13), %rax
	movq	(%rax), %rsi
	addq	(%r12), %rsi
	xorl	%edi, %edi
	callq	_writel
	movq	8(%r13), %rax
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	*8(%rax)
	movq	8(%r13), %rax
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	movl	$1, %esi
	callq	*8(%rax)
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	testl	%r15d, %r15d
	je	LBB0_13
## %bb.9:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %r12
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	(%rax), %r14d
	movl	%ebx, %eax
	shrl	$2, %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	leal	-1(%rax), %ecx
	movl	%eax, %eax
	shlq	$5, %rcx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	shlq	$5, %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	movq	%r13, -96(%rbp)                 ## 8-byte Spill
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_cpu_to_le32
	movq	%rax, 8(%r13,%r15)
	addl	%ebx, %r14d
	addq	$32, %r15
	cmpq	%r15, -80(%rbp)                 ## 8-byte Folded Reload
	movq	-96(%rbp), %r13                 ## 8-byte Reload
	je	LBB0_13
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	24(%r13), %r13
	movl	%r14d, %edi
	callq	_cpu_to_le32
	movq	%rax, 24(%r13,%r15)
	movq	$0, 16(%r13,%r15)
	movl	-56(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%r13,%r15)
	movslq	%r12d, %r12
	addq	$32, %r12
	movq	%r12, %rdi
	cmpq	%r15, -88(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	jmp	LBB0_12
LBB0_13:
	movq	_ATI_REG_LINKPTR_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	orl	16(%r13), %edi
	movq	8(%r13), %rax
	movq	(%rax), %rsi
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	addq	(%rax), %rsi
	callq	_writel
	movl	%ebx, (%r13)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, 4(%r13)
	xorl	%eax, %eax
LBB0_14:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATI_MAX_DESCRIPTORS,4,2        ## @ATI_MAX_DESCRIPTORS
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_SNDRV_DMA_TYPE_DEV,4,2         ## @SNDRV_DMA_TYPE_DEV
	.comm	_ATI_DESC_LIST_SIZE,4,2         ## @ATI_DESC_LIST_SIZE
	.comm	_ATI_REG_LINKPTR_EN,4,2         ## @ATI_REG_LINKPTR_EN
	.no_dead_strip	_atiixp_build_dma_packets
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atiixp_build_dma_packets
_atiixp_build_dma_packets:              ; @atiixp_build_dma_packets
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
Lloh0:
	adrp	x8, _ATI_MAX_DESCRIPTORS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ATI_MAX_DESCRIPTORS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w3
	b.hs	LBB0_2
LBB0_1:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_14
LBB0_2:
	mov	x20, x4
	mov	x19, x3
	mov	x24, x2
	mov	x21, x1
	mov	x22, x0
	add	x23, x1, #16
	ldr	x8, [x1, #24]
	cbz	x8, LBB0_4
; %bb.3:
	ldr	w8, [x21, #4]
	cmp	w8, w19
	b.eq	LBB0_6
	b	LBB0_8
LBB0_4:
Lloh6:
	adrp	x8, _SNDRV_DMA_TYPE_DEV@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SNDRV_DMA_TYPE_DEV@GOTPAGEOFF]
Lloh8:
	ldr	w25, [x8]
	ldr	w0, [x22, #12]
	bl	_snd_dma_pci_data
	mov	x1, x0
Lloh9:
	adrp	x8, _ATI_DESC_LIST_SIZE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ATI_DESC_LIST_SIZE@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x25
	mov	x3, x23
	bl	_snd_dma_alloc_pages
	tbnz	x0, #63, LBB0_1
; %bb.5:
	mov	w8, #0
	str	xzr, [x21]
	cmp	w8, w19
	b.ne	LBB0_8
LBB0_6:
	ldr	w8, [x21]
	cmp	w8, w20
	b.ne	LBB0_8
; %bb.7:
	mov	w0, #0
	b	LBB0_14
LBB0_8:
	add	x25, x22, #8
	mov	x0, x25
	bl	_spin_lock_irqsave
	ldr	x8, [x22]
	ldr	x9, [x21, #8]
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #0
	bl	_writel
	ldr	x8, [x21, #8]
	ldr	x8, [x8, #8]
	mov	x0, x22
	mov	w1, #0
	blr	x8
	ldr	x8, [x21, #8]
	ldr	x8, [x8, #8]
	str	x22, [sp]                       ; 8-byte Folded Spill
	mov	x0, x22
	mov	w1, #1
	blr	x8
	mov	x0, x25
	bl	_spin_unlock_irqrestore
	str	w19, [sp, #12]                  ; 4-byte Folded Spill
	cbz	w19, LBB0_13
; %bb.9:
	mov	x25, #0
	ldr	x26, [x23]
	ldr	x8, [x24]
	ldr	w24, [x8]
	lsr	w27, w20, #2
	ldr	w9, [sp, #12]                   ; 4-byte Folded Reload
	sub	w8, w9, #1
	mov	w9, w9
	lsl	x28, x8, #5
	lsl	x22, x9, #5
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_cpu_to_le32
	str	x0, [x19, #8]
	add	w24, w24, w20
	add	x25, x25, #32
	cmp	x22, x25
	b.eq	LBB0_13
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x19, [x21, #24]
	mov	x0, x24
	bl	_cpu_to_le32
	add	x19, x19, x25
	stp	xzr, x0, [x19, #16]
	str	w27, [x19]
	sxtw	x8, w26
	add	x26, x8, #32
	mov	x0, x26
	cmp	x28, x25
	b.ne	LBB0_10
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	x0, [x23]
	b	LBB0_10
LBB0_13:
	ldr	w8, [x21, #16]
Lloh12:
	adrp	x9, _ATI_REG_LINKPTR_EN@GOTPAGE
Lloh13:
	ldr	x9, [x9, _ATI_REG_LINKPTR_EN@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w0, w9, w8
	ldr	x8, [sp]                        ; 8-byte Folded Reload
	ldr	x8, [x8]
	ldr	x9, [x21, #8]
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	mov	w0, #0
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	stp	w20, w8, [x21]
LBB0_14:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ATI_MAX_DESCRIPTORS,4,2        ; @ATI_MAX_DESCRIPTORS
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_SNDRV_DMA_TYPE_DEV,4,2         ; @SNDRV_DMA_TYPE_DEV
	.comm	_ATI_DESC_LIST_SIZE,4,2         ; @ATI_DESC_LIST_SIZE
	.comm	_ATI_REG_LINKPTR_EN,4,2         ; @ATI_REG_LINKPTR_EN
	.no_dead_strip	_atiixp_build_dma_packets
.subsections_via_symbols
