	.file	"extr_sms_cart.c_write_mapper_93c46.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	write_mapper_93c46, @function
write_mapper_93c46:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	ebp, esi
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	ebx, edi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	cmp	edi, 32768
	je	.L9
	cmp	edi, 65532
	je	.L10
	jbe	.L4
	movzx	esi, sil
	and	edi, 3
	call	mapper_16k_w@PLT
.L4:
	mov	rdx, QWORD PTR z80_writemap[rip]
	mov	eax, ebx
	and	ebx, 1023
	shr	eax, 10
	mov	rax, QWORD PTR [rdx+rax*8]
	mov	BYTE PTR [rax+rbx], bpl
	add	rsp, 8
	.cfi_remember_state
	.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
.L10:
	.cfi_restore_state
	mov	eax, esi
	and	eax, 8
	mov	BYTE PTR eeprom_93c[rip], al
	test	sil, sil
	jns	.L4
	xor	eax, eax
	call	eeprom_93c_init@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L9:
	cmp	BYTE PTR eeprom_93c[rip], 0
	je	.L4
	add	rsp, 8
	.cfi_def_cfa_offset 24
	movzx	edi, sil
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	jmp	eeprom_93c_write@PLT
	.cfi_endproc
.LFE0:
	.size	write_mapper_93c46, .-write_mapper_93c46
	.comm	z80_writemap,8,8
	.comm	eeprom_93c,1,1
	.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_sms_cart.c_write_mapper_93c46.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	write_mapper_93c46, %function
write_mapper_93c46:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	cmp	r0, #32768
	push	{r4, r5, r6, lr}
	mov	r4, r0
	mov	r5, r1
	beq	.L9
	ldr	r3, .L11
	cmp	r0, r3
	beq	.L10
	bls	.L4
	and	r0, r0, #3
	bl	mapper_16k_w
.L4:
	ldr	r3, .L11+4
	lsr	r2, r4, #10
	ldr	r3, [r3]
	lsl	r4, r4, #22
	ldr	r3, [r3, r2, lsl #2]
	lsr	r4, r4, #22
	strb	r5, [r3, r4]
	pop	{r4, r5, r6, pc}
.L10:
	ldr	r3, .L11+8
	and	r2, r1, #8
	tst	r1, #128
	strb	r2, [r3]
	beq	.L4
	bl	eeprom_93c_init
	b	.L4
.L9:
	ldr	r3, .L11+8
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L4
	pop	{r4, r5, r6, lr}
	mov	r0, r1
	b	eeprom_93c_write
.L12:
	.align	2
.L11:
	.word	65532
	.word	z80_writemap
	.word	eeprom_93c
	.size	write_mapper_93c46, .-write_mapper_93c46
	.comm	z80_writemap,4,4
	.comm	eeprom_93c,1,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
