	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PsndDoDAC                      ## -- Begin function PsndDoDAC
	.p2align	4, 0x90
_PsndDoDAC:                             ## @PsndDoDAC
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_ym2612@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_PsndDacLine@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rdx
	cmpl	$311, %edi                      ## imm = 0x137
	movl	$311, %esi                      ## imm = 0x137
	cmovll	%edi, %esi
	leal	1(%rsi), %edi
	movl	%edi, (%rcx)
	movq	_dac_info@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx,%rdx,4), %r14d
	sarl	$4, %r14d
	movslq	%esi, %rdx
	movl	(%rcx,%rdx,4), %ebx
	movl	%ebx, %edi
	sarl	$4, %edi
	movl	%edi, %ecx
	subl	%r14d, %ecx
	movl	%ebx, %edx
	andl	$15, %edx
	addl	%edx, %ecx
	je	LBB0_23
## %bb.1:
	movq	_PicoOpt@GOTPCREL(%rip), %r8
	movq	_POPT_EN_STEREO@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	testl	%esi, (%r8)
	je	LBB0_10
## %bb.2:
	testl	%ecx, %ecx
	jle	LBB0_23
## %bb.3:
	movq	_PsndOut@GOTPCREL(%rip), %r8
	leal	(%r14,%r14), %esi
	movslq	%esi, %rsi
	addq	%rsi, %rsi
	addq	(%r8), %rsi
	addl	%edi, %edx
	movl	%r14d, %r8d
	notl	%r8d
	addl	%edx, %r8d
	testb	$7, %cl
	je	LBB0_7
## %bb.4:
	addb	%bl, %dil
	subb	%r14b, %dil
	movzbl	%dil, %edx
	andl	$7, %edx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movw	%ax, (%rsi)
	addq	$4, %rsi
	incq	%rdi
	cmpl	%edi, %edx
	jne	LBB0_5
## %bb.6:
	subl	%edi, %ecx
LBB0_7:
	cmpl	$7, %r8d
	jb	LBB0_23
## %bb.8:
	decl	%ecx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movw	%ax, (%rsi)
	movw	%ax, 4(%rsi)
	movw	%ax, 8(%rsi)
	movw	%ax, 12(%rsi)
	movw	%ax, 16(%rsi)
	movw	%ax, 20(%rsi)
	movw	%ax, 24(%rsi)
	movw	%ax, 28(%rsi)
	addl	$-8, %ecx
	addq	$32, %rsi
	cmpl	$-2, %ecx
	jb	LBB0_9
	jmp	LBB0_23
LBB0_10:
	testl	%ecx, %ecx
	jle	LBB0_23
## %bb.11:
	movq	_PsndOut@GOTPCREL(%rip), %rsi
	movq	(%rsi), %r8
	movslq	%r14d, %r9
	leaq	(%r8,%r9,2), %rsi
	addl	%edx, %edi
	notl	%r14d
	addl	%edi, %r14d
	cmpl	$15, %r14d
	jb	LBB0_21
## %bb.12:
	incq	%r14
	movq	%r14, %r10
	andq	$-16, %r10
	movd	%eax, %xmm0
	pshuflw	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0,4,5,6,7]
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	leaq	-16(%r10), %rdx
	movq	%rdx, %rdi
	shrq	$4, %rdi
	incq	%rdi
	movl	%edi, %r11d
	andl	$7, %r11d
	cmpq	$112, %rdx
	jae	LBB0_14
## %bb.13:
	xorl	%edx, %edx
	jmp	LBB0_16
LBB0_14:
	andq	$-8, %rdi
	leaq	(%r8,%r9,2), %rbx
	addq	$240, %rbx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, -240(%rbx,%rdx,2)
	movdqu	%xmm0, -224(%rbx,%rdx,2)
	movdqu	%xmm0, -208(%rbx,%rdx,2)
	movdqu	%xmm0, -192(%rbx,%rdx,2)
	movdqu	%xmm0, -176(%rbx,%rdx,2)
	movdqu	%xmm0, -160(%rbx,%rdx,2)
	movdqu	%xmm0, -144(%rbx,%rdx,2)
	movdqu	%xmm0, -128(%rbx,%rdx,2)
	movdqu	%xmm0, -112(%rbx,%rdx,2)
	movdqu	%xmm0, -96(%rbx,%rdx,2)
	movdqu	%xmm0, -80(%rbx,%rdx,2)
	movdqu	%xmm0, -64(%rbx,%rdx,2)
	movdqu	%xmm0, -48(%rbx,%rdx,2)
	movdqu	%xmm0, -32(%rbx,%rdx,2)
	movdqu	%xmm0, -16(%rbx,%rdx,2)
	movdqu	%xmm0, (%rbx,%rdx,2)
	subq	$-128, %rdx
	addq	$-8, %rdi
	jne	LBB0_15
LBB0_16:
	testq	%r11, %r11
	je	LBB0_19
## %bb.17:
	addq	%r9, %rdx
	leaq	(%r8,%rdx,2), %rdx
	addq	$16, %rdx
	shlq	$5, %r11
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, -16(%rdx,%rdi)
	movdqu	%xmm0, (%rdx,%rdi)
	addq	$32, %rdi
	cmpq	%rdi, %r11
	jne	LBB0_18
LBB0_19:
	cmpq	%r10, %r14
	je	LBB0_23
## %bb.20:
	leaq	(%rsi,%r10,2), %rsi
	subl	%r10d, %ecx
LBB0_21:
	incl	%ecx
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movw	%ax, (%rsi)
	addq	$2, %rsi
	decl	%ecx
	cmpl	$1, %ecx
	ja	LBB0_22
LBB0_23:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ym2612,4,2                     ## @ym2612
	.comm	_PsndDacLine,4,2                ## @PsndDacLine
	.comm	_dac_info,8,3                   ## @dac_info
	.comm	_PicoOpt,4,2                    ## @PicoOpt
	.comm	_POPT_EN_STEREO,4,2             ## @POPT_EN_STEREO
	.comm	_PsndOut,8,3                    ## @PsndOut
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PsndDoDAC                      ; -- Begin function PsndDoDAC
	.p2align	2
_PsndDoDAC:                             ; @PsndDoDAC
	.cfi_startproc
; %bb.0:
Lloh0:
	adrp	x8, _ym2612@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ym2612@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _PsndDacLine@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PsndDacLine@GOTPAGEOFF]
	ldrsw	x10, [x9]
	mov	w11, #311
	cmp	w0, #311
	csel	w12, w0, w11, lt
	add	w11, w12, #1
	str	w11, [x9]
Lloh5:
	adrp	x9, _dac_info@GOTPAGE
Lloh6:
	ldr	x9, [x9, _dac_info@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	ldr	w10, [x9, x10, lsl #2]
	asr	w11, w10, #4
	ldr	w9, [x9, w12, sxtw #2]
	asr	w12, w9, #4
	and	w13, w9, #0xf
	sub	w9, w12, w11
	adds	w9, w9, w13
	b.eq	LBB0_16
; %bb.1:
Lloh8:
	adrp	x10, _PicoOpt@GOTPAGE
Lloh9:
	ldr	x10, [x10, _PicoOpt@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
Lloh11:
	adrp	x14, _POPT_EN_STEREO@GOTPAGE
Lloh12:
	ldr	x14, [x14, _POPT_EN_STEREO@GOTPAGEOFF]
Lloh13:
	ldr	w14, [x14]
	tst	w14, w10
	b.eq	LBB0_9
; %bb.2:
	cmp	w9, #1
	b.lt	LBB0_16
; %bb.3:
Lloh14:
	adrp	x10, _PsndOut@GOTPAGE
Lloh15:
	ldr	x10, [x10, _PsndOut@GOTPAGEOFF]
Lloh16:
	ldr	x14, [x10]
	add	x10, x14, w11, sxtw #2
	mvn	w15, w11
	add	w12, w12, w13
	add	w12, w12, w15
	cmp	w12, #3
	b.lo	LBB0_7
; %bb.4:
	sbfiz	x13, x11, #1, #32
	add	x11, x12, #1
	and	x12, x11, #0x1fffffffc
	add	x10, x10, x12, lsl #2
	sub	w9, w9, w12
	add	x13, x14, x13, lsl #1
	add	x13, x13, #8
	mov	x14, x12
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	sturh	w8, [x13, #-8]
	sturh	w8, [x13, #-4]
	strh	w8, [x13]
	strh	w8, [x13, #4]
	add	x13, x13, #16
	subs	x14, x14, #4
	b.ne	LBB0_5
; %bb.6:
	cmp	x11, x12
	b.eq	LBB0_16
LBB0_7:
	add	w9, w9, #1
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	strh	w8, [x10], #4
	sub	w9, w9, #1
	cmp	w9, #1
	b.hi	LBB0_8
	b	LBB0_16
LBB0_9:
	cmp	w9, #1
	b.lt	LBB0_16
; %bb.10:
Lloh17:
	adrp	x10, _PsndOut@GOTPAGE
Lloh18:
	ldr	x10, [x10, _PsndOut@GOTPAGEOFF]
Lloh19:
	ldr	x14, [x10]
	add	x10, x14, w11, sxtw #1
	mvn	w15, w11
	add	w12, w12, w13
	add	w12, w12, w15
	cmp	w12, #31
	b.lo	LBB0_14
; %bb.11:
                                        ; kill: def $w11 killed $w11 killed $x11 def $x11
	sxtw	x13, w11
	add	x11, x12, #1
	and	x12, x11, #0x1ffffffe0
	add	x10, x10, x12, lsl #1
	sub	w9, w9, w12
	dup.8h	v0, w8
	add	x13, x14, x13, lsl #1
	add	x13, x13, #32
	mov	x14, x12
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	stp	q0, q0, [x13, #-32]
	stp	q0, q0, [x13], #64
	subs	x14, x14, #32
	b.ne	LBB0_12
; %bb.13:
	cmp	x11, x12
	b.eq	LBB0_16
LBB0_14:
	add	w9, w9, #1
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	strh	w8, [x10], #2
	sub	w9, w9, #1
	cmp	w9, #1
	b.hi	LBB0_15
LBB0_16:
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_ym2612,4,2                     ; @ym2612
	.comm	_PsndDacLine,4,2                ; @PsndDacLine
	.comm	_dac_info,8,3                   ; @dac_info
	.comm	_PicoOpt,4,2                    ; @PicoOpt
	.comm	_POPT_EN_STEREO,4,2             ; @POPT_EN_STEREO
	.comm	_PsndOut,8,3                    ; @PsndOut
.subsections_via_symbols
