	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns_gmac_adjust_link
_hns_gmac_adjust_link:                  ## @hns_gmac_adjust_link
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	_GMAC_DUPLEX_TYPE_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_GMAC_DUPLEX_TYPE_B@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ecx, %ecx
	testl	%edx, %edx
	setne	%cl
	movl	%eax, %edx
	callq	_dsaf_set_dev_bit
	cmpl	$128, %ebx
	je	LBB0_6
## %bb.1:
	cmpl	$129, %ebx
	je	LBB0_5
## %bb.2:
	cmpl	$130, %ebx
	jne	LBB0_7
## %bb.3:
	movq	_GMAC_PORT_MODE_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_GMAC_PORT_MODE_M@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_GMAC_PORT_MODE_S@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	$6, %r8d
	jmp	LBB0_4
LBB0_6:
	movq	_GMAC_PORT_MODE_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_GMAC_PORT_MODE_M@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_GMAC_PORT_MODE_S@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	$8, %r8d
	jmp	LBB0_4
LBB0_5:
	movq	_GMAC_PORT_MODE_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_GMAC_PORT_MODE_M@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_GMAC_PORT_MODE_S@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	$7, %r8d
LBB0_4:
	callq	_dsaf_set_dev_field
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_7:
	movl	(%r14), %ecx
	movl	4(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GMAC_DUPLEX_TYPE_REG,4,2       ## @GMAC_DUPLEX_TYPE_REG
	.comm	_GMAC_DUPLEX_TYPE_B,4,2         ## @GMAC_DUPLEX_TYPE_B
	.comm	_GMAC_PORT_MODE_REG,4,2         ## @GMAC_PORT_MODE_REG
	.comm	_GMAC_PORT_MODE_M,4,2           ## @GMAC_PORT_MODE_M
	.comm	_GMAC_PORT_MODE_S,4,2           ## @GMAC_PORT_MODE_S
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hns_gmac_adjust_link fail, speed%d mac%d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_hns_gmac_adjust_link
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hns_gmac_adjust_link
_hns_gmac_adjust_link:                  ; @hns_gmac_adjust_link
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _GMAC_DUPLEX_TYPE_REG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GMAC_DUPLEX_TYPE_REG@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _GMAC_DUPLEX_TYPE_B@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GMAC_DUPLEX_TYPE_B@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w2, #0
	cset	w3, ne
	mov	x2, x8
	bl	_dsaf_set_dev_bit
	cmp	w20, #128
	b.eq	LBB0_4
; %bb.1:
	cmp	w20, #129
	b.eq	LBB0_5
; %bb.2:
	cmp	w20, #130
	b.ne	LBB0_7
; %bb.3:
Lloh6:
	adrp	x8, _GMAC_PORT_MODE_REG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GMAC_PORT_MODE_REG@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _GMAC_PORT_MODE_M@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GMAC_PORT_MODE_M@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
Lloh12:
	adrp	x8, _GMAC_PORT_MODE_S@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GMAC_PORT_MODE_S@GOTPAGEOFF]
Lloh14:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w4, #6
	b	LBB0_6
LBB0_4:
Lloh15:
	adrp	x8, _GMAC_PORT_MODE_REG@GOTPAGE
Lloh16:
	ldr	x8, [x8, _GMAC_PORT_MODE_REG@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
Lloh18:
	adrp	x8, _GMAC_PORT_MODE_M@GOTPAGE
Lloh19:
	ldr	x8, [x8, _GMAC_PORT_MODE_M@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
Lloh21:
	adrp	x8, _GMAC_PORT_MODE_S@GOTPAGE
Lloh22:
	ldr	x8, [x8, _GMAC_PORT_MODE_S@GOTPAGEOFF]
Lloh23:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w4, #8
	b	LBB0_6
LBB0_5:
Lloh24:
	adrp	x8, _GMAC_PORT_MODE_REG@GOTPAGE
Lloh25:
	ldr	x8, [x8, _GMAC_PORT_MODE_REG@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
Lloh27:
	adrp	x8, _GMAC_PORT_MODE_M@GOTPAGE
Lloh28:
	ldr	x8, [x8, _GMAC_PORT_MODE_M@GOTPAGEOFF]
Lloh29:
	ldr	w2, [x8]
Lloh30:
	adrp	x8, _GMAC_PORT_MODE_S@GOTPAGE
Lloh31:
	ldr	x8, [x8, _GMAC_PORT_MODE_S@GOTPAGEOFF]
Lloh32:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w4, #7
LBB0_6:
	bl	_dsaf_set_dev_field
	mov	w0, #0
	b	LBB0_8
LBB0_7:
	ldp	w3, w0, [x19]
Lloh33:
	adrp	x1, l_.str@PAGE
Lloh34:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_err
Lloh35:
	adrp	x8, _EINVAL@GOTPAGE
Lloh36:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_GMAC_DUPLEX_TYPE_REG,4,2       ; @GMAC_DUPLEX_TYPE_REG
	.comm	_GMAC_DUPLEX_TYPE_B,4,2         ; @GMAC_DUPLEX_TYPE_B
	.comm	_GMAC_PORT_MODE_REG,4,2         ; @GMAC_PORT_MODE_REG
	.comm	_GMAC_PORT_MODE_M,4,2           ; @GMAC_PORT_MODE_M
	.comm	_GMAC_PORT_MODE_S,4,2           ; @GMAC_PORT_MODE_S
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hns_gmac_adjust_link fail, speed%d mac%d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_hns_gmac_adjust_link
.subsections_via_symbols
