	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function chk_6120_linkrecovery
_chk_6120_linkrecovery:                 ## @chk_6120_linkrecovery
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	%esi, %edi
	callq	_qib_6120_iblink_state
	movq	%rax, %r14
	movq	_cr_iblinkerrrecov@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_read_6120_creg32
	movq	(%rbx), %rcx
	movl	$1, %r15d
	cmpq	(%rcx), %rax
	je	LBB0_2
## %bb.1:
	movq	$0, (%rcx)
	movl	8(%rbx), %edi
	movq	_QIB_IB_LINKDOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_qib_set_linkstate
	xorl	%r15d, %r15d
LBB0_2:
	movq	_IB_PORT_ACTIVE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r14
	jne	LBB0_4
## %bb.3:
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_read_6120_creg32
	movq	(%rbx), %rcx
	movq	%rax, (%rcx)
LBB0_4:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cr_iblinkerrrecov,4,2          ## @cr_iblinkerrrecov
	.comm	_QIB_IB_LINKDOWN,4,2            ## @QIB_IB_LINKDOWN
	.comm	_IB_PORT_ACTIVE,8,3             ## @IB_PORT_ACTIVE
	.no_dead_strip	_chk_6120_linkrecovery
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function chk_6120_linkrecovery
_chk_6120_linkrecovery:                 ; @chk_6120_linkrecovery
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	mov	x0, x1
	bl	_qib_6120_iblink_state
	mov	x20, x0
Lloh0:
	adrp	x22, _cr_iblinkerrrecov@GOTPAGE
Lloh1:
	ldr	x22, [x22, _cr_iblinkerrrecov@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_read_6120_creg32
	ldr	x8, [x19]
	ldr	x9, [x8]
	cmp	x0, x9
	b.ne	LBB0_2
; %bb.1:
	mov	w21, #1
	b	LBB0_3
LBB0_2:
	str	xzr, [x8]
	ldr	w0, [x19, #8]
Lloh2:
	adrp	x8, _QIB_IB_LINKDOWN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _QIB_IB_LINKDOWN@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	bl	_qib_set_linkstate
	mov	w21, #0
LBB0_3:
Lloh5:
	adrp	x8, _IB_PORT_ACTIVE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _IB_PORT_ACTIVE@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x20, x8
	b.ne	LBB0_5
; %bb.4:
	ldr	w1, [x22]
	mov	x0, x19
	bl	_read_6120_creg32
	ldr	x8, [x19]
	str	x0, [x8]
LBB0_5:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_cr_iblinkerrrecov,4,2          ; @cr_iblinkerrrecov
	.comm	_QIB_IB_LINKDOWN,4,2            ; @QIB_IB_LINKDOWN
	.comm	_IB_PORT_ACTIVE,8,3             ; @IB_PORT_ACTIVE
	.no_dead_strip	_chk_6120_linkrecovery
.subsections_via_symbols
