	.file	"extr_pm8001_sas.c_pm8001_open_reject_retry.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	pm8001_open_reject_retry
	.type	pm8001_open_reject_retry, @function
pm8001_open_reject_retry:
.LFB0:
	.cfi_startproc
	endbr64
	test	rdi, rdi
	je	.L1
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rdx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdi
	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
	xor	esi, esi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	call	spin_lock_irqsave@PLT
	mov	eax, DWORD PTR PM8001_MAX_CCB[rip]
	test	eax, eax
	jle	.L3
	lea	rax, 4[r14]
	xor	ebx, ebx
	mov	QWORD PTR 8[rsp], rax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	add	rbx, 1
	cmp	DWORD PTR PM8001_MAX_CCB[rip], ebx
	jle	.L3
.L9:
	mov	rdx, QWORD PTR 8[r14]
	lea	rax, [rbx+rbx*2]
	lea	r13, [rdx+rax*8]
	mov	rax, QWORD PTR 16[r13]
	test	rax, rax
	je	.L4
	mov	rcx, QWORD PTR SAS_PHY_UNUSED[rip]
	cmp	QWORD PTR [rax], rcx
	je	.L4
	test	r15, r15
	je	.L25
	cmp	rax, r15
	jne	.L4
.L6:
	mov	ecx, DWORD PTR 0[r13]
	lea	edx, 1[rcx]
	cmp	edx, 1
	jbe	.L4
	mov	r12, QWORD PTR 8[r13]
	test	r12, r12
	je	.L4
	cmp	QWORD PTR 8[r12], 0
	je	.L4
	test	rbp, rbp
	je	.L10
	cmp	r12, rbp
	jne	.L4
.L10:
	mov	edx, DWORD PTR SAS_TASK_COMPLETE[rip]
	lea	r9, 16[r12]
	xor	esi, esi
	mov	DWORD PTR 28[rsp], ecx
	mov	rdi, r9
	mov	QWORD PTR 16[rsp], r9
	mov	DWORD PTR 28[r12], edx
	mov	edx, DWORD PTR SAS_OPEN_REJECT[rip]
	mov	DWORD PTR 24[r12], edx
	mov	edx, DWORD PTR SAS_OREJ_RSVD_RETRY[rip]
	mov	DWORD PTR 20[r12], edx
	sub	DWORD PTR 8[rax], 1
	call	spin_lock_irqsave@PLT
	mov	edi, DWORD PTR SAS_TASK_STATE_PENDING[rip]
	or	edi, DWORD PTR SAS_TASK_AT_INITIATOR[rip]
	not	edi
	and	edi, DWORD PTR [r12]
	or	edi, DWORD PTR SAS_TASK_STATE_DONE[rip]
	mov	DWORD PTR [r12], edi
	and	edi, DWORD PTR SAS_TASK_STATE_ABORTED[rip]
	call	unlikely@PLT
	mov	r9, QWORD PTR 16[rsp]
	mov	ecx, DWORD PTR 28[rsp]
	mov	esi, 0
	test	rax, rax
	mov	DWORD PTR 16[rsp], ecx
	mov	rdi, r9
	je	.L8
	call	spin_unlock_irqrestore@PLT
	mov	ecx, DWORD PTR 16[rsp]
	mov	rdx, r13
	mov	rsi, r12
	mov	rdi, r14
	add	rbx, 1
	call	pm8001_ccb_task_free@PLT
	cmp	DWORD PTR PM8001_MAX_CCB[rip], ebx
	jg	.L9
.L3:
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rdi, r14
	xor	esi, esi
	pop	rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_restore 12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_restore 13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_restore 14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_restore 15
	.cfi_def_cfa_offset 8
	jmp	spin_unlock_irqrestore@PLT
	.p2align 4,,10
	.p2align 3
.L25:
	.cfi_restore_state
	mov	rdx, rax
	sub	rdx, QWORD PTR 8[rsp]
	test	dl, 15
	jne	.L4
	shr	rdx, 4
	cmp	rdx, QWORD PTR PM8001_MAX_DEVICES[rip]
	jb	.L6
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L1:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_def_cfa_offset 96
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	call	spin_unlock_irqrestore@PLT
	mov	ecx, DWORD PTR 16[rsp]
	mov	rdx, r13
	mov	rsi, r12
	mov	rdi, r14
	call	pm8001_ccb_task_free@PLT
	xor	eax, eax
	call	mb@PLT
	xor	esi, esi
	mov	rdi, r14
	mov	QWORD PTR 16[rsp], rsi
	call	spin_unlock_irqrestore@PLT
	mov	rdi, r12
	call	[QWORD PTR 8[r12]]
	mov	rsi, QWORD PTR 16[rsp]
	mov	rdi, r14
	call	spin_lock_irqsave@PLT
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	pm8001_open_reject_retry, .-pm8001_open_reject_retry
	.comm	SAS_TASK_STATE_PENDING,4,4
	.comm	SAS_TASK_STATE_DONE,4,4
	.comm	SAS_TASK_STATE_ABORTED,4,4
	.comm	SAS_TASK_COMPLETE,4,4
	.comm	SAS_TASK_AT_INITIATOR,4,4
	.comm	SAS_PHY_UNUSED,8,8
	.comm	SAS_OREJ_RSVD_RETRY,4,4
	.comm	SAS_OPEN_REJECT,4,4
	.comm	PM8001_MAX_DEVICES,8,8
	.comm	PM8001_MAX_CCB,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_pm8001_sas.c_pm8001_open_reject_retry.c"
	.text
	.align	2
	.global	pm8001_open_reject_retry
	.syntax unified
	.arm
	.fpu softvfp
	.type	pm8001_open_reject_retry, %function
pm8001_open_reject_retry:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	subs	r6, r0, #0
	sub	sp, sp, #12
	beq	.L1
	ldr	r9, .L22
	mov	fp, r1
	mov	r1, #0
	mov	r7, r2
	bl	spin_lock_irqsave
	ldr	r3, [r9]
	cmp	r3, #0
	ble	.L3
	mov	r4, #0
	ldr	r10, .L22+4
	b	.L8
.L4:
	ldr	r3, [r9]
	add	r4, r4, #1
	cmp	r3, r4
	ble	.L3
.L8:
	ldr	r3, [r6, #8]
	add	r2, r4, r4, lsl #1
	add	r5, r3, r2, lsl #2
	ldr	r1, [r5, #8]
	cmp	r1, #0
	beq	.L4
	ldr	ip, [r1]
	ldr	r0, [r10]
	cmp	ip, r0
	beq	.L4
	cmp	r7, #0
	beq	.L21
	cmp	r1, r7
	bne	.L4
.L6:
	ldr	r3, [r3, r2, lsl #2]
	add	r2, r3, #1
	cmp	r2, #1
	str	r3, [sp]
	bls	.L4
	ldr	r8, [r5, #4]
	cmp	r8, #0
	beq	.L4
	ldr	r2, [r8, #4]
	cmp	r2, #0
	beq	.L4
	cmp	fp, #0
	cmpne	r8, fp
	bne	.L4
	ldr	r3, .L22+8
	ldr	r0, [r1, #4]
	ldr	ip, [r3]
	ldr	r3, .L22+12
	str	ip, [r8, #20]
	ldr	r2, [r3]
	ldr	r3, .L22+16
	str	r2, [r8, #16]
	ldr	ip, [r3]
	add	r2, r8, #8
	sub	r0, r0, #1
	str	ip, [r8, #12]
	str	r0, [r1, #4]
	mov	r0, r2
	mov	r1, #0
	str	r2, [sp, #4]
	bl	spin_lock_irqsave
	ldr	r3, .L22+20
	ldr	ip, .L22+24
	ldr	r1, [r3]
	ldr	r3, .L22+28
	ldr	ip, [ip]
	ldr	r0, [r3]
	orr	r0, r1, r0
	ldr	r1, [r8]
	bic	r1, r1, r0
	ldr	r0, .L22+32
	orr	r1, r1, ip
	ldr	r0, [r0]
	str	r1, [r8]
	and	r0, r0, r1
	bl	unlikely
	cmp	r0, #0
	ldr	r2, [sp, #4]
	ldr	r3, [sp]
	beq	.L7
	mov	r0, r2
	mov	r1, #0
	bl	spin_unlock_irqrestore
	ldr	r3, [sp]
	mov	r2, r5
	mov	r1, r8
	mov	r0, r6
	bl	pm8001_ccb_task_free
	ldr	r3, [r9]
	add	r4, r4, #1
	cmp	r3, r4
	bgt	.L8
.L3:
	mov	r0, r6
	mov	r1, #0
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	spin_unlock_irqrestore
.L21:
	add	r0, r6, #4
	sub	r0, r1, r0
	tst	r0, #7
	bne	.L4
	ldr	ip, .L22+36
	ldr	ip, [ip]
	cmp	ip, r0, lsr #3
	bhi	.L6
	b	.L4
.L1:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L7:
	mov	r0, r2
	mov	r1, #0
	str	r3, [sp]
	bl	spin_unlock_irqrestore
	mov	r2, r5
	ldr	r3, [sp]
	mov	r1, r8
	mov	r0, r6
	bl	pm8001_ccb_task_free
	bl	mb
	mov	r1, #0
	mov	r0, r6
	bl	spin_unlock_irqrestore
	mov	r0, r8
	ldr	r3, [r8, #4]
	blx	r3
	mov	r1, #0
	mov	r0, r6
	bl	spin_lock_irqsave
	b	.L4
.L23:
	.align	2
.L22:
	.word	PM8001_MAX_CCB
	.word	SAS_PHY_UNUSED
	.word	SAS_TASK_COMPLETE
	.word	SAS_OPEN_REJECT
	.word	SAS_OREJ_RSVD_RETRY
	.word	SAS_TASK_STATE_PENDING
	.word	SAS_TASK_STATE_DONE
	.word	SAS_TASK_AT_INITIATOR
	.word	SAS_TASK_STATE_ABORTED
	.word	PM8001_MAX_DEVICES
	.size	pm8001_open_reject_retry, .-pm8001_open_reject_retry
	.comm	SAS_TASK_STATE_PENDING,4,4
	.comm	SAS_TASK_STATE_DONE,4,4
	.comm	SAS_TASK_STATE_ABORTED,4,4
	.comm	SAS_TASK_COMPLETE,4,4
	.comm	SAS_TASK_AT_INITIATOR,4,4
	.comm	SAS_PHY_UNUSED,4,4
	.comm	SAS_OREJ_RSVD_RETRY,4,4
	.comm	SAS_OPEN_REJECT,4,4
	.comm	PM8001_MAX_DEVICES,4,4
	.comm	PM8001_MAX_CCB,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
