	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aica_dma_transfer
_aica_dma_transfer:                     ## @aica_dma_transfer
	.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	%rdx, %rcx
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movl	%edi, %r15d
	movq	8(%rdx), %rax
	movq	(%rax), %rax
	movl	(%rax), %esi
	movq	_AICA_PERIOD_NUMBER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cltd
	idivl	%edi
	movl	%eax, %edi
	movl	%esi, %eax
	cltd
	idivl	%edi
	testl	%r15d, %r15d
	jle	LBB0_1
## %bb.2:
	movq	(%rcx), %r12
	xorl	%ebx, %ebx
	movslq	%edx, %r14
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	callq	_local_irq_save
	movq	_AICA_DMA_CHANNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_AICA_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	%ebx, %eax
	cltd
	idivl	%r15d
	movslq	%eax, %rsi
	addq	(%r12), %rsi
	movq	_AICA_PERIOD_SIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rcx
	imulq	%r14, %rcx
	addq	%rcx, %rsi
	movq	_CHANNEL_OFFSET@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movslq	%ebx, %rdx
	imulq	%rax, %rdx
	movq	_AICA_CHANNEL0_OFFSET@GOTPCREL(%rip), %rax
	addq	(%rax), %rcx
	addq	%rdx, %rcx
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	cltd
	idivl	%r15d
	movq	_AICA_DMA_MODE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r8d
	movq	%rcx, %rdx
	movl	%eax, %ecx
	callq	_dma_xfer
	movl	%eax, %r13d
	movl	%eax, %edi
	shrl	$31, %edi
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_AICA_DMA_CHANNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_dma_wait_for_completion
	callq	_local_irq_restore
	incl	%ebx
	cmpl	%ebx, %r15d
	jne	LBB0_3
	jmp	LBB0_6
LBB0_1:
	xorl	%r13d, %r13d
	jmp	LBB0_6
LBB0_4:
	callq	_local_irq_restore
LBB0_6:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AICA_PERIOD_NUMBER,4,2         ## @AICA_PERIOD_NUMBER
	.comm	_AICA_DMA_CHANNEL,4,2           ## @AICA_DMA_CHANNEL
	.comm	_AICA_BUFFER_SIZE,4,2           ## @AICA_BUFFER_SIZE
	.comm	_AICA_PERIOD_SIZE,4,2           ## @AICA_PERIOD_SIZE
	.comm	_AICA_CHANNEL0_OFFSET,8,3       ## @AICA_CHANNEL0_OFFSET
	.comm	_CHANNEL_OFFSET,4,2             ## @CHANNEL_OFFSET
	.comm	_AICA_DMA_MODE,4,2              ## @AICA_DMA_MODE
	.no_dead_strip	_aica_dma_transfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aica_dma_transfer
_aica_dma_transfer:                     ; @aica_dma_transfer
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	cmp	w0, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x19, x0
	mov	w22, #0
	ldp	x23, x8, [x2]
	ldr	x8, [x8]
	ldr	w8, [x8]
Lloh0:
	adrp	x9, _AICA_PERIOD_NUMBER@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AICA_PERIOD_NUMBER@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	sdiv	w9, w9, w0
	sdiv	w10, w8, w9
	msub	w8, w10, w9, w8
Lloh3:
	adrp	x24, _AICA_DMA_CHANNEL@GOTPAGE
Lloh4:
	ldr	x24, [x24, _AICA_DMA_CHANNEL@GOTPAGEOFF]
Lloh5:
	adrp	x27, _AICA_CHANNEL0_OFFSET@GOTPAGE
Lloh6:
	ldr	x27, [x27, _AICA_CHANNEL0_OFFSET@GOTPAGEOFF]
	sxtw	x28, w8
Lloh7:
	adrp	x25, _CHANNEL_OFFSET@GOTPAGE
Lloh8:
	ldr	x25, [x25, _CHANNEL_OFFSET@GOTPAGEOFF]
	sdiv	w20, w1, w0
Lloh9:
	adrp	x26, _AICA_DMA_MODE@GOTPAGE
Lloh10:
	ldr	x26, [x26, _AICA_DMA_MODE@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	bl	_local_irq_save
	ldr	w0, [x24]
	ldr	x8, [x23]
Lloh11:
	adrp	x9, _AICA_BUFFER_SIZE@GOTPAGE
Lloh12:
	ldr	x9, [x9, _AICA_BUFFER_SIZE@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	mul	w9, w9, w22
	sdiv	w9, w9, w19
	add	x8, x8, w9, sxtw
Lloh14:
	adrp	x9, _AICA_PERIOD_SIZE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _AICA_PERIOD_SIZE@GOTPAGEOFF]
Lloh16:
	ldrsw	x9, [x9]
	mul	x9, x9, x28
	add	x1, x8, x9
	ldr	x8, [x27]
	ldrsw	x10, [x25]
	sxtw	x11, w22
	add	x8, x8, x9
	madd	x2, x10, x11, x8
	ldr	w4, [x26]
	mov	x3, x20
	bl	_dma_xfer
	mov	x21, x0
	lsr	w0, w0, #31
	bl	_unlikely
	cbnz	x0, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x24]
	bl	_dma_wait_for_completion
	bl	_local_irq_restore
	add	w22, w22, #1
	cmp	w19, w22
	b.ne	LBB0_2
	b	LBB0_6
LBB0_4:
	mov	w21, #0
	b	LBB0_6
LBB0_5:
	bl	_local_irq_restore
LBB0_6:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_AICA_PERIOD_NUMBER,4,2         ; @AICA_PERIOD_NUMBER
	.comm	_AICA_DMA_CHANNEL,4,2           ; @AICA_DMA_CHANNEL
	.comm	_AICA_BUFFER_SIZE,4,2           ; @AICA_BUFFER_SIZE
	.comm	_AICA_PERIOD_SIZE,4,2           ; @AICA_PERIOD_SIZE
	.comm	_AICA_CHANNEL0_OFFSET,8,3       ; @AICA_CHANNEL0_OFFSET
	.comm	_CHANNEL_OFFSET,4,2             ; @CHANNEL_OFFSET
	.comm	_AICA_DMA_MODE,4,2              ; @AICA_DMA_MODE
	.no_dead_strip	_aica_dma_transfer
.subsections_via_symbols
