	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function carthw_realtec_write8
_carthw_realtec_write8:                 ## @carthw_realtec_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ecx
	movq	_realtec_bank@GOTPCREL(%rip), %r14
	movl	(%r14), %ebx
	movq	_realtec_size@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	cmpl	$4210688, %edi                  ## imm = 0x404000
	je	LBB0_7
## %bb.1:
	movl	%edi, %edx
	cmpl	$4202496, %edi                  ## imm = 0x402000
	je	LBB0_5
## %bb.2:
	cmpl	$4194304, %edx                  ## imm = 0x400000
	jne	LBB0_9
## %bb.3:
	movl	%ebx, %eax
	andl	$917504, %eax                   ## imm = 0xE0000
	movl	%ecx, %edx
	andl	$6, %edx
	shll	$19, %edx
	orl	%eax, %edx
	movl	%edx, (%r14)
	cmpl	%ebx, %edx
	je	LBB0_11
## %bb.4:
	movq	_EL_ANOMALY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SekPc@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	leaq	L_.str(%rip), %rsi
	movl	$4194304, %edx                  ## imm = 0x400000
	jmp	LBB0_10
LBB0_7:
	movl	%ebx, %eax
	andl	$3145728, %eax                  ## imm = 0x300000
	movl	%ecx, %edx
	andl	$7, %edx
	shll	$17, %edx
	orl	%eax, %edx
	movl	%edx, (%r14)
	cmpl	%ebx, %edx
	je	LBB0_11
## %bb.8:
	movq	_EL_ANOMALY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SekPc@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	leaq	L_.str(%rip), %rsi
	movl	$4210688, %edx                  ## imm = 0x404000
	jmp	LBB0_10
LBB0_5:
	movl	%ecx, %eax
	andl	$31, %eax
	shll	$17, %eax
	movq	_realtec_size@GOTPCREL(%rip), %rdx
	movl	%eax, (%rdx)
	cmpl	%r12d, %eax
	je	LBB0_11
## %bb.6:
	movq	_EL_ANOMALY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SekPc@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	leaq	L_.str(%rip), %rsi
	movl	$4202496, %edx                  ## imm = 0x402000
	jmp	LBB0_10
LBB0_9:
	movq	_EL_ANOMALY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SekPc@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	leaq	L_.str.1(%rip), %rsi
LBB0_10:
	xorl	%eax, %eax
	callq	_elprintf
LBB0_11:
	movl	(%r14), %edx
	testl	%edx, %edx
	js	LBB0_19
## %bb.12:
	movq	_realtec_size@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	testl	%ecx, %ecx
	js	LBB0_19
## %bb.13:
	cmpl	%ebx, %edx
	jne	LBB0_15
## %bb.14:
	cmpl	%r12d, %ecx
	jne	LBB0_15
LBB0_19:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	_EL_ANOMALY@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	_SekPc@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_elprintf
	movq	_realtec_size@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_Pico@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	movl	(%r14), %eax
	subl	%eax, %ecx
	cmpl	%ecx, %edx
	jle	LBB0_16
## %bb.20:
	movl	(%r15), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_elprintf                       ## TAILCALL
LBB0_16:
	movq	_m68k_read16_map@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	_m68k_read8_map@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	decl	%edx
	movslq	%eax, %rcx
	addq	8(%r12), %rcx
	movl	%ebx, %esi
	xorl	%r8d, %r8d
	callq	_cpu68k_map_set
	movl	(%r15), %edi
	movq	_realtec_size@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	decl	%edx
	movslq	(%r14), %rcx
	addq	8(%r12), %rcx
	movl	%ebx, %esi
	xorl	%r8d, %r8d
	callq	_cpu68k_map_set
	movl	(%r13), %edx
	addl	%edx, %ebx
	cmpl	$4194303, %ebx                  ## imm = 0x3FFFFF
	jg	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=1
	movl	(%r14), %eax
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_realtec_bank,4,2               ## @realtec_bank
	.comm	_realtec_size,4,2               ## @realtec_size
	.comm	_EL_ANOMALY,4,2                 ## @EL_ANOMALY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"write [%06x] %02x @ %06x"

	.comm	_SekPc,4,2                      ## @SekPc
L_.str.1:                               ## @.str.1
	.asciz	"realtec: unexpected write [%06x] %02x @ %06x"

L_.str.2:                               ## @.str.2
	.asciz	"realtec: new bank %06x, size %06x"

	.comm	_Pico,16,3                      ## @Pico
L_.str.3:                               ## @.str.3
	.asciz	"realtec: bank too large / out of range?"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function carthw_realtec_write8
_carthw_realtec_write8:                 ; @carthw_realtec_write8
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
                                        ; kill: def $w1 killed $w1 def $x1
                                        ; kill: def $w0 killed $w0 def $x0
Lloh0:
	adrp	x20, _realtec_bank@GOTPAGE
Lloh1:
	ldr	x20, [x20, _realtec_bank@GOTPAGEOFF]
	ldr	w19, [x20]
Lloh2:
	adrp	x21, _realtec_size@GOTPAGE
Lloh3:
	ldr	x21, [x21, _realtec_size@GOTPAGEOFF]
	ldr	w22, [x21]
	cmp	w0, #1028, lsl #12              ; =4210688
	b.eq	LBB0_5
; %bb.1:
	cmp	w0, #1026, lsl #12              ; =4202496
	b.eq	LBB0_7
; %bb.2:
	cmp	w0, #1024, lsl #12              ; =4194304
	b.ne	LBB0_11
; %bb.3:
	and	w8, w19, #0xe0000
	lsr	w9, w1, #1
	bfi	w8, w9, #20, #2
	str	w8, [x20]
	cmp	w8, w19
	b.eq	LBB0_13
; %bb.4:
Lloh4:
	adrp	x8, _EL_ANOMALY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EL_ANOMALY@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
Lloh7:
	adrp	x8, _SekPc@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SekPc@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	str	x8, [sp, #16]
	mov	w8, #4194304
	b	LBB0_9
LBB0_5:
	and	w8, w19, #0x300000
	bfi	w8, w1, #17, #3
	str	w8, [x20]
	cmp	w8, w19
	b.eq	LBB0_13
; %bb.6:
Lloh10:
	adrp	x8, _EL_ANOMALY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EL_ANOMALY@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
Lloh13:
	adrp	x8, _SekPc@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SekPc@GOTPAGEOFF]
	mov	w9, #8192
	movk	w9, #64, lsl #16
	add	w9, w9, #2, lsl #12             ; =8192
Lloh15:
	ldr	w8, [x8]
                                        ; kill: def $w1 killed $w1 killed $x1 def $x1
	stp	x1, x8, [sp, #8]
	str	x9, [sp]
	b	LBB0_10
LBB0_7:
	ubfiz	w8, w1, #17, #5
	str	w8, [x21]
	cmp	w8, w22
	b.eq	LBB0_13
; %bb.8:
Lloh16:
	adrp	x8, _EL_ANOMALY@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EL_ANOMALY@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
Lloh19:
	adrp	x8, _SekPc@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SekPc@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	str	x8, [sp, #16]
                                        ; kill: def $w1 killed $w1 killed $x1 def $x1
	mov	w8, #8192
	movk	w8, #64, lsl #16
LBB0_9:
	stp	x8, x1, [sp]
LBB0_10:
Lloh22:
	adrp	x1, l_.str@PAGE
Lloh23:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_12
LBB0_11:
Lloh24:
	adrp	x8, _EL_ANOMALY@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EL_ANOMALY@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
Lloh27:
	adrp	x9, _SekPc@GOTPAGE
Lloh28:
	ldr	x9, [x9, _SekPc@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
                                        ; kill: def $w1 killed $w1 killed $x1 def $x1
	stp	x1, x9, [sp, #8]
	str	x0, [sp]
Lloh30:
	adrp	x1, l_.str.1@PAGE
Lloh31:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x8
LBB0_12:
	bl	_elprintf
LBB0_13:
	ldr	w8, [x20]
	tbnz	w8, #31, LBB0_21
; %bb.14:
	ldr	w9, [x21]
	tbnz	w9, #31, LBB0_21
; %bb.15:
	cmp	w8, w19
	ccmp	w9, w22, #0, eq
	b.eq	LBB0_21
; %bb.16:
Lloh32:
	adrp	x19, _EL_ANOMALY@GOTPAGE
Lloh33:
	ldr	x19, [x19, _EL_ANOMALY@GOTPAGEOFF]
	ldr	w0, [x19]
Lloh34:
	adrp	x10, _SekPc@GOTPAGE
Lloh35:
	ldr	x10, [x10, _SekPc@GOTPAGEOFF]
Lloh36:
	ldr	w10, [x10]
	stp	x9, x10, [sp, #8]
	str	x8, [sp]
Lloh37:
	adrp	x1, l_.str.2@PAGE
Lloh38:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_elprintf
	ldr	w8, [x21]
Lloh39:
	adrp	x22, _Pico@GOTPAGE
Lloh40:
	ldr	x22, [x22, _Pico@GOTPAGEOFF]
	ldr	w10, [x22]
	ldr	w9, [x20]
	sub	w10, w10, w9
	cmp	w8, w10
	b.le	LBB0_18
; %bb.17:
	ldr	w0, [x19]
Lloh41:
	adrp	x1, l_.str.3@PAGE
Lloh42:
	add	x1, x1, l_.str.3@PAGEOFF
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_elprintf
LBB0_18:
	mov	w19, #0
Lloh43:
	adrp	x23, _m68k_read8_map@GOTPAGE
Lloh44:
	ldr	x23, [x23, _m68k_read8_map@GOTPAGEOFF]
Lloh45:
	adrp	x24, _m68k_read16_map@GOTPAGE
Lloh46:
	ldr	x24, [x24, _m68k_read16_map@GOTPAGEOFF]
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x23]
	sub	w2, w8, #1
	ldr	x8, [x22, #8]
	add	x3, x8, w9, sxtw
	mov	x1, x19
	mov	w4, #0
	bl	_cpu68k_map_set
	ldr	w0, [x24]
	ldr	w8, [x21]
	sub	w2, w8, #1
	ldr	x8, [x22, #8]
	ldrsw	x9, [x20]
	add	x3, x8, x9
	mov	x1, x19
	mov	w4, #0
	bl	_cpu68k_map_set
	ldr	w8, [x21]
	add	w19, w8, w19
	cmp	w19, #1024, lsl #12             ; =4194304
	b.ge	LBB0_21
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=1
	ldr	w9, [x20]
	b	LBB0_19
LBB0_21:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpLdrGot	Lloh45, Lloh46
	.loh AdrpLdrGot	Lloh43, Lloh44
	.cfi_endproc
                                        ; -- End function
	.comm	_realtec_bank,4,2               ; @realtec_bank
	.comm	_realtec_size,4,2               ; @realtec_size
	.comm	_EL_ANOMALY,4,2                 ; @EL_ANOMALY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"write [%06x] %02x @ %06x"

	.comm	_SekPc,4,2                      ; @SekPc
l_.str.1:                               ; @.str.1
	.asciz	"realtec: unexpected write [%06x] %02x @ %06x"

l_.str.2:                               ; @.str.2
	.asciz	"realtec: new bank %06x, size %06x"

	.comm	_Pico,16,3                      ; @Pico
l_.str.3:                               ; @.str.3
	.asciz	"realtec: bank too large / out of range?"

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