	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cs5535audio_build_dma_packets
_cs5535audio_build_dma_packets:         ## @cs5535audio_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_CS5535AUDIO_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, %r13d
	movl	%ecx, %r12d
	movq	%rsi, %rbx
	cmpq	$0, 32(%rsi)
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_4
## %bb.3:
	movl	4(%rbx), %eax
	cmpl	%r12d, %eax
	je	LBB0_7
	jmp	LBB0_8
LBB0_4:
	movl	%r13d, -48(%rbp)                ## 4-byte Spill
	leaq	24(%rbx), %r14
	movq	_SNDRV_DMA_TYPE_DEV@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	%rdi, %r15
	movl	4(%rdi), %edi
	callq	_snd_dma_pci_data
	movq	_CS5535AUDIO_DESC_LIST_SIZE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	incq	%rdx
	movl	%r13d, %edi
	movl	%eax, %esi
	movq	%r14, %rcx
	callq	_snd_dma_alloc_pages
	testq	%rax, %rax
	js	LBB0_1
## %bb.5:
	movq	$0, (%rbx)
	xorl	%eax, %eax
	movl	-48(%rbp), %r13d                ## 4-byte Reload
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	%r15, %rdi
	cmpl	%r12d, %eax
	jne	LBB0_8
LBB0_7:
	xorl	%eax, %eax
	cmpl	%r13d, (%rbx)
	je	LBB0_14
LBB0_8:
	testl	%r12d, %r12d
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	je	LBB0_9
## %bb.10:
	movq	(%rdx), %rax
	movl	(%rax), %r14d
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movl	%r12d, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	leaq	(,%rax,8), %rax
	leaq	(%rax,%rax,2), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	%r13d, %r12d
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	32(%rbx), %r15
	movl	%r14d, %edi
	callq	_cpu_to_le32
	movl	%eax, (%r15,%r13)
	movl	%r12d, %edi
	callq	_cpu_to_le32
	movq	%rax, 16(%r15,%r13)
	movq	_PRD_EOP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_le32
	movq	%rax, 8(%r15,%r13)
	addl	%r12d, %r14d
	addq	$24, %r13
	cmpq	%r13, -48(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_11
## %bb.12:
	movl	%r12d, %r13d
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_13
LBB0_9:
	xorl	%r15d, %r15d
LBB0_13:
	movq	32(%rbx), %r14
	movl	24(%rbx), %edi
	callq	_cpu_to_le32
	leaq	(%r15,%r15,2), %r15
	movl	%eax, (%r14,%r15,8)
	movq	$0, 16(%r14,%r15,8)
	movq	_PRD_JMP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_le32
	movq	%rax, 8(%r14,%r15,8)
	leal	(%r12,%r12,2), %edi
	shll	$3, %edi
	addl	(%r14,%r15,8), %edi
	callq	_cpu_to_le32
	movq	%rax, %r14
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 16(%rbx)
	movl	%r13d, (%rbx)
	movl	%r12d, 4(%rbx)
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	callq	_spin_lock_irq
	movq	8(%rbx), %rax
	movq	%r15, %rdi
	callq	*8(%rax)
	movq	8(%rbx), %rax
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	*(%rax)
	movq	%r15, %rdi
	callq	_spin_unlock_irq
	xorl	%eax, %eax
LBB0_14:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CS5535AUDIO_MAX_DESCRIPTORS,4,2 ## @CS5535AUDIO_MAX_DESCRIPTORS
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_SNDRV_DMA_TYPE_DEV,4,2         ## @SNDRV_DMA_TYPE_DEV
	.comm	_CS5535AUDIO_DESC_LIST_SIZE,8,3 ## @CS5535AUDIO_DESC_LIST_SIZE
	.comm	_PRD_EOP,4,2                    ## @PRD_EOP
	.comm	_PRD_JMP,4,2                    ## @PRD_JMP
	.no_dead_strip	_cs5535audio_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 cs5535audio_build_dma_packets
_cs5535audio_build_dma_packets:         ; @cs5535audio_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, _CS5535AUDIO_MAX_DESCRIPTORS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CS5535AUDIO_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	x22, x4
	mov	x21, x3
	mov	x27, x2
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x1, #32]
	cbz	x8, LBB0_4
; %bb.3:
	ldr	w8, [x20, #4]
	cmp	w8, w21
	b.eq	LBB0_6
	b	LBB0_7
LBB0_4:
	add	x24, x20, #24
Lloh6:
	adrp	x8, _SNDRV_DMA_TYPE_DEV@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SNDRV_DMA_TYPE_DEV@GOTPAGEOFF]
Lloh8:
	ldr	w25, [x8]
	ldr	w0, [x19, #4]
	bl	_snd_dma_pci_data
	mov	x1, x0
Lloh9:
	adrp	x8, _CS5535AUDIO_DESC_LIST_SIZE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CS5535AUDIO_DESC_LIST_SIZE@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	add	x2, x8, #1
	mov	x0, x25
	mov	x3, x24
	bl	_snd_dma_alloc_pages
	tbnz	x0, #63, LBB0_1
; %bb.5:
	mov	w8, #0
	str	xzr, [x20]
	cmp	w8, w21
	b.ne	LBB0_7
LBB0_6:
	ldr	w8, [x20]
	cmp	w8, w22
	b.eq	LBB0_13
LBB0_7:
	cbz	w21, LBB0_11
; %bb.8:
	mov	x26, #0
	str	x27, [sp, #8]                   ; 8-byte Folded Spill
	ldr	x8, [x27]
	ldr	w24, [x8]
	mov	w25, w21
	add	x8, x25, w21, uxtw #1
	lsl	x27, x8, #3
Lloh12:
	adrp	x28, _PRD_EOP@GOTPAGE
Lloh13:
	ldr	x28, [x28, _PRD_EOP@GOTPAGEOFF]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x23, [x20, #32]
	mov	x0, x24
	bl	_cpu_to_le32
	add	x23, x23, x26
	str	w0, [x23]
	mov	x0, x22
	bl	_cpu_to_le32
	str	x0, [x23, #16]
	ldr	w0, [x28]
	bl	_cpu_to_le32
	str	x0, [x23, #8]
	add	w24, w24, w22
	add	x26, x26, #24
	cmp	x27, x26
	b.ne	LBB0_9
; %bb.10:
	ldr	x27, [sp, #8]                   ; 8-byte Folded Reload
	b	LBB0_12
LBB0_11:
	mov	x25, #0
LBB0_12:
	ldr	x23, [x20, #32]
	ldr	w0, [x20, #24]
	bl	_cpu_to_le32
	mov	w24, #24
	madd	x23, x25, x24, x23
	str	w0, [x23]
	str	xzr, [x23, #16]
Lloh14:
	adrp	x8, _PRD_JMP@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PRD_JMP@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	_cpu_to_le32
	str	x0, [x23, #8]
	ldr	w8, [x23]
	madd	w0, w21, w24, w8
	bl	_cpu_to_le32
	mov	x24, x0
	str	x27, [x20, #16]
	stp	w22, w21, [x20]
	mov	x0, x19
	bl	_spin_lock_irq
	ldr	x8, [x20, #8]
	ldr	x8, [x8, #8]
	mov	x0, x19
	blr	x8
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	mov	x0, x19
	mov	x1, x24
	blr	x8
	mov	x0, x19
	bl	_spin_unlock_irq
LBB0_13:
	mov	w0, #0
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 AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_CS5535AUDIO_MAX_DESCRIPTORS,4,2 ; @CS5535AUDIO_MAX_DESCRIPTORS
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_SNDRV_DMA_TYPE_DEV,4,2         ; @SNDRV_DMA_TYPE_DEV
	.comm	_CS5535AUDIO_DESC_LIST_SIZE,8,3 ; @CS5535AUDIO_DESC_LIST_SIZE
	.comm	_PRD_EOP,4,2                    ; @PRD_EOP
	.comm	_PRD_JMP,4,2                    ; @PRD_JMP
	.no_dead_strip	_cs5535audio_build_dma_packets
.subsections_via_symbols
