	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pcd_pcm_sync                   ## -- Begin function pcd_pcm_sync
	.p2align	4, 0x90
_pcd_pcm_sync:                          ## @pcd_pcm_sync
	.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
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_Pico_mcd@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	32(%rbx), %edx
	subl	%edx, %edi
	cmpl	$384, %edi                      ## imm = 0x180
	jl	LBB0_15
## %bb.1:
	movl	%edi, %eax
	movl	$2863311531, %ecx               ## imm = 0xAAAAAAAB
	imulq	%rax, %rcx
	shrq	$40, %rcx
	movl	(%rbx), %edi
	leal	(%rdi,%rcx), %r8d
	movq	_PCM_MIXBUF_LEN@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	movl	%esi, %r9d
	subl	%edi, %r9d
	cmpl	%esi, %r8d
	cmovlel	%ecx, %r9d
	movsbl	40(%rbx), %ecx
	sarl	$7, %ecx
	andl	36(%rbx), %ecx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	jne	LBB0_3
## %bb.2:
	cmpq	$0, 56(%rbx)
	je	LBB0_14
LBB0_3:
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movslq	%edi, %rcx
	movl	$1, 16(%rbx)
	movq	$0, 56(%rbx)
	movq	8(%rbx), %rdx
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	48(%rbx), %rbx
	movslq	%r9d, %r15
	leaq	(%rdx,%rcx,8), %rsi
	addq	$4, %rsi
	xorl	%edi, %edi
	movq	_PCM_STEP_SHIFT@GOTPCREL(%rip), %r12
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%r9, -72(%rbp)                  ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	%edx, (%rax)
	movq	-72(%rbp), %r9                  ## 8-byte Reload
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	incq	%rdi
	cmpq	$8, %rdi
	je	LBB0_13
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	movq	%rdi, %rcx
	shlq	$4, %rcx
	leaq	(%rbx,%rcx), %rax
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	btl	%edi, %edx
	jae	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	(%rax), %edx
	testl	%r9d, %r9d
	jle	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	8(%rbx,%rcx), %r13
	movl	(%r13), %ecx
	movl	4(%r13), %ebx
	movl	%ebx, %r8d
	andl	$15, %r8d
	imull	%ecx, %r8d
	sarl	$6, %r8d
	sarl	$4, %ebx
	imull	%ecx, %ebx
	sarl	$6, %ebx
	movzwl	8(%r13), %r9d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	24(%rax), %r10
	xorl	%r11d, %r11d
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=2
	movl	%r14d, %eax
	andl	$127, %eax
	negl	%eax
	testb	$-128, %r14b
	cmovel	%r14d, %eax
	movl	%eax, %ecx
	imull	%r8d, %ecx
	addl	%ecx, -4(%rsi,%r11,8)
	imull	%ebx, %eax
	addl	%eax, (%rsi,%r11,8)
	incq	%r11
	addl	%r9d, %edx
	andl	$134217727, %edx                ## imm = 0x7FFFFFF
	cmpq	%r15, %r11
	jge	LBB0_11
LBB0_8:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r12), %ecx
	movl	%edx, %eax
	shrq	%cl, %rax
	movl	(%r10,%rax,4), %r14d
	cmpl	$255, %r14d
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=2
	movzwl	16(%r13), %edx
	movl	(%r10,%rdx,4), %r14d
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %edx
	cmpl	$255, %r14d
	jne	LBB0_10
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	8(%rbx,%rcx), %rcx
	movl	24(%rcx), %edx
	movb	(%r12), %cl
	addb	$8, %cl
	shll	%cl, %edx
	movl	%edx, (%rax)
	jmp	LBB0_12
LBB0_13:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %edi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
LBB0_14:
	leal	(%r9,%r9,2), %ecx
	shll	$7, %ecx
	addl	%edx, %ecx
	movl	%ecx, 32(%rbx)
	addl	%r9d, %edi
	movl	%edi, (%rbx)
LBB0_15:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_Pico_mcd,8,3                   ## @Pico_mcd
	.comm	_PCM_MIXBUF_LEN,4,2             ## @PCM_MIXBUF_LEN
	.comm	_PCM_STEP_SHIFT,4,2             ## @PCM_STEP_SHIFT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pcd_pcm_sync                   ; -- Begin function pcd_pcm_sync
	.p2align	2
_pcd_pcm_sync:                          ; @pcd_pcm_sync
	.cfi_startproc
; %bb.0:
Lloh0:
	adrp	x8, _Pico_mcd@GOTPAGE
Lloh1:
	ldr	x8, [x8, _Pico_mcd@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	w9, [x8, #32]
	sub	w10, w0, w9
	cmp	w10, #384
	b.lt	LBB0_15
; %bb.1:
	mov	w11, #43691
	movk	w11, #43690, lsl #16
	umull	x10, w10, w11
	lsr	x10, x10, #40
	ldr	w13, [x8]
Lloh3:
	adrp	x11, _PCM_MIXBUF_LEN@GOTPAGE
Lloh4:
	ldr	x11, [x11, _PCM_MIXBUF_LEN@GOTPAGEOFF]
Lloh5:
	ldr	w11, [x11]
	sub	w12, w11, w13
	add	w14, w13, w10
	cmp	w14, w11
	csel	w10, w12, w10, gt
	ldr	w11, [x8, #36]
	ldrb	w12, [x8, #40]
	lsl	w12, w12, #24
	ands	w11, w11, w12, asr #31
	b.ne	LBB0_3
; %bb.2:
	ldr	x12, [x8, #56]
	cbz	x12, LBB0_14
LBB0_3:
	mov	x12, #0
	sxtw	x13, w13
	ldr	x14, [x8, #8]
	add	x13, x14, x13, lsl #3
	mov	w14, #1
	str	w14, [x8, #16]
	str	xzr, [x8, #56]
	ldr	x14, [x8, #48]
	sxtw	x15, w10
Lloh6:
	adrp	x16, _PCM_STEP_SHIFT@GOTPAGE
Lloh7:
	ldr	x16, [x16, _PCM_STEP_SHIFT@GOTPAGEOFF]
	movi.2s	v0, #15
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	str	w2, [x17]
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x12, x12, #1
	cmp	x12, #8
	b.eq	LBB0_13
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	lsr	w0, w11, w12
	add	x17, x14, x12, lsl #4
	tbz	w0, #0, LBB0_12
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w2, [x17]
	ldr	x0, [x17, #8]
	ldrh	w1, [x0, #8]
	mov	x4, x0
	ld1r.2s	{ v1 }, [x4], #4
	cmp	w10, #1
	b.lt	LBB0_4
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x3, #0
	ldr	w4, [x4]
	dup.2s	v2, w4
	fmov	s3, w4
	and.8b	v3, v3, v0
	sshr.2s	v2, v2, #4
	mov.s	v3[1], v2[1]
	mul.2s	v1, v3, v1
	sshr.2s	v1, v1, #6
	ldr	x4, [x8, #24]
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=2
	and	w6, w5, #0x7f
	tst	w5, #0x80
	csneg	w5, w5, w6, eq
	dup.2s	v2, w5
	lsl	x5, x3, #3
	ldr	d3, [x13, x5]
	mla.2s	v3, v2, v1
	str	d3, [x13, x5]
	add	x3, x3, #1
	add	w2, w2, w1
	and	w2, w2, #0x7ffffff
	cmp	x3, x15
	b.ge	LBB0_4
LBB0_10:                                ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w6, [x16]
	mov	w5, w2
	lsr	x5, x5, x6
	ldr	w5, [x4, x5, lsl #2]
	cmp	w5, #255
	b.ne	LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	ldrh	w2, [x0, #16]
	ldr	w5, [x4, x2, lsl #2]
	lsl	w2, w2, w6
	cmp	w5, #255
	b.ne	LBB0_9
	b	LBB0_4
LBB0_12:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x0, [x17, #8]
	ldr	w0, [x0, #24]
	ldr	w1, [x16]
	add	w1, w1, #8
	lsl	w0, w0, w1
	str	w0, [x17]
	b	LBB0_5
LBB0_13:
	ldr	w13, [x8]
LBB0_14:
	mov	w11, #384
	madd	w9, w10, w11, w9
	str	w9, [x8, #32]
	add	w9, w13, w10
	str	w9, [x8]
LBB0_15:
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_Pico_mcd,8,3                   ; @Pico_mcd
	.comm	_PCM_MIXBUF_LEN,4,2             ; @PCM_MIXBUF_LEN
	.comm	_PCM_STEP_SHIFT,4,2             ; @PCM_STEP_SHIFT
.subsections_via_symbols
