	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtl_get_port_link
_rtl_get_port_link:                     ## @rtl_get_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	_RTL8306_NUM_PORTS@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jle	LBB0_1
## %bb.2:
	movq	%rdx, %r14
	movl	%esi, %ebx
	movq	%rdi, %r15
	movq	_LINK@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movl	%ebx, %edi
	callq	_RTL_PORT_REG
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_rtl_get
	movq	%rax, 24(%r14)
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movl	(%r12), %esi
	movl	%ebx, %edi
	callq	_RTL_PORT_REG
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_rtl_get
	movq	%rax, 24(%r14)
	testq	%rax, %rax
	je	LBB0_8
LBB0_4:
	movq	_DUPLEX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_RTL_PORT_REG
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_rtl_get
	movq	%rax, 16(%r14)
	movq	_NWAY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_RTL_PORT_REG
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_rtl_get
	movq	%rax, 8(%r14)
	movq	_SPEED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_RTL_PORT_REG
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_rtl_get
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	_SWITCH_PORT_SPEED_100@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_9
LBB0_6:
	movq	_SWITCH_PORT_SPEED_10@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %eax
	movl	%eax, (%r14)
LBB0_8:
	xorl	%eax, %eax
LBB0_9:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RTL8306_NUM_PORTS,4,2          ## @RTL8306_NUM_PORTS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_LINK,4,2                       ## @LINK
	.comm	_DUPLEX,4,2                     ## @DUPLEX
	.comm	_NWAY,4,2                       ## @NWAY
	.comm	_SPEED,4,2                      ## @SPEED
	.comm	_SWITCH_PORT_SPEED_100,4,2      ## @SWITCH_PORT_SPEED_100
	.comm	_SWITCH_PORT_SPEED_10,4,2       ## @SWITCH_PORT_SPEED_10
	.no_dead_strip	_rtl_get_port_link
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rtl_get_port_link
_rtl_get_port_link:                     ; @rtl_get_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
Lloh0:
	adrp	x8, _RTL8306_NUM_PORTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RTL8306_NUM_PORTS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.le	LBB0_5
; %bb.1:
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
Lloh3:
	adrp	x22, _LINK@GOTPAGE
Lloh4:
	ldr	x22, [x22, _LINK@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x21
	bl	_RTL_PORT_REG
	mov	x1, x0
	mov	x0, x20
	bl	_rtl_get
	str	x0, [x19, #24]
	cbnz	x0, LBB0_3
; %bb.2:
	ldr	w1, [x22]
	mov	x0, x21
	bl	_RTL_PORT_REG
	mov	x1, x0
	mov	x0, x20
	bl	_rtl_get
	str	x0, [x19, #24]
	cbz	x0, LBB0_8
LBB0_3:
Lloh5:
	adrp	x8, _DUPLEX@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DUPLEX@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_RTL_PORT_REG
	mov	x1, x0
	mov	x0, x20
	bl	_rtl_get
	str	x0, [x19, #16]
Lloh8:
	adrp	x8, _NWAY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _NWAY@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_RTL_PORT_REG
	mov	x1, x0
	mov	x0, x20
	bl	_rtl_get
	str	x0, [x19, #8]
Lloh11:
	adrp	x8, _SPEED@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SPEED@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_RTL_PORT_REG
	mov	x1, x0
	mov	x0, x20
	bl	_rtl_get
	cbz	x0, LBB0_6
; %bb.4:
	mov	w0, #0
Lloh14:
	adrp	x8, _SWITCH_PORT_SPEED_100@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SWITCH_PORT_SPEED_100@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_6:
Lloh19:
	adrp	x8, _SWITCH_PORT_SPEED_10@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SWITCH_PORT_SPEED_10@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	str	w8, [x19]
LBB0_8:
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_RTL8306_NUM_PORTS,4,2          ; @RTL8306_NUM_PORTS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_LINK,4,2                       ; @LINK
	.comm	_DUPLEX,4,2                     ; @DUPLEX
	.comm	_NWAY,4,2                       ; @NWAY
	.comm	_SPEED,4,2                      ; @SPEED
	.comm	_SWITCH_PORT_SPEED_100,4,2      ; @SWITCH_PORT_SPEED_100
	.comm	_SWITCH_PORT_SPEED_10,4,2       ; @SWITCH_PORT_SPEED_10
	.no_dead_strip	_rtl_get_port_link
.subsections_via_symbols
