	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pcd_pcm_write                  ## -- Begin function pcd_pcm_write
	.p2align	4, 0x90
_pcd_pcm_write:                         ## @pcd_pcm_write
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movl	%edi, %ebx
	xorl	%eax, %eax
	callq	_SekCyclesDoneS68k
	movq	_Pico_mcd@GOTPCREL(%rip), %r15
	movq	(%r15), %rcx
	movl	%eax, %edx
	subl	8(%rcx), %edx
	cmpl	$384, %edx                      ## imm = 0x180
	jl	LBB0_2
## %bb.1:
	movl	%eax, %edi
	callq	_pcd_pcm_sync
LBB0_2:
	cmpl	$6, %ebx
	ja	LBB0_4
## %bb.3:
	movq	(%r15), %rax
	movq	16(%rax), %rcx
	movq	40(%rax), %rax
	movq	(%rax,%rcx,8), %rax
	movl	%ebx, %ecx
	movl	%r14d, (%rax,%rcx,4)
	jmp	LBB0_11
LBB0_4:
	cmpl	$8, %ebx
	je	LBB0_10
## %bb.5:
	cmpl	$7, %ebx
	jne	LBB0_11
## %bb.6:
	testb	$64, %r14b
	jne	LBB0_7
## %bb.8:
	movl	%r14d, %ecx
	andl	$15, %ecx
	movq	(%r15), %rax
	movl	%ecx, 24(%rax)
	jmp	LBB0_9
LBB0_10:
	notl	%r14d
	movq	(%r15), %rax
	movl	%r14d, 32(%rax)
	jmp	LBB0_11
LBB0_7:
	movl	%r14d, %ecx
	andl	$7, %ecx
	movq	(%r15), %rax
	movq	%rcx, 16(%rax)
LBB0_9:
	movl	%r14d, 28(%rax)
	movq	_EL_CD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	callq	_elprintf
LBB0_11:
	movq	(%r15), %rax
	movl	$1, (%rax)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_Pico_mcd,8,3                   ## @Pico_mcd
	.comm	_EL_CD,4,2                      ## @EL_CD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pcm control %02x"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pcd_pcm_write                  ; -- Begin function pcd_pcm_write
	.p2align	2
_pcd_pcm_write:                         ; @pcd_pcm_write
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x1
	mov	x20, x0
	bl	_SekCyclesDoneS68k
Lloh0:
	adrp	x21, _Pico_mcd@GOTPAGE
Lloh1:
	ldr	x21, [x21, _Pico_mcd@GOTPAGEOFF]
	ldr	x8, [x21]
	ldr	w8, [x8, #8]
	sub	w8, w0, w8
	cmp	w8, #384
	b.lt	LBB0_2
; %bb.1:
	bl	_pcd_pcm_sync
LBB0_2:
	cmp	w20, #6
	b.hi	LBB0_4
; %bb.3:
	ldr	x8, [x21]
	ldr	x9, [x8, #40]
	ldr	x8, [x8, #16]
	ldr	x8, [x9, x8, lsl #3]
	str	w19, [x8, w20, uxtw #2]
	b	LBB0_11
LBB0_4:
	cmp	w20, #8
	b.eq	LBB0_8
; %bb.5:
	cmp	w20, #7
	b.ne	LBB0_11
; %bb.6:
	tbnz	w19, #6, LBB0_9
; %bb.7:
	and	w9, w19, #0xf
	ldr	x8, [x21]
	str	w9, [x8, #24]
	b	LBB0_10
LBB0_8:
	mvn	w8, w19
	ldr	x9, [x21]
	str	w8, [x9, #32]
	b	LBB0_11
LBB0_9:
	and	w9, w19, #0x7
	ldr	x8, [x21]
	str	x9, [x8, #16]
LBB0_10:
	str	w19, [x8, #28]
Lloh2:
	adrp	x8, _EL_CD@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EL_CD@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_elprintf
LBB0_11:
	ldr	x8, [x21]
	mov	w9, #1
	str	w9, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_Pico_mcd,8,3                   ; @Pico_mcd
	.comm	_EL_CD,4,2                      ; @EL_CD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pcm control %02x"

.subsections_via_symbols
