	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar8216_read_port_link
_ar8216_read_port_link:                 ## @ar8216_read_port_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	%rdx, %rdi
	xorl	%esi, %esi
	movl	$28, %edx
	callq	_memset
	movq	8(%r15), %rax
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	*(%rax)
	movl	%eax, %r12d
	movq	_AR8216_PORT_STATUS_LINK_AUTO@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	movl	%r12d, %edx
	andl	(%rax), %edx
	setne	%cl
	movl	%ecx, (%rbx)
	je	LBB0_2
## %bb.1:
	movq	_AR8216_PORT_STATUS_LINK_UP@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	movl	(%rcx), %ecx
	andl	%r12d, %ecx
	setne	%al
LBB0_6:
	movl	%eax, 4(%rbx)
	testl	%eax, %eax
	jne	LBB0_8
	jmp	LBB0_16
LBB0_2:
	movl	$1, 4(%rbx)
	movq	(%r15), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.3:
	movl	%r14d, %edi
	callq	*%rax
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	setne	%al
	movzbl	%al, %eax
	jmp	LBB0_6
LBB0_4:
	movl	4(%rbx), %eax
	testl	%eax, %eax
	je	LBB0_16
LBB0_8:
	movq	_AR8216_PORT_STATUS_DUPLEX@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	movl	(%rax), %eax
	andl	%r12d, %eax
	setne	%cl
	movl	%ecx, 8(%rbx)
	movq	_AR8216_PORT_STATUS_TXFLOW@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	movl	(%rcx), %ecx
	andl	%r12d, %ecx
	setne	%dl
	movl	%edx, 12(%rbx)
	movq	_AR8216_PORT_STATUS_RXFLOW@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	movl	(%rcx), %ecx
	andl	%r12d, %ecx
	setne	%dl
	movl	%edx, 16(%rbx)
	cmpl	$0, (%rbx)
	je	LBB0_12
## %bb.9:
	testl	%eax, %eax
	je	LBB0_12
## %bb.10:
	movq	8(%r15), %rax
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	*%rax
	movl	%eax, 24(%rbx)
LBB0_12:
	movq	_AR8216_PORT_STATUS_SPEED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%r12d, %eax
	movq	_AR8216_PORT_STATUS_SPEED_S@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	addl	$-128, %eax
	cmpl	$2, %eax
	ja	LBB0_13
## %bb.14:
	cltq
	leaq	l_switch.table.ar8216_read_port_link(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	jmp	LBB0_15
LBB0_13:
	movq	_SWITCH_PORT_SPEED_UNKNOWN@GOTPCREL(%rip), %rax
LBB0_15:
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
LBB0_16:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AR8216_PORT_STATUS_LINK_AUTO,4,2 ## @AR8216_PORT_STATUS_LINK_AUTO
	.comm	_AR8216_PORT_STATUS_LINK_UP,4,2 ## @AR8216_PORT_STATUS_LINK_UP
	.comm	_AR8216_PORT_STATUS_DUPLEX,4,2  ## @AR8216_PORT_STATUS_DUPLEX
	.comm	_AR8216_PORT_STATUS_TXFLOW,4,2  ## @AR8216_PORT_STATUS_TXFLOW
	.comm	_AR8216_PORT_STATUS_RXFLOW,4,2  ## @AR8216_PORT_STATUS_RXFLOW
	.comm	_AR8216_PORT_STATUS_SPEED,4,2   ## @AR8216_PORT_STATUS_SPEED
	.comm	_AR8216_PORT_STATUS_SPEED_S,4,2 ## @AR8216_PORT_STATUS_SPEED_S
	.comm	_SWITCH_PORT_SPEED_10,4,2       ## @SWITCH_PORT_SPEED_10
	.comm	_SWITCH_PORT_SPEED_100,4,2      ## @SWITCH_PORT_SPEED_100
	.comm	_SWITCH_PORT_SPEED_1000,4,2     ## @SWITCH_PORT_SPEED_1000
	.comm	_SWITCH_PORT_SPEED_UNKNOWN,4,2  ## @SWITCH_PORT_SPEED_UNKNOWN
	.no_dead_strip	_ar8216_read_port_link
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.ar8216_read_port_link
l_switch.table.ar8216_read_port_link:
	.quad	_SWITCH_PORT_SPEED_10
	.quad	_SWITCH_PORT_SPEED_100
	.quad	_SWITCH_PORT_SPEED_1000

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ar8216_read_port_link
_ar8216_read_port_link:                 ; @ar8216_read_port_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	x19, x2
	mov	x20, x1
	mov	x21, x0
	mov	x0, x2
	mov	w1, #0
	mov	w2, #28
	bl	_memset
	ldr	x8, [x21, #8]
	ldr	x8, [x8]
	mov	x0, x21
	mov	x1, x20
	blr	x8
	mov	x22, x0
Lloh0:
	adrp	x8, _AR8216_PORT_STATUS_LINK_AUTO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AR8216_PORT_STATUS_LINK_AUTO@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ands	w8, w8, w0
	cset	w9, ne
	str	w9, [x19]
	cbz	w8, LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _AR8216_PORT_STATUS_LINK_UP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AR8216_PORT_STATUS_LINK_UP@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w22
LBB0_2:
	cset	w8, ne
	str	w8, [x19, #4]
	cbnz	w8, LBB0_7
	b	LBB0_15
LBB0_3:
	mov	w8, #1
	str	w8, [x19, #4]
	ldr	x8, [x21]
	cbz	x8, LBB0_7
; %bb.4:
	mov	x0, x20
	blr	x8
	tbnz	w0, #31, LBB0_6
; %bb.5:
	cmp	w0, #0
	b	LBB0_2
LBB0_6:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_15
LBB0_7:
Lloh6:
	adrp	x8, _AR8216_PORT_STATUS_DUPLEX@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AR8216_PORT_STATUS_DUPLEX@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ands	w8, w8, w22
	cset	w9, ne
Lloh9:
	adrp	x10, _AR8216_PORT_STATUS_TXFLOW@GOTPAGE
Lloh10:
	ldr	x10, [x10, _AR8216_PORT_STATUS_TXFLOW@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	tst	w10, w22
	cset	w10, ne
Lloh12:
	adrp	x11, _AR8216_PORT_STATUS_RXFLOW@GOTPAGE
Lloh13:
	ldr	x11, [x11, _AR8216_PORT_STATUS_RXFLOW@GOTPAGEOFF]
	stp	w9, w10, [x19, #8]
Lloh14:
	ldr	w9, [x11]
	tst	w9, w22
	cset	w9, ne
	str	w9, [x19, #16]
	ldr	w9, [x19]
	cbz	w9, LBB0_11
; %bb.8:
	cbz	w8, LBB0_11
; %bb.9:
	ldr	x8, [x21, #8]
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_11
; %bb.10:
	mov	x0, x21
	mov	x1, x20
	blr	x8
	str	w0, [x19, #24]
LBB0_11:
Lloh15:
	adrp	x8, _AR8216_PORT_STATUS_SPEED@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AR8216_PORT_STATUS_SPEED@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	and	w8, w8, w22
Lloh18:
	adrp	x9, _AR8216_PORT_STATUS_SPEED_S@GOTPAGE
Lloh19:
	ldr	x9, [x9, _AR8216_PORT_STATUS_SPEED_S@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	asr	w8, w8, w9
	sub	w8, w8, #128
	cmp	w8, #2
	b.hi	LBB0_13
; %bb.12:
Lloh21:
	adrp	x9, l_switch.table.ar8216_read_port_link@PAGE
Lloh22:
	add	x9, x9, l_switch.table.ar8216_read_port_link@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
	b	LBB0_14
LBB0_13:
Lloh23:
	adrp	x8, _SWITCH_PORT_SPEED_UNKNOWN@GOTPAGE
Lloh24:
	ldr	x8, [x8, _SWITCH_PORT_SPEED_UNKNOWN@GOTPAGEOFF]
LBB0_14:
	ldr	w8, [x8]
	str	w8, [x19, #20]
LBB0_15:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_AR8216_PORT_STATUS_LINK_AUTO,4,2 ; @AR8216_PORT_STATUS_LINK_AUTO
	.comm	_AR8216_PORT_STATUS_LINK_UP,4,2 ; @AR8216_PORT_STATUS_LINK_UP
	.comm	_AR8216_PORT_STATUS_DUPLEX,4,2  ; @AR8216_PORT_STATUS_DUPLEX
	.comm	_AR8216_PORT_STATUS_TXFLOW,4,2  ; @AR8216_PORT_STATUS_TXFLOW
	.comm	_AR8216_PORT_STATUS_RXFLOW,4,2  ; @AR8216_PORT_STATUS_RXFLOW
	.comm	_AR8216_PORT_STATUS_SPEED,4,2   ; @AR8216_PORT_STATUS_SPEED
	.comm	_AR8216_PORT_STATUS_SPEED_S,4,2 ; @AR8216_PORT_STATUS_SPEED_S
	.comm	_SWITCH_PORT_SPEED_10,4,2       ; @SWITCH_PORT_SPEED_10
	.comm	_SWITCH_PORT_SPEED_100,4,2      ; @SWITCH_PORT_SPEED_100
	.comm	_SWITCH_PORT_SPEED_1000,4,2     ; @SWITCH_PORT_SPEED_1000
	.comm	_SWITCH_PORT_SPEED_UNKNOWN,4,2  ; @SWITCH_PORT_SPEED_UNKNOWN
	.no_dead_strip	_ar8216_read_port_link
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.ar8216_read_port_link
l_switch.table.ar8216_read_port_link:
	.quad	_SWITCH_PORT_SPEED_10
	.quad	_SWITCH_PORT_SPEED_100
	.quad	_SWITCH_PORT_SPEED_1000

.subsections_via_symbols
