	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function PicoWrite8_z80
_PicoWrite8_z80:                        ## @PicoWrite8_z80
	.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
	movq	_Pico@GOTPCREL(%rip), %r15
	testb	$1, (%r15)
	jne	LBB0_2
## %bb.1:
	cmpq	$0, 8(%r15)
	jne	LBB0_2
## %bb.4:
	testl	$16384, %ebx                    ## imm = 0x4000
	jne	LBB0_6
## %bb.5:
	movl	$2, %edi
	callq	_SekCyclesBurnRun
	movslq	%r14d, %rax
	movq	16(%r15), %rcx
	andl	$8191, %ebx                     ## imm = 0x1FFF
	movq	%rax, (%rcx,%rbx,8)
	jmp	LBB0_9
LBB0_2:
	movq	_EL_ANOMALY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movzbl	%r14b, %ecx
	movq	_SekPc@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	leaq	L_.str(%rip), %rsi
LBB0_3:
	movl	%ebx, %edx
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_elprintf                       ## TAILCALL
LBB0_6:
	movl	%ebx, %eax
	andl	$24576, %eax                    ## imm = 0x6000
	cmpl	$16384, %eax                    ## imm = 0x4000
	jne	LBB0_10
## %bb.7:
	movq	_PicoOpt@GOTPCREL(%rip), %rax
	movq	_POPT_EN_FM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_9
## %bb.8:
	andl	$3, %ebx
	movzbl	%r14b, %esi
	movl	%ebx, %edi
	xorl	%edx, %edx
	callq	_ym2612_write_local
	andl	$1, %eax
	movq	_emustatus@GOTPCREL(%rip), %rcx
	orl	%eax, (%rcx)
	jmp	LBB0_9
LBB0_10:
	movl	%ebx, %eax
	andl	$32761, %eax                    ## imm = 0x7FF9
	cmpl	$32529, %eax                    ## imm = 0x7F11
	jne	LBB0_13
## %bb.11:
	movq	_PicoOpt@GOTPCREL(%rip), %rax
	movq	_POPT_EN_PSG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_9
## %bb.12:
	movl	%r14d, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_SN76496Write                   ## TAILCALL
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movl	%ebx, %eax
	andl	$32512, %eax                    ## imm = 0x7F00
	cmpl	$24576, %eax                    ## imm = 0x6000
	jne	LBB0_14
## %bb.15:
	movl	4(%r15), %eax
	shrl	%eax
	shll	$8, %r14d
	orl	%eax, %r14d
	andl	$511, %r14d                     ## imm = 0x1FF
	movl	%r14d, 4(%r15)
	movq	_EL_Z80BNK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	shll	$15, %r14d
	leaq	L_.str.1(%rip), %rsi
	movl	%r14d, %edx
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_elprintf                       ## TAILCALL
LBB0_14:
	movq	_EL_UIO@GOTPCREL(%rip), %rax
	movq	_EL_ANOMALY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movzbl	%r14b, %ecx
	movq	_SekPc@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_Pico,24,3                      ## @Pico
	.comm	_EL_ANOMALY,4,2                 ## @EL_ANOMALY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"68k z80 write with no bus or reset! [%06x] %02x @ %06x"

	.comm	_SekPc,4,2                      ## @SekPc
	.comm	_PicoOpt,4,2                    ## @PicoOpt
	.comm	_POPT_EN_FM,4,2                 ## @POPT_EN_FM
	.comm	_emustatus,4,2                  ## @emustatus
	.comm	_POPT_EN_PSG,4,2                ## @POPT_EN_PSG
	.comm	_EL_Z80BNK,4,2                  ## @EL_Z80BNK
L_.str.1:                               ## @.str.1
	.asciz	"z80 bank=%06x"

	.comm	_EL_UIO,4,2                     ## @EL_UIO
L_.str.2:                               ## @.str.2
	.asciz	"68k bad write [%06x] %02x @ %06x"

	.no_dead_strip	_PicoWrite8_z80
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function PicoWrite8_z80
_PicoWrite8_z80:                        ; @PicoWrite8_z80
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x21, _Pico@GOTPAGE
Lloh1:
	ldr	x21, [x21, _Pico@GOTPAGEOFF]
	ldrb	w8, [x21]
	tbnz	w8, #0, LBB0_4
; %bb.1:
	ldr	x8, [x21, #8]
	cbnz	x8, LBB0_4
; %bb.2:
	tbnz	w19, #14, LBB0_7
; %bb.3:
	mov	w0, #2
	bl	_SekCyclesBurnRun
	sxtw	x8, w20
	ldr	x9, [x21, #16]
	and	w10, w19, #0x1fff
	str	x8, [x9, w10, uxtw #3]
	b	LBB0_6
LBB0_4:
Lloh2:
	adrp	x8, _EL_ANOMALY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EL_ANOMALY@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	and	w8, w20, #0xff
Lloh5:
	adrp	x9, _SekPc@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SekPc@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	stp	x8, x9, [sp]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
LBB0_5:
	mov	x2, x19
	bl	_elprintf
LBB0_6:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_7:
	and	w8, w19, #0x6000
	cmp	w8, #4, lsl #12                 ; =16384
	b.ne	LBB0_10
; %bb.8:
Lloh10:
	adrp	x8, _PicoOpt@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PicoOpt@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, _POPT_EN_FM@GOTPAGE
Lloh14:
	ldr	x9, [x9, _POPT_EN_FM@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.9:
	and	w0, w19, #0x3
	and	w1, w20, #0xff
	mov	w2, #0
	bl	_ym2612_write_local
	and	w8, w0, #0x1
Lloh16:
	adrp	x9, _emustatus@GOTPAGE
Lloh17:
	ldr	x9, [x9, _emustatus@GOTPAGEOFF]
	ldr	w10, [x9]
	orr	w8, w10, w8
	str	w8, [x9]
	b	LBB0_6
LBB0_10:
	mov	w8, #32761
	and	w8, w19, w8
	mov	w9, #32529
	cmp	w8, w9
	b.ne	LBB0_13
; %bb.11:
Lloh18:
	adrp	x8, _PicoOpt@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PicoOpt@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
Lloh21:
	adrp	x9, _POPT_EN_PSG@GOTPAGE
Lloh22:
	ldr	x9, [x9, _POPT_EN_PSG@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.12:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	b	_SN76496Write
LBB0_13:
	and	w8, w19, #0x7f00
	cmp	w8, #6, lsl #12                 ; =24576
	b.ne	LBB0_15
; %bb.14:
	ldr	w8, [x21, #4]
	lsr	w8, w8, #1
	orr	w8, w8, w20, lsl #8
	and	w8, w8, #0x1ff
	str	w8, [x21, #4]
Lloh24:
	adrp	x9, _EL_Z80BNK@GOTPAGE
Lloh25:
	ldr	x9, [x9, _EL_Z80BNK@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x9]
	lsl	w2, w8, #15
Lloh27:
	adrp	x1, l_.str.1@PAGE
Lloh28:
	add	x1, x1, l_.str.1@PAGEOFF
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	b	_elprintf
LBB0_15:
Lloh29:
	adrp	x8, _EL_UIO@GOTPAGE
Lloh30:
	ldr	x8, [x8, _EL_UIO@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
Lloh32:
	adrp	x9, _EL_ANOMALY@GOTPAGE
Lloh33:
	ldr	x9, [x9, _EL_ANOMALY@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	orr	w0, w9, w8
	and	w8, w20, #0xff
Lloh35:
	adrp	x9, _SekPc@GOTPAGE
Lloh36:
	ldr	x9, [x9, _SekPc@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
	stp	x8, x9, [sp]
Lloh38:
	adrp	x1, l_.str.2@PAGE
Lloh39:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_Pico,24,3                      ; @Pico
	.comm	_EL_ANOMALY,4,2                 ; @EL_ANOMALY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"68k z80 write with no bus or reset! [%06x] %02x @ %06x"

	.comm	_SekPc,4,2                      ; @SekPc
	.comm	_PicoOpt,4,2                    ; @PicoOpt
	.comm	_POPT_EN_FM,4,2                 ; @POPT_EN_FM
	.comm	_emustatus,4,2                  ; @emustatus
	.comm	_POPT_EN_PSG,4,2                ; @POPT_EN_PSG
	.comm	_EL_Z80BNK,4,2                  ; @EL_Z80BNK
l_.str.1:                               ; @.str.1
	.asciz	"z80 bank=%06x"

	.comm	_EL_UIO,4,2                     ; @EL_UIO
l_.str.2:                               ; @.str.2
	.asciz	"68k bad write [%06x] %02x @ %06x"

	.no_dead_strip	_PicoWrite8_z80
.subsections_via_symbols
