	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tlan_phy_detect
_tlan_phy_detect:                       ## @tlan_phy_detect
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_netdev_priv
	movq	%rax, %r14
	movq	16(%rax), %rax
	movq	_TLAN_ADAPTER_UNMANAGED_PHY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_2
## %bb.1:
	movl	$65535, (%r14)                  ## imm = 0xFFFF
LBB0_20:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_TLAN_PHY_MAX_ADDR@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rsi
	movq	_MII_GEN_ID_HI@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-44(%rbp), %rcx
	movq	%r15, %rdi
	callq	_tlan_mii_read_reg
	cmpl	$65535, -44(%rbp)               ## imm = 0xFFFF
	jne	LBB0_3
## %bb.4:
	movq	_TLAN_PHY_NONE@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	jmp	LBB0_5
LBB0_3:
	movq	(%rbx), %rcx
LBB0_5:
	movq	8(%r14), %rax
	movq	%rcx, (%rax)
	movq	_TLAN_PHY_NONE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, 8(%rax)
	cmpq	$0, (%rbx)
	js	LBB0_17
## %bb.6:
	movq	$-1, %rbx
	leaq	-44(%rbp), %r13
	leaq	-48(%rbp), %r12
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	_TLAN_PHY_MAX_ADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
LBB0_14:                                ##   in Loop: Header=BB0_7 Depth=1
	cmpq	%rax, %rbx
	jge	LBB0_15
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	incq	%rbx
	movq	_MII_GEN_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	leaq	-52(%rbp), %rcx
	callq	_tlan_mii_read_reg
	movq	_MII_GEN_ID_HI@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movq	%r13, %rcx
	callq	_tlan_mii_read_reg
	movq	_MII_GEN_ID_LO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movq	%r12, %rcx
	callq	_tlan_mii_read_reg
	movl	-52(%rbp), %ecx
	movl	-44(%rbp), %r8d
	movl	-48(%rbp), %r9d
	cmpl	$65535, %ecx                    ## imm = 0xFFFF
	jne	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	cmpl	$65535, %r8d                    ## imm = 0xFFFF
	jne	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	cmpl	$65535, %r9d                    ## imm = 0xFFFF
	je	LBB0_10
LBB0_11:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	_TLAN_DEBUG_GNRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdx
	callq	_TLAN_DBG
	movq	8(%r14), %rcx
	movq	8(%rcx), %rdx
	movq	_TLAN_PHY_MAX_ADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_TLAN_PHY_NONE@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	jne	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_7 Depth=1
	cmpq	%rax, %rbx
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%rbx, 8(%rcx)
	jmp	LBB0_14
LBB0_15:
	movq	8(%r14), %rax
	movq	_TLAN_PHY_NONE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, 8(%rax)
	jne	LBB0_16
LBB0_17:
	cmpq	%rcx, (%rax)
	jne	LBB0_18
## %bb.19:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_netdev_info
	jmp	LBB0_20
LBB0_16:
	movl	$1, (%r14)
	jmp	LBB0_20
LBB0_18:
	movl	$0, (%r14)
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_TLAN_ADAPTER_UNMANAGED_PHY,4,2 ## @TLAN_ADAPTER_UNMANAGED_PHY
	.comm	_TLAN_PHY_MAX_ADDR,8,3          ## @TLAN_PHY_MAX_ADDR
	.comm	_MII_GEN_ID_HI,4,2              ## @MII_GEN_ID_HI
	.comm	_TLAN_PHY_NONE,8,3              ## @TLAN_PHY_NONE
	.comm	_MII_GEN_CTL,4,2                ## @MII_GEN_CTL
	.comm	_MII_GEN_ID_LO,4,2              ## @MII_GEN_ID_LO
	.comm	_TLAN_DEBUG_GNRL,4,2            ## @TLAN_DEBUG_GNRL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PHY found at %02x %04x %04x %04x\n"

L_.str.1:                               ## @.str.1
	.asciz	"Cannot initialize device, no PHY was found!\n"

	.no_dead_strip	_tlan_phy_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tlan_phy_detect
_tlan_phy_detect:                       ; @tlan_phy_detect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	bl	_netdev_priv
	mov	x20, x0
	ldr	x8, [x0, #16]
	ldr	w8, [x8]
Lloh0:
	adrp	x9, _TLAN_ADAPTER_UNMANAGED_PHY@GOTPAGE
Lloh1:
	ldr	x9, [x9, _TLAN_ADAPTER_UNMANAGED_PHY@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.1:
	mov	w8, #65535
LBB0_2:
	str	w8, [x20]
LBB0_3:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_4:
Lloh3:
	adrp	x23, _TLAN_PHY_MAX_ADDR@GOTPAGE
Lloh4:
	ldr	x23, [x23, _TLAN_PHY_MAX_ADDR@GOTPAGEOFF]
	ldr	x1, [x23]
Lloh5:
	adrp	x24, _MII_GEN_ID_HI@GOTPAGE
Lloh6:
	ldr	x24, [x24, _MII_GEN_ID_HI@GOTPAGEOFF]
	ldr	w2, [x24]
	add	x3, sp, #8
	mov	x0, x19
	bl	_tlan_mii_read_reg
	ldr	w8, [sp, #8]
	mov	w9, #65535
Lloh7:
	adrp	x10, _TLAN_PHY_NONE@GOTPAGE
Lloh8:
	ldr	x10, [x10, _TLAN_PHY_NONE@GOTPAGEOFF]
	cmp	w8, w9
	b.ne	LBB0_6
; %bb.5:
	ldr	x9, [x10]
	b	LBB0_7
LBB0_6:
	ldr	x9, [x23]
LBB0_7:
	ldr	x8, [x20, #8]
	str	x9, [x8]
	ldr	x9, [x10]
	str	x9, [x8, #8]
	ldr	x10, [x23]
	tbnz	x10, #63, LBB0_15
; %bb.8:
Lloh9:
	adrp	x26, _MII_GEN_CTL@GOTPAGE
Lloh10:
	ldr	x26, [x26, _MII_GEN_CTL@GOTPAGEOFF]
Lloh11:
	adrp	x27, _MII_GEN_ID_LO@GOTPAGE
Lloh12:
	ldr	x27, [x27, _MII_GEN_ID_LO@GOTPAGEOFF]
	mov	x28, #-1
	mov	w25, #65535
Lloh13:
	adrp	x21, l_.str@PAGE
Lloh14:
	add	x21, x21, l_.str@PAGEOFF
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_11 Depth=1
	ldr	x8, [x23]
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	add	x28, x28, #1
	cmp	x28, x8
	b.ge	LBB0_14
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	add	x22, x28, #1
	ldr	w2, [x26]
	add	x3, sp, #12
	mov	x0, x19
	mov	x1, x22
	bl	_tlan_mii_read_reg
	ldr	w2, [x24]
	add	x3, sp, #8
	mov	x0, x19
	mov	x1, x22
	bl	_tlan_mii_read_reg
	ldr	w2, [x27]
	add	x3, sp, #4
	mov	x0, x19
	mov	x1, x22
	bl	_tlan_mii_read_reg
	ldp	w4, w3, [sp, #8]
	ldr	w5, [sp, #4]
	cmp	w3, w25
	ccmp	w4, w25, #0, eq
	ccmp	w5, w25, #0, eq
	b.eq	LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
Lloh15:
	adrp	x8, _TLAN_DEBUG_GNRL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _TLAN_DEBUG_GNRL@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	mov	x1, x21
	mov	x2, x22
	bl	_TLAN_DBG
	ldr	x9, [x20, #8]
	ldr	x10, [x9, #8]
Lloh18:
	adrp	x8, _TLAN_PHY_NONE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _TLAN_PHY_NONE@GOTPAGEOFF]
Lloh20:
	ldr	x11, [x8]
	ldr	x8, [x23]
	cmp	x10, x11
	ccmp	x22, x8, #4, eq
	b.eq	LBB0_10
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	str	x22, [x9, #8]
	b	LBB0_10
LBB0_14:
	ldr	x8, [x20, #8]
	ldr	x10, [x8, #8]
Lloh21:
	adrp	x9, _TLAN_PHY_NONE@GOTPAGE
Lloh22:
	ldr	x9, [x9, _TLAN_PHY_NONE@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x10, x9
	b.ne	LBB0_17
LBB0_15:
	ldr	x8, [x8]
	cmp	x8, x9
	b.ne	LBB0_18
; %bb.16:
Lloh24:
	adrp	x1, l_.str.1@PAGE
Lloh25:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_netdev_info
	b	LBB0_3
LBB0_17:
	mov	w8, #1
	b	LBB0_2
LBB0_18:
	str	wzr, [x20]
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_TLAN_ADAPTER_UNMANAGED_PHY,4,2 ; @TLAN_ADAPTER_UNMANAGED_PHY
	.comm	_TLAN_PHY_MAX_ADDR,8,3          ; @TLAN_PHY_MAX_ADDR
	.comm	_MII_GEN_ID_HI,4,2              ; @MII_GEN_ID_HI
	.comm	_TLAN_PHY_NONE,8,3              ; @TLAN_PHY_NONE
	.comm	_MII_GEN_CTL,4,2                ; @MII_GEN_CTL
	.comm	_MII_GEN_ID_LO,4,2              ; @MII_GEN_ID_LO
	.comm	_TLAN_DEBUG_GNRL,4,2            ; @TLAN_DEBUG_GNRL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PHY found at %02x %04x %04x %04x\n"

l_.str.1:                               ; @.str.1
	.asciz	"Cannot initialize device, no PHY was found!\n"

	.no_dead_strip	_tlan_phy_detect
.subsections_via_symbols
