	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function z80_md_vdp_br_write
_z80_md_vdp_br_write:                   ## @z80_md_vdp_br_write
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movl	%edi, %eax
	andl	$65529, %eax                    ## imm = 0xFFF9
	cmpl	$32529, %eax                    ## imm = 0x7F11
	jne	LBB0_3
## %bb.1:
	movq	_PicoOpt@GOTPCREL(%rip), %rax
	movq	_POPT_EN_PSG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_5
## %bb.2:
	movzbl	%sil, %edi
	popq	%rbp
	jmp	_SN76496Write                   ## TAILCALL
LBB0_3:
	movl	%edi, %edx
	movl	%edi, %eax
	andl	$-256, %eax
	cmpl	$24576, %eax                    ## imm = 0x6000
	jne	LBB0_6
## %bb.4:
	movq	_Pico@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	shrl	%ecx
	movzbl	%sil, %edx
	shll	$8, %edx
	orl	%ecx, %edx
	andl	$511, %edx                      ## imm = 0x1FF
	movl	%edx, (%rax)
LBB0_5:
	popq	%rbp
	retq
LBB0_6:
	movq	_EL_ANOMALY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movzbl	%sil, %ecx
	leaq	L_.str(%rip), %rsi
	popq	%rbp
	jmp	_elprintf                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PicoOpt,4,2                    ## @PicoOpt
	.comm	_POPT_EN_PSG,4,2                ## @POPT_EN_PSG
	.comm	_Pico,4,2                       ## @Pico
	.comm	_EL_ANOMALY,4,2                 ## @EL_ANOMALY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"z80 invalid w8 [%06x] %02x"

	.no_dead_strip	_z80_md_vdp_br_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function z80_md_vdp_br_write
_z80_md_vdp_br_write:                   ; @z80_md_vdp_br_write
	.cfi_startproc
; %bb.0:
	mov	x3, x1
	mov	w8, #65529
	and	w8, w0, w8
	mov	w9, #32529
	cmp	w8, w9
	b.ne	LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _PicoOpt@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PicoOpt@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _POPT_EN_PSG@GOTPAGE
Lloh4:
	ldr	x9, [x9, _POPT_EN_PSG@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.2:
	mov	x0, x3
	b	_SN76496Write
LBB0_3:
	mov	x2, x0
	and	w8, w0, #0xffffff00
	cmp	w8, #6, lsl #12                 ; =24576
	b.ne	LBB0_6
; %bb.4:
Lloh6:
	adrp	x8, _Pico@GOTPAGE
Lloh7:
	ldr	x8, [x8, _Pico@GOTPAGEOFF]
	ldr	w9, [x8]
	lsr	w9, w9, #1
	orr	w9, w9, w3, lsl #8
	and	w9, w9, #0x1ff
	str	w9, [x8]
LBB0_5:
	ret
LBB0_6:
Lloh8:
	adrp	x8, _EL_ANOMALY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EL_ANOMALY@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	b	_elprintf
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_PicoOpt,4,2                    ; @PicoOpt
	.comm	_POPT_EN_PSG,4,2                ; @POPT_EN_PSG
	.comm	_Pico,4,2                       ; @Pico
	.comm	_EL_ANOMALY,4,2                 ; @EL_ANOMALY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"z80 invalid w8 [%06x] %02x"

	.no_dead_strip	_z80_md_vdp_br_write
.subsections_via_symbols
