	.file	"extr_eeprom.c_EEPROM_read.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"eeprom: early read, cycles=%i"
.LC1:
	.string	"eeprom: r ack"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC2:
	.string	"eeprom: read: addr %02x, cycle %i, reg %02x"
	.section	.rodata.str1.1
.LC3:
	.string	"eeprom: read done, byte %02x"
	.text
	.p2align 4
	.globl	EEPROM_read
	.type	EEPROM_read, @function
EEPROM_read:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	edi, DWORD PTR Pico[rip]
	sar	edi, 6
	call	EEPROM_write_do@PLT
	mov	r14d, DWORD PTR Pico[rip]
	xor	eax, eax
	mov	ebp, DWORD PTR Pico[rip+4]
	mov	r12d, DWORD PTR Pico[rip+8]
	mov	r13d, DWORD PTR Pico[rip+12]
	call	SekCyclesDone@PLT
	mov	ebx, r14d
	sub	eax, DWORD PTR last_write[rip]
	shr	ebx, 6
	and	ebx, 1
	test	r14b, -128
	jne	.L2
	cmp	eax, 23
	ja	.L26
.L2:
	test	r14b, 8
	je	.L3
	cmp	r12d, 27
	ja	.L3
	mov	eax, 134480384
	bt	rax, r12
	jnc	.L4
	mov	edi, DWORD PTR EL_EEPROM[rip]
	lea	rsi, .LC1[rip]
	xor	eax, eax
	xor	ebx, ebx
	call	elprintf@PLT
.L3:
	mov	ecx, DWORD PTR SRam[rip+8]
	mov	eax, ebx
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	sal	eax, cl
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	.cfi_restore_state
	mov	edi, DWORD PTR EL_EEPROM[rip]
	mov	edx, eax
	xor	eax, eax
	add	r12d, 1
	lea	rsi, .LC0[rip]
	call	elprintf@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L4:
	lea	eax, -10[r12]
	cmp	eax, 7
	ja	.L3
	mov	edx, ebp
	mov	r15d, 17
	and	edx, 8191
	sub	r15d, r12d
	cmp	QWORD PTR SRam[rip+16], 0
	je	.L5
	and	r13d, 1
	je	.L3
	mov	edi, DWORD PTR EL_EEPROM[rip]
	mov	r8d, r14d
	mov	ecx, r12d
	xor	eax, eax
	lea	rsi, .LC2[rip]
	mov	DWORD PTR 12[rsp], edx
	call	elprintf@PLT
	mov	ebx, DWORD PTR 12[rsp]
	test	r15d, r15d
	jne	.L7
.L24:
	mov	rax, QWORD PTR SRam[rip]
	mov	edi, DWORD PTR EL_EEPROM[rip]
	lea	rsi, .LC3[rip]
	mov	edx, DWORD PTR [rax+rbx*4]
	xor	eax, eax
	call	elprintf@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	and	ebp, 1
	je	.L3
	mov	edi, DWORD PTR EL_EEPROM[rip]
	shr	edx
	xor	eax, eax
	mov	r8d, r14d
	mov	ecx, r12d
	lea	rsi, .LC2[rip]
	mov	ebx, edx
	call	elprintf@PLT
	test	r15d, r15d
	je	.L24
.L7:
	mov	rax, QWORD PTR SRam[rip]
	mov	ecx, r15d
	mov	ebx, DWORD PTR [rax+rbx*4]
	shr	ebx, cl
	and	ebx, 1
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	EEPROM_read, .-EEPROM_read
	.comm	last_write,4,4
	.comm	SRam,24,16
	.comm	Pico,16,16
	.comm	EL_EEPROM,4,4
	.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_eeprom.c_EEPROM_read.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"eeprom: early read, cycles=%i\000"
	.align	2
.LC1:
	.ascii	"eeprom: r ack\000"
	.align	2
.LC2:
	.ascii	"eeprom: read: addr %02x, cycle %i, reg %02x\000"
	.align	2
.LC3:
	.ascii	"eeprom: read done, byte %02x\000"
	.text
	.align	2
	.global	EEPROM_read
	.syntax unified
	.arm
	.fpu softvfp
	.type	EEPROM_read, %function
EEPROM_read:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r4, .L27
	sub	sp, sp, #12
	ldr	r0, [r4]
	asr	r0, r0, #6
	bl	EEPROM_write_do
	ldm	r4, {r5, r7}
	ldr	r6, [r4, #8]
	ldr	r8, [r4, #12]
	bl	SekCyclesDone
	ldr	r3, .L27+4
	lsr	r1, r5, #7
	ldr	r2, [r3]
	eor	r1, r1, #1
	sub	r2, r0, r2
	cmp	r2, #23
	movls	r1, #0
	andhi	r1, r1, #1
	lsr	r4, r5, #6
	cmp	r1, #0
	and	r4, r4, #1
	bne	.L26
.L2:
	tst	r5, #8
	beq	.L23
	cmp	r6, #18
	cmpne	r6, #9
	moveq	r3, #1
	movne	r3, #0
	cmp	r6, #27
	orreq	r3, r3, #1
	cmp	r3, #0
	beq	.L4
	ldr	r3, .L27+8
	ldr	r1, .L27+12
	ldr	r0, [r3]
	bl	elprintf
	mov	r4, #0
.L23:
	ldr	r9, .L27+16
.L3:
	ldr	r0, [r9, #4]
	lsl	r0, r4, r0
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L4:
	sub	r3, r6, #10
	cmp	r3, #7
	ldr	r9, .L27+16
	bhi	.L3
	ldr	r3, [r9, #8]
	lsl	r10, r7, #19
	cmp	r3, #0
	lsr	r10, r10, #19
	rsb	fp, r6, #17
	beq	.L5
	tst	r8, #1
	beq	.L3
	ldr	r4, .L27+8
	str	r5, [sp]
	mov	r3, r6
	mov	r2, r10
	ldr	r0, [r4]
	ldr	r1, .L27+20
	bl	elprintf
	cmp	fp, #0
	bne	.L7
.L24:
	ldr	r3, [r9]
	ldr	r0, [r4]
	ldr	r2, [r3, r10, lsl #2]
	ldr	r1, .L27+24
	bl	elprintf
	b	.L7
.L26:
	ldr	r3, .L27+8
	ldr	r1, .L27+28
	ldr	r0, [r3]
	bl	elprintf
	add	r6, r6, #1
	b	.L2
.L5:
	tst	r7, #1
	beq	.L3
	ldr	r4, .L27+8
	str	r5, [sp]
	lsr	r10, r10, #1
	mov	r3, r6
	mov	r2, r10
	ldr	r0, [r4]
	ldr	r1, .L27+20
	bl	elprintf
	cmp	fp, #0
	beq	.L24
.L7:
	ldr	r3, [r9]
	ldr	r4, [r3, r10, lsl #2]
	lsr	r4, r4, fp
	and	r4, r4, #1
	b	.L3
.L28:
	.align	2
.L27:
	.word	Pico
	.word	last_write
	.word	EL_EEPROM
	.word	.LC1
	.word	SRam
	.word	.LC2
	.word	.LC3
	.word	.LC0
	.size	EEPROM_read, .-EEPROM_read
	.comm	last_write,4,4
	.comm	SRam,12,4
	.comm	Pico,16,4
	.comm	EL_EEPROM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
