	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bank_switch
_bank_switch:                           ## @bank_switch
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_Pico@GOTPCREL(%rip), %r12
	cmpq	$0, 24(%r12)
	je	LBB0_1
## %bb.7:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	%edi, %ebx
	shll	$20, %ebx
	movq	_SRR_MAPPED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 16(%r12)
	je	LBB0_3
## %bb.2:
	movq	_SRam@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	je	LBB0_5
LBB0_3:
	movl	(%r12), %eax
	cmpl	%eax, %ebx
	jae	LBB0_4
## %bb.6:
	movq	_M68K_BANK_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	addl	%ecx, %eax
	notl	%ecx
	andl	%eax, %ecx
	subl	%ebx, %ecx
	cmpl	$1048576, %ecx                  ## imm = 0x100000
	movl	$1048576, %r14d                 ## imm = 0x100000
	cmovbl	%ecx, %r14d
	movq	_m68k_read8_map@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addl	$9437183, %r14d                 ## imm = 0x8FFFFF
	movl	%ebx, %r15d
	movq	8(%r12), %rcx
	addq	%r15, %rcx
	movl	$9437184, %esi                  ## imm = 0x900000
	movl	%r14d, %edx
	xorl	%r8d, %r8d
	callq	_cpu68k_map_set
	movq	_m68k_read16_map@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	8(%r12), %r15
	movl	$9437184, %esi                  ## imm = 0x900000
	movl	%r14d, %edx
	movq	%r15, %rcx
	xorl	%r8d, %r8d
	callq	_cpu68k_map_set
	movq	_EL_32X@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	$9437184, %edx                  ## imm = 0x900000
	movl	%r14d, %ecx
	movl	%ebx, %r8d
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_elprintf                       ## TAILCALL
LBB0_4:
	movq	_EL_32X@GOTPCREL(%rip), %rax
	movq	_EL_ANOMALY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_elprintf
LBB0_5:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_bank_map_handler               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_Pico,32,3                      ## @Pico
	.comm	_SRR_MAPPED,4,2                 ## @SRR_MAPPED
	.comm	_SRam,4,2                       ## @SRam
	.comm	_EL_32X,4,2                     ## @EL_32X
	.comm	_EL_ANOMALY,4,2                 ## @EL_ANOMALY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"missing bank @ %06x"

	.comm	_M68K_BANK_MASK,4,2             ## @M68K_BANK_MASK
	.comm	_m68k_read8_map,4,2             ## @m68k_read8_map
	.comm	_m68k_read16_map,4,2            ## @m68k_read16_map
L_.str.1:                               ## @.str.1
	.asciz	"bank %06x-%06x -> %06x"

	.comm	_PicoCpuFM68k,8,3               ## @PicoCpuFM68k
	.no_dead_strip	_bank_switch
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bank_switch
_bank_switch:                           ; @bank_switch
	.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
Lloh0:
	adrp	x21, _Pico@GOTPAGE
Lloh1:
	ldr	x21, [x21, _Pico@GOTPAGEOFF]
	ldr	x8, [x21, #24]
	cbz	x8, LBB0_2
LBB0_1:
	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_2:
	lsl	w19, w0, #20
	ldr	w8, [x21, #16]
Lloh2:
	adrp	x9, _SRR_MAPPED@GOTPAGE
Lloh3:
	ldr	x9, [x9, _SRR_MAPPED@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh5:
	adrp	x9, _SRam@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SRam@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	cmp	w8, #0
	ccmp	w19, w9, #0, ne
	b.eq	LBB0_6
; %bb.3:
	ldr	w8, [x21]
	cmp	w19, w8
	b.hs	LBB0_5
; %bb.4:
Lloh8:
	adrp	x9, _M68K_BANK_MASK@GOTPAGE
Lloh9:
	ldr	x9, [x9, _M68K_BANK_MASK@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	add	w8, w9, w8
	bic	w8, w8, w9
	sub	w8, w8, w19
	mov	w9, #1048576
Lloh11:
	adrp	x10, _m68k_read8_map@GOTPAGE
Lloh12:
	ldr	x10, [x10, _m68k_read8_map@GOTPAGEOFF]
	cmp	w8, #256, lsl #12               ; =1048576
	csel	w8, w8, w9, lo
Lloh13:
	ldr	w0, [x10]
	mov	w9, #9437183
	add	w20, w8, w9
	ldr	x8, [x21, #8]
	add	x3, x8, x19
	mov	w1, #9437184
	mov	x2, x20
	mov	w4, #0
	bl	_cpu68k_map_set
Lloh14:
	adrp	x8, _m68k_read16_map@GOTPAGE
Lloh15:
	ldr	x8, [x8, _m68k_read16_map@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	ldr	x8, [x21, #8]
	add	x3, x8, x19
	mov	w1, #9437184
	mov	x2, x20
	mov	w4, #0
	bl	_cpu68k_map_set
Lloh17:
	adrp	x8, _EL_32X@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EL_32X@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
                                        ; kill: def $w19 killed $w19 killed $x19 def $x19
	stp	x20, x19, [sp]
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w2, #9437184
	bl	_elprintf
	b	LBB0_1
LBB0_5:
Lloh22:
	adrp	x8, _EL_32X@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EL_32X@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
Lloh25:
	adrp	x9, _EL_ANOMALY@GOTPAGE
Lloh26:
	ldr	x9, [x9, _EL_ANOMALY@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	orr	w0, w9, w8
Lloh28:
	adrp	x1, l_.str@PAGE
Lloh29:
	add	x1, x1, l_.str@PAGEOFF
	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
	b	_bank_map_handler
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_Pico,32,3                      ; @Pico
	.comm	_SRR_MAPPED,4,2                 ; @SRR_MAPPED
	.comm	_SRam,4,2                       ; @SRam
	.comm	_EL_32X,4,2                     ; @EL_32X
	.comm	_EL_ANOMALY,4,2                 ; @EL_ANOMALY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"missing bank @ %06x"

	.comm	_M68K_BANK_MASK,4,2             ; @M68K_BANK_MASK
	.comm	_m68k_read8_map,4,2             ; @m68k_read8_map
	.comm	_m68k_read16_map,4,2            ; @m68k_read16_map
l_.str.1:                               ; @.str.1
	.asciz	"bank %06x-%06x -> %06x"

	.comm	_PicoCpuFM68k,8,3               ; @PicoCpuFM68k
	.no_dead_strip	_bank_switch
.subsections_via_symbols
