	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function setup_7322_link_recovery
_setup_7322_link_recovery:              ## @setup_7322_link_recovery
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	16(%rdi), %rbx
	movq	(%rbx), %rax
	cmpl	$0, 4(%rax)
	je	LBB0_19
## %bb.1:
	testl	%esi, %esi
	jne	LBB0_7
## %bb.2:
	movl	(%rax), %ecx
	leal	1(%rcx), %edx
	movl	%edx, (%rax)
	movq	8(%rdi), %rax
	movl	$1, (%rax)
	testl	%ecx, %ecx
	je	LBB0_3
LBB0_7:
	movq	_portsel_2port@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	_atetm_2port@GOTPCREL(%rip), %rax
LBB0_8:
	movq	(%rax), %r14
	movq	%rbx, %rdi
	callq	_qib_r_grab
	testq	%rax, %rax
	js	LBB0_20
## %bb.9:
	movq	_BISTEN_ETM@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_LEN_ETM@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movq	_reset_atetm@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	callq	_qib_r_shift
	testq	%rax, %rax
	js	LBB0_20
## %bb.10:
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_qib_r_update
	testq	%rax, %rax
	js	LBB0_20
## %bb.11:
	movq	_BISTEN_AT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_LEN_AT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_reset_at@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	callq	_qib_r_shift
	testq	%rax, %rax
	js	LBB0_20
## %bb.12:
	movq	_BISTEN_AT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_qib_r_update
	testq	%rax, %rax
	js	LBB0_20
## %bb.13:
	movq	_BISTEN_PORT_SEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_LEN_PORT_SEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	%r15, %rcx
	xorl	%r8d, %r8d
	callq	_qib_r_shift
	testq	%rax, %rax
	js	LBB0_20
## %bb.14:
	movq	_BISTEN_PORT_SEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_qib_r_update
	testq	%rax, %rax
	js	LBB0_20
## %bb.15:
	movq	_BISTEN_AT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_LEN_AT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_at@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	callq	_qib_r_shift
	testq	%rax, %rax
	js	LBB0_20
## %bb.16:
	movq	_BISTEN_AT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_qib_r_update
	testq	%rax, %rax
	js	LBB0_20
## %bb.17:
	movl	(%r12), %esi
	movl	(%r13), %edx
	movq	%rbx, %rdi
	movq	%r14, %rcx
	xorl	%r8d, %r8d
	callq	_qib_r_shift
	testq	%rax, %rax
	js	LBB0_20
## %bb.18:
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_qib_r_update
	testq	%rax, %rax
	js	LBB0_20
LBB0_19:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_qib_dev_err                    ## TAILCALL
LBB0_3:
	cmpl	$1, (%rdi)
	jne	LBB0_4
## %bb.5:
	movq	_portsel_port1@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_4:
	movq	_portsel_port2@GOTPCREL(%rip), %rax
LBB0_6:
	movq	(%rax), %r15
	movq	_atetm_1port@GOTPCREL(%rip), %rax
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_portsel_port1,8,3              ## @portsel_port1
	.comm	_portsel_port2,8,3              ## @portsel_port2
	.comm	_atetm_1port,8,3                ## @atetm_1port
	.comm	_portsel_2port,8,3              ## @portsel_2port
	.comm	_atetm_2port,8,3                ## @atetm_2port
	.comm	_BISTEN_ETM,4,2                 ## @BISTEN_ETM
	.comm	_LEN_ETM,4,2                    ## @LEN_ETM
	.comm	_reset_atetm,8,3                ## @reset_atetm
	.comm	_BISTEN_AT,4,2                  ## @BISTEN_AT
	.comm	_LEN_AT,4,2                     ## @LEN_AT
	.comm	_reset_at,8,3                   ## @reset_at
	.comm	_BISTEN_PORT_SEL,4,2            ## @BISTEN_PORT_SEL
	.comm	_LEN_PORT_SEL,4,2               ## @LEN_PORT_SEL
	.comm	_at,8,3                         ## @at
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed IB link recovery setup\n"

	.no_dead_strip	_setup_7322_link_recovery
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function setup_7322_link_recovery
_setup_7322_link_recovery:              ; @setup_7322_link_recovery
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	ldr	x19, [x0, #16]
	ldr	x8, [x19]
	ldr	w9, [x8, #4]
	cbz	w9, LBB0_15
; %bb.1:
	cbnz	w1, LBB0_3
; %bb.2:
	ldr	w9, [x8]
	add	w10, w9, #1
	str	w10, [x8]
	ldr	x8, [x0, #8]
	mov	w10, #1
	str	w10, [x8]
	cbz	w9, LBB0_17
LBB0_3:
Lloh0:
	adrp	x8, _portsel_2port@GOTPAGE
Lloh1:
	ldr	x8, [x8, _portsel_2port@GOTPAGEOFF]
Lloh2:
	ldr	x21, [x8]
Lloh3:
	adrp	x8, _atetm_2port@GOTPAGE
Lloh4:
	ldr	x8, [x8, _atetm_2port@GOTPAGEOFF]
LBB0_4:
	ldr	x20, [x8]
	mov	x0, x19
	bl	_qib_r_grab
	tbnz	x0, #63, LBB0_16
; %bb.5:
Lloh5:
	adrp	x22, _BISTEN_ETM@GOTPAGE
Lloh6:
	ldr	x22, [x22, _BISTEN_ETM@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh7:
	adrp	x23, _LEN_ETM@GOTPAGE
Lloh8:
	ldr	x23, [x23, _LEN_ETM@GOTPAGEOFF]
	ldr	w2, [x23]
Lloh9:
	adrp	x8, _reset_atetm@GOTPAGE
Lloh10:
	ldr	x8, [x8, _reset_atetm@GOTPAGEOFF]
Lloh11:
	ldr	x3, [x8]
	mov	x0, x19
	mov	x4, #0
	bl	_qib_r_shift
	tbnz	x0, #63, LBB0_16
; %bb.6:
	ldr	w1, [x22]
	mov	x0, x19
	bl	_qib_r_update
	tbnz	x0, #63, LBB0_16
; %bb.7:
Lloh12:
	adrp	x24, _BISTEN_AT@GOTPAGE
Lloh13:
	ldr	x24, [x24, _BISTEN_AT@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh14:
	adrp	x25, _LEN_AT@GOTPAGE
Lloh15:
	ldr	x25, [x25, _LEN_AT@GOTPAGEOFF]
	ldr	w2, [x25]
Lloh16:
	adrp	x8, _reset_at@GOTPAGE
Lloh17:
	ldr	x8, [x8, _reset_at@GOTPAGEOFF]
Lloh18:
	ldr	x3, [x8]
	mov	x0, x19
	mov	x4, #0
	bl	_qib_r_shift
	tbnz	x0, #63, LBB0_16
; %bb.8:
	ldr	w1, [x24]
	mov	x0, x19
	bl	_qib_r_update
	tbnz	x0, #63, LBB0_16
; %bb.9:
Lloh19:
	adrp	x26, _BISTEN_PORT_SEL@GOTPAGE
Lloh20:
	ldr	x26, [x26, _BISTEN_PORT_SEL@GOTPAGEOFF]
	ldr	w1, [x26]
Lloh21:
	adrp	x8, _LEN_PORT_SEL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _LEN_PORT_SEL@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x3, x21
	mov	x4, #0
	bl	_qib_r_shift
	tbnz	x0, #63, LBB0_16
; %bb.10:
	ldr	w1, [x26]
	mov	x0, x19
	bl	_qib_r_update
	tbnz	x0, #63, LBB0_16
; %bb.11:
	ldr	w1, [x24]
	ldr	w2, [x25]
Lloh24:
	adrp	x8, _at@GOTPAGE
Lloh25:
	ldr	x8, [x8, _at@GOTPAGEOFF]
Lloh26:
	ldr	x3, [x8]
	mov	x0, x19
	mov	x4, #0
	bl	_qib_r_shift
	tbnz	x0, #63, LBB0_16
; %bb.12:
	ldr	w1, [x24]
	mov	x0, x19
	bl	_qib_r_update
	tbnz	x0, #63, LBB0_16
; %bb.13:
	ldr	w1, [x22]
	ldr	w2, [x23]
	mov	x0, x19
	mov	x3, x20
	mov	x4, #0
	bl	_qib_r_shift
	tbnz	x0, #63, LBB0_16
; %bb.14:
	ldr	w1, [x22]
	mov	x0, x19
	bl	_qib_r_update
	tbnz	x0, #63, LBB0_16
LBB0_15:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_16:
Lloh27:
	adrp	x1, l_.str@PAGE
Lloh28:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_qib_dev_err
LBB0_17:
Lloh29:
	adrp	x8, _portsel_port1@GOTPAGE
Lloh30:
	ldr	x8, [x8, _portsel_port1@GOTPAGEOFF]
Lloh31:
	adrp	x9, _portsel_port2@GOTPAGE
Lloh32:
	ldr	x9, [x9, _portsel_port2@GOTPAGEOFF]
	ldr	w10, [x0]
	cmp	w10, #1
	csel	x8, x8, x9, eq
	ldr	x21, [x8]
Lloh33:
	adrp	x8, _atetm_1port@GOTPAGE
Lloh34:
	ldr	x8, [x8, _atetm_1port@GOTPAGEOFF]
	b	LBB0_4
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_portsel_port1,8,3              ; @portsel_port1
	.comm	_portsel_port2,8,3              ; @portsel_port2
	.comm	_atetm_1port,8,3                ; @atetm_1port
	.comm	_portsel_2port,8,3              ; @portsel_2port
	.comm	_atetm_2port,8,3                ; @atetm_2port
	.comm	_BISTEN_ETM,4,2                 ; @BISTEN_ETM
	.comm	_LEN_ETM,4,2                    ; @LEN_ETM
	.comm	_reset_atetm,8,3                ; @reset_atetm
	.comm	_BISTEN_AT,4,2                  ; @BISTEN_AT
	.comm	_LEN_AT,4,2                     ; @LEN_AT
	.comm	_reset_at,8,3                   ; @reset_at
	.comm	_BISTEN_PORT_SEL,4,2            ; @BISTEN_PORT_SEL
	.comm	_LEN_PORT_SEL,4,2               ; @LEN_PORT_SEL
	.comm	_at,8,3                         ; @at
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed IB link recovery setup\n"

	.no_dead_strip	_setup_7322_link_recovery
.subsections_via_symbols
