	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function azx_via_get_position
_azx_via_get_position:                  ## @azx_via_get_position
	.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	%rsi, %r14
	movq	%rdi, %r13
	movq	_SD_LPIB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_azx_sd_readl
	movl	%eax, %r12d
	movq	24(%r14), %rax
	movq	(%rax), %rax
	movq	_SNDRV_PCM_STREAM_PLAYBACK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movl	%r12d, %ebx
	jmp	LBB0_12
LBB0_2:
	movq	16(%r14), %rax
	movl	(%rax), %edi
	callq	_le32_to_cpu
	xorl	%ebx, %ebx
	xorl	%edx, %edx
	divl	(%r14)
	movl	%edx, %r15d
	movq	_VIA_IN_STREAM0_FIFO_SIZE_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r13), %rdi
	callq	_readw
	movl	%eax, %ecx
	cmpq	$0, 8(%r14)
	je	LBB0_5
## %bb.3:
	cmpl	%ecx, %r12d
	jbe	LBB0_12
## %bb.4:
	movq	$0, 8(%r14)
LBB0_5:
	movl	%r12d, %ebx
	cmpl	%ecx, %r12d
	ja	LBB0_7
## %bb.6:
	movl	4(%r14), %ebx
	addl	%r12d, %ebx
LBB0_7:
	movl	(%r14), %esi
	movl	%r12d, %eax
	xorl	%edx, %edx
	divl	%esi
	cmpl	%ecx, %edx
	jae	LBB0_8
## %bb.9:
	subl	%ecx, %ebx
	xorl	%ecx, %ecx
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%esi
	subl	%edx, %ebx
	cmpl	%edx, %r15d
	jae	LBB0_11
## %bb.10:
	addl	%esi, %ebx
	cmpl	4(%r14), %ebx
	cmovael	%ecx, %ebx
	jmp	LBB0_11
LBB0_8:
	subl	%edx, %r12d
	movl	%r12d, %ebx
LBB0_11:
	addl	%r15d, %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SD_LPIB,4,2                    ## @SD_LPIB
	.comm	_SNDRV_PCM_STREAM_PLAYBACK,8,3  ## @SNDRV_PCM_STREAM_PLAYBACK
	.comm	_VIA_IN_STREAM0_FIFO_SIZE_OFFSET,8,3 ## @VIA_IN_STREAM0_FIFO_SIZE_OFFSET
	.no_dead_strip	_azx_via_get_position
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function azx_via_get_position
_azx_via_get_position:                  ; @azx_via_get_position
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x1
	mov	x23, x0
Lloh0:
	adrp	x8, _SD_LPIB@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SD_LPIB@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_azx_sd_readl
	mov	x20, x0
	ldr	x8, [x19, #24]
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _SNDRV_PCM_STREAM_PLAYBACK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SNDRV_PCM_STREAM_PLAYBACK@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_12
; %bb.1:
	mov	x21, x0
	ldr	x8, [x19, #16]
	ldr	w0, [x8]
	bl	_le32_to_cpu
	mov	x22, x0
	ldr	w24, [x19]
	ldr	x8, [x23]
Lloh6:
	adrp	x9, _VIA_IN_STREAM0_FIFO_SIZE_OFFSET@GOTPAGE
Lloh7:
	ldr	x9, [x9, _VIA_IN_STREAM0_FIFO_SIZE_OFFSET@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readw
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_4
; %bb.2:
	cmp	w21, w0
	b.ls	LBB0_11
; %bb.3:
	str	xzr, [x19, #8]
LBB0_4:
	udiv	w8, w22, w24
	cmp	w21, w0
	b.hi	LBB0_6
; %bb.5:
	ldr	w9, [x19, #4]
	add	w20, w9, w21
LBB0_6:
	msub	w8, w8, w24, w22
	ldr	w9, [x19]
	udiv	w10, w21, w9
	msub	w10, w10, w9, w21
	cmp	w10, w0
	b.hs	LBB0_9
; %bb.7:
	sub	w11, w20, w0
	udiv	w10, w11, w9
	mul	w10, w10, w9
	sub	w11, w11, w10
	cmp	w8, w11
	b.hs	LBB0_10
; %bb.8:
	ldr	w11, [x19, #4]
	add	w9, w10, w9
	cmp	w9, w11
	csel	w10, w9, wzr, lo
	b	LBB0_10
LBB0_9:
	sub	w10, w21, w10
LBB0_10:
	add	w20, w10, w8
	b	LBB0_12
LBB0_11:
	mov	w20, #0
LBB0_12:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_SD_LPIB,4,2                    ; @SD_LPIB
	.comm	_SNDRV_PCM_STREAM_PLAYBACK,8,3  ; @SNDRV_PCM_STREAM_PLAYBACK
	.comm	_VIA_IN_STREAM0_FIFO_SIZE_OFFSET,8,3 ; @VIA_IN_STREAM0_FIFO_SIZE_OFFSET
	.no_dead_strip	_azx_via_get_position
.subsections_via_symbols
