	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vortex_adbdma_resetup
_vortex_adbdma_resetup:                 ## @vortex_adbdma_resetup
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %rax
	movslq	%esi, %rsi
	leaq	(%rsi,%rsi,4), %rcx
	leaq	(%rax,%rcx,4), %r15
	shll	$2, %esi
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$4, %edi
	leal	-4(%r14,%rax), %eax
	cmovll	%edi, %eax
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	addl	-56(%rbp), %eax                 ## 4-byte Folded Reload
	movl	(%r13), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	shll	$2, %eax
	movslq	%eax, %r12
	movq	_VORTEX_ADBDMA_BUFBASE@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	addq	%r12, %rbx
	movl	16(%r15), %edi
	imull	12(%r15), %esi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_snd_pcm_sgbuf_get_addr
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	%rbx, %rsi
	movl	%eax, %edx
	callq	_hwwrite
	movl	(%r13), %edi
	movq	_VORTEX_ADBDMA_BUFBASE@GOTPCREL(%rip), %rax
	addq	(%rax), %r12
	movq	%r12, %rsi
	callq	_hwread
	incl	%r14d
	cmpl	$4, %r14d
	movl	$0, %ebx
	je	LBB0_6
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %ecx
	cmpl	%ecx, %r14d
	jge	LBB0_6
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	4(%r15), %esi
	leal	(%r14,%rsi), %eax
	cmpl	%ecx, %eax
	movl	%ecx, %eax
	cmovll	%ebx, %eax
	subl	%eax, %esi
	addl	%r14d, %esi
	movl	8(%r15), %eax
	leal	(%r14,%rax), %edi
	cmpl	$3, %ecx
	jg	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%ecx, %edi
	cmovll	%ebx, %ecx
	subl	%ecx, %eax
	addl	%r14d, %eax
	jmp	LBB0_5
LBB0_6:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VORTEX_ADBDMA_BUFBASE,8,3      ## @VORTEX_ADBDMA_BUFBASE
	.no_dead_strip	_vortex_adbdma_resetup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vortex_adbdma_resetup
_vortex_adbdma_resetup:                 ; @vortex_adbdma_resetup
	.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
	mov	x19, x0
	mov	w22, #0
	ldr	x8, [x0, #8]
	mov	w9, #20
	smaddl	x23, w1, w9, x8
	add	x9, x23, #4
	add	x8, x23, #8
	stp	x8, x9, [sp]                    ; 16-byte Folded Spill
	lsl	w26, w1, #2
	add	x27, x23, #16
	add	x28, x23, #12
Lloh0:
	adrp	x24, _VORTEX_ADBDMA_BUFBASE@GOTPAGE
Lloh1:
	ldr	x24, [x24, _VORTEX_ADBDMA_BUFBASE@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x23]
	cmp	w22, w8
	b.ge	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x9, [sp, #8]                    ; 8-byte Folded Reload
	ldr	w9, [x9]
	add	w10, w22, w9
	cmp	w10, w8
	csel	w10, wzr, w8, lt
	sub	w9, w9, w10
	add	w9, w22, w9
	ldr	x10, [sp]                       ; 8-byte Folded Reload
	ldr	w10, [x10]
	add	w11, w22, w10
	sub	w12, w11, #4
	cmp	w11, #3
	csel	w12, w12, w11, gt
	cmp	w11, w8
	csel	w11, wzr, w8, lt
	sub	w10, w10, w11
	add	w10, w22, w10
	cmp	w8, #3
	csel	w8, w12, w10, gt
	ldr	w20, [x19]
	ldr	x10, [x24]
	add	w8, w8, w26
	lsl	w8, w8, #2
	sxtw	x25, w8
	add	x21, x10, x25
	ldr	w0, [x27]
	ldr	w8, [x28]
	mul	w1, w8, w9
	bl	_snd_pcm_sgbuf_get_addr
	mov	x2, x0
	mov	x0, x20
	mov	x1, x21
	bl	_hwwrite
	ldr	w0, [x19]
	ldr	x8, [x24]
	add	x1, x8, x25
	bl	_hwread
	add	w22, w22, #1
	cmp	w22, #4
	b.ne	LBB0_1
LBB0_3:
	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 AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_VORTEX_ADBDMA_BUFBASE,8,3      ; @VORTEX_ADBDMA_BUFBASE
	.no_dead_strip	_vortex_adbdma_resetup
.subsections_via_symbols
