	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function MosaicPutByte
_MosaicPutByte:                         ## @MosaicPutByte
	.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
	cmpl	$65472, %edi                    ## imm = 0xFFC0
	jl	LBB0_13
## %bb.1:
	movl	%edi, %ebx
	addl	$-65472, %ebx                   ## imm = 0xFFFF0040
	movq	_mosaic_curbank@GOTPCREL(%rip), %r15
	movslq	(%r15), %rdi
	cmpl	%edi, %ebx
	je	LBB0_13
## %bb.2:
	movq	_mosaic_current_num_banks@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %ebx
	jl	LBB0_4
## %bb.3:
	cmpl	%eax, %edi
	jge	LBB0_13
LBB0_4:
	cmpl	%eax, %ebx
	jl	LBB0_7
## %bb.5:
	cmpl	%eax, %edi
	jge	LBB0_7
## %bb.6:
	movq	_mosaic_ram@GOTPCREL(%rip), %rax
	shlq	$12, %rdi
	addq	(%rax), %rdi
	movq	_MEMORY_mem@GOTPCREL(%rip), %rax
	movl	$49152, %esi                    ## imm = 0xC000
	addq	(%rax), %rsi
	movl	$4096, %edx                     ## imm = 0x1000
	callq	_memcpy
	movl	$49152, %edi                    ## imm = 0xC000
	movl	$255, %esi
	movl	$4096, %edx                     ## imm = 0x1000
	callq	_MEMORY_dFillMem
	movl	$49152, %edi                    ## imm = 0xC000
	movl	$53247, %esi                    ## imm = 0xCFFF
	callq	_MEMORY_SetROM
	jmp	LBB0_12
LBB0_7:
	cmpl	%eax, %ebx
	jge	LBB0_10
## %bb.8:
	cmpl	%eax, %edi
	jl	LBB0_10
## %bb.9:
	movq	_MEMORY_mem@GOTPCREL(%rip), %rax
	movl	$49152, %edi                    ## imm = 0xC000
	addq	(%rax), %rdi
	movq	_mosaic_ram@GOTPCREL(%rip), %rax
	movl	%ebx, %ecx
	shll	$12, %ecx
	movslq	%ecx, %rsi
	addq	(%rax), %rsi
	jmp	LBB0_11
LBB0_10:
	movq	_mosaic_ram@GOTPCREL(%rip), %r12
	shlq	$12, %rdi
	addq	(%r12), %rdi
	movq	_MEMORY_mem@GOTPCREL(%rip), %r13
	movl	$49152, %r14d                   ## imm = 0xC000
	movq	(%r13), %rsi
	addq	%r14, %rsi
	movl	$4096, %edx                     ## imm = 0x1000
	callq	_memcpy
	addq	(%r13), %r14
	movl	%ebx, %eax
	shll	$12, %eax
	movslq	%eax, %rsi
	addq	(%r12), %rsi
	movq	%r14, %rdi
LBB0_11:
	movl	$4096, %edx                     ## imm = 0x1000
	callq	_memcpy
	movl	$49152, %edi                    ## imm = 0xC000
	movl	$53247, %esi                    ## imm = 0xCFFF
	callq	_MEMORY_SetRAM
LBB0_12:
	movl	%ebx, (%r15)
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mosaic_curbank,4,2             ## @mosaic_curbank
	.comm	_mosaic_current_num_banks,4,2   ## @mosaic_current_num_banks
	.comm	_mosaic_ram,8,3                 ## @mosaic_ram
	.comm	_MEMORY_mem,8,3                 ## @MEMORY_mem
	.no_dead_strip	_MosaicPutByte
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function MosaicPutByte
_MosaicPutByte:                         ; @MosaicPutByte
	.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
	mov	w8, #65472
	cmp	w0, w8
	b.lt	LBB0_10
; %bb.1:
	mov	w9, #-65472
Lloh0:
	adrp	x19, _mosaic_curbank@GOTPAGE
Lloh1:
	ldr	x19, [x19, _mosaic_curbank@GOTPAGEOFF]
	ldrsw	x8, [x19]
	add	w20, w0, w9
	cmp	w20, w8
	b.eq	LBB0_10
; %bb.2:
Lloh2:
	adrp	x9, _mosaic_current_num_banks@GOTPAGE
Lloh3:
	ldr	x9, [x9, _mosaic_current_num_banks@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	cmp	w20, w9
	ccmp	w8, w9, #8, ge
	b.ge	LBB0_10
; %bb.3:
	cmp	w20, w9
	ccmp	w8, w9, #0, ge
	b.lt	LBB0_6
; %bb.4:
	cmp	w20, w9
	ccmp	w8, w9, #8, lt
	b.ge	LBB0_7
; %bb.5:
Lloh5:
	adrp	x21, _mosaic_ram@GOTPAGE
Lloh6:
	ldr	x21, [x21, _mosaic_ram@GOTPAGEOFF]
	ldr	x9, [x21]
	add	x0, x9, x8, lsl #12
Lloh7:
	adrp	x22, _MEMORY_mem@GOTPAGE
Lloh8:
	ldr	x22, [x22, _MEMORY_mem@GOTPAGEOFF]
	ldr	x8, [x22]
	add	x1, x8, #12, lsl #12            ; =49152
	mov	w2, #4096
	bl	_memcpy
	ldr	x8, [x22]
	add	x0, x8, #12, lsl #12            ; =49152
	ldr	x8, [x21]
	b	LBB0_8
LBB0_6:
Lloh9:
	adrp	x9, _mosaic_ram@GOTPAGE
Lloh10:
	ldr	x9, [x9, _mosaic_ram@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	add	x0, x9, x8, lsl #12
Lloh12:
	adrp	x8, _MEMORY_mem@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MEMORY_mem@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	add	x1, x8, #12, lsl #12            ; =49152
	mov	w2, #4096
	bl	_memcpy
	mov	w0, #49152
	mov	w1, #255
	mov	w2, #4096
	bl	_MEMORY_dFillMem
	mov	w0, #49152
	mov	w1, #53247
	bl	_MEMORY_SetROM
	b	LBB0_9
LBB0_7:
Lloh15:
	adrp	x8, _MEMORY_mem@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MEMORY_mem@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	add	x0, x8, #12, lsl #12            ; =49152
Lloh18:
	adrp	x8, _mosaic_ram@GOTPAGE
Lloh19:
	ldr	x8, [x8, _mosaic_ram@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
LBB0_8:
	lsl	w9, w20, #12
	add	x1, x8, w9, sxtw
	mov	w2, #4096
	bl	_memcpy
	mov	w0, #49152
	mov	w1, #53247
	bl	_MEMORY_SetRAM
LBB0_9:
	str	w20, [x19]
LBB0_10:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_mosaic_curbank,4,2             ; @mosaic_curbank
	.comm	_mosaic_current_num_banks,4,2   ; @mosaic_current_num_banks
	.comm	_mosaic_ram,8,3                 ; @mosaic_ram
	.comm	_MEMORY_mem,8,3                 ; @MEMORY_mem
	.no_dead_strip	_MosaicPutByte
.subsections_via_symbols
