	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ag71xx_link_adjust
_ag71xx_link_adjust:                    ## @ag71xx_link_adjust
	.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, %rbx
	movq	16(%rdi), %rax
	movq	(%rax), %r14
	testl	%esi, %esi
	je	LBB0_2
## %bb.1:
	cmpl	$0, 16(%r14)
	jne	LBB0_2
## %bb.16:
	movq	%rbx, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ag71xx_hw_stop                 ## TAILCALL
LBB0_2:
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movq	_AR7100@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_ag71xx_is
	testl	%eax, %eax
	jne	LBB0_5
## %bb.3:
	movq	_AR9130@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_ag71xx_is
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	callq	_ag71xx_fast_reset
LBB0_5:
	movq	_AG71XX_REG_MAC_CFG2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_ag71xx_rr
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_MAC_CFG2_IF_1000@GOTPCREL(%rip), %rax
	movq	_MAC_CFG2_IF_10_100@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	orl	(%rax), %r15d
	movq	_MAC_CFG2_FDX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%r13d, %r13d
	cmpq	$0, 8(%r14)
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	cmovnel	%eax, %r13d
	movq	_AG71XX_REG_MAC_IFCTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_ag71xx_rr
	movq	_MAC_IFCTL_SPEED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r12d
	notl	%r12d
	andl	%eax, %r12d
	movq	_AG71XX_REG_FIFO_CFG5@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_ag71xx_rr
	movq	_FIFO_CFG5_BM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	%r14, %rdx
	movl	%ecx, %r14d
	notl	%r14d
	andl	%eax, %r14d
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movl	(%rdx), %edx
	cmpl	$130, %edx
	je	LBB0_11
## %bb.6:
	cmpl	$129, %edx
	je	LBB0_10
## %bb.7:
	cmpl	$128, %edx
	jne	LBB0_9
## %bb.8:
	orl	%eax, %ecx
	movl	%ecx, %r14d
	movq	_MAC_CFG2_IF_1000@GOTPCREL(%rip), %rcx
	jmp	LBB0_12
LBB0_10:
	movq	_MAC_IFCTL_SPEED@GOTPCREL(%rip), %rax
	orl	(%rax), %r12d
LBB0_11:
	movq	_MAC_CFG2_IF_10_100@GOTPCREL(%rip), %rcx
LBB0_12:
	orl	-44(%rbp), %r15d                ## 4-byte Folded Reload
	notl	%r15d
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	andl	%r15d, %eax
	orl	%eax, %r13d
	orl	(%rcx), %r13d
	cmpl	$0, 8(%rbx)
	movq	(%rbx), %rax
	movl	8(%rax), %edx
	je	LBB0_14
## %bb.13:
	movzwl	%dx, %ecx
	movl	%ecx, 8(%rax)
	movl	8(%rbx), %esi
	movl	$2048, %edi                     ## imm = 0x800
	subl	%esi, %edi
	movl	$2051, %edx                     ## imm = 0x803
	subl	%esi, %edx
	testl	%edi, %edi
	cmovnsl	%edi, %edx
	andl	$-4, %edx
	shll	$14, %edx
	orl	%ecx, %edx
	movl	%edx, 8(%rax)
LBB0_14:
	movq	_AG71XX_REG_FIFO_CFG3@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_ag71xx_wr
	movq	_AG71XX_REG_MAC_CFG2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r13d, %edx
	callq	_ag71xx_wr
	movq	_AG71XX_REG_FIFO_CFG5@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_ag71xx_wr
	movq	_AG71XX_REG_MAC_IFCTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r12d, %edx
	callq	_ag71xx_wr
	movq	%rbx, %rdi
	callq	_ag71xx_hw_start
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_15
## %bb.17:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_phy_print_status               ## TAILCALL
LBB0_15:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_WARN                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AR7100,4,2                     ## @AR7100
	.comm	_AR9130,4,2                     ## @AR9130
	.comm	_AG71XX_REG_MAC_CFG2,4,2        ## @AG71XX_REG_MAC_CFG2
	.comm	_MAC_CFG2_IF_1000,4,2           ## @MAC_CFG2_IF_1000
	.comm	_MAC_CFG2_IF_10_100,4,2         ## @MAC_CFG2_IF_10_100
	.comm	_MAC_CFG2_FDX,4,2               ## @MAC_CFG2_FDX
	.comm	_AG71XX_REG_MAC_IFCTL,4,2       ## @AG71XX_REG_MAC_IFCTL
	.comm	_MAC_IFCTL_SPEED,4,2            ## @MAC_IFCTL_SPEED
	.comm	_AG71XX_REG_FIFO_CFG5,4,2       ## @AG71XX_REG_FIFO_CFG5
	.comm	_FIFO_CFG5_BM,4,2               ## @FIFO_CFG5_BM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"not supported speed %i\n"

	.comm	_AG71XX_REG_FIFO_CFG3,4,2       ## @AG71XX_REG_FIFO_CFG3
	.no_dead_strip	_ag71xx_link_adjust
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ag71xx_link_adjust
_ag71xx_link_adjust:                    ; @ag71xx_link_adjust
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x21, x0
	ldr	x8, [x0, #16]
	ldr	x19, [x8]
	cbz	w1, LBB0_3
; %bb.1:
	ldr	w8, [x19, #16]
	cbnz	w8, LBB0_3
; %bb.2:
	mov	x0, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_ag71xx_hw_stop
LBB0_3:
Lloh0:
	adrp	x8, _AR7100@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AR7100@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_ag71xx_is
	cbnz	w0, LBB0_6
; %bb.4:
Lloh3:
	adrp	x8, _AR9130@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AR9130@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_ag71xx_is
	cbnz	w0, LBB0_6
; %bb.5:
	mov	x0, x21
	bl	_ag71xx_fast_reset
LBB0_6:
Lloh6:
	adrp	x8, _AG71XX_REG_MAC_CFG2@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AG71XX_REG_MAC_CFG2@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_ag71xx_rr
	str	w0, [sp, #8]                    ; 4-byte Folded Spill
Lloh9:
	adrp	x8, _MAC_CFG2_IF_1000@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MAC_CFG2_IF_1000@GOTPAGEOFF]
Lloh11:
	ldr	w28, [x8]
Lloh12:
	adrp	x22, _MAC_CFG2_IF_10_100@GOTPAGE
Lloh13:
	ldr	x22, [x22, _MAC_CFG2_IF_10_100@GOTPAGEOFF]
	ldr	w25, [x22]
Lloh14:
	adrp	x8, _MAC_CFG2_FDX@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MAC_CFG2_FDX@GOTPAGEOFF]
Lloh16:
	ldr	w26, [x8]
	ldr	x8, [x19, #8]
	cmp	x8, #0
	csel	w27, wzr, w26, eq
Lloh17:
	adrp	x8, _AG71XX_REG_MAC_IFCTL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AG71XX_REG_MAC_IFCTL@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_ag71xx_rr
Lloh20:
	adrp	x24, _MAC_IFCTL_SPEED@GOTPAGE
Lloh21:
	ldr	x24, [x24, _MAC_IFCTL_SPEED@GOTPAGEOFF]
	ldr	w8, [x24]
	bic	w8, w0, w8
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
Lloh22:
	adrp	x8, _AG71XX_REG_FIFO_CFG5@GOTPAGE
Lloh23:
	ldr	x8, [x8, _AG71XX_REG_FIFO_CFG5@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_ag71xx_rr
Lloh25:
	adrp	x8, _FIFO_CFG5_BM@GOTPAGE
Lloh26:
	ldr	x8, [x8, _FIFO_CFG5_BM@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	bic	w23, w0, w8
	ldr	w2, [x19]
	cmp	w2, #130
	b.eq	LBB0_11
; %bb.7:
	cmp	w2, #129
	b.eq	LBB0_10
; %bb.8:
	cmp	w2, #128
	b.ne	LBB0_16
; %bb.9:
	orr	w23, w8, w0
Lloh28:
	adrp	x22, _MAC_CFG2_IF_1000@GOTPAGE
Lloh29:
	ldr	x22, [x22, _MAC_CFG2_IF_1000@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
	ldr	w8, [x24]
	ldr	w9, [sp, #12]                   ; 4-byte Folded Reload
	orr	w9, w8, w9
	str	w9, [sp, #12]                   ; 4-byte Folded Spill
Lloh30:
	adrp	x22, _MAC_CFG2_IF_10_100@GOTPAGE
Lloh31:
	ldr	x22, [x22, _MAC_CFG2_IF_10_100@GOTPAGEOFF]
LBB0_11:
	orr	w8, w25, w28
	orr	w8, w8, w26
	ldr	w9, [sp, #8]                    ; 4-byte Folded Reload
	bic	w8, w9, w8
	orr	w8, w27, w8
	ldr	w9, [x22]
	orr	w24, w8, w9
	ldr	w9, [x21, #8]
	ldr	x8, [x21]
	ldr	w2, [x8, #8]
	cbz	w9, LBB0_13
; %bb.12:
	and	w9, w2, #0xffff
	str	w9, [x8, #8]
	ldr	w9, [x21, #8]
	mov	w10, #2048
	sub	w10, w10, w9
	mov	w11, #2051
	sub	w9, w11, w9
	cmp	w10, #0
	csel	w9, w9, w10, lt
	lsr	w9, w9, #2
	bfi	w2, w9, #16, #16
	str	w2, [x8, #8]
LBB0_13:
Lloh32:
	adrp	x8, _AG71XX_REG_FIFO_CFG3@GOTPAGE
Lloh33:
	ldr	x8, [x8, _AG71XX_REG_FIFO_CFG3@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_ag71xx_wr
Lloh35:
	adrp	x8, _AG71XX_REG_MAC_CFG2@GOTPAGE
Lloh36:
	ldr	x8, [x8, _AG71XX_REG_MAC_CFG2@GOTPAGEOFF]
Lloh37:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, x24
	bl	_ag71xx_wr
Lloh38:
	adrp	x8, _AG71XX_REG_FIFO_CFG5@GOTPAGE
Lloh39:
	ldr	x8, [x8, _AG71XX_REG_FIFO_CFG5@GOTPAGEOFF]
Lloh40:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, x23
	bl	_ag71xx_wr
Lloh41:
	adrp	x8, _AG71XX_REG_MAC_IFCTL@GOTPAGE
Lloh42:
	ldr	x8, [x8, _AG71XX_REG_MAC_IFCTL@GOTPAGEOFF]
Lloh43:
	ldr	w1, [x8]
	mov	x0, x21
	ldr	w2, [sp, #12]                   ; 4-byte Folded Reload
	bl	_ag71xx_wr
	mov	x0, x21
	bl	_ag71xx_hw_start
	cbz	w20, LBB0_15
; %bb.14:
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_phy_print_status
LBB0_15:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_16:
Lloh44:
	adrp	x1, l_.str@PAGE
Lloh45:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_WARN
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh44, Lloh45
	.cfi_endproc
                                        ; -- End function
	.comm	_AR7100,4,2                     ; @AR7100
	.comm	_AR9130,4,2                     ; @AR9130
	.comm	_AG71XX_REG_MAC_CFG2,4,2        ; @AG71XX_REG_MAC_CFG2
	.comm	_MAC_CFG2_IF_1000,4,2           ; @MAC_CFG2_IF_1000
	.comm	_MAC_CFG2_IF_10_100,4,2         ; @MAC_CFG2_IF_10_100
	.comm	_MAC_CFG2_FDX,4,2               ; @MAC_CFG2_FDX
	.comm	_AG71XX_REG_MAC_IFCTL,4,2       ; @AG71XX_REG_MAC_IFCTL
	.comm	_MAC_IFCTL_SPEED,4,2            ; @MAC_IFCTL_SPEED
	.comm	_AG71XX_REG_FIFO_CFG5,4,2       ; @AG71XX_REG_FIFO_CFG5
	.comm	_FIFO_CFG5_BM,4,2               ; @FIFO_CFG5_BM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"not supported speed %i\n"

	.comm	_AG71XX_REG_FIFO_CFG3,4,2       ; @AG71XX_REG_FIFO_CFG3
	.no_dead_strip	_ag71xx_link_adjust
.subsections_via_symbols
