	.file	"extr_et131x.c_eeprom_write.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	eeprom_write, @function
eeprom_write:
.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
	mov	r13d, edx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, esi
	xor	esi, esi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	rbx, QWORD PTR [rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	DWORD PTR 4[rsp], 0
	mov	rdi, rbx
	call	eeprom_wait_ready@PLT
	test	eax, eax
	js	.L1
	mov	esi, DWORD PTR LBCIF_CONTROL_REGISTER[rip]
	mov	edx, DWORD PTR LBCIF_CONTROL_LBCIF_ENABLE[rip]
	mov	rdi, rbx
	or	edx, DWORD PTR LBCIF_CONTROL_I2C_WRITE[rip]
	call	pci_write_config_byte@PLT
	test	rax, rax
	jne	.L28
	mov	eax, DWORD PTR MAX_NUM_WRITE_RETRIES[rip]
	test	eax, eax
	jle	.L5
	xor	r14d, r14d
	mov	r15, rsp
.L4:
	mov	esi, DWORD PTR LBCIF_ADDRESS_REGISTER[rip]
	mov	edx, r12d
	mov	rdi, rbx
	call	pci_write_config_dword@PLT
	test	rax, rax
	jne	.L5
	mov	esi, DWORD PTR LBCIF_DATA_REGISTER[rip]
	mov	edx, r13d
	mov	rdi, rbx
	call	pci_write_config_byte@PLT
	test	rax, rax
	jne	.L5
	mov	rsi, r15
	mov	rdi, rbx
	call	eeprom_wait_ready@PLT
	test	eax, eax
	js	.L14
	mov	eax, DWORD PTR [rsp]
	test	DWORD PTR LBCIF_STATUS_GENERAL_ERROR[rip], eax
	je	.L7
	mov	rdx, QWORD PTR 0[rbp]
	cmp	QWORD PTR [rdx], 0
	je	.L5
.L7:
	test	DWORD PTR LBCIF_STATUS_ACK_ERROR[rip], eax
	jne	.L30
	mov	r14d, 1
.L8:
	mov	edi, 10
	xor	r13d, r13d
	lea	rbp, 4[rsp]
	xor	r15d, r15d
	call	udelay@PLT
	.p2align 4,,10
	.p2align 3
.L13:
	mov	edx, DWORD PTR LBCIF_CONTROL_LBCIF_ENABLE[rip]
	mov	esi, DWORD PTR LBCIF_CONTROL_REGISTER[rip]
	mov	rdi, rbx
	call	pci_write_config_byte@PLT
	test	rax, rax
	cmovne	r14d, r15d
	.p2align 4,,10
	.p2align 3
.L11:
	mov	esi, DWORD PTR LBCIF_ADDRESS_REGISTER[rip]
	mov	edx, r12d
	mov	rdi, rbx
	call	pci_write_config_dword@PLT
	.p2align 4,,10
	.p2align 3
.L10:
	mov	esi, DWORD PTR LBCIF_DATA_REGISTER[rip]
	mov	rdx, rbp
	mov	rdi, rbx
	call	pci_read_config_dword@PLT
	mov	eax, DWORD PTR 4[rsp]
	test	eax, 65536
	je	.L10
	test	eax, 262144
	jne	.L11
	and	eax, 65280
	cmp	eax, 49152
	jne	.L12
	cmp	r13d, 10000
	je	.L12
	add	r13d, 1
	jmp	.L13
.L12:
	test	r14d, r14d
	jne	.L14
.L28:
	mov	eax, DWORD PTR EIO[rip]
	neg	eax
.L1:
	mov	rcx, QWORD PTR 8[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L31
	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
	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
.L14:
	.cfi_restore_state
	xor	eax, eax
	jmp	.L1
.L30:
	mov	edi, 10
	add	r14d, 1
	call	udelay@PLT
	cmp	DWORD PTR MAX_NUM_WRITE_RETRIES[rip], r14d
	jg	.L4
.L5:
	xor	r14d, r14d
	jmp	.L8
.L31:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	eeprom_write, .-eeprom_write
	.comm	MAX_NUM_WRITE_RETRIES,4,4
	.comm	LBCIF_STATUS_GENERAL_ERROR,4,4
	.comm	LBCIF_STATUS_ACK_ERROR,4,4
	.comm	LBCIF_DATA_REGISTER,4,4
	.comm	LBCIF_CONTROL_REGISTER,4,4
	.comm	LBCIF_CONTROL_LBCIF_ENABLE,4,4
	.comm	LBCIF_CONTROL_I2C_WRITE,4,4
	.comm	LBCIF_ADDRESS_REGISTER,4,4
	.comm	EIO,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_et131x.c_eeprom_write.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	eeprom_write, %function
eeprom_write:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	r3, #0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r4, [r0]
	sub	sp, sp, #28
	str	r2, [sp, #4]
	ldr	r2, .L39
	mov	r8, r0
	mov	r6, r1
	mov	r0, r4
	mov	r1, r3
	ldr	r2, [r2]
	str	r2, [sp, #20]
	mov	r2,#0
	str	r3, [sp, #16]
	bl	eeprom_wait_ready
	subs	r3, r0, #0
	str	r3, [sp]
	blt	.L1
	ldr	r10, .L39+4
	ldr	r3, .L39+8
	ldr	r2, [r10]
	ldr	r3, [r3]
	mov	r0, r4
	orr	r2, r2, r3
	ldr	r3, .L39+12
	ldr	r1, [r3]
	bl	pci_write_config_byte
	subs	r3, r0, #0
	str	r3, [sp]
	bne	.L34
	ldr	r9, .L39+16
	ldr	r3, [r9]
	cmp	r3, #0
	ble	.L36
	ldr	fp, [sp]
	ldr	r7, .L39+20
	ldr	r5, .L39+24
.L4:
	mov	r2, r6
	mov	r0, r4
	ldr	r1, [r7]
	bl	pci_write_config_dword
	cmp	r0, #0
	bne	.L5
	mov	r0, r4
	ldr	r2, [sp, #4]
	ldr	r1, [r5]
	bl	pci_write_config_byte
	cmp	r0, #0
	bne	.L5
	mov	r0, r4
	add	r1, sp, #12
	bl	eeprom_wait_ready
	cmp	r0, #0
	blt	.L1
	ldr	r2, .L39+28
	ldr	r3, [sp, #12]
	ldr	r2, [r2]
	tst	r3, r2
	beq	.L7
	ldr	r2, [r8]
	ldr	r2, [r2]
	cmp	r2, #0
	beq	.L5
.L7:
	ldr	r2, .L39+32
	ldr	r2, [r2]
	tst	r3, r2
	bne	.L37
	mov	r9, #1
.L8:
	mov	r0, #10
	bl	udelay
	mov	r8, #0
	ldr	fp, .L39+36
.L13:
	ldr	r3, .L39+12
	mov	r0, r4
	ldr	r2, [r10]
	ldr	r1, [r3]
	bl	pci_write_config_byte
	cmp	r0, #0
	movne	r9, #0
.L11:
	mov	r2, r6
	mov	r0, r4
	ldr	r1, [r7]
	bl	pci_write_config_dword
.L10:
	mov	r0, r4
	ldr	r1, [r5]
	add	r2, sp, #16
	bl	pci_read_config_dword
	ldr	r3, [sp, #16]
	tst	r3, #65536
	beq	.L10
	tst	r3, #262144
	bne	.L11
	sub	r2, r8, fp
	clz	r2, r2
	and	r3, r3, #65280
	lsr	r2, r2, #5
	cmp	r3, #49152
	moveq	r3, r2
	orrne	r3, r2, #1
	cmp	r3, #0
	addeq	r8, r8, #1
	beq	.L13
.L12:
	cmp	r9, #0
	bne	.L1
.L34:
	ldr	r3, .L39+40
	ldr	r3, [r3]
	rsb	r3, r3, #0
	str	r3, [sp]
.L1:
	ldr	r3, .L39
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L38
	ldr	r0, [sp]
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L37:
	mov	r0, #10
	bl	udelay
	ldr	r3, [r9]
	add	fp, fp, #1
	cmp	r3, fp
	bgt	.L4
.L5:
	mov	r9, #0
	b	.L8
.L38:
	bl	__stack_chk_fail
.L36:
	ldr	r7, .L39+20
	ldr	r5, .L39+24
	b	.L5
.L40:
	.align	2
.L39:
	.word	.LC0
	.word	LBCIF_CONTROL_LBCIF_ENABLE
	.word	LBCIF_CONTROL_I2C_WRITE
	.word	LBCIF_CONTROL_REGISTER
	.word	MAX_NUM_WRITE_RETRIES
	.word	LBCIF_ADDRESS_REGISTER
	.word	LBCIF_DATA_REGISTER
	.word	LBCIF_STATUS_GENERAL_ERROR
	.word	LBCIF_STATUS_ACK_ERROR
	.word	10000
	.word	EIO
	.size	eeprom_write, .-eeprom_write
	.comm	MAX_NUM_WRITE_RETRIES,4,4
	.comm	LBCIF_STATUS_GENERAL_ERROR,4,4
	.comm	LBCIF_STATUS_ACK_ERROR,4,4
	.comm	LBCIF_DATA_REGISTER,4,4
	.comm	LBCIF_CONTROL_REGISTER,4,4
	.comm	LBCIF_CONTROL_LBCIF_ENABLE,4,4
	.comm	LBCIF_CONTROL_I2C_WRITE,4,4
	.comm	LBCIF_ADDRESS_REGISTER,4,4
	.comm	EIO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
