	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_YM2612UpdateOne_940            ## -- Begin function YM2612UpdateOne_940
	.p2align	4, 0x90
_YM2612UpdateOne_940:                   ## @YM2612UpdateOne_940
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r13d
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, %ebx
	movq	%rdi, %r12
	movq	_shared_data@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_JOB940_YM2612UPDATEONE@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_CHECK_BUSY
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	(%r14), %edi
	callq	_wait_busy_940
LBB0_2:
	movq	_shared_ctl@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movl	(%rax), %r15d
	movl	%ebx, %edx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %edx
	testl	%r13d, %r13d
	je	LBB0_5
## %bb.3:
	testl	%r15d, %r15d
	je	LBB0_5
## %bb.4:
	movq	%r12, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_memcpy32
	jmp	LBB0_6
LBB0_5:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_memset32
LBB0_6:
	movq	(%r14), %rax
	xorl	%ecx, %ecx
	cmpl	$1, 4(%rax)
	setne	%cl
	movq	8(%rax,%rcx,8), %rcx
	movq	_writebuff_ptr@GOTPCREL(%rip), %rdx
	movzwl	(%rdx), %esi
	movl	$65535, (%rcx,%rsi,4)           ## imm = 0xFFFF
	movl	$0, (%rdx)
	movq	_PsndLen_exc_add@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, %ecx
	je	LBB0_8
## %bb.7:
	movq	_PsndLen@GOTPCREL(%rip), %rdx
	movq	_PsndLen_exc_cnt@GOTPCREL(%rip), %rsi
	addl	(%rsi), %ecx
	xorl	%ebx, %ebx
	cmpl	$65536, %ecx                    ## imm = 0x10000
	setge	%bl
	addl	(%rdx), %ebx
LBB0_8:
	xorb	$1, 4(%rax)
	movl	%ebx, 24(%rax)
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, 28(%rax)
	movq	_JOB940_YM2612UPDATEONE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_add_job_940
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_shared_data,8,3                ## @shared_data
	.comm	_JOB940_YM2612UPDATEONE,4,2     ## @JOB940_YM2612UPDATEONE
	.comm	_shared_ctl,8,3                 ## @shared_ctl
	.comm	_writebuff_ptr,4,2              ## @writebuff_ptr
	.comm	_PsndLen_exc_add,4,2            ## @PsndLen_exc_add
	.comm	_PsndLen,4,2                    ## @PsndLen
	.comm	_PsndLen_exc_cnt,4,2            ## @PsndLen_exc_cnt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_YM2612UpdateOne_940            ; -- Begin function YM2612UpdateOne_940
	.p2align	2
_YM2612UpdateOne_940:                   ; @YM2612UpdateOne_940
	.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	x24, x3
	mov	x19, x2
	mov	x20, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _shared_data@GOTPAGE
Lloh1:
	ldr	x8, [x8, _shared_data@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x23, [x8]
Lloh3:
	adrp	x25, _JOB940_YM2612UPDATEONE@GOTPAGE
Lloh4:
	ldr	x25, [x25, _JOB940_YM2612UPDATEONE@GOTPAGEOFF]
	ldr	w0, [x25]
	bl	_CHECK_BUSY
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w0, [x25]
	bl	_wait_busy_940
LBB0_2:
Lloh5:
	adrp	x26, _shared_ctl@GOTPAGE
Lloh6:
	ldr	x26, [x26, _shared_ctl@GOTPAGEOFF]
	ldr	x8, [x26]
	ldr	w21, [x8]
	lsl	w2, w20, w19
	cbz	w24, LBB0_5
; %bb.3:
	cbz	w21, LBB0_5
; %bb.4:
	mov	x0, x22
	mov	x1, x23
	bl	_memcpy32
	b	LBB0_6
LBB0_5:
	mov	x0, x22
	mov	w1, #0
	bl	_memset32
LBB0_6:
	ldr	x8, [x26]
	ldr	w9, [x8, #4]
	cmp	w9, #1
	mov	w9, #16
	mov	w10, #8
	csel	x9, x10, x9, eq
	ldr	x9, [x8, x9]
Lloh7:
	adrp	x10, _writebuff_ptr@GOTPAGE
Lloh8:
	ldr	x10, [x10, _writebuff_ptr@GOTPAGEOFF]
	ldrh	w11, [x10]
	mov	w12, #65535
	str	w12, [x9, x11, lsl #2]
	str	wzr, [x10]
Lloh9:
	adrp	x9, _PsndLen_exc_add@GOTPAGE
Lloh10:
	ldr	x9, [x9, _PsndLen_exc_add@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	cbz	w9, LBB0_8
; %bb.7:
Lloh12:
	adrp	x10, _PsndLen@GOTPAGE
Lloh13:
	ldr	x10, [x10, _PsndLen@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
Lloh15:
	adrp	x11, _PsndLen_exc_cnt@GOTPAGE
Lloh16:
	ldr	x11, [x11, _PsndLen_exc_cnt@GOTPAGEOFF]
Lloh17:
	ldr	w11, [x11]
	add	w9, w11, w9
	cmp	w9, #16, lsl #12                ; =65536
	cinc	w20, w10, ge
LBB0_8:
	ldr	w9, [x8, #4]
	eor	w9, w9, #0x1
	str	w9, [x8, #4]
	stp	w20, w19, [x8, #24]
	ldr	w0, [x25]
	bl	_add_job_940
	mov	x0, x21
	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	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_shared_data,8,3                ; @shared_data
	.comm	_JOB940_YM2612UPDATEONE,4,2     ; @JOB940_YM2612UPDATEONE
	.comm	_shared_ctl,8,3                 ; @shared_ctl
	.comm	_writebuff_ptr,4,2              ; @writebuff_ptr
	.comm	_PsndLen_exc_add,4,2            ; @PsndLen_exc_add
	.comm	_PsndLen,4,2                    ; @PsndLen
	.comm	_PsndLen_exc_cnt,4,2            ; @PsndLen_exc_cnt
.subsections_via_symbols
