	.file	"extr_dm9000.c_dm9000_set_eeprom.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	dm9000_set_eeprom, @function
dm9000_set_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
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdx
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	to_dm9000_board@PLT
	mov	ebx, DWORD PTR [r12]
	mov	r14, rax
	mov	eax, DWORD PTR 4[r12]
	mov	edx, ebx
	or	edx, eax
	and	edx, 1
	je	.L2
.L5:
	mov	r13d, DWORD PTR EINVAL[rip]
	neg	r13d
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r13d
	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
.L2:
	.cfi_restore_state
	mov	r13d, DWORD PTR [r14]
	and	r13d, DWORD PTR DM9000_PLATF_NO_EEPROM[rip]
	jne	.L11
	mov	rcx, QWORD PTR DM_EEPROM_MAGIC[rip]
	cmp	QWORD PTR 8[r12], rcx
	jne	.L5
	test	eax, eax
	jle	.L1
	sub	eax, 1
	shr	eax
	lea	r12, 8[rbp+rax*8]
	.p2align 4,,10
	.p2align 3
.L7:
	mov	esi, ebx
	mov	rdx, rbp
	mov	rdi, r14
	add	rbp, 8
	shr	esi, 31
	add	esi, ebx
	add	ebx, 2
	sar	esi
	call	dm9000_write_eeprom@PLT
	cmp	rbp, r12
	jne	.L7
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r13d
	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
.L11:
	.cfi_restore_state
	mov	r13d, DWORD PTR ENOENT[rip]
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	neg	r13d
	mov	eax, r13d
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	dm9000_set_eeprom, .-dm9000_set_eeprom
	.comm	ENOENT,4,4
	.comm	EINVAL,4,4
	.comm	DM_EEPROM_MAGIC,8,8
	.comm	DM9000_PLATF_NO_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_dm9000.c_dm9000_set_eeprom.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	dm9000_set_eeprom, %function
dm9000_set_eeprom:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r1
	mov	r6, r2
	bl	to_dm9000_board
	ldr	r1, [r4, #4]
	ldr	r3, [r4]
	mov	r7, r0
	orr	r0, r3, r1
	tst	r0, #1
	beq	.L2
.L5:
	ldr	r3, .L14
	ldr	r5, [r3]
	rsb	r5, r5, #0
.L1:
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	ldr	r2, .L14+4
	ldr	r5, [r7]
	ldr	r2, [r2]
	ands	r5, r5, r2
	bne	.L12
	ldr	r2, .L14+8
	ldr	r0, [r4, #8]
	ldr	r2, [r2]
	cmp	r0, r2
	bne	.L5
	cmp	r1, #0
	ble	.L1
	sub	r8, r1, #1
	mov	r4, r6
	bic	r8, r8, #1
	add	r6, r3, #2
	add	r8, r8, r6
	b	.L7
.L13:
	add	r6, r6, #2
.L7:
	add	r3, r3, r3, lsr #31
	mov	r2, r4
	asr	r1, r3, #1
	mov	r0, r7
	bl	dm9000_write_eeprom
	cmp	r6, r8
	mov	r3, r6
	add	r4, r4, #8
	bne	.L13
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
.L12:
	ldr	r3, .L14+12
	ldr	r5, [r3]
	rsb	r5, r5, #0
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
.L15:
	.align	2
.L14:
	.word	EINVAL
	.word	DM9000_PLATF_NO_EEPROM
	.word	DM_EEPROM_MAGIC
	.word	ENOENT
	.size	dm9000_set_eeprom, .-dm9000_set_eeprom
	.comm	ENOENT,4,4
	.comm	EINVAL,4,4
	.comm	DM_EEPROM_MAGIC,4,4
	.comm	DM9000_PLATF_NO_EEPROM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
