	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function niu_init_link
_niu_init_link:                         ## @niu_init_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movq	(%rax), %rax
	movq	_PLAT_TYPE_NIU@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.1:
	movq	%rbx, %rdi
	callq	_niu_xcvr_init
	testl	%eax, %eax
	jne	LBB0_9
## %bb.2:
	movl	$200, %edi
	callq	_msleep
LBB0_3:
	movq	%rbx, %rdi
	callq	_niu_serdes_init
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movq	_NIU_FLAGS_HOTPLUG_PHY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rbx)
	je	LBB0_9
LBB0_5:
	movl	$200, %edi
	callq	_msleep
	movq	%rbx, %rdi
	callq	_niu_xcvr_init
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movq	_NIU_FLAGS_HOTPLUG_PHY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_8
LBB0_7:
	leaq	-12(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_niu_link_status
LBB0_8:
	xorl	%eax, %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PLAT_TYPE_NIU,8,3              ## @PLAT_TYPE_NIU
	.comm	_NIU_FLAGS_HOTPLUG_PHY,4,2      ## @NIU_FLAGS_HOTPLUG_PHY
	.no_dead_strip	_niu_init_link
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function niu_init_link
_niu_init_link:                         ; @niu_init_link
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _PLAT_TYPE_NIU@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PLAT_TYPE_NIU@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	mov	x0, x19
	bl	_niu_xcvr_init
	cbnz	w0, LBB0_9
; %bb.2:
	mov	w0, #200
	bl	_msleep
LBB0_3:
	mov	x0, x19
	bl	_niu_serdes_init
Lloh3:
	adrp	x20, _NIU_FLAGS_HOTPLUG_PHY@GOTPAGE
Lloh4:
	ldr	x20, [x20, _NIU_FLAGS_HOTPLUG_PHY@GOTPAGEOFF]
	cbz	w0, LBB0_5
; %bb.4:
	ldr	w8, [x19]
	ldr	w9, [x20]
	tst	w9, w8
	b.eq	LBB0_9
LBB0_5:
	mov	w0, #200
	bl	_msleep
	mov	x0, x19
	bl	_niu_xcvr_init
	cbz	w0, LBB0_7
; %bb.6:
	ldr	w8, [x19]
	ldr	w9, [x20]
	tst	w9, w8
	b.eq	LBB0_8
LBB0_7:
	add	x1, sp, #12
	mov	x0, x19
	bl	_niu_link_status
LBB0_8:
	mov	w0, #0
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_PLAT_TYPE_NIU,8,3              ; @PLAT_TYPE_NIU
	.comm	_NIU_FLAGS_HOTPLUG_PHY,4,2      ; @NIU_FLAGS_HOTPLUG_PHY
	.no_dead_strip	_niu_init_link
.subsections_via_symbols
