	.file	"extr_qla_bsg.c_qla2x00_optrom_setup.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"start %d > optrom_size %d.\n"
.LC1:
	.string	"optrom_state %d.\n"
.LC2:
	.string	"is_update=%d.\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC3:
	.string	"Invalid start region 0x%x/0x%x.\n"
	.align 8
.LC4:
	.string	"Read: Unable to allocate memory for optrom retrieval (%x)\n"
	.text
	.p2align 4
	.type	qla2x00_optrom_setup, @function
qla2x00_optrom_setup:
.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	r13, rdx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdi
	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
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	rbx, QWORD PTR [rsi]
	mov	r14, QWORD PTR 16[rdi]
	mov	edi, DWORD PTR 44[rbx]
	call	pci_channel_offline@PLT
	mov	edi, eax
	call	unlikely@PLT
	test	rax, rax
	jne	.L25
	mov	rax, QWORD PTR [r14]
	mov	r9d, DWORD PTR [rbx]
	mov	r14d, DWORD PTR 4[rax]
	cmp	r9d, r14d
	jl	.L27
	mov	r8, QWORD PTR 8[rbx]
	cmp	r8, QWORD PTR QLA_SWAITING[rip]
	je	.L5
	mov	edi, DWORD PTR ql_log_info[rip]
	mov	edx, 28758
	mov	rsi, rbp
	xor	eax, eax
	lea	rcx, .LC1[rip]
	call	ql_log@PLT
	mov	eax, DWORD PTR EBUSY[rip]
	neg	eax
.L1:
	add	rsp, 8
	.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
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	mov	DWORD PTR 16[rbx], r14d
	mov	edi, DWORD PTR ql_dbg_user[rip]
	mov	r8, r13
	mov	rsi, rbp
	lea	rcx, .LC2[rip]
	mov	edx, 28759
	movsx	r15, r14d
	call	ql_dbg@PLT
	test	r13, r13
	je	.L6
	movsx	rcx, DWORD PTR [rbx]
	cmp	QWORD PTR OPTROM_SIZE_2300[rip], rcx
	mov	rax, rcx
	jne	.L19
	test	r14d, r14d
	je	.L7
.L19:
	mov	esi, DWORD PTR 20[rbx]
	lea	edx, 0[0+rsi*4]
	cmp	edx, r14d
	je	.L7
	mov	esi, DWORD PTR 24[rbx]
	lea	edx, 0[0+rsi*4]
	cmp	edx, r14d
	jne	.L28
.L7:
	mov	rdi, QWORD PTR 8[r12]
	sub	eax, r14d
	cdqe
	add	r15, rdi
	cmp	r15, rcx
	cmovg	rdi, rax
	mov	rax, QWORD PTR QLA_SWRITING[rip]
	mov	QWORD PTR 32[rbx], rdi
	mov	QWORD PTR 8[rbx], rax
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L27:
	mov	edi, DWORD PTR ql_log_warn[rip]
	movsx	r8, r14d
	mov	edx, 28757
	xor	eax, eax
	lea	rcx, .LC0[rip]
	mov	rsi, rbp
	call	ql_log@PLT
.L25:
	mov	eax, DWORD PTR EINVAL[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	neg	eax
	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
.L6:
	.cfi_restore_state
	movsx	rdx, DWORD PTR [rbx]
	mov	rdi, QWORD PTR [r12]
	mov	rax, rdx
	add	r15, rdi
	sub	eax, r14d
	cmp	r15, rdx
	cdqe
	cmovg	rdi, rax
	mov	rax, QWORD PTR QLA_SREADING[rip]
	mov	QWORD PTR 32[rbx], rdi
	mov	QWORD PTR 8[rbx], rax
.L16:
	call	vzalloc@PLT
	mov	edx, eax
	mov	DWORD PTR 40[rbx], eax
	xor	eax, eax
	test	edx, edx
	jne	.L1
	mov	r8, QWORD PTR 32[rbx]
	mov	edi, DWORD PTR ql_log_warn[rip]
	mov	edx, 28761
	mov	rsi, rbp
	lea	rcx, .LC4[rip]
	call	ql_log@PLT
	mov	rax, QWORD PTR QLA_SWAITING[rip]
	mov	QWORD PTR 8[rbx], rax
	mov	eax, DWORD PTR ENOMEM[rip]
	neg	eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L28:
	mov	rdi, rbx
	call	IS_QLA24XX_TYPE@PLT
	test	rax, rax
	je	.L9
.L24:
	movsx	rcx, DWORD PTR [rbx]
	mov	rax, rcx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L9:
	mov	rdi, rbx
	call	IS_QLA25XX@PLT
	test	rax, rax
	jne	.L24
	mov	rdi, rbx
	call	IS_CNA_CAPABLE@PLT
	test	rax, rax
	jne	.L24
	mov	rdi, rbx
	call	IS_QLA2031@PLT
	test	rax, rax
	jne	.L24
	mov	rdi, rbx
	call	IS_QLA27XX@PLT
	test	rax, rax
	jne	.L24
	mov	rdi, rbx
	call	IS_QLA28XX@PLT
	test	rax, rax
	jne	.L24
	mov	r9, QWORD PTR 8[r12]
	mov	edi, DWORD PTR ql_log_warn[rip]
	mov	r8, r15
	xor	eax, eax
	lea	rcx, .LC3[rip]
	mov	edx, 28760
	mov	rsi, rbp
	call	ql_log@PLT
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	qla2x00_optrom_setup, .-qla2x00_optrom_setup
	.comm	ql_log_warn,4,4
	.comm	ql_log_info,4,4
	.comm	ql_dbg_user,4,4
	.comm	QLA_SWRITING,8,8
	.comm	QLA_SWAITING,8,8
	.comm	QLA_SREADING,8,8
	.comm	OPTROM_SIZE_2300,8,8
	.comm	ENOMEM,4,4
	.comm	EINVAL,4,4
	.comm	EBUSY,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_qla_bsg.c_qla2x00_optrom_setup.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"start %d > optrom_size %d.\012\000"
	.align	2
.LC1:
	.ascii	"optrom_state %d.\012\000"
	.align	2
.LC2:
	.ascii	"is_update=%d.\012\000"
	.align	2
.LC3:
	.ascii	"Invalid start region 0x%x/0x%x.\012\000"
	.align	2
.LC4:
	.ascii	"Read: Unable to allocate memory for optrom retrieva"
	.ascii	"l (%x)\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	qla2x00_optrom_setup, %function
qla2x00_optrom_setup:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r9, r0
	ldr	r5, [r1]
	sub	sp, sp, #8
	ldr	r0, [r5, #28]
	mov	r6, r1
	mov	r8, r2
	ldr	r7, [r9, #8]
	bl	pci_channel_offline
	bl	unlikely
	subs	r4, r0, #0
	bne	.L19
	ldr	r2, [r7]
	ldr	r3, [r5]
	ldr	r7, [r2, #4]
	cmp	r3, r7
	blt	.L21
	ldr	r10, .L23
	ldr	r3, [r5, #4]
	ldr	r2, [r10]
	cmp	r3, r2
	beq	.L5
	ldr	r2, .L23+4
	str	r3, [sp]
	ldr	r0, [r2]
	ldr	r3, .L23+8
	mov	r1, r6
	ldr	r2, .L23+12
	bl	ql_log
	ldr	r3, .L23+16
	ldr	r0, [r3]
	rsb	r4, r0, #0
.L1:
	mov	r0, r4
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L5:
	ldr	r3, .L23+20
	str	r7, [r5, #8]
	ldr	r0, [r3]
	mov	r1, r6
	ldr	r3, .L23+24
	ldr	r2, .L23+28
	str	r8, [sp]
	bl	ql_dbg
	cmp	r8, #0
	beq	.L6
	ldr	r2, .L23+32
	ldr	r3, [r5]
	ldr	r2, [r2]
	cmp	r2, r3
	cmpeq	r7, #0
	beq	.L7
	ldr	r2, [r5, #12]
	cmp	r7, r2, lsl #2
	beq	.L7
	ldr	r2, [r5, #16]
	cmp	r7, r2, lsl #2
	bne	.L22
.L7:
	ldr	r0, [r9, #4]
	add	r2, r0, r7
	cmp	r2, r3
	subgt	r0, r3, r7
	ldr	r3, .L23+36
	str	r0, [r5, #20]
	ldr	r3, [r3]
	str	r3, [r5, #4]
	b	.L15
.L21:
	ldr	r2, .L23+40
	str	r3, [sp, #4]
	str	r7, [sp]
	ldr	r0, [r2]
	mov	r1, r6
	ldr	r3, .L23+44
	ldr	r2, .L23+48
	bl	ql_log
.L19:
	ldr	r3, .L23+52
	ldr	r0, [r3]
	rsb	r4, r0, #0
	mov	r0, r4
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L6:
	ldr	r0, [r9]
	ldr	r3, [r5]
	add	r2, r0, r7
	cmp	r2, r3
	subgt	r0, r3, r7
	ldr	r3, .L23+56
	str	r0, [r5, #20]
	ldr	r3, [r3]
	str	r3, [r5, #4]
.L15:
	bl	vzalloc
	cmp	r0, #0
	str	r0, [r5, #24]
	bne	.L1
	ldr	r3, [r5, #20]
	ldr	r2, .L23+40
	mov	r1, r6
	ldr	r0, [r2]
	ldr	r2, .L23+60
	str	r3, [sp]
	ldr	r3, .L23+64
	bl	ql_log
	ldr	r2, .L23+68
	ldr	r3, [r10]
	ldr	r0, [r2]
	str	r3, [r5, #4]
	rsb	r4, r0, #0
	b	.L1
.L22:
	mov	r0, r5
	bl	IS_QLA24XX_TYPE
	cmp	r0, #0
	beq	.L8
.L18:
	ldr	r3, [r5]
	b	.L7
.L8:
	mov	r0, r5
	bl	IS_QLA25XX
	cmp	r0, #0
	bne	.L18
	mov	r0, r5
	bl	IS_CNA_CAPABLE
	cmp	r0, #0
	bne	.L18
	mov	r0, r5
	bl	IS_QLA2031
	cmp	r0, #0
	bne	.L18
	mov	r0, r5
	bl	IS_QLA27XX
	cmp	r0, #0
	bne	.L18
	mov	r0, r5
	bl	IS_QLA28XX
	cmp	r0, #0
	bne	.L18
	ldr	r2, [r9, #4]
	ldr	r3, .L23+40
	str	r2, [sp, #4]
	str	r7, [sp]
	ldr	r0, [r3]
	mov	r1, r6
	ldr	r3, .L23+72
	ldr	r2, .L23+76
	bl	ql_log
	ldr	r3, .L23+52
	ldr	r0, [r3]
	rsb	r4, r0, #0
	b	.L1
.L24:
	.align	2
.L23:
	.word	QLA_SWAITING
	.word	ql_log_info
	.word	.LC1
	.word	28758
	.word	EBUSY
	.word	ql_dbg_user
	.word	.LC2
	.word	28759
	.word	OPTROM_SIZE_2300
	.word	QLA_SWRITING
	.word	ql_log_warn
	.word	.LC0
	.word	28757
	.word	EINVAL
	.word	QLA_SREADING
	.word	28761
	.word	.LC4
	.word	ENOMEM
	.word	.LC3
	.word	28760
	.size	qla2x00_optrom_setup, .-qla2x00_optrom_setup
	.comm	ql_log_warn,4,4
	.comm	ql_log_info,4,4
	.comm	ql_dbg_user,4,4
	.comm	QLA_SWRITING,4,4
	.comm	QLA_SWAITING,4,4
	.comm	QLA_SREADING,4,4
	.comm	OPTROM_SIZE_2300,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,4,4
	.comm	EBUSY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
