	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function carthw_ssf2_write8
_carthw_ssf2_write8:                    ## @carthw_ssf2_write8
	.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
	movl	%esi, %edx
	movl	%edi, %ebx
	movl	%edi, %eax
	andl	$16777200, %eax                 ## imm = 0xFFFFF0
	cmpl	$10563824, %eax                 ## imm = 0xA130F0
	jne	LBB0_5
## %bb.1:
	andl	$14, %ebx
	je	LBB0_4
## %bb.2:
	movq	_ssf2_banks@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%ebx, %ecx
	shrl	%ecx
	movl	%edx, (%rax,%rcx,4)
	shll	$19, %edx
	leal	524288(%rdx), %eax
	movq	_Pico@GOTPCREL(%rip), %r12
	cmpl	(%r12), %eax
	jle	LBB0_3
## %bb.6:
	movq	_EL_ANOMALY@GOTPCREL(%rip), %rax
	movq	_EL_STATUS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_elprintf                       ## TAILCALL
LBB0_5:
	movl	%ebx, %edi
	movl	%edx, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PicoWrite8_io                  ## TAILCALL
LBB0_4:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	shll	$18, %ebx
	movq	_m68k_read8_map@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %r14d
	orl	$524287, %r14d                  ## imm = 0x7FFFF
	movslq	%edx, %r15
	movq	8(%r12), %rcx
	addq	%r15, %rcx
	movl	%ebx, %esi
	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	%ebx, %esi
	movl	%r14d, %edx
	movq	%r15, %rcx
	xorl	%r8d, %r8d
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_cpu68k_map_set                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ssf2_banks,8,3                 ## @ssf2_banks
	.comm	_Pico,16,3                      ## @Pico
	.comm	_EL_ANOMALY,4,2                 ## @EL_ANOMALY
	.comm	_EL_STATUS,4,2                  ## @EL_STATUS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ssf2: missing bank @ %06x"

	.comm	_m68k_read8_map,4,2             ## @m68k_read8_map
	.comm	_m68k_read16_map,4,2            ## @m68k_read16_map
	.no_dead_strip	_carthw_ssf2_write8
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function carthw_ssf2_write8
_carthw_ssf2_write8:                    ; @carthw_ssf2_write8
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	and	w8, w0, #0xfffff0
	sub	w8, w8, #2579, lsl #12          ; =10563584
	cmp	w8, #240
	b.ne	LBB0_4
; %bb.1:
	ands	w8, w0, #0xe
	b.eq	LBB0_5
; %bb.2:
Lloh0:
	adrp	x9, _ssf2_banks@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ssf2_banks@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	lsr	w10, w8, #1
	str	w1, [x9, w10, uxtw #2]
	lsl	w2, w1, #19
	add	w9, w2, #128, lsl #12           ; =524288
Lloh3:
	adrp	x21, _Pico@GOTPAGE
Lloh4:
	ldr	x21, [x21, _Pico@GOTPAGEOFF]
	ldr	w10, [x21]
	cmp	w9, w10
	b.le	LBB0_6
; %bb.3:
Lloh5:
	adrp	x8, _EL_ANOMALY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EL_ANOMALY@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _EL_STATUS@GOTPAGE
Lloh9:
	ldr	x9, [x9, _EL_STATUS@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w0, w9, w8
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
                                        ; kill: def $w2 killed $w2 killed $x2
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_elprintf
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_PicoWrite8_io
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_6:
Lloh13:
	adrp	x9, _m68k_read8_map@GOTPAGE
Lloh14:
	ldr	x9, [x9, _m68k_read8_map@GOTPAGEOFF]
	lsl	w19, w8, #18
Lloh15:
	ldr	w0, [x9]
	orr	w20, w19, #0x7ffff
	ldr	x8, [x21, #8]
	sxtw	x22, w2
	add	x3, x8, x22
	mov	x1, x19
	mov	x2, x20
	mov	w4, #0
	bl	_cpu68k_map_set
Lloh16:
	adrp	x8, _m68k_read16_map@GOTPAGE
Lloh17:
	ldr	x8, [x8, _m68k_read16_map@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	ldr	x8, [x21, #8]
	add	x3, x8, x22
	mov	x1, x19
	mov	x2, x20
	mov	w4, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_cpu68k_map_set
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_ssf2_banks,8,3                 ; @ssf2_banks
	.comm	_Pico,16,3                      ; @Pico
	.comm	_EL_ANOMALY,4,2                 ; @EL_ANOMALY
	.comm	_EL_STATUS,4,2                  ; @EL_STATUS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ssf2: missing bank @ %06x"

	.comm	_m68k_read8_map,4,2             ; @m68k_read8_map
	.comm	_m68k_read16_map,4,2            ; @m68k_read16_map
	.no_dead_strip	_carthw_ssf2_write8
.subsections_via_symbols
