	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns_get_mdix_mode
_hns_get_mdix_mode:                     ## @hns_get_mdix_mode
	.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	%rsi, %r14
	movq	(%rdi), %rbx
	testq	%rbx, %rbx
	je	LBB0_2
## %bb.1:
	cmpl	$0, (%rbx)
	je	LBB0_2
## %bb.3:
	movq	_HNS_PHY_PAGE_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_HNS_PHY_PAGE_MDIX@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_phy_write
	movq	_HNS_PHY_CSC_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_phy_read
	movq	_PHY_MDIX_CTRL_M@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_PHY_MDIX_CTRL_S@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	callq	_hnae_get_field
	movl	%eax, %r15d
	movq	_HNS_PHY_CSS_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_phy_read
	movl	%eax, %r13d
	movq	_PHY_MDIX_STATUS_B@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edi
	callq	_hnae_get_bit
	movl	%eax, %r12d
	movq	_PHY_SPEED_DUP_RESOLVE_B@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edi
	callq	_hnae_get_bit
	movl	%eax, %r13d
	movq	_HNS_PHY_PAGE_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_HNS_PHY_PAGE_COPPER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_phy_write
	cmpl	$3, %r15d
	ja	LBB0_4
## %bb.5:
	movslq	%r15d, %rax
	leaq	l_switch.table.hns_get_mdix_mode(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	jmp	LBB0_6
LBB0_2:
	movq	_ETH_TP_MDI_INVALID@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%r14)
	jmp	LBB0_12
LBB0_4:
	movq	_ETH_TP_MDI_INVALID@GOTPCREL(%rip), %rax
LBB0_6:
	movq	(%rax), %rax
	movq	%rax, 8(%r14)
	testl	%r13d, %r13d
	je	LBB0_7
## %bb.8:
	testl	%r12d, %r12d
	je	LBB0_10
## %bb.9:
	movq	_ETH_TP_MDI_X@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_7:
	movq	_ETH_TP_MDI_INVALID@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_10:
	movq	_ETH_TP_MDI@GOTPCREL(%rip), %rax
LBB0_11:
	movq	(%rax), %rax
LBB0_12:
	movq	%rax, (%r14)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ETH_TP_MDI_INVALID,8,3         ## @ETH_TP_MDI_INVALID
	.comm	_HNS_PHY_PAGE_REG,4,2           ## @HNS_PHY_PAGE_REG
	.comm	_HNS_PHY_PAGE_MDIX,4,2          ## @HNS_PHY_PAGE_MDIX
	.comm	_HNS_PHY_CSC_REG,4,2            ## @HNS_PHY_CSC_REG
	.comm	_PHY_MDIX_CTRL_M,4,2            ## @PHY_MDIX_CTRL_M
	.comm	_PHY_MDIX_CTRL_S,4,2            ## @PHY_MDIX_CTRL_S
	.comm	_HNS_PHY_CSS_REG,4,2            ## @HNS_PHY_CSS_REG
	.comm	_PHY_MDIX_STATUS_B,4,2          ## @PHY_MDIX_STATUS_B
	.comm	_PHY_SPEED_DUP_RESOLVE_B,4,2    ## @PHY_SPEED_DUP_RESOLVE_B
	.comm	_HNS_PHY_PAGE_COPPER,4,2        ## @HNS_PHY_PAGE_COPPER
	.comm	_ETH_TP_MDI,8,3                 ## @ETH_TP_MDI
	.comm	_ETH_TP_MDI_X,8,3               ## @ETH_TP_MDI_X
	.comm	_ETH_TP_MDI_AUTO,8,3            ## @ETH_TP_MDI_AUTO
	.no_dead_strip	_hns_get_mdix_mode
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.hns_get_mdix_mode
l_switch.table.hns_get_mdix_mode:
	.quad	_ETH_TP_MDI
	.quad	_ETH_TP_MDI_X
	.quad	_ETH_TP_MDI_INVALID
	.quad	_ETH_TP_MDI_AUTO

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hns_get_mdix_mode
_hns_get_mdix_mode:                     ; @hns_get_mdix_mode
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x1
	ldr	x20, [x0]
	cbz	x20, LBB0_7
; %bb.1:
	ldr	w8, [x20]
	cbz	w8, LBB0_7
; %bb.2:
Lloh0:
	adrp	x24, _HNS_PHY_PAGE_REG@GOTPAGE
Lloh1:
	ldr	x24, [x24, _HNS_PHY_PAGE_REG@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh2:
	adrp	x8, _HNS_PHY_PAGE_MDIX@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HNS_PHY_PAGE_MDIX@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_phy_write
Lloh5:
	adrp	x8, _HNS_PHY_CSC_REG@GOTPAGE
Lloh6:
	ldr	x8, [x8, _HNS_PHY_CSC_REG@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_phy_read
Lloh8:
	adrp	x8, _PHY_MDIX_CTRL_M@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PHY_MDIX_CTRL_M@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x8, _PHY_MDIX_CTRL_S@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PHY_MDIX_CTRL_S@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	bl	_hnae_get_field
	mov	x21, x0
Lloh14:
	adrp	x8, _HNS_PHY_CSS_REG@GOTPAGE
Lloh15:
	ldr	x8, [x8, _HNS_PHY_CSS_REG@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_phy_read
	mov	x23, x0
Lloh17:
	adrp	x8, _PHY_MDIX_STATUS_B@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PHY_MDIX_STATUS_B@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	bl	_hnae_get_bit
	mov	x22, x0
Lloh20:
	adrp	x8, _PHY_SPEED_DUP_RESOLVE_B@GOTPAGE
Lloh21:
	ldr	x8, [x8, _PHY_SPEED_DUP_RESOLVE_B@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_hnae_get_bit
	mov	x23, x0
	ldr	w1, [x24]
Lloh23:
	adrp	x8, _HNS_PHY_PAGE_COPPER@GOTPAGE
Lloh24:
	ldr	x8, [x8, _HNS_PHY_PAGE_COPPER@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_phy_write
Lloh26:
	adrp	x8, _ETH_TP_MDI_INVALID@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ETH_TP_MDI_INVALID@GOTPAGEOFF]
	mov	x9, x8
	cmp	w21, #3
	b.hi	LBB0_4
; %bb.3:
Lloh28:
	adrp	x9, l_switch.table.hns_get_mdix_mode@PAGE
Lloh29:
	add	x9, x9, l_switch.table.hns_get_mdix_mode@PAGEOFF
	ldr	x9, [x9, w21, sxtw #3]
LBB0_4:
	ldr	x9, [x9]
	str	x9, [x19, #8]
	cbz	w23, LBB0_9
; %bb.5:
	cbz	w22, LBB0_8
; %bb.6:
Lloh30:
	adrp	x8, _ETH_TP_MDI_X@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ETH_TP_MDI_X@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:
Lloh32:
	adrp	x8, _ETH_TP_MDI_INVALID@GOTPAGE
Lloh33:
	ldr	x8, [x8, _ETH_TP_MDI_INVALID@GOTPAGEOFF]
Lloh34:
	ldr	x8, [x8]
	str	x8, [x19, #8]
	b	LBB0_10
LBB0_8:
Lloh35:
	adrp	x8, _ETH_TP_MDI@GOTPAGE
Lloh36:
	ldr	x8, [x8, _ETH_TP_MDI@GOTPAGEOFF]
LBB0_9:
	ldr	x8, [x8]
LBB0_10:
	str	x8, [x19]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_ETH_TP_MDI_INVALID,8,3         ; @ETH_TP_MDI_INVALID
	.comm	_HNS_PHY_PAGE_REG,4,2           ; @HNS_PHY_PAGE_REG
	.comm	_HNS_PHY_PAGE_MDIX,4,2          ; @HNS_PHY_PAGE_MDIX
	.comm	_HNS_PHY_CSC_REG,4,2            ; @HNS_PHY_CSC_REG
	.comm	_PHY_MDIX_CTRL_M,4,2            ; @PHY_MDIX_CTRL_M
	.comm	_PHY_MDIX_CTRL_S,4,2            ; @PHY_MDIX_CTRL_S
	.comm	_HNS_PHY_CSS_REG,4,2            ; @HNS_PHY_CSS_REG
	.comm	_PHY_MDIX_STATUS_B,4,2          ; @PHY_MDIX_STATUS_B
	.comm	_PHY_SPEED_DUP_RESOLVE_B,4,2    ; @PHY_SPEED_DUP_RESOLVE_B
	.comm	_HNS_PHY_PAGE_COPPER,4,2        ; @HNS_PHY_PAGE_COPPER
	.comm	_ETH_TP_MDI,8,3                 ; @ETH_TP_MDI
	.comm	_ETH_TP_MDI_X,8,3               ; @ETH_TP_MDI_X
	.comm	_ETH_TP_MDI_AUTO,8,3            ; @ETH_TP_MDI_AUTO
	.no_dead_strip	_hns_get_mdix_mode
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.hns_get_mdix_mode
l_switch.table.hns_get_mdix_mode:
	.quad	_ETH_TP_MDI
	.quad	_ETH_TP_MDI_X
	.quad	_ETH_TP_MDI_INVALID
	.quad	_ETH_TP_MDI_AUTO

.subsections_via_symbols
