	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qca8k_adjust_link
_qca8k_adjust_link:                     ## @qca8k_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	%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	%rdx, %rbx
	movl	%esi, %r15d
	movq	%rdi, %r12
	movq	(%rdi), %r14
	movq	%rdx, %rdi
	callq	_phy_is_pseudo_fixed_link
	testl	%eax, %eax
	je	LBB0_11
## %bb.1:
	movl	(%rbx), %ecx
	cmpl	$10, %ecx
	je	LBB0_2
## %bb.3:
	cmpl	$1000, %ecx                     ## imm = 0x3E8
	je	LBB0_7
## %bb.4:
	cmpl	$100, %ecx
	jne	LBB0_6
## %bb.5:
	movq	_QCA8K_PORT_STATUS_SPEED_100@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_QCA8K_PORT_STATUS_SPEED_10@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_7:
	movq	_QCA8K_PORT_STATUS_SPEED_1000@GOTPCREL(%rip), %rax
LBB0_8:
	movq	8(%rbx), %rcx
	movq	_DUPLEX_FULL@GOTPCREL(%rip), %rdx
	movl	$0, %r13d
	cmpq	(%rdx), %rcx
	jne	LBB0_10
## %bb.9:
	movq	_QCA8K_PORT_STATUS_DUPLEX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
LBB0_10:
	orl	(%rax), %r13d
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_dsa_is_cpu_port
	movq	_QCA8K_PORT_STATUS_RXFLOW@GOTPCREL(%rip), %rcx
	movq	_QCA8K_PORT_STATUS_TXFLOW@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ebx
	orl	(%rcx), %ebx
	testq	%rax, %rax
	movl	$0, %eax
	cmovel	%eax, %ebx
	orl	%r13d, %ebx
	movq	%r14, %rdi
	movl	%r15d, %esi
	xorl	%edx, %edx
	callq	_qca8k_port_set_status
	movl	%r15d, %edi
	callq	_QCA8K_REG_PORT_STATUS
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	%ebx, %edx
	callq	_qca8k_write
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	$1, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_qca8k_port_set_status          ## TAILCALL
LBB0_6:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_dbg                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_QCA8K_PORT_STATUS_SPEED_10,4,2 ## @QCA8K_PORT_STATUS_SPEED_10
	.comm	_QCA8K_PORT_STATUS_SPEED_100,4,2 ## @QCA8K_PORT_STATUS_SPEED_100
	.comm	_QCA8K_PORT_STATUS_SPEED_1000,4,2 ## @QCA8K_PORT_STATUS_SPEED_1000
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"port%d link speed %dMbps not supported.\n"

	.comm	_DUPLEX_FULL,8,3                ## @DUPLEX_FULL
	.comm	_QCA8K_PORT_STATUS_DUPLEX,4,2   ## @QCA8K_PORT_STATUS_DUPLEX
	.comm	_QCA8K_PORT_STATUS_RXFLOW,4,2   ## @QCA8K_PORT_STATUS_RXFLOW
	.comm	_QCA8K_PORT_STATUS_TXFLOW,4,2   ## @QCA8K_PORT_STATUS_TXFLOW
	.no_dead_strip	_qca8k_adjust_link
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qca8k_adjust_link
_qca8k_adjust_link:                     ; @qca8k_adjust_link
	.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	x22, x2
	mov	x19, x1
	mov	x21, x0
	ldr	x20, [x0]
	mov	x0, x2
	bl	_phy_is_pseudo_fixed_link
	cbz	w0, LBB0_5
; %bb.1:
	ldr	w3, [x22]
	cmp	w3, #10
	b.eq	LBB0_6
; %bb.2:
	cmp	w3, #1000
	b.eq	LBB0_7
; %bb.3:
	cmp	w3, #100
	b.ne	LBB0_9
; %bb.4:
Lloh0:
	adrp	x8, _QCA8K_PORT_STATUS_SPEED_100@GOTPAGE
Lloh1:
	ldr	x8, [x8, _QCA8K_PORT_STATUS_SPEED_100@GOTPAGEOFF]
	b	LBB0_8
LBB0_5:
	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
LBB0_6:
Lloh2:
	adrp	x8, _QCA8K_PORT_STATUS_SPEED_10@GOTPAGE
Lloh3:
	ldr	x8, [x8, _QCA8K_PORT_STATUS_SPEED_10@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh4:
	adrp	x8, _QCA8K_PORT_STATUS_SPEED_1000@GOTPAGE
Lloh5:
	ldr	x8, [x8, _QCA8K_PORT_STATUS_SPEED_1000@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	ldr	x9, [x22, #8]
Lloh6:
	adrp	x10, _DUPLEX_FULL@GOTPAGE
Lloh7:
	ldr	x10, [x10, _DUPLEX_FULL@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
Lloh9:
	adrp	x11, _QCA8K_PORT_STATUS_DUPLEX@GOTPAGE
Lloh10:
	ldr	x11, [x11, _QCA8K_PORT_STATUS_DUPLEX@GOTPAGEOFF]
Lloh11:
	ldr	w11, [x11]
	cmp	x9, x10
	csel	w9, w11, wzr, eq
	orr	w22, w9, w8
	mov	x0, x21
	mov	x1, x19
	bl	_dsa_is_cpu_port
Lloh12:
	adrp	x8, _QCA8K_PORT_STATUS_RXFLOW@GOTPAGE
Lloh13:
	ldr	x8, [x8, _QCA8K_PORT_STATUS_RXFLOW@GOTPAGEOFF]
Lloh14:
	adrp	x9, _QCA8K_PORT_STATUS_TXFLOW@GOTPAGE
Lloh15:
	ldr	x9, [x9, _QCA8K_PORT_STATUS_TXFLOW@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	ldr	w9, [x9]
	orr	w8, w9, w8
	cmp	x0, #0
	csel	w8, wzr, w8, eq
	orr	w21, w22, w8
	mov	x0, x20
	mov	x1, x19
	mov	w2, #0
	bl	_qca8k_port_set_status
	mov	x0, x19
	bl	_QCA8K_REG_PORT_STATUS
	mov	x1, x0
	mov	x0, x20
	mov	x2, x21
	bl	_qca8k_write
	mov	x0, x20
	mov	x1, x19
	mov	w2, #1
	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
	b	_qca8k_port_set_status
LBB0_9:
	ldr	w0, [x20]
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	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
	b	_dev_dbg
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh16
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_QCA8K_PORT_STATUS_SPEED_10,4,2 ; @QCA8K_PORT_STATUS_SPEED_10
	.comm	_QCA8K_PORT_STATUS_SPEED_100,4,2 ; @QCA8K_PORT_STATUS_SPEED_100
	.comm	_QCA8K_PORT_STATUS_SPEED_1000,4,2 ; @QCA8K_PORT_STATUS_SPEED_1000
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"port%d link speed %dMbps not supported.\n"

	.comm	_DUPLEX_FULL,8,3                ; @DUPLEX_FULL
	.comm	_QCA8K_PORT_STATUS_DUPLEX,4,2   ; @QCA8K_PORT_STATUS_DUPLEX
	.comm	_QCA8K_PORT_STATUS_RXFLOW,4,2   ; @QCA8K_PORT_STATUS_RXFLOW
	.comm	_QCA8K_PORT_STATUS_TXFLOW,4,2   ; @QCA8K_PORT_STATUS_TXFLOW
	.no_dead_strip	_qca8k_adjust_link
.subsections_via_symbols
