	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_YM2612Write_                   ## -- Begin function YM2612Write_
	.p2align	4, 0x90
_YM2612Write_:                          ## @YM2612Write_
	.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
	movl	%esi, %ebx
                                        ## kill: def $edi killed $edi def $rdi
	movzbl	%bl, %esi
	andl	$3, %edi
	leaq	LJTI0_0(%rip), %rax
	movslq	(%rax,%rdi,4), %rcx
	addq	%rax, %rcx
	jmpq	*%rcx
LBB0_29:
	movq	_ym2612@GOTPCREL(%rip), %rax
	movl	%esi, 16(%rax)
	movl	$0, (%rax)
	jmp	LBB0_30
LBB0_1:
	movq	_ym2612@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	cmpl	$0, (%rcx)
	jne	LBB0_31
## %bb.2:
	movl	16(%rcx), %edi
	movl	%edi, %eax
	andl	$240, %eax
	cmpl	$32, %eax
	jne	LBB0_24
## %bb.3:
	movl	$1, %eax
	addl	$-34, %edi
	cmpl	$9, %edi
	ja	LBB0_31
## %bb.4:
	leaq	LJTI0_1(%rip), %rax
	movslq	(%rax,%rdi,4), %rdx
	addq	%rax, %rdx
	movl	$1, %eax
	jmpq	*%rdx
LBB0_5:
	testb	$8, %bl
	jne	LBB0_6
## %bb.7:
	movl	$0, 44(%rcx)
	movl	$1, %eax
	jmp	LBB0_31
LBB0_26:
	movq	_ym2612@GOTPCREL(%rip), %rax
	movl	%esi, 16(%rax)
	movl	$1, (%rax)
LBB0_30:
	xorl	%eax, %eax
LBB0_31:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_27:
	movq	_ym2612@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	cmpl	$1, (%rcx)
	jne	LBB0_31
## %bb.28:
	movl	$256, %edi                      ## imm = 0x100
	orl	16(%rcx), %edi
	jmp	LBB0_25
LBB0_24:
                                        ## kill: def $edi killed $edi killed $rdi
LBB0_25:
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_OPNWriteReg                    ## TAILCALL
LBB0_8:
	movl	%esi, %edi
	callq	_set_timers
	jmp	LBB0_30
LBB0_9:
	movl	%ebx, %ecx
	andl	$3, %ecx
	movl	$0, %eax
	cmpl	$3, %ecx
	je	LBB0_31
## %bb.10:
	leal	3(%rcx), %r14d
	testb	$4, %bl
	cmovel	%ecx, %r14d
	movq	_SLOT1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	testb	$16, %bl
	jne	LBB0_11
## %bb.12:
	callq	_FM_KEYOFF
	jmp	LBB0_13
LBB0_22:
	shll	$6, %esi
	addl	$-8192, %esi                    ## imm = 0xE000
	movl	%esi, 4(%rcx)
	jmp	LBB0_30
LBB0_23:
	andl	$128, %ebx
	movl	%ebx, 8(%rcx)
	jmp	LBB0_30
LBB0_6:
	movq	48(%rcx), %rax
	andl	$7, %ebx
	movl	(%rax,%rbx,4), %eax
	movl	%eax, 44(%rcx)
	movl	$1, %eax
	jmp	LBB0_31
LBB0_11:
	callq	_FM_KEYON
LBB0_13:
	movq	_SLOT2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	testb	$32, %bl
	jne	LBB0_14
## %bb.15:
	callq	_FM_KEYOFF
	jmp	LBB0_16
LBB0_14:
	callq	_FM_KEYON
LBB0_16:
	movq	_SLOT3@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	testb	$64, %bl
	jne	LBB0_17
## %bb.18:
	callq	_FM_KEYOFF
	jmp	LBB0_19
LBB0_17:
	callq	_FM_KEYON
LBB0_19:
	movq	_SLOT4@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	testb	$-128, %bl
	jne	LBB0_20
## %bb.21:
	callq	_FM_KEYOFF
	movl	$1, %eax
	jmp	LBB0_31
LBB0_20:
	callq	_FM_KEYON
	movl	$1, %eax
	jmp	LBB0_31
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_29, LBB0_29-LJTI0_0
.set L0_0_set_1, LBB0_1-LJTI0_0
.set L0_0_set_26, LBB0_26-LJTI0_0
.set L0_0_set_27, LBB0_27-LJTI0_0
LJTI0_0:
	.long	L0_0_set_29
	.long	L0_0_set_1
	.long	L0_0_set_26
	.long	L0_0_set_27
.set L0_1_set_5, LBB0_5-LJTI0_1
.set L0_1_set_31, LBB0_31-LJTI0_1
.set L0_1_set_8, LBB0_8-LJTI0_1
.set L0_1_set_9, LBB0_9-LJTI0_1
.set L0_1_set_22, LBB0_22-LJTI0_1
.set L0_1_set_23, LBB0_23-LJTI0_1
LJTI0_1:
	.long	L0_1_set_5
	.long	L0_1_set_31
	.long	L0_1_set_31
	.long	L0_1_set_31
	.long	L0_1_set_31
	.long	L0_1_set_8
	.long	L0_1_set_9
	.long	L0_1_set_31
	.long	L0_1_set_22
	.long	L0_1_set_23
	.end_data_region
                                        ## -- End function
	.comm	_ym2612,56,3                    ## @ym2612
	.comm	_SLOT1,4,2                      ## @SLOT1
	.comm	_SLOT2,4,2                      ## @SLOT2
	.comm	_SLOT3,4,2                      ## @SLOT3
	.comm	_SLOT4,4,2                      ## @SLOT4
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_YM2612Write_                   ; -- Begin function YM2612Write_
	.p2align	2
_YM2612Write_:                          ; @YM2612Write_
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	and	w1, w1, #0xff
	and	w8, w0, #0x3
Lloh0:
	adrp	x9, lJTI0_0@PAGE
Lloh1:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_1
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_1:
	mov	w0, #0
Lloh2:
	adrp	x8, _ym2612@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ym2612@GOTPAGEOFF]
	str	w1, [x8, #16]
	str	wzr, [x8]
	b	LBB0_16
LBB0_2:
Lloh4:
	adrp	x9, _ym2612@GOTPAGE
Lloh5:
	ldr	x9, [x9, _ym2612@GOTPAGEOFF]
	ldr	w8, [x9]
	cbnz	w8, LBB0_15
; %bb.3:
	ldr	w8, [x9, #16]
	and	w10, w8, #0xf0
	cmp	w10, #32
	b.ne	LBB0_11
; %bb.4:
	mov	w0, #1
	sub	w8, w8, #34
	cmp	w8, #9
	b.hi	LBB0_16
; %bb.5:
Lloh6:
	adrp	x10, lJTI0_1@PAGE
Lloh7:
	add	x10, x10, lJTI0_1@PAGEOFF
	adr	x11, LBB0_6
	ldrb	w12, [x10, x8]
	add	x11, x11, x12, lsl #2
	br	x11
LBB0_6:
	tbnz	w19, #3, LBB0_19
; %bb.7:
	str	wzr, [x9, #44]
	mov	w0, #1
	b	LBB0_16
LBB0_8:
	mov	w0, #0
Lloh8:
	adrp	x8, _ym2612@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ym2612@GOTPAGEOFF]
	str	w1, [x8, #16]
	mov	w9, #1
	str	w9, [x8]
	b	LBB0_16
LBB0_9:
Lloh10:
	adrp	x8, _ym2612@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ym2612@GOTPAGEOFF]
	ldr	w9, [x8]
	cmp	w9, #1
	b.ne	LBB0_15
; %bb.10:
	ldr	w8, [x8, #16]
	orr	w0, w8, #0x100
	b	LBB0_12
LBB0_11:
	mov	x0, x8
LBB0_12:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_OPNWriteReg
LBB0_13:
	mov	x0, x1
	bl	_set_timers
	b	LBB0_15
LBB0_14:
	and	w8, w19, #0x3
	cmp	w8, #3
	b.ne	LBB0_20
LBB0_15:
	mov	w0, #0
LBB0_16:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_17:
	mov	w0, #0
	lsl	w8, w1, #6
	sub	w8, w8, #2, lsl #12             ; =8192
	str	w8, [x9, #4]
	b	LBB0_16
LBB0_18:
	mov	w0, #0
	and	w8, w19, #0x80
	str	w8, [x9, #8]
	b	LBB0_16
LBB0_19:
	ldr	x8, [x9, #48]
	and	w10, w19, #0x7
	ldr	w8, [x8, w10, uxtw #2]
	str	w8, [x9, #44]
	mov	w0, #1
	b	LBB0_16
LBB0_20:
	add	w9, w8, #3
	tst	w19, #0x4
	csel	w20, w8, w9, eq
Lloh12:
	adrp	x8, _SLOT1@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SLOT1@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x20
	tbnz	w19, #4, LBB0_22
; %bb.21:
	bl	_FM_KEYOFF
	b	LBB0_23
LBB0_22:
	bl	_FM_KEYON
LBB0_23:
Lloh15:
	adrp	x8, _SLOT2@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SLOT2@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x20
	tbnz	w19, #5, LBB0_25
; %bb.24:
	bl	_FM_KEYOFF
	b	LBB0_26
LBB0_25:
	bl	_FM_KEYON
LBB0_26:
Lloh18:
	adrp	x8, _SLOT3@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SLOT3@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x20
	tbnz	w19, #6, LBB0_28
; %bb.27:
	bl	_FM_KEYOFF
	b	LBB0_29
LBB0_28:
	bl	_FM_KEYON
LBB0_29:
Lloh21:
	adrp	x8, _SLOT4@GOTPAGE
Lloh22:
	ldr	x8, [x8, _SLOT4@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x20
	tbnz	w19, #7, LBB0_31
; %bb.30:
	bl	_FM_KEYOFF
	mov	w0, #1
	b	LBB0_16
LBB0_31:
	bl	_FM_KEYON
	mov	w0, #1
	b	LBB0_16
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_1-LBB0_1)>>2
	.byte	(LBB0_2-LBB0_1)>>2
	.byte	(LBB0_8-LBB0_1)>>2
	.byte	(LBB0_9-LBB0_1)>>2
lJTI0_1:
	.byte	(LBB0_6-LBB0_6)>>2
	.byte	(LBB0_16-LBB0_6)>>2
	.byte	(LBB0_16-LBB0_6)>>2
	.byte	(LBB0_16-LBB0_6)>>2
	.byte	(LBB0_16-LBB0_6)>>2
	.byte	(LBB0_13-LBB0_6)>>2
	.byte	(LBB0_14-LBB0_6)>>2
	.byte	(LBB0_16-LBB0_6)>>2
	.byte	(LBB0_17-LBB0_6)>>2
	.byte	(LBB0_18-LBB0_6)>>2
                                        ; -- End function
	.comm	_ym2612,56,3                    ; @ym2612
	.comm	_SLOT1,4,2                      ; @SLOT1
	.comm	_SLOT2,4,2                      ; @SLOT2
	.comm	_SLOT3,4,2                      ; @SLOT3
	.comm	_SLOT4,4,2                      ; @SLOT4
.subsections_via_symbols
