	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_local_link_attributes
_set_local_link_attributes:             ## @set_local_link_attributes
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	16(%rdi), %r15
	movq	%r15, %rdi
	callq	_fabric_serdes_reset
	leaq	-56(%rbp), %rsi
	leaq	-52(%rbp), %rdx
	leaq	-48(%rbp), %rcx
	movq	%r15, %rdi
	movq	%r14, %r8
	callq	_read_tx_settings
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_13
## %bb.1:
	movq	(%r15), %rbx
	xorl	%edi, %edi
	movl	$20, %esi
	xorl	%edx, %edx
	callq	_dc8051_ver
	cmpq	%rax, %rbx
	jge	LBB0_3
## %bb.2:
	movq	_OPA_LINK_SPEED_25G@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%r8d, %r8d
	testl	%eax, 4(%r14)
	setne	%r8b
	jmp	LBB0_5
LBB0_3:
	movl	$0, (%r14)
	movl	4(%r14), %eax
	movq	_OPA_LINK_SPEED_25G@GOTPCREL(%rip), %rcx
	xorl	%r8d, %r8d
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	setne	%r8b
	addl	%r8d, %r8d
	movl	%r8d, (%r14)
	movq	_OPA_LINK_SPEED_12_5G@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.4:
	orl	$1, %r8d
LBB0_5:
	movl	%r8d, (%r14)
LBB0_6:
	movl	$15, -56(%rbp)
	movl	-52(%rbp), %edx
	movl	-48(%rbp), %ecx
	movq	%r15, %rdi
	movl	$15, %esi
	callq	_write_tx_settings
	movl	%eax, %ebx
	movq	_HCMD_SUCCESS@GOTPCREL(%rip), %r13
	cmpl	(%r13), %eax
	jne	LBB0_13
## %bb.7:
	movq	_HOST_INTERFACE_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_write_host_interface_version
	cmpl	(%r13), %eax
	jne	LBB0_8
## %bb.9:
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$1, %edx
	callq	_write_vc_local_phy
	movl	%eax, %ebx
	cmpl	(%r13), %eax
	jne	LBB0_13
## %bb.10:
	movl	32(%r15), %esi
	movl	24(%r15), %r8d
	movl	28(%r15), %ecx
	movl	12(%r14), %r9d
	movq	%r15, %rdi
	movl	$1, %edx
	callq	_write_vc_local_fabric
	movl	%eax, %ebx
	cmpl	(%r13), %eax
	jne	LBB0_13
## %bb.11:
	movq	_loopback@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_LOOPBACK_SERDES_CONFIG_BIT_MASK_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$1, %edx
	shll	%cl, %edx
	movq	_LOOPBACK_SERDES@GOTPCREL(%rip), %rcx
	movl	$1, %ebx
	xorl	%r12d, %r12d
	cmpq	(%rcx), %rax
	cmovnel	%r12d, %edx
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	(%r15), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	$1, %edi
	movl	$25, %esi
	xorl	%edx, %edx
	callq	_dc8051_ver
	movq	_EXT_CFG_LCB_RESET_SUPPORTED_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %ebx
	cmpq	%rax, -64(%rbp)                 ## 8-byte Folded Reload
	cmovll	%r12d, %ebx
	orl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	movl	8(%r14), %edi
	callq	_opa_to_vc_link_widths
	movq	%r15, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	movl	%eax, %ecx
	callq	_write_vc_local_link_mode
	movl	%eax, %ebx
	cmpl	(%r13), %eax
	jne	LBB0_13
## %bb.12:
	movq	16(%r15), %rax
	movl	(%rax), %esi
	movl	8(%r15), %edx
	movq	%r15, %rdi
	callq	_write_local_device_id
	movl	%eax, %ebx
	cmpl	(%r13), %eax
	jne	LBB0_13
	jmp	LBB0_14
LBB0_8:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %edx
	callq	_dd_dev_err
LBB0_13:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_dd_dev_err
	movl	%ebx, %r12d
LBB0_14:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_OPA_LINK_SPEED_25G,4,2         ## @OPA_LINK_SPEED_25G
	.comm	_OPA_LINK_SPEED_12_5G,4,2       ## @OPA_LINK_SPEED_12_5G
	.comm	_HCMD_SUCCESS,4,2               ## @HCMD_SUCCESS
	.comm	_HOST_INTERFACE_VERSION,4,2     ## @HOST_INTERFACE_VERSION
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to set host interface version, return 0x%x\n"

	.comm	_loopback,8,3                   ## @loopback
	.comm	_LOOPBACK_SERDES,8,3            ## @LOOPBACK_SERDES
	.comm	_LOOPBACK_SERDES_CONFIG_BIT_MASK_SHIFT,4,2 ## @LOOPBACK_SERDES_CONFIG_BIT_MASK_SHIFT
	.comm	_EXT_CFG_LCB_RESET_SUPPORTED_SHIFT,4,2 ## @EXT_CFG_LCB_RESET_SUPPORTED_SHIFT
L_.str.1:                               ## @.str.1
	.asciz	"Failed to set local link attributes, return 0x%x\n"

	.no_dead_strip	_set_local_link_attributes
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_local_link_attributes
_set_local_link_attributes:             ; @set_local_link_attributes
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x0
	ldr	x19, [x0, #16]
	mov	x0, x19
	bl	_fabric_serdes_reset
	add	x1, sp, #12
	add	x2, sp, #8
	add	x3, sp, #4
	mov	x0, x19
	mov	x4, x20
	bl	_read_tx_settings
	mov	x21, x0
	cbnz	w0, LBB0_14
; %bb.1:
	ldr	x21, [x19]
	mov	w1, #20
	mov	w2, #0
	bl	_dc8051_ver
	cmp	x21, x0
	b.ge	LBB0_3
; %bb.2:
	ldr	w8, [x20, #4]
Lloh0:
	adrp	x9, _OPA_LINK_SPEED_25G@GOTPAGE
Lloh1:
	ldr	x9, [x9, _OPA_LINK_SPEED_25G@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w4, ne
	b	LBB0_5
LBB0_3:
	str	wzr, [x20]
	ldr	w8, [x20, #4]
Lloh3:
	adrp	x9, _OPA_LINK_SPEED_25G@GOTPAGE
Lloh4:
	ldr	x9, [x9, _OPA_LINK_SPEED_25G@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w9, ne
	lsl	w4, w9, #1
	str	w4, [x20]
Lloh6:
	adrp	x9, _OPA_LINK_SPEED_12_5G@GOTPAGE
Lloh7:
	ldr	x9, [x9, _OPA_LINK_SPEED_12_5G@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.4:
	orr	w4, w4, #0x1
LBB0_5:
	str	w4, [x20]
LBB0_6:
	mov	w8, #15
	str	w8, [sp, #12]
	ldp	w3, w2, [sp, #4]
	mov	x0, x19
	mov	w1, #15
	bl	_write_tx_settings
	mov	x21, x0
Lloh9:
	adrp	x22, _HCMD_SUCCESS@GOTPAGE
Lloh10:
	ldr	x22, [x22, _HCMD_SUCCESS@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w0, w8
	b.ne	LBB0_14
; %bb.7:
Lloh11:
	adrp	x8, _HOST_INTERFACE_VERSION@GOTPAGE
Lloh12:
	ldr	x8, [x8, _HOST_INTERFACE_VERSION@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_write_host_interface_version
	ldr	w8, [x22]
	cmp	w0, w8
	b.ne	LBB0_13
; %bb.8:
	mov	x0, x19
	mov	w1, #0
	mov	w2, #1
	bl	_write_vc_local_phy
	mov	x21, x0
	ldr	w8, [x22]
	cmp	w0, w8
	b.ne	LBB0_14
; %bb.9:
	ldp	w3, w1, [x19, #28]
	ldr	w4, [x19, #24]
	ldr	w5, [x20, #12]
	mov	w23, #1
	mov	x0, x19
	mov	w2, #1
	bl	_write_vc_local_fabric
	mov	x21, x0
	ldr	w8, [x22]
	cmp	w0, w8
	b.ne	LBB0_14
; %bb.10:
Lloh14:
	adrp	x8, _loopback@GOTPAGE
Lloh15:
	ldr	x8, [x8, _loopback@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
Lloh17:
	adrp	x9, _LOOPBACK_SERDES@GOTPAGE
Lloh18:
	ldr	x9, [x9, _LOOPBACK_SERDES@GOTPAGEOFF]
Lloh19:
	adrp	x10, _LOOPBACK_SERDES_CONFIG_BIT_MASK_SHIFT@GOTPAGE
Lloh20:
	ldr	x10, [x10, _LOOPBACK_SERDES_CONFIG_BIT_MASK_SHIFT@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
Lloh22:
	ldr	w10, [x10]
	lsl	w10, w23, w10
	cmp	x8, x9
	csel	w21, w10, wzr, eq
	ldr	x24, [x19]
	mov	w0, #1
	mov	w1, #25
	mov	w2, #0
	bl	_dc8051_ver
Lloh23:
	adrp	x8, _EXT_CFG_LCB_RESET_SUPPORTED_SHIFT@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EXT_CFG_LCB_RESET_SUPPORTED_SHIFT@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	lsl	w8, w23, w8
	cmp	x24, x0
	csel	w8, wzr, w8, lt
	orr	w21, w8, w21
	ldr	w0, [x20, #8]
	bl	_opa_to_vc_link_widths
	mov	x3, x0
	mov	x0, x19
	mov	x1, x21
	mov	w2, #0
	bl	_write_vc_local_link_mode
	mov	x21, x0
	ldr	w8, [x22]
	cmp	w0, w8
	b.ne	LBB0_14
; %bb.11:
	ldr	x8, [x19, #16]
	ldr	w1, [x8]
	ldr	w2, [x19, #8]
	mov	x0, x19
	bl	_write_local_device_id
	mov	x21, x0
	ldr	w8, [x22]
	cmp	w0, w8
	b.ne	LBB0_14
; %bb.12:
	mov	w21, #0
	b	LBB0_15
LBB0_13:
	mov	x21, x0
Lloh26:
	adrp	x1, l_.str@PAGE
Lloh27:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_dd_dev_err
LBB0_14:
Lloh28:
	adrp	x1, l_.str.1@PAGE
Lloh29:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_dd_dev_err
LBB0_15:
	mov	x0, x21
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh21
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_OPA_LINK_SPEED_25G,4,2         ; @OPA_LINK_SPEED_25G
	.comm	_OPA_LINK_SPEED_12_5G,4,2       ; @OPA_LINK_SPEED_12_5G
	.comm	_HCMD_SUCCESS,4,2               ; @HCMD_SUCCESS
	.comm	_HOST_INTERFACE_VERSION,4,2     ; @HOST_INTERFACE_VERSION
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to set host interface version, return 0x%x\n"

	.comm	_loopback,8,3                   ; @loopback
	.comm	_LOOPBACK_SERDES,8,3            ; @LOOPBACK_SERDES
	.comm	_LOOPBACK_SERDES_CONFIG_BIT_MASK_SHIFT,4,2 ; @LOOPBACK_SERDES_CONFIG_BIT_MASK_SHIFT
	.comm	_EXT_CFG_LCB_RESET_SUPPORTED_SHIFT,4,2 ; @EXT_CFG_LCB_RESET_SUPPORTED_SHIFT
l_.str.1:                               ; @.str.1
	.asciz	"Failed to set local link attributes, return 0x%x\n"

	.no_dead_strip	_set_local_link_attributes
.subsections_via_symbols
