	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_bank
_write_bank:                            ## @write_bank
	.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, %r15d
	movq	_EL_Z80BNK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	xorl	%eax, %eax
	callq	_z80_pc
	movzbl	%r15b, %edx
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	movl	%r14d, %ecx
	movl	%eax, %r8d
	xorl	%eax, %eax
	callq	_elprintf
	andl	$15, %r15d
	leal	-12(%r15), %eax
	cmpl	$3, %eax
	ja	LBB0_10
## %bb.1:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_2:
	movq	_EL_STATUS@GOTPCREL(%rip), %rax
	movq	_EL_ANOMALY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movzbl	%r14b, %edx
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_3
LBB0_4:
	testb	%r14b, %r14b
	je	LBB0_5
## %bb.6:
	movq	_EL_STATUS@GOTPCREL(%rip), %rax
	movq	_EL_ANOMALY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movzbl	%r14b, %edx
	leaq	L_.str.2(%rip), %rsi
LBB0_3:
	xorl	%eax, %eax
	callq	_elprintf
	jmp	LBB0_10
LBB0_7:
	movq	_bank_mask@GOTPCREL(%rip), %rax
	movb	(%rax), %bl
	andb	%r14b, %bl
	movzbl	%bl, %ecx
	movq	_z80_read_map@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_Pico@GOTPCREL(%rip), %rax
	shll	$14, %ecx
	addl	8(%rax), %ecx
	movl	$16384, %esi                    ## imm = 0x4000
	movl	$32767, %edx                    ## imm = 0x7FFF
	jmp	LBB0_9
LBB0_8:
	movq	_bank_mask@GOTPCREL(%rip), %rax
	movb	(%rax), %bl
	andb	%r14b, %bl
	movzbl	%bl, %ecx
	movq	_z80_read_map@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_Pico@GOTPCREL(%rip), %rax
	shll	$14, %ecx
	addl	8(%rax), %ecx
	movl	$32768, %esi                    ## imm = 0x8000
	movl	$49151, %edx                    ## imm = 0xBFFF
LBB0_9:
	xorl	%r8d, %r8d
	callq	_z80_map_set
	movl	%ebx, %r14d
LBB0_10:
	movq	_Pico@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movb	%r14b, (%rax,%r15)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	xorl	%r14d, %r14d
	jmp	LBB0_10
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_4, LBB0_4-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
LJTI0_0:
	.long	L0_0_set_2
	.long	L0_0_set_4
	.long	L0_0_set_7
	.long	L0_0_set_8
	.end_data_region
                                        ## -- End function
	.comm	_EL_Z80BNK,4,2                  ## @EL_Z80BNK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bank %04x %02x @ %04x"

	.comm	_EL_STATUS,4,2                  ## @EL_STATUS
	.comm	_EL_ANOMALY,4,2                 ## @EL_ANOMALY
L_.str.1:                               ## @.str.1
	.asciz	"%02x written to control reg!"

L_.str.2:                               ## @.str.2
	.asciz	"bank0 changed to %d!"

	.comm	_bank_mask,1,0                  ## @bank_mask
	.comm	_z80_read_map,4,2               ## @z80_read_map
	.comm	_Pico,16,3                      ## @Pico
	.comm	_CZ80,4,2                       ## @CZ80
	.no_dead_strip	_write_bank
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_bank
_write_bank:                            ; @write_bank
	.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	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _EL_Z80BNK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EL_Z80BNK@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	bl	_z80_pc
                                        ; kill: def $w0 killed $w0 def $x0
	mov	w8, w19
	stp	x8, x0, [sp]
	and	w2, w20, #0xff
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_elprintf
	and	x20, x20, #0xf
	sub	w8, w20, #12
Lloh5:
	adrp	x21, _Pico@GOTPAGE
Lloh6:
	ldr	x21, [x21, _Pico@GOTPAGEOFF]
	cmp	w8, #3
	b.hi	LBB0_9
; %bb.1:
Lloh7:
	adrp	x9, lJTI0_0@PAGE
Lloh8:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
Lloh9:
	adrp	x8, _EL_STATUS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EL_STATUS@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _EL_ANOMALY@GOTPAGE
Lloh13:
	ldr	x9, [x9, _EL_ANOMALY@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w0, w9, w8
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_5
LBB0_3:
	cbz	w19, LBB0_9
; %bb.4:
Lloh17:
	adrp	x8, _EL_STATUS@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EL_STATUS@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
Lloh20:
	adrp	x9, _EL_ANOMALY@GOTPAGE
Lloh21:
	ldr	x9, [x9, _EL_ANOMALY@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	orr	w0, w9, w8
Lloh23:
	adrp	x1, l_.str.2@PAGE
Lloh24:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_5:
	mov	x2, x19
	bl	_elprintf
	b	LBB0_9
LBB0_6:
Lloh25:
	adrp	x8, _bank_mask@GOTPAGE
Lloh26:
	ldr	x8, [x8, _bank_mask@GOTPAGEOFF]
	ldrb	w8, [x8]
	and	w19, w8, w19
Lloh27:
	adrp	x8, _z80_read_map@GOTPAGE
Lloh28:
	ldr	x8, [x8, _z80_read_map@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
	ldr	w8, [x21, #8]
	add	w3, w8, w19, lsl #14
	mov	w1, #16384
	mov	w2, #32767
	b	LBB0_8
LBB0_7:
Lloh30:
	adrp	x8, _bank_mask@GOTPAGE
Lloh31:
	ldr	x8, [x8, _bank_mask@GOTPAGEOFF]
	ldrb	w8, [x8]
	and	w19, w8, w19
Lloh32:
	adrp	x8, _z80_read_map@GOTPAGE
Lloh33:
	ldr	x8, [x8, _z80_read_map@GOTPAGEOFF]
Lloh34:
	ldr	w0, [x8]
	ldr	w8, [x21, #8]
	add	w3, w8, w19, lsl #14
	mov	w1, #32768
	mov	w2, #49151
LBB0_8:
	mov	w4, #0
	bl	_z80_map_set
LBB0_9:
	ldr	x8, [x21]
	strb	w19, [x8, 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
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh30, Lloh31
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_3-LBB0_2)>>2
	.byte	(LBB0_6-LBB0_2)>>2
	.byte	(LBB0_7-LBB0_2)>>2
                                        ; -- End function
	.comm	_EL_Z80BNK,4,2                  ; @EL_Z80BNK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bank %04x %02x @ %04x"

	.comm	_EL_STATUS,4,2                  ; @EL_STATUS
	.comm	_EL_ANOMALY,4,2                 ; @EL_ANOMALY
l_.str.1:                               ; @.str.1
	.asciz	"%02x written to control reg!"

l_.str.2:                               ; @.str.2
	.asciz	"bank0 changed to %d!"

	.comm	_bank_mask,1,0                  ; @bank_mask
	.comm	_z80_read_map,4,2               ; @z80_read_map
	.comm	_Pico,16,3                      ; @Pico
	.comm	_CZ80,4,2                       ; @CZ80
	.no_dead_strip	_write_bank
.subsections_via_symbols
