	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ym_update
_ym_update:                             ## @ym_update
	.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	%rdi, %r14
	movq	_shared_ctl@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	xorl	%ecx, %ecx
	cmpl	$1, (%rax)
	setne	%cl
	movq	8(%rax,%rcx,8), %r12
	addq	$4, %r12
	movl	$1024, %r15d                    ## imm = 0x400
	movl	$2049, %r13d                    ## imm = 0x801
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	-4(%r12), %ebx
	cmpl	$65534, %ebx                    ## imm = 0xFFFE
	je	LBB0_5
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$65535, %ebx                    ## imm = 0xFFFF
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%ebx, %edi
	sarl	$8, %edi
	movl	%ebx, %esi
	callq	_YM2612Write_
	movl	%ebx, %esi
	sarl	$16, %esi
	sarl	$24, %ebx
	movl	%ebx, %edi
	callq	_YM2612Write_
	leal	-1(%r15), %eax
	addq	$8, %r12
	addl	$-2, %r13d
	cmpl	$1, %r15d
	movl	%eax, %r15d
	ja	LBB0_1
LBB0_4:
	movq	_shared_ctl@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movl	24(%rax), %esi
	movq	32(%rax), %rdx
	movq	%r14, %rdi
	jmp	LBB0_10
LBB0_5:
	movq	_shared_ctl@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	24(%rax), %ecx
	movl	%ecx, %ebx
	shrl	$31, %ebx
	addl	%ecx, %ebx
	sarl	%ebx
	movq	32(%rax), %rdx
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	$1, %ecx
	callq	_YM2612UpdateOne_
	movq	_shared_ctl@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	movq	%rax, 40(%rsi)
	testl	%r15d, %r15d
	movq	%rcx, %r15
	jle	LBB0_9
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %esi
	cmpl	$65535, %esi                    ## imm = 0xFFFF
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	%esi, %edi
	sarl	$8, %edi
	callq	_YM2612Write_
	addq	$4, %r12
	decl	%r13d
	cmpl	$1, %r13d
	jg	LBB0_6
LBB0_8:
	movq	(%r15), %rsi
LBB0_9:
	movq	32(%rsi), %rdx
	testq	%rdx, %rdx
	setne	%cl
	movl	%ebx, %eax
	shll	%cl, %eax
	cltq
	leaq	(%r14,%rax,4), %rdi
	movl	24(%rsi), %esi
	subl	%ebx, %esi
LBB0_10:
	movl	$1, %ecx
	callq	_YM2612UpdateOne_
	movq	(%r15), %rcx
	movq	%rax, 40(%rcx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_shared_ctl,8,3                 ## @shared_ctl
	.no_dead_strip	_ym_update
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ym_update
_ym_update:                             ; @ym_update
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
Lloh0:
	adrp	x21, _shared_ctl@GOTPAGE
Lloh1:
	ldr	x21, [x21, _shared_ctl@GOTPAGEOFF]
	ldr	x8, [x21]
	ldr	w9, [x8]
	cmp	w9, #1
	mov	w9, #16
	mov	w10, #8
	csel	x9, x10, x9, eq
	ldr	x22, [x8, x9]
	mov	w24, #1024
	mov	w23, #2049
	mov	w25, #65534
	mov	w26, #65535
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w20, [x22]
	cmp	w20, w25
	b.eq	LBB0_5
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	cmp	w20, w26
	b.eq	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	asr	w0, w20, #8
	mov	x1, x20
	bl	_YM2612Write_
	asr	w1, w20, #16
	add	x22, x22, #8
	asr	w0, w20, #24
	bl	_YM2612Write_
	sub	w23, w23, #2
	subs	w24, w24, #1
	b.hi	LBB0_1
LBB0_4:
	ldr	x8, [x21]
	ldr	w1, [x8, #24]
	ldr	x2, [x8, #32]
	mov	x0, x19
	b	LBB0_11
LBB0_5:
	ldr	x8, [x21]
	ldr	w9, [x8, #24]
	cmp	w9, #0
	cinc	w9, w9, lt
	asr	w20, w9, #1
	ldr	x2, [x8, #32]
	mov	x0, x19
	mov	x1, x20
	mov	w3, #1
	bl	_YM2612UpdateOne_
	ldr	x8, [x21]
	str	x0, [x8, #40]
	cmp	w24, #1
	b.lt	LBB0_10
; %bb.6:
	mov	w24, #4
	mov	w25, #65535
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22, x24]
	cmp	w1, w25
	b.eq	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	asr	w0, w1, #8
	bl	_YM2612Write_
	add	x24, x24, #4
	sub	w23, w23, #1
	cmp	w23, #1
	b.gt	LBB0_7
LBB0_9:
	ldr	x8, [x21]
LBB0_10:
	ldr	x2, [x8, #32]
	cmp	x2, #0
	cset	w9, ne
	lsl	w9, w20, w9
	add	x0, x19, w9, sxtw #2
	ldr	w8, [x8, #24]
	sub	w1, w8, w20
LBB0_11:
	mov	w3, #1
	bl	_YM2612UpdateOne_
	ldr	x8, [x21]
	str	x0, [x8, #40]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_shared_ctl,8,3                 ; @shared_ctl
	.no_dead_strip	_ym_update
.subsections_via_symbols
