	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function b53_port_get_link
_b53_port_get_link:                     ## @b53_port_get_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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %r15d
	callq	_sw_to_b53
	movq	%rax, %rbx
	movq	%rax, %rdi
	movl	%r15d, %esi
	callq	_is_cpu_port
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, (%r14)
	movq	%rbx, %rdi
	callq	_is5325
	testq	%rax, %rax
	jne	LBB0_14
## %bb.11:
	movq	%rbx, %rdi
	callq	_is5365
	testq	%rax, %rax
	jne	LBB0_14
## %bb.12:
	movq	_SWITCH_PORT_SPEED_1000@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_14:
	movq	_SWITCH_PORT_SPEED_100@GOTPCREL(%rip), %rax
LBB0_15:
	movq	(%rax), %rax
	movq	%rax, 16(%r14)
	movl	$0, 8(%r14)
	jmp	LBB0_16
LBB0_3:
	movl	(%rbx), %r12d
	movl	%r15d, %edi
	callq	_BIT
	testl	%r12d, %eax
	je	LBB0_13
## %bb.4:
	movq	_B53_STAT_PAGE@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_B53_LINK_STAT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-40(%rbp), %rcx
	movq	%rbx, %rdi
	callq	_b53_read16
	movl	(%r12), %esi
	movl	4(%rbx), %edx
	leaq	-36(%rbp), %rcx
	movq	%rbx, %rdi
	callq	_b53_read16
	movl	-40(%rbp), %eax
	xorl	%ecx, %ecx
	btl	%r15d, %eax
	setb	%cl
	movl	%ecx, -40(%rbp)
	movl	-36(%rbp), %eax
	xorl	%ecx, %ecx
	btl	%r15d, %eax
	setb	%cl
	movl	%ecx, -36(%rbp)
	movq	%rbx, %rdi
	callq	_is5325
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	callq	_is5365
	testq	%rax, %rax
	je	LBB0_17
LBB0_6:
	movl	(%r12), %esi
	movq	_B53_SPEED_STAT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-48(%rbp), %rcx
	movq	%rbx, %rdi
	callq	_b53_read16
	movl	-48(%rbp), %edi
	movl	%r15d, %esi
	callq	_SPEED_PORT_FE
LBB0_7:
	movl	%eax, -44(%rbp)
	movl	-40(%rbp), %ecx
	movl	%ecx, (%r14)
	testl	%ecx, %ecx
	je	LBB0_10
## %bb.8:
	movl	-36(%rbp), %ecx
	movl	%ecx, 4(%r14)
	addl	$-128, %eax
	cmpl	$2, %eax
	ja	LBB0_10
## %bb.9:
	cltq
	leaq	l_switch.table.b53_port_get_link(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%r14)
LBB0_10:
	movl	$1, 8(%r14)
	jmp	LBB0_16
LBB0_13:
	movl	$0, (%r14)
LBB0_16:
	xorl	%eax, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movl	(%r12), %esi
	movq	_B53_SPEED_STAT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-44(%rbp), %rcx
	movq	%rbx, %rdi
	callq	_b53_read32
	movl	-44(%rbp), %edi
	movl	%r15d, %esi
	callq	_SPEED_PORT_GE
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_SWITCH_PORT_SPEED_100,8,3      ## @SWITCH_PORT_SPEED_100
	.comm	_SWITCH_PORT_SPEED_1000,8,3     ## @SWITCH_PORT_SPEED_1000
	.comm	_B53_STAT_PAGE,4,2              ## @B53_STAT_PAGE
	.comm	_B53_LINK_STAT,4,2              ## @B53_LINK_STAT
	.comm	_B53_SPEED_STAT,4,2             ## @B53_SPEED_STAT
	.comm	_SWITCH_PORT_SPEED_10,8,3       ## @SWITCH_PORT_SPEED_10
	.no_dead_strip	_b53_port_get_link
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.b53_port_get_link
l_switch.table.b53_port_get_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 b53_port_get_link
_b53_port_get_link:                     ; @b53_port_get_link
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	bl	_sw_to_b53
	mov	x21, x0
	mov	x1, x20
	bl	_is_cpu_port
	cbz	x0, LBB0_4
; %bb.1:
	movi.2s	v0, #1
	str	d0, [x19]
	mov	x0, x21
	bl	_is5325
Lloh0:
	adrp	x20, _SWITCH_PORT_SPEED_100@GOTPAGE
Lloh1:
	ldr	x20, [x20, _SWITCH_PORT_SPEED_100@GOTPAGEOFF]
	cbnz	x0, LBB0_3
; %bb.2:
	mov	x0, x21
	bl	_is5365
Lloh2:
	adrp	x8, _SWITCH_PORT_SPEED_1000@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SWITCH_PORT_SPEED_1000@GOTPAGEOFF]
	cmp	x0, #0
	csel	x20, x8, x20, eq
LBB0_3:
	ldr	x8, [x20]
	str	x8, [x19, #16]
	str	wzr, [x19, #8]
	b	LBB0_13
LBB0_4:
	ldr	w22, [x21]
	mov	x0, x20
	bl	_BIT
	tst	w0, w22
	b.eq	LBB0_12
; %bb.5:
Lloh4:
	adrp	x22, _B53_STAT_PAGE@GOTPAGE
Lloh5:
	ldr	x22, [x22, _B53_STAT_PAGE@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh6:
	adrp	x8, _B53_LINK_STAT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _B53_LINK_STAT@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	add	x3, sp, #8
	mov	x0, x21
	bl	_b53_read16
	ldr	w1, [x22]
	ldr	w2, [x21, #4]
	add	x3, sp, #4
	mov	x0, x21
	bl	_b53_read16
	ldr	w8, [sp, #8]
	lsr	w8, w8, w20
	and	w9, w8, #0x1
	ldr	w8, [sp, #4]
	lsr	w8, w8, w20
	and	w8, w8, #0x1
	stp	w8, w9, [sp, #4]
	mov	x0, x21
	bl	_is5325
	cbnz	x0, LBB0_7
; %bb.6:
	mov	x0, x21
	bl	_is5365
	cbz	x0, LBB0_14
LBB0_7:
	ldr	w1, [x22]
Lloh9:
	adrp	x8, _B53_SPEED_STAT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _B53_SPEED_STAT@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x3, sp
	mov	x0, x21
	bl	_b53_read16
	ldr	w0, [sp]
	mov	x1, x20
	bl	_SPEED_PORT_FE
LBB0_8:
	str	w0, [sp, #12]
	ldr	w8, [sp, #8]
	str	w8, [x19]
	cbz	w8, LBB0_11
; %bb.9:
	ldr	w8, [sp, #4]
	str	w8, [x19, #4]
	sub	w8, w0, #128
	cmp	w8, #2
	b.hi	LBB0_11
; %bb.10:
Lloh12:
	adrp	x9, l_switch.table.b53_port_get_link@PAGE
Lloh13:
	add	x9, x9, l_switch.table.b53_port_get_link@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
	ldr	x8, [x8]
	str	x8, [x19, #16]
LBB0_11:
	mov	w8, #1
	str	w8, [x19, #8]
	b	LBB0_13
LBB0_12:
	str	wzr, [x19]
LBB0_13:
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_14:
	ldr	w1, [x22]
Lloh14:
	adrp	x8, _B53_SPEED_STAT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _B53_SPEED_STAT@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	add	x3, sp, #12
	mov	x0, x21
	bl	_b53_read32
	ldr	w0, [sp, #12]
	mov	x1, x20
	bl	_SPEED_PORT_GE
	b	LBB0_8
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_SWITCH_PORT_SPEED_100,8,3      ; @SWITCH_PORT_SPEED_100
	.comm	_SWITCH_PORT_SPEED_1000,8,3     ; @SWITCH_PORT_SPEED_1000
	.comm	_B53_STAT_PAGE,4,2              ; @B53_STAT_PAGE
	.comm	_B53_LINK_STAT,4,2              ; @B53_LINK_STAT
	.comm	_B53_SPEED_STAT,4,2             ; @B53_SPEED_STAT
	.comm	_SWITCH_PORT_SPEED_10,8,3       ; @SWITCH_PORT_SPEED_10
	.no_dead_strip	_b53_port_get_link
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.b53_port_get_link
l_switch.table.b53_port_get_link:
	.quad	_SWITCH_PORT_SPEED_10
	.quad	_SWITCH_PORT_SPEED_100
	.quad	_SWITCH_PORT_SPEED_1000

.subsections_via_symbols
