	.file	"extr_aic79xx_core.c_ahd_write_seeprom.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	ahd_write_seeprom
	.type	ahd_write_seeprom, @function
ahd_write_seeprom:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	r14, rsi
	mov	esi, DWORD PTR AHD_MODE_SCSI_MSK[rip]
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13d, ecx
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	ebx, edx
	mov	edx, esi
	call	AHD_ASSERT_MODES@PLT
	mov	edx, DWORD PTR SEEOP_EWEN_ADDR[rip]
	mov	esi, DWORD PTR SEEADR[rip]
	mov	rdi, rbp
	call	ahd_outb@PLT
	mov	esi, DWORD PTR SEECTL[rip]
	mov	edx, DWORD PTR SEEOP_EWEN[rip]
	mov	rdi, rbp
	or	edx, DWORD PTR SEESTART[rip]
	call	ahd_outb@PLT
	mov	rdi, rbp
	call	ahd_wait_seeprom@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	add	r13d, ebx
	cmp	ebx, r13d
	jl	.L5
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L12:
	add	ebx, 1
	cmp	r13d, ebx
	je	.L4
.L5:
	mov	esi, DWORD PTR SEEDAT[rip]
	mov	edx, DWORD PTR [r14]
	mov	rdi, rbp
	add	r14, 4
	call	ahd_outw@PLT
	mov	esi, DWORD PTR SEEADR[rip]
	mov	edx, ebx
	mov	rdi, rbp
	call	ahd_outb@PLT
	mov	esi, DWORD PTR SEECTL[rip]
	mov	edx, DWORD PTR SEEOP_WRITE[rip]
	mov	rdi, rbp
	or	edx, DWORD PTR SEESTART[rip]
	call	ahd_outb@PLT
	mov	rdi, rbp
	call	ahd_wait_seeprom@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L12
.L4:
	mov	edx, DWORD PTR SEEOP_EWDS_ADDR[rip]
	mov	esi, DWORD PTR SEEADR[rip]
	mov	rdi, rbp
	call	ahd_outb@PLT
	mov	esi, DWORD PTR SEECTL[rip]
	mov	edx, DWORD PTR SEEOP_EWDS[rip]
	mov	rdi, rbp
	or	edx, DWORD PTR SEESTART[rip]
	call	ahd_outb@PLT
	mov	rdi, rbp
	call	ahd_wait_seeprom@PLT
	test	eax, eax
	cmovne	r12d, eax
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	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
.L3:
	.cfi_restore_state
	mov	r12d, DWORD PTR EINVAL[rip]
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	ahd_write_seeprom, .-ahd_write_seeprom
	.comm	SEESTART,4,4
	.comm	SEEOP_WRITE,4,4
	.comm	SEEOP_EWEN_ADDR,4,4
	.comm	SEEOP_EWEN,4,4
	.comm	SEEOP_EWDS_ADDR,4,4
	.comm	SEEOP_EWDS,4,4
	.comm	SEEDAT,4,4
	.comm	SEECTL,4,4
	.comm	SEEADR,4,4
	.comm	ENOENT,4,4
	.comm	EINVAL,4,4
	.comm	AHD_MODE_SCSI_MSK,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_aic79xx_core.c_ahd_write_seeprom.c"
	.text
	.align	2
	.global	ahd_write_seeprom
	.syntax unified
	.arm
	.fpu softvfp
	.type	ahd_write_seeprom, %function
ahd_write_seeprom:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r0
	mov	r7, r3
	ldr	r3, .L12
	mov	r6, r1
	ldr	r1, [r3]
	mov	r8, r2
	mov	r2, r1
	bl	AHD_ASSERT_MODES
	ldr	r10, .L12+4
	ldr	r2, .L12+8
	ldr	r1, [r10]
	ldr	r2, [r2]
	mov	r0, r4
	bl	ahd_outb
	ldr	r9, .L12+12
	ldr	r1, .L12+16
	ldr	r3, .L12+20
	ldr	r1, [r1]
	ldr	r2, [r9]
	mov	r0, r4
	orr	r2, r1, r2
	ldr	r1, [r3]
	bl	ahd_outb
	mov	r0, r4
	bl	ahd_wait_seeprom
	subs	r5, r0, #0
	bne	.L1
	add	r7, r8, r7
	cmp	r8, r7
	bge	.L3
	ldr	fp, .L12+24
	b	.L5
.L11:
	cmp	r7, r8
	beq	.L4
.L5:
	ldr	r3, .L12+28
	ldr	r2, [r6], #4
	ldr	r1, [r3]
	mov	r0, r4
	bl	ahd_outw
	mov	r2, r8
	ldr	r1, [r10]
	mov	r0, r4
	bl	ahd_outb
	ldr	r0, [fp]
	ldr	r3, .L12+20
	ldr	r2, [r9]
	ldr	r1, [r3]
	orr	r2, r0, r2
	mov	r0, r4
	bl	ahd_outb
	mov	r0, r4
	bl	ahd_wait_seeprom
	subs	r5, r0, #0
	add	r8, r8, #1
	beq	.L11
.L4:
	ldr	r3, .L12+32
	ldr	r1, [r10]
	ldr	r2, [r3]
	mov	r0, r4
	bl	ahd_outb
	ldr	r2, .L12+36
	ldr	r3, [r9]
	ldr	r2, [r2]
	ldr	r1, .L12+20
	orr	r2, r2, r3
	ldr	r1, [r1]
	mov	r0, r4
	bl	ahd_outb
	mov	r0, r4
	bl	ahd_wait_seeprom
	cmp	r0, #0
	movne	r5, r0
.L1:
	mov	r0, r5
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L3:
	ldr	r3, .L12+40
	ldr	r5, [r3]
	b	.L4
.L13:
	.align	2
.L12:
	.word	AHD_MODE_SCSI_MSK
	.word	SEEADR
	.word	SEEOP_EWEN_ADDR
	.word	SEESTART
	.word	SEEOP_EWEN
	.word	SEECTL
	.word	SEEOP_WRITE
	.word	SEEDAT
	.word	SEEOP_EWDS_ADDR
	.word	SEEOP_EWDS
	.word	EINVAL
	.size	ahd_write_seeprom, .-ahd_write_seeprom
	.comm	SEESTART,4,4
	.comm	SEEOP_WRITE,4,4
	.comm	SEEOP_EWEN_ADDR,4,4
	.comm	SEEOP_EWEN,4,4
	.comm	SEEOP_EWDS_ADDR,4,4
	.comm	SEEOP_EWDS,4,4
	.comm	SEEDAT,4,4
	.comm	SEECTL,4,4
	.comm	SEEADR,4,4
	.comm	ENOENT,4,4
	.comm	EINVAL,4,4
	.comm	AHD_MODE_SCSI_MSK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
