	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function niu_probe_ports
_niu_probe_ports:                       ## @niu_probe_ports
	.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	(%rdi), %r14
	movq	(%r14), %rax
	movq	_PORT_PHY_UNKNOWN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.1:
	movq	%rdi, %r15
	movq	%r14, %rsi
	callq	_walk_phys
	testl	%eax, %eax
	jne	LBB0_7
## %bb.2:
	movq	%r15, %rdi
	movl	$2, %esi
	callq	_niu_set_ldg_timer_res
	movq	_LDN_MAX@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	js	LBB0_5
## %bb.3:
	movl	$-1, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	incl	%ebx
	movq	%r15, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_niu_ldn_irq_enable
	cmpl	(%r12), %ebx
	jl	LBB0_4
LBB0_5:
	movq	(%r14), %rcx
	movq	_PORT_PHY_INVALID@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	cmpq	(%rdx), %rcx
	jne	LBB0_7
## %bb.6:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PORT_PHY_UNKNOWN,8,3           ## @PORT_PHY_UNKNOWN
	.comm	_LDN_MAX,4,2                    ## @LDN_MAX
	.comm	_PORT_PHY_INVALID,8,3           ## @PORT_PHY_INVALID
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_niu_probe_ports
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function niu_probe_ports
_niu_probe_ports:                       ; @niu_probe_ports
	.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
	ldr	x19, [x0]
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _PORT_PHY_UNKNOWN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PORT_PHY_UNKNOWN@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.1:
	mov	x20, x0
	mov	x1, x19
	bl	_walk_phys
	cbnz	w0, LBB0_8
; %bb.2:
	mov	x0, x20
	mov	w1, #2
	bl	_niu_set_ldg_timer_res
Lloh3:
	adrp	x22, _LDN_MAX@GOTPAGE
Lloh4:
	ldr	x22, [x22, _LDN_MAX@GOTPAGEOFF]
	ldr	w8, [x22]
	tbnz	w8, #31, LBB0_5
; %bb.3:
	mov	w21, #-1
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	w21, w21, #1
	mov	x0, x20
	mov	x1, x21
	mov	w2, #0
	bl	_niu_ldn_irq_enable
	ldr	w8, [x22]
	cmp	w21, w8
	b.lt	LBB0_4
LBB0_5:
	ldr	x8, [x19]
Lloh5:
	adrp	x9, _PORT_PHY_INVALID@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PORT_PHY_INVALID@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.6:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_7:
	mov	w0, #0
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	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_PORT_PHY_UNKNOWN,8,3           ; @PORT_PHY_UNKNOWN
	.comm	_LDN_MAX,4,2                    ; @LDN_MAX
	.comm	_PORT_PHY_INVALID,8,3           ; @PORT_PHY_INVALID
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_niu_probe_ports
.subsections_via_symbols
