	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PBI_MIO_D1PutByte              ## -- Begin function PBI_MIO_D1PutByte
	.p2align	4, 0x90
_PBI_MIO_D1PutByte:                     ## @PBI_MIO_D1PutByte
	.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, %r14d
	movl	%edi, %r12d
	movq	_mio_ram_bank_offset@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %r15
	movq	_mio_ram_enabled@GOTPCREL(%rip), %r13
	movl	(%r13), %ebx
	andl	$65507, %r12d                   ## imm = 0xFFE3
	leal	11808(%r12), %eax
	cmpw	$3, %ax
	ja	LBB0_14
## %bb.1:
	movzwl	%ax, %eax
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_2:
	movl	%r15d, %eax
	andl	$983040, %eax                   ## imm = 0xF0000
	movl	%r14d, %ecx
	shll	$8, %ecx
	orl	%eax, %ecx
	movl	%ecx, (%rdx)
	jmp	LBB0_14
LBB0_5:
	movzwl	%r15w, %eax
	movl	%r14d, %ecx
	andl	$15, %ecx
	shll	$16, %ecx
	orl	%eax, %ecx
	movl	%ecx, (%rdx)
	movl	%r14d, %eax
	andl	$32, %eax
	movl	%eax, (%r13)
	movq	_mio_scsi_enabled@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_14
## %bb.6:
	movl	%r14d, %edi
	shrl	$4, %edi
	andl	$1, %edi
	callq	_PBI_SCSI_PutSEL
	jmp	LBB0_13
LBB0_7:
	movq	_mio_rom_bank@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	je	LBB0_14
## %bb.8:
	leal	-4(%r14), %eax
	roll	$30, %eax
	cmpl	$7, %eax
	ja	LBB0_11
## %bb.9:
	movl	$139, %ecx
	btl	%eax, %ecx
	jb	LBB0_10
LBB0_11:
	movq	_MEMORY_mem@GOTPCREL(%rip), %rax
	movl	$55296, %edi                    ## imm = 0xD800
	addq	(%rax), %rdi
	movq	_MEMORY_os@GOTPCREL(%rip), %rax
	movl	$6144, %esi                     ## imm = 0x1800
	addq	(%rax), %rsi
	movl	$2048, %edx                     ## imm = 0x800
	callq	_memcpy
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_12
LBB0_3:
	movq	_mio_scsi_enabled@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_14
## %bb.4:
	movl	%r14d, %edi
	xorl	$255, %edi
	callq	_PBI_SCSI_PutByte
	movl	$1, %edi
	callq	_PBI_SCSI_PutACK
	xorl	%edi, %edi
	callq	_PBI_SCSI_PutACK
	jmp	LBB0_13
LBB0_10:
	cltq
	leaq	l_switch.table.PBI_MIO_D1PutByte(%rip), %rcx
	movq	_MEMORY_mem@GOTPCREL(%rip), %rdx
	movl	$55296, %edi                    ## imm = 0xD800
	addq	(%rdx), %rdi
	movq	_mio_rom@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rsi
	addq	(%rcx,%rax,8), %rsi
	movl	$2048, %edx                     ## imm = 0x800
	callq	_memcpy
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_printf
LBB0_12:
	movl	%eax, %edi
	callq	_D
	movq	_mio_rom_bank@GOTPCREL(%rip), %rax
	movl	%r14d, (%rax)
LBB0_13:
	movq	_mio_ram_bank_offset@GOTPCREL(%rip), %rdx
LBB0_14:
	movslq	(%rdx), %rsi
	movl	(%r13), %eax
	testl	%eax, %eax
	je	LBB0_18
## %bb.15:
	cmpl	%eax, %ebx
	je	LBB0_18
## %bb.16:
	movq	_MEMORY_mem@GOTPCREL(%rip), %rax
	movl	$54784, %edi                    ## imm = 0xD600
	addq	(%rax), %rdi
	movq	_mio_ram@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	jmp	LBB0_17
LBB0_18:
	testl	%eax, %eax
	je	LBB0_21
## %bb.19:
	cmpl	%esi, %r15d
	je	LBB0_21
## %bb.20:
	movq	_mio_ram@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	%r15, %rdi
	movq	_MEMORY_mem@GOTPCREL(%rip), %r15
	movl	$54784, %ebx                    ## imm = 0xD600
	movq	(%r15), %rsi
	addq	%rbx, %rsi
	movq	%rdx, %r13
	movl	$256, %edx                      ## imm = 0x100
	callq	_memcpy
	addq	(%r15), %rbx
	movslq	(%r13), %rsi
	movq	_mio_ram@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	movq	%rbx, %rdi
LBB0_17:
	movl	$256, %edx                      ## imm = 0x100
	callq	_memcpy
LBB0_24:
	movq	_CPU_remember_PC@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	_CPU_remember_PC_curpos@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	decl	%eax
	movq	_CPU_REMEMBER_PC_STEPS@GOTPCREL(%rip), %rsi
	cltd
	idivl	(%rsi)
	movslq	%edx, %rax
	movl	(%rcx,%rax,4), %ecx
	leaq	L_.str.2(%rip), %rdi
	movl	%r12d, %esi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_printf
	movl	%eax, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_D                              ## TAILCALL
LBB0_21:
	testl	%eax, %eax
	jne	LBB0_24
## %bb.22:
	cmpl	%eax, %ebx
	je	LBB0_24
## %bb.23:
	movq	_mio_ram@GOTPCREL(%rip), %rax
	addq	(%rax), %r15
	movq	_MEMORY_mem@GOTPCREL(%rip), %r13
	movl	$54784, %ebx                    ## imm = 0xD600
	movq	(%r13), %rsi
	addq	%rbx, %rsi
	movq	%r15, %rdi
	movl	$256, %edx                      ## imm = 0x100
	callq	_memcpy
	addq	(%r13), %rbx
	movq	%rbx, %rdi
	movl	$255, %esi
	movl	$256, %edx                      ## imm = 0x100
	callq	_memset
	jmp	LBB0_24
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_3, LBB0_3-LJTI0_0
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
LJTI0_0:
	.long	L0_0_set_2
	.long	L0_0_set_3
	.long	L0_0_set_5
	.long	L0_0_set_7
	.end_data_region
                                        ## -- End function
	.comm	_mio_ram_bank_offset,4,2        ## @mio_ram_bank_offset
	.comm	_mio_ram_enabled,4,2            ## @mio_ram_enabled
	.comm	_mio_scsi_enabled,8,3           ## @mio_scsi_enabled
	.comm	_mio_rom_bank,4,2               ## @mio_rom_bank
	.comm	_MEMORY_mem,8,3                 ## @MEMORY_mem
	.comm	_mio_rom,8,3                    ## @mio_rom
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mio bank:%2x activated\n"

	.comm	_MEMORY_os,8,3                  ## @MEMORY_os
L_.str.1:                               ## @.str.1
	.asciz	"Floating point rom activated\n"

	.comm	_mio_ram,8,3                    ## @mio_ram
L_.str.2:                               ## @.str.2
	.asciz	"MIO Write addr:%4x byte:%2x, cpu:%4x\n"

	.comm	_CPU_remember_PC,8,3            ## @CPU_remember_PC
	.comm	_CPU_remember_PC_curpos,4,2     ## @CPU_remember_PC_curpos
	.comm	_CPU_REMEMBER_PC_STEPS,4,2      ## @CPU_REMEMBER_PC_STEPS
	.section	__TEXT,__const
	.p2align	3                               ## @switch.table.PBI_MIO_D1PutByte
l_switch.table.PBI_MIO_D1PutByte:
	.quad	8192                            ## 0x2000
	.quad	10240                           ## 0x2800
	.quad	8192                            ## 0x2000
	.quad	12288                           ## 0x3000
	.quad	8192                            ## 0x2000
	.quad	8192                            ## 0x2000
	.quad	8192                            ## 0x2000
	.quad	14336                           ## 0x3800

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PBI_MIO_D1PutByte              ; -- Begin function PBI_MIO_D1PutByte
	.p2align	2
_PBI_MIO_D1PutByte:                     ; @PBI_MIO_D1PutByte
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x1
Lloh0:
	adrp	x21, _mio_ram_bank_offset@GOTPAGE
Lloh1:
	ldr	x21, [x21, _mio_ram_bank_offset@GOTPAGEOFF]
	ldrsw	x22, [x21]
Lloh2:
	adrp	x24, _mio_ram_enabled@GOTPAGE
Lloh3:
	ldr	x24, [x24, _mio_ram_enabled@GOTPAGEOFF]
	ldr	w23, [x24]
	mov	w8, #65507
	and	w20, w0, w8
	mov	w8, #-53728
	add	w8, w20, w8
	cmp	w8, #3
	b.hi	LBB0_13
; %bb.1:
Lloh4:
	adrp	x9, lJTI0_0@PAGE
Lloh5:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
	and	w8, w22, #0xf0000
	orr	w8, w8, w19, lsl #8
	str	w8, [x21]
	b	LBB0_13
LBB0_3:
	and	w8, w22, #0xffff
	bfi	w8, w19, #16, #4
	str	w8, [x21]
	and	w8, w19, #0x20
	str	w8, [x24]
Lloh6:
	adrp	x8, _mio_scsi_enabled@GOTPAGE
Lloh7:
	ldr	x8, [x8, _mio_scsi_enabled@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cbz	x8, LBB0_13
; %bb.4:
	ubfx	w0, w19, #4, #1
	bl	_PBI_SCSI_PutSEL
	b	LBB0_13
LBB0_5:
Lloh9:
	adrp	x25, _mio_rom_bank@GOTPAGE
Lloh10:
	ldr	x25, [x25, _mio_rom_bank@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w8, w19
	b.eq	LBB0_13
; %bb.6:
	sub	w8, w19, #4
	ror	w8, w8, #2
	cmp	w8, #7
	b.hi	LBB0_8
; %bb.7:
	mov	w9, #139
	lsr	w9, w9, w8
	tbnz	w9, #0, LBB0_11
LBB0_8:
Lloh11:
	adrp	x8, _MEMORY_mem@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MEMORY_mem@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	mov	w9, #55296
	add	x0, x8, x9
Lloh14:
	adrp	x8, _MEMORY_os@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MEMORY_os@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	mov	w9, #6144
	add	x1, x8, x9
	mov	w2, #2048
	bl	_memcpy
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_12
LBB0_9:
Lloh19:
	adrp	x8, _mio_scsi_enabled@GOTPAGE
Lloh20:
	ldr	x8, [x8, _mio_scsi_enabled@GOTPAGEOFF]
Lloh21:
	ldr	x8, [x8]
	cbz	x8, LBB0_13
; %bb.10:
	eor	w0, w19, #0xff
	bl	_PBI_SCSI_PutByte
	mov	w0, #1
	bl	_PBI_SCSI_PutACK
	mov	w0, #0
	bl	_PBI_SCSI_PutACK
	b	LBB0_13
LBB0_11:
Lloh22:
	adrp	x9, l_switch.table.PBI_MIO_D1PutByte@PAGE
Lloh23:
	add	x9, x9, l_switch.table.PBI_MIO_D1PutByte@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
Lloh24:
	adrp	x9, _MEMORY_mem@GOTPAGE
Lloh25:
	ldr	x9, [x9, _MEMORY_mem@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	mov	w10, #55296
	add	x0, x9, x10
Lloh27:
	adrp	x9, _mio_rom@GOTPAGE
Lloh28:
	ldr	x9, [x9, _mio_rom@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w2, #2048
	bl	_memcpy
	mov	x8, x19
	str	x8, [sp]
Lloh30:
	adrp	x0, l_.str@PAGE
Lloh31:
	add	x0, x0, l_.str@PAGEOFF
LBB0_12:
	bl	_printf
	bl	_D
	str	w19, [x25]
LBB0_13:
	ldrsw	x8, [x21]
	ldr	w9, [x24]
	cmp	w9, #0
	ccmp	w23, w9, #4, ne
	b.ne	LBB0_17
; %bb.14:
	cmp	w9, #0
	ccmp	w22, w8, #4, ne
	b.ne	LBB0_18
; %bb.15:
	cmp	w9, #0
	ccmp	w23, w9, #4, eq
	b.eq	LBB0_20
; %bb.16:
Lloh32:
	adrp	x8, _mio_ram@GOTPAGE
Lloh33:
	ldr	x8, [x8, _mio_ram@GOTPAGEOFF]
Lloh34:
	ldr	x8, [x8]
	add	x0, x8, x22
Lloh35:
	adrp	x21, _MEMORY_mem@GOTPAGE
Lloh36:
	ldr	x21, [x21, _MEMORY_mem@GOTPAGEOFF]
	ldr	x8, [x21]
	mov	w22, #54784
	add	x1, x8, x22
	mov	w2, #256
	bl	_memcpy
	ldr	x8, [x21]
	add	x0, x8, x22
	mov	w1, #255
	mov	w2, #256
	bl	_memset
	b	LBB0_20
LBB0_17:
Lloh37:
	adrp	x9, _MEMORY_mem@GOTPAGE
Lloh38:
	ldr	x9, [x9, _MEMORY_mem@GOTPAGEOFF]
Lloh39:
	ldr	x9, [x9]
	mov	w10, #54784
	add	x0, x9, x10
Lloh40:
	adrp	x9, _mio_ram@GOTPAGE
Lloh41:
	ldr	x9, [x9, _mio_ram@GOTPAGEOFF]
Lloh42:
	ldr	x9, [x9]
	add	x1, x9, x8
	b	LBB0_19
LBB0_18:
Lloh43:
	adrp	x23, _mio_ram@GOTPAGE
Lloh44:
	ldr	x23, [x23, _mio_ram@GOTPAGEOFF]
	ldr	x8, [x23]
	add	x0, x8, x22
Lloh45:
	adrp	x22, _MEMORY_mem@GOTPAGE
Lloh46:
	ldr	x22, [x22, _MEMORY_mem@GOTPAGEOFF]
	ldr	x8, [x22]
	mov	w24, #54784
	add	x1, x8, x24
	mov	w2, #256
	bl	_memcpy
	ldr	x8, [x22]
	add	x0, x8, x24
	ldr	x8, [x23]
	ldrsw	x9, [x21]
	add	x1, x8, x9
LBB0_19:
	mov	w2, #256
	bl	_memcpy
LBB0_20:
Lloh47:
	adrp	x8, _CPU_remember_PC@GOTPAGE
Lloh48:
	ldr	x8, [x8, _CPU_remember_PC@GOTPAGEOFF]
Lloh49:
	ldr	x8, [x8]
Lloh50:
	adrp	x9, _CPU_remember_PC_curpos@GOTPAGE
Lloh51:
	ldr	x9, [x9, _CPU_remember_PC_curpos@GOTPAGEOFF]
Lloh52:
	ldr	w9, [x9]
Lloh53:
	adrp	x10, _CPU_REMEMBER_PC_STEPS@GOTPAGE
Lloh54:
	ldr	x10, [x10, _CPU_REMEMBER_PC_STEPS@GOTPAGEOFF]
	sub	w9, w9, #1
Lloh55:
	ldr	w10, [x10]
	sdiv	w11, w9, w10
	msub	w9, w11, w10, w9
	ldr	w8, [x8, w9, sxtw #2]
	stp	x19, x8, [sp, #8]
	str	x20, [sp]
Lloh56:
	adrp	x0, l_.str.2@PAGE
Lloh57:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_printf
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_D
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh45, Lloh46
	.loh AdrpLdrGot	Lloh43, Lloh44
	.loh AdrpAdd	Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_9-LBB0_2)>>2
	.byte	(LBB0_3-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
                                        ; -- End function
	.comm	_mio_ram_bank_offset,4,2        ; @mio_ram_bank_offset
	.comm	_mio_ram_enabled,4,2            ; @mio_ram_enabled
	.comm	_mio_scsi_enabled,8,3           ; @mio_scsi_enabled
	.comm	_mio_rom_bank,4,2               ; @mio_rom_bank
	.comm	_MEMORY_mem,8,3                 ; @MEMORY_mem
	.comm	_mio_rom,8,3                    ; @mio_rom
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mio bank:%2x activated\n"

	.comm	_MEMORY_os,8,3                  ; @MEMORY_os
l_.str.1:                               ; @.str.1
	.asciz	"Floating point rom activated\n"

	.comm	_mio_ram,8,3                    ; @mio_ram
l_.str.2:                               ; @.str.2
	.asciz	"MIO Write addr:%4x byte:%2x, cpu:%4x\n"

	.comm	_CPU_remember_PC,8,3            ; @CPU_remember_PC
	.comm	_CPU_remember_PC_curpos,4,2     ; @CPU_remember_PC_curpos
	.comm	_CPU_REMEMBER_PC_STEPS,4,2      ; @CPU_REMEMBER_PC_STEPS
	.section	__TEXT,__const
	.p2align	3                               ; @switch.table.PBI_MIO_D1PutByte
l_switch.table.PBI_MIO_D1PutByte:
	.quad	8192                            ; 0x2000
	.quad	10240                           ; 0x2800
	.quad	8192                            ; 0x2000
	.quad	12288                           ; 0x3000
	.quad	8192                            ; 0x2000
	.quad	8192                            ; 0x2000
	.quad	8192                            ; 0x2000
	.quad	14336                           ; 0x3800

.subsections_via_symbols
