	.file	"extr_atl1c_hw.c_atl1c_read_eeprom.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	atl1c_read_eeprom
	.type	atl1c_read_eeprom, @function
atl1c_read_eeprom:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	xor	r12d, r12d
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	sub	rsp, 32
	.cfi_def_cfa_offset 80
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	test	sil, 3
	je	.L12
.L1:
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L13
	add	rsp, 32
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	mov	ebx, esi
	mov	esi, DWORD PTR REG_OTP_CTRL[rip]
	mov	r13, rdx
	lea	rdx, 12[rsp]
	mov	rbp, rdi
	call	AT_READ_REG@PLT
	mov	edx, DWORD PTR 12[rsp]
	mov	eax, DWORD PTR OTP_CTRL_CLK_EN[rip]
	test	edx, eax
	je	.L14
.L3:
	mov	esi, DWORD PTR REG_EEPROM_DATA_LO[rip]
	xor	edx, edx
	mov	rdi, rbp
	lea	r14, 16[rsp]
	call	AT_WRITE_REG@PLT
	and	ebx, DWORD PTR EEPROM_CTRL_ADDR_MASK[rip]
	mov	ecx, DWORD PTR EEPROM_CTRL_ADDR_SHIFT[rip]
	mov	rdi, rbp
	mov	edx, ebx
	mov	esi, DWORD PTR REG_EEPROM_CTRL[rip]
	mov	ebx, 10
	sal	edx, cl
	mov	DWORD PTR 16[rsp], edx
	call	AT_WRITE_REG@PLT
	.p2align 4,,10
	.p2align 3
.L5:
	mov	edi, 100
	call	udelay@PLT
	mov	esi, DWORD PTR REG_EEPROM_CTRL[rip]
	mov	rdx, r14
	mov	rdi, rbp
	call	AT_READ_REG@PLT
	mov	eax, DWORD PTR 16[rsp]
	and	eax, DWORD PTR EEPROM_CTRL_RW[rip]
	mov	r12d, eax
	jne	.L4
	sub	ebx, 1
	jne	.L5
	mov	edx, DWORD PTR 12[rsp]
	test	DWORD PTR OTP_CTRL_CLK_EN[rip], edx
	jne	.L1
.L15:
	mov	esi, DWORD PTR REG_OTP_CTRL[rip]
	mov	rdi, rbp
	call	AT_WRITE_REG@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L4:
	mov	esi, DWORD PTR REG_EEPROM_CTRL[rip]
	lea	rdx, 20[rsp]
	mov	rdi, rbp
	mov	r12d, 1
	call	AT_READ_REG@PLT
	mov	esi, DWORD PTR REG_EEPROM_DATA_LO[rip]
	mov	rdx, r13
	mov	rdi, rbp
	call	AT_READ_REG@PLT
	movzx	eax, WORD PTR 20[rsp]
	mov	edi, DWORD PTR 0[r13]
	mov	DWORD PTR 20[rsp], eax
	sar	edi, 16
	sal	eax, 16
	or	edi, eax
	call	swab32@PLT
	mov	edx, DWORD PTR 12[rsp]
	mov	DWORD PTR 0[r13], eax
	test	DWORD PTR OTP_CTRL_CLK_EN[rip], edx
	jne	.L1
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L14:
	mov	esi, DWORD PTR REG_OTP_CTRL[rip]
	or	edx, eax
	mov	rdi, rbp
	call	AT_WRITE_REG@PLT
	jmp	.L3
.L13:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	atl1c_read_eeprom, .-atl1c_read_eeprom
	.comm	REG_OTP_CTRL,4,4
	.comm	REG_EEPROM_DATA_LO,4,4
	.comm	REG_EEPROM_CTRL,4,4
	.comm	OTP_CTRL_CLK_EN,4,4
	.comm	EEPROM_CTRL_RW,4,4
	.comm	EEPROM_CTRL_ADDR_SHIFT,4,4
	.comm	EEPROM_CTRL_ADDR_MASK,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_atl1c_hw.c_atl1c_read_eeprom.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	atl1c_read_eeprom
	.syntax unified
	.arm
	.fpu softvfp
	.type	atl1c_read_eeprom, %function
atl1c_read_eeprom:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, .L16
	sub	sp, sp, #28
	tst	r1, #3
	ldr	r3, [r3]
	str	r3, [sp, #20]
	mov	r3,#0
	movne	r3, #0
	beq	.L12
.L1:
	ldr	r2, .L16
	ldr	r1, [r2]
	ldr	r2, [sp, #20]
	eors	r1, r2, r1
	mov	r2, #0
	bne	.L13
	mov	r0, r3
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L12:
	ldr	r9, .L16+4
	ldr	r8, .L16+8
	mov	r4, r1
	mov	r7, r2
	ldr	r1, [r9]
	add	r2, sp, #8
	mov	r5, r0
	bl	AT_READ_REG
	ldr	r3, [r8]
	ldr	r2, [sp, #8]
	tst	r2, r3
	beq	.L14
.L3:
	ldr	r10, .L16+12
	mov	r2, #0
	ldr	r1, [r10]
	mov	r0, r5
	bl	AT_WRITE_REG
	ldr	r2, .L16+16
	ldr	r3, .L16+20
	ldr	r1, [r2]
	ldr	r6, .L16+24
	ldr	r2, [r3]
	and	r4, r4, r1
	lsl	r2, r4, r2
	mov	r0, r5
	ldr	r1, [r6]
	str	r2, [sp, #12]
	mov	r4, #10
	bl	AT_WRITE_REG
	ldr	fp, .L16+28
.L5:
	mov	r0, #100
	bl	udelay
	mov	r0, r5
	ldr	r1, [r6]
	add	r2, sp, #12
	bl	AT_READ_REG
	ldr	r0, [sp, #12]
	ldr	r3, [fp]
	ands	r3, r0, r3
	bne	.L4
	subs	r4, r4, #1
	bne	.L5
	ldr	r1, [r8]
	ldr	r2, [sp, #8]
	tst	r2, r1
	bne	.L1
.L15:
	mov	r0, r5
	ldr	r1, [r9]
	str	r3, [sp, #4]
	bl	AT_WRITE_REG
	ldr	r3, [sp, #4]
	b	.L1
.L4:
	ldr	r1, [r6]
	add	r2, sp, #16
	mov	r0, r5
	bl	AT_READ_REG
	mov	r2, r7
	ldr	r1, [r10]
	mov	r0, r5
	bl	AT_READ_REG
	ldrh	r3, [sp, #16]
	ldrsh	r0, [r7, #2]
	str	r3, [sp, #16]
	orr	r0, r0, r3, lsl #16
	bl	swab32
	str	r0, [r7]
	ldr	r1, [r8]
	ldr	r2, [sp, #8]
	mov	r3, #1
	tst	r2, r1
	bne	.L1
	b	.L15
.L14:
	mov	r0, r5
	ldr	r1, [r9]
	orr	r2, r2, r3
	bl	AT_WRITE_REG
	b	.L3
.L13:
	bl	__stack_chk_fail
.L17:
	.align	2
.L16:
	.word	.LC0
	.word	REG_OTP_CTRL
	.word	OTP_CTRL_CLK_EN
	.word	REG_EEPROM_DATA_LO
	.word	EEPROM_CTRL_ADDR_MASK
	.word	EEPROM_CTRL_ADDR_SHIFT
	.word	REG_EEPROM_CTRL
	.word	EEPROM_CTRL_RW
	.size	atl1c_read_eeprom, .-atl1c_read_eeprom
	.comm	REG_OTP_CTRL,4,4
	.comm	REG_EEPROM_DATA_LO,4,4
	.comm	REG_EEPROM_CTRL,4,4
	.comm	OTP_CTRL_CLK_EN,4,4
	.comm	EEPROM_CTRL_RW,4,4
	.comm	EEPROM_CTRL_ADDR_SHIFT,4,4
	.comm	EEPROM_CTRL_ADDR_MASK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
