	.file	"extr_qib_iba7322.c_setup_7322_link_recovery.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Failed IB link recovery setup\n"
	.text
	.p2align 4
	.type	setup_7322_link_recovery, @function
setup_7322_link_recovery:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, QWORD PTR 16[rdi]
	mov	rax, QWORD PTR 0[rbp]
	mov	edx, DWORD PTR 4[rax]
	test	edx, edx
	je	.L1
	test	esi, esi
	je	.L13
.L4:
	mov	r12, QWORD PTR portsel_2port[rip]
	mov	r13, QWORD PTR atetm_2port[rip]
.L7:
	mov	rdi, rbp
	call	qib_r_grab@PLT
	test	rax, rax
	js	.L9
	mov	rcx, QWORD PTR reset_atetm[rip]
	mov	edx, DWORD PTR LEN_ETM[rip]
	xor	r8d, r8d
	mov	rdi, rbp
	mov	esi, DWORD PTR BISTEN_ETM[rip]
	call	qib_r_shift@PLT
	test	rax, rax
	jns	.L14
.L9:
	mov	rdi, rbp
	lea	rsi, .LC0[rip]
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	jmp	qib_dev_err@PLT
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	mov	ecx, DWORD PTR [rax]
	lea	edx, 1[rcx]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR 8[rdi]
	mov	DWORD PTR [rax], 1
	cmp	edx, 1
	jne	.L4
	cmp	DWORD PTR [rdi], 1
	mov	r12, QWORD PTR portsel_port2[rip]
	jne	.L6
	mov	r12, QWORD PTR portsel_port1[rip]
.L6:
	mov	r13, QWORD PTR atetm_1port[rip]
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L14:
	mov	esi, DWORD PTR BISTEN_ETM[rip]
	mov	rdi, rbp
	call	qib_r_update@PLT
	test	rax, rax
	js	.L9
	mov	rcx, QWORD PTR reset_at[rip]
	mov	edx, DWORD PTR LEN_AT[rip]
	xor	r8d, r8d
	mov	rdi, rbp
	mov	esi, DWORD PTR BISTEN_AT[rip]
	call	qib_r_shift@PLT
	test	rax, rax
	js	.L9
	mov	esi, DWORD PTR BISTEN_AT[rip]
	mov	rdi, rbp
	call	qib_r_update@PLT
	test	rax, rax
	js	.L9
	mov	edx, DWORD PTR LEN_PORT_SEL[rip]
	xor	r8d, r8d
	mov	rcx, r12
	mov	rdi, rbp
	mov	esi, DWORD PTR BISTEN_PORT_SEL[rip]
	call	qib_r_shift@PLT
	test	rax, rax
	js	.L9
	mov	esi, DWORD PTR BISTEN_PORT_SEL[rip]
	mov	rdi, rbp
	call	qib_r_update@PLT
	test	rax, rax
	js	.L9
	mov	rcx, QWORD PTR at[rip]
	mov	edx, DWORD PTR LEN_AT[rip]
	xor	r8d, r8d
	mov	rdi, rbp
	mov	esi, DWORD PTR BISTEN_AT[rip]
	call	qib_r_shift@PLT
	test	rax, rax
	js	.L9
	mov	esi, DWORD PTR BISTEN_AT[rip]
	mov	rdi, rbp
	call	qib_r_update@PLT
	test	rax, rax
	js	.L9
	mov	edx, DWORD PTR LEN_ETM[rip]
	xor	r8d, r8d
	mov	rcx, r13
	mov	rdi, rbp
	mov	esi, DWORD PTR BISTEN_ETM[rip]
	call	qib_r_shift@PLT
	test	rax, rax
	js	.L9
	mov	esi, DWORD PTR BISTEN_ETM[rip]
	mov	rdi, rbp
	call	qib_r_update@PLT
	test	rax, rax
	js	.L9
.L1:
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	setup_7322_link_recovery, .-setup_7322_link_recovery
	.comm	reset_atetm,8,8
	.comm	reset_at,8,8
	.comm	portsel_port2,8,8
	.comm	portsel_port1,8,8
	.comm	portsel_2port,8,8
	.comm	atetm_2port,8,8
	.comm	atetm_1port,8,8
	.comm	at,8,8
	.comm	LEN_PORT_SEL,4,4
	.comm	LEN_ETM,4,4
	.comm	LEN_AT,4,4
	.comm	BISTEN_PORT_SEL,4,4
	.comm	BISTEN_ETM,4,4
	.comm	BISTEN_AT,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_qib_iba7322.c_setup_7322_link_recovery.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Failed IB link recovery setup\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	setup_7322_link_recovery, %function
setup_7322_link_recovery:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r4, [r0, #8]
	sub	sp, sp, #12
	ldr	r3, [r4]
	ldr	r2, [r3, #4]
	cmp	r2, #0
	beq	.L1
	cmp	r1, #0
	beq	.L13
.L4:
	ldr	r2, .L15
	ldr	r3, .L15+4
	ldr	r8, [r2]
	ldr	r9, [r3]
.L7:
	mov	r0, r4
	bl	qib_r_grab
	cmp	r0, #0
	blt	.L9
	mov	r6, #0
	ldr	r3, .L15+8
	ldr	r7, .L15+12
	ldr	r5, .L15+16
	str	r6, [sp]
	mov	r0, r4
	ldr	r3, [r3]
	ldr	r2, [r7]
	ldr	r1, [r5]
	bl	qib_r_shift
	cmp	r0, r6
	bge	.L14
.L9:
	mov	r0, r4
	ldr	r1, .L15+20
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	qib_dev_err
.L13:
	mov	ip, #1
	ldr	r2, [r3]
	ldr	r1, [r0, #4]
	add	r2, r2, ip
	cmp	r2, ip
	str	r2, [r3]
	str	ip, [r1]
	bne	.L4
	ldr	r3, [r0]
	cmp	r3, ip
	ldreq	r3, .L15+24
	ldrne	r3, .L15+28
	ldr	r8, [r3]
	ldr	r3, .L15+32
	ldr	r9, [r3]
	b	.L7
.L14:
	mov	r0, r4
	ldr	r1, [r5]
	bl	qib_r_update
	cmp	r0, r6
	blt	.L9
	ldr	r3, .L15+36
	ldr	fp, .L15+40
	ldr	r10, .L15+44
	str	r6, [sp]
	mov	r0, r4
	ldr	r3, [r3]
	ldr	r2, [fp]
	ldr	r1, [r10]
	bl	qib_r_shift
	cmp	r0, r6
	blt	.L9
	mov	r0, r4
	ldr	r1, [r10]
	bl	qib_r_update
	cmp	r0, r6
	blt	.L9
	mov	r3, r8
	ldr	r2, .L15+48
	ldr	r8, .L15+52
	str	r6, [sp]
	mov	r0, r4
	ldr	r2, [r2]
	ldr	r1, [r8]
	bl	qib_r_shift
	cmp	r0, r6
	blt	.L9
	mov	r0, r4
	ldr	r1, [r8]
	bl	qib_r_update
	cmp	r0, r6
	blt	.L9
	ldr	r3, .L15+56
	str	r6, [sp]
	mov	r0, r4
	ldr	r2, [fp]
	ldr	r3, [r3]
	ldr	r1, [r10]
	bl	qib_r_shift
	cmp	r0, r6
	blt	.L9
	mov	r0, r4
	ldr	r1, [r10]
	bl	qib_r_update
	cmp	r0, r6
	blt	.L9
	mov	r3, r9
	mov	r0, r4
	ldr	r2, [r7]
	ldr	r1, [r5]
	str	r6, [sp]
	bl	qib_r_shift
	cmp	r0, r6
	blt	.L9
	mov	r0, r4
	ldr	r1, [r5]
	bl	qib_r_update
	cmp	r0, r6
	blt	.L9
.L1:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L16:
	.align	2
.L15:
	.word	portsel_2port
	.word	atetm_2port
	.word	reset_atetm
	.word	LEN_ETM
	.word	BISTEN_ETM
	.word	.LC0
	.word	portsel_port1
	.word	portsel_port2
	.word	atetm_1port
	.word	reset_at
	.word	LEN_AT
	.word	BISTEN_AT
	.word	LEN_PORT_SEL
	.word	BISTEN_PORT_SEL
	.word	at
	.size	setup_7322_link_recovery, .-setup_7322_link_recovery
	.comm	reset_atetm,4,4
	.comm	reset_at,4,4
	.comm	portsel_port2,4,4
	.comm	portsel_port1,4,4
	.comm	portsel_2port,4,4
	.comm	atetm_2port,4,4
	.comm	atetm_1port,4,4
	.comm	at,4,4
	.comm	LEN_PORT_SEL,4,4
	.comm	LEN_ETM,4,4
	.comm	LEN_AT,4,4
	.comm	BISTEN_PORT_SEL,4,4
	.comm	BISTEN_ETM,4,4
	.comm	BISTEN_AT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
