	.file	"extr_memory.c_MosaicPutByte.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	MosaicPutByte, @function
MosaicPutByte:
.LFB0:
	.cfi_startproc
	endbr64
	cmp	edi, 65471
	jle	.L7
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	lea	ebx, -65472[rdi]
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	edi, DWORD PTR mosaic_curbank[rip]
	cmp	edi, ebx
	je	.L1
	mov	eax, DWORD PTR mosaic_current_num_banks[rip]
	cmp	eax, ebx
	jg	.L3
	cmp	edi, eax
	jge	.L1
	mov	rax, QWORD PTR MEMORY_mem[rip]
	sal	edi, 12
	mov	edx, 4096
	movsx	rdi, edi
	add	rdi, QWORD PTR mosaic_ram[rip]
	lea	rsi, 49152[rax]
	call	memcpy@PLT
	mov	edx, 4096
	mov	esi, 255
	mov	edi, 49152
	call	MEMORY_dFillMem@PLT
	mov	esi, 53247
	mov	edi, 49152
	call	MEMORY_SetROM@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rcx, QWORD PTR MEMORY_mem[rip]
	mov	ebp, ebx
	mov	rsi, QWORD PTR mosaic_ram[rip]
	sal	ebp, 12
	lea	r8, 49152[rcx]
	movsx	rbp, ebp
	cmp	edi, eax
	jge	.L11
	sal	edi, 12
	mov	edx, 4096
	movsx	rdi, edi
	add	rdi, rsi
	mov	rsi, r8
	call	memcpy@PLT
	mov	rsi, QWORD PTR mosaic_ram[rip]
	mov	edx, 4096
	mov	rax, QWORD PTR MEMORY_mem[rip]
	add	rsi, rbp
	lea	rdi, 49152[rax]
	call	memcpy@PLT
	mov	esi, 53247
	mov	edi, 49152
	call	MEMORY_SetRAM@PLT
.L4:
	mov	DWORD PTR mosaic_curbank[rip], ebx
.L1:
	add	rsp, 8
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore 3
	.cfi_restore 6
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -24
	.cfi_offset 6, -16
	add	rsi, rbp
	mov	rdi, r8
	mov	edx, 4096
	call	memcpy@PLT
	mov	esi, 53247
	mov	edi, 49152
	call	MEMORY_SetRAM@PLT
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	MosaicPutByte, .-MosaicPutByte
	.comm	mosaic_ram,8,8
	.comm	mosaic_current_num_banks,4,4
	.comm	mosaic_curbank,4,4
	.comm	MEMORY_mem,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_memory.c_MosaicPutByte.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	MosaicPutByte, %function
MosaicPutByte:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L12
	cmp	r0, r3
	bxle	lr
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r5, .L12+4
	sub	r4, r0, #65280
	ldr	r3, [r5]
	sub	r4, r4, #192
	cmp	r3, r4
	popeq	{r4, r5, r6, r7, r8, pc}
	ldr	r2, .L12+8
	ldr	r2, [r2]
	cmp	r2, r4
	bgt	.L3
	cmp	r3, r2
	popge	{r4, r5, r6, r7, r8, pc}
	ldr	r2, .L12+12
	ldr	r1, .L12+16
	ldr	r0, [r2]
	ldr	r1, [r1]
	add	r0, r0, r3, lsl #12
	mov	r2, #4096
	add	r1, r1, #49152
	bl	memcpy
	mov	r2, #4096
	mov	r1, #255
	mov	r0, #49152
	bl	MEMORY_dFillMem
	ldr	r1, .L12+20
	mov	r0, #49152
	bl	MEMORY_SetROM
	b	.L4
.L3:
	ldr	r6, .L12+16
	ldr	r7, .L12+12
	cmp	r3, r2
	ldr	r0, [r6]
	ldr	r2, [r7]
	lsl	r8, r4, #12
	add	r0, r0, #49152
	addge	r1, r8, r2
	bge	.L10
	mov	r1, r0
	add	r0, r2, r3, lsl #12
	mov	r2, #4096
	bl	memcpy
	ldr	r1, [r7]
	ldr	r0, [r6]
	add	r1, r8, r1
	add	r0, r0, #49152
.L10:
	mov	r2, #4096
	bl	memcpy
	mov	r0, #49152
	ldr	r1, .L12+20
	bl	MEMORY_SetRAM
.L4:
	str	r4, [r5]
	pop	{r4, r5, r6, r7, r8, pc}
.L13:
	.align	2
.L12:
	.word	65471
	.word	mosaic_curbank
	.word	mosaic_current_num_banks
	.word	mosaic_ram
	.word	MEMORY_mem
	.word	53247
	.size	MosaicPutByte, .-MosaicPutByte
	.comm	mosaic_ram,4,4
	.comm	mosaic_current_num_banks,4,4
	.comm	mosaic_curbank,4,4
	.comm	MEMORY_mem,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
