	.file	"extr_pci.c_sprom_do_write.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Writing SPROM. Do NOT turn off the power! Please stand by...\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"[ 0%%"
.LC2:
	.string	"25%%"
.LC3:
	.string	"50%%"
.LC4:
	.string	"75%%"
.LC5:
	.string	"."
.LC6:
	.string	"100%% ]\n"
.LC7:
	.string	"SPROM written\n"
	.section	.rodata.str1.8
	.align 8
.LC8:
	.string	"Could not access SPROM control register.\n"
	.text
	.p2align 4
	.type	sprom_do_write, @function
sprom_do_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
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	r12, QWORD PTR 24[rdi]
	mov	r13d, DWORD PTR [rdi]
	lea	rdi, .LC0[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	lea	r14, 20[rsp]
	call	pr_notice@PLT
	mov	esi, DWORD PTR SSB_SPROMCTL[rip]
	mov	rdx, r14
	mov	rdi, r12
	call	pci_read_config_dword@PLT
	mov	r15d, eax
	test	eax, eax
	je	.L17
.L2:
	lea	rdi, .LC8[rip]
	call	pr_err@PLT
.L1:
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L18
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r15d
	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
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	mov	esi, DWORD PTR SSB_SPROMCTL[rip]
	mov	edx, DWORD PTR 20[rsp]
	mov	rdi, r12
	or	edx, DWORD PTR SSB_SPROMCTL_WE[rip]
	mov	DWORD PTR 20[rsp], edx
	call	pci_write_config_dword@PLT
	mov	r15d, eax
	test	eax, eax
	jne	.L2
	lea	rdi, .LC1[rip]
	call	pr_notice@PLT
	mov	edi, 500
	call	msleep@PLT
	test	r13d, r13d
	jle	.L3
	mov	eax, r13d
	xor	r15d, r15d
	sar	eax, 2
	mov	DWORD PTR 4[rsp], eax
	mov	eax, r13d
	sar	eax
	mov	DWORD PTR 8[rsp], eax
	lea	eax, 0[r13+r13*2]
	sub	r13d, 1
	sar	eax, 2
	mov	DWORD PTR 12[rsp], eax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L4:
	cmp	DWORD PTR 8[rsp], r15d
	je	.L19
	cmp	DWORD PTR 12[rsp], r15d
	je	.L20
	test	r15b, 1
	jne	.L21
.L5:
	mov	rax, QWORD PTR 8[rbx]
	mov	edi, DWORD PTR 0[rbp+r15*4]
	add	rax, QWORD PTR 16[rbx]
	lea	rsi, [rax+r15*2]
	call	writew@PLT
	mov	edi, 20
	call	msleep@PLT
	lea	rax, 1[r15]
	cmp	r15, r13
	je	.L3
	mov	r15, rax
.L8:
	cmp	DWORD PTR 4[rsp], r15d
	jne	.L4
	lea	rdi, .LC2[rip]
	call	pr_cont@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L21:
	lea	rdi, .LC5[rip]
	call	pr_cont@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L19:
	lea	rdi, .LC3[rip]
	call	pr_cont@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L20:
	lea	rdi, .LC4[rip]
	call	pr_cont@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	mov	esi, DWORD PTR SSB_SPROMCTL[rip]
	mov	rdx, r14
	mov	rdi, r12
	call	pci_read_config_dword@PLT
	mov	r15d, eax
	test	eax, eax
	jne	.L2
	mov	edx, DWORD PTR SSB_SPROMCTL_WE[rip]
	mov	esi, DWORD PTR SSB_SPROMCTL[rip]
	mov	rdi, r12
	not	edx
	and	edx, DWORD PTR 20[rsp]
	mov	DWORD PTR 20[rsp], edx
	call	pci_write_config_dword@PLT
	mov	r15d, eax
	test	eax, eax
	jne	.L2
	mov	edi, 500
	call	msleep@PLT
	lea	rdi, .LC6[rip]
	call	pr_cont@PLT
	lea	rdi, .LC7[rip]
	call	pr_notice@PLT
	jmp	.L1
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	sprom_do_write, .-sprom_do_write
	.comm	SSB_SPROMCTL_WE,4,4
	.comm	SSB_SPROMCTL,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_pci.c_sprom_do_write.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Writing SPROM. Do NOT turn off the power! Please st"
	.ascii	"and by...\012\000"
	.align	2
.LC1:
	.ascii	"[ 0%%\000"
	.align	2
.LC2:
	.ascii	"25%%\000"
	.align	2
.LC3:
	.ascii	"50%%\000"
	.align	2
.LC4:
	.ascii	"75%%\000"
	.align	2
.LC5:
	.ascii	".\000"
	.align	2
.LC6:
	.ascii	"100%% ]\012\000"
	.align	2
.LC7:
	.ascii	"SPROM written\012\000"
	.align	2
.LC8:
	.ascii	"Could not access SPROM control register.\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC9:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sprom_do_write, %function
sprom_do_write:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r10, r0
	ldr	r6, [r0, #12]
	ldr	r3, .L26
	ldr	r7, .L26+4
	sub	sp, sp, #20
	ldr	r0, .L26+8
	mov	r4, r1
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	ldr	r5, [r10]
	bl	pr_notice
	mov	r0, r6
	ldr	r1, [r7]
	add	r2, sp, #8
	bl	pci_read_config_dword
	subs	fp, r0, #0
	beq	.L20
.L2:
	ldr	r0, .L26+12
	bl	pr_err
.L1:
	ldr	r3, .L26
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L21
	mov	r0, fp
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L20:
	ldr	r3, .L26+16
	ldr	r2, [sp, #8]
	ldr	r0, [r3]
	ldr	r1, [r7]
	orr	r2, r2, r0
	mov	r0, r6
	str	r2, [sp, #8]
	bl	pci_write_config_dword
	subs	fp, r0, #0
	bne	.L2
	ldr	r0, .L26+20
	bl	pr_notice
	mov	r0, #500
	bl	msleep
	cmp	r5, #0
	ble	.L10
	add	r8, r5, r5, lsl #1
	asr	r8, r8, #2
	asr	r3, r5, #1
	str	r6, [sp, #4]
	sub	r4, r4, #4
	mov	r6, r10
	asr	r9, r5, #2
	mov	r10, r8
	mov	r8, r3
	b	.L9
.L5:
	cmp	r8, fp
	beq	.L22
	cmp	r10, fp
	beq	.L23
	tst	fp, #1
	bne	.L24
.L6:
	ldr	r2, [r6, #4]
	ldr	r1, [r6, #8]
	ldr	r0, [r4, #4]!
	add	r1, r1, r2
	add	r1, r1, fp, lsl #1
	bl	writew
	add	fp, fp, #1
	mov	r0, #20
	bl	msleep
	cmp	r5, fp
	beq	.L25
.L9:
	cmp	r9, fp
	bne	.L5
	ldr	r0, .L26+24
	bl	pr_cont
	b	.L6
.L24:
	ldr	r0, .L26+28
	bl	pr_cont
	b	.L6
.L22:
	ldr	r0, .L26+32
	bl	pr_cont
	b	.L6
.L23:
	ldr	r0, .L26+36
	bl	pr_cont
	b	.L6
.L25:
	ldr	r6, [sp, #4]
.L10:
	mov	r0, r6
	ldr	r1, [r7]
	add	r2, sp, #8
	bl	pci_read_config_dword
	subs	fp, r0, #0
	bne	.L2
	ldr	r3, .L26+16
	ldr	r2, [sp, #8]
	ldr	r3, [r3]
	mov	r0, r6
	bic	r2, r2, r3
	ldr	r1, [r7]
	str	r2, [sp, #8]
	bl	pci_write_config_dword
	subs	fp, r0, #0
	bne	.L2
	mov	r0, #500
	bl	msleep
	ldr	r0, .L26+40
	bl	pr_cont
	ldr	r0, .L26+44
	bl	pr_notice
	b	.L1
.L21:
	bl	__stack_chk_fail
.L27:
	.align	2
.L26:
	.word	.LC9
	.word	SSB_SPROMCTL
	.word	.LC0
	.word	.LC8
	.word	SSB_SPROMCTL_WE
	.word	.LC1
	.word	.LC2
	.word	.LC5
	.word	.LC3
	.word	.LC4
	.word	.LC6
	.word	.LC7
	.size	sprom_do_write, .-sprom_do_write
	.comm	SSB_SPROMCTL_WE,4,4
	.comm	SSB_SPROMCTL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
