	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ym_flush_writes
_ym_flush_writes:                       ## @ym_flush_writes
	.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	_shared_ctl@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	xorl	%ecx, %ecx
	cmpl	$1, (%rax)
	setne	%cl
	movq	8(%rax,%rcx,8), %r14
	movl	$2049, %ebx                     ## imm = 0x801
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	addq	$4, %r14
	decl	%ebx
	cmpl	$1, %ebx
	jbe	LBB0_5
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %esi
	cmpl	$65534, %esi                    ## imm = 0xFFFE
	je	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$65535, %esi                    ## imm = 0xFFFF
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%esi, %edi
	sarl	$8, %edi
	callq	_YM2612Write_
	jmp	LBB0_4
LBB0_5:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_shared_ctl,8,3                 ## @shared_ctl
	.no_dead_strip	_ym_flush_writes
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ym_flush_writes
_ym_flush_writes:                       ; @ym_flush_writes
	.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
Lloh0:
	adrp	x8, _shared_ctl@GOTPAGE
Lloh1:
	ldr	x8, [x8, _shared_ctl@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	w9, [x8]
	cmp	w9, #1
	mov	w9, #16
	mov	w10, #8
	csel	x9, x10, x9, eq
	ldr	x19, [x8, x9]
	mov	w20, #2049
	mov	w21, #65534
	mov	w22, #65535
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	sub	w20, w20, #1
	cmp	w20, #1
	b.ls	LBB0_5
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x19], #4
	cmp	w1, w21
	b.eq	LBB0_1
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	cmp	w1, w22
	b.eq	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	asr	w0, w1, #8
	bl	_YM2612Write_
	b	LBB0_1
LBB0_5:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_shared_ctl,8,3                 ; @shared_ctl
	.no_dead_strip	_ym_flush_writes
.subsections_via_symbols
