	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xgbe_phy_find_phy_device
_xgbe_phy_find_phy_device:              ## @xgbe_phy_find_phy_device
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	24(%rdi), %rbx
	xorl	%r14d, %r14d
	cmpq	$0, 16(%rbx)
	jne	LBB0_14
## %bb.1:
	movq	%rdi, %r13
	movq	$0, 16(%rdi)
	movq	(%rbx), %rdx
	movq	_XGBE_MDIO_MODE_NONE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdx
	je	LBB0_14
## %bb.2:
	movq	8(%rbx), %rax
	movq	_XGBE_PORT_MODE_SFP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	cmpl	$0, 32(%rbx)
	je	LBB0_14
LBB0_4:
	movl	24(%rbx), %esi
	movq	%r13, %rdi
	callq	*8(%r13)
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %r15d
	movl	(%r13), %edi
	movl	24(%rbx), %edx
	movq	(%rbx), %rcx
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_netdev_err
	movl	%r15d, %r14d
	jmp	LBB0_14
LBB0_6:
	movl	28(%rbx), %edi
	movl	24(%rbx), %esi
	movq	(%rbx), %rax
	movq	_XGBE_MDIO_MODE_CL45@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpq	(%rcx), %rax
	sete	%dl
	callq	_get_phy_device
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movl	(%r13), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_netdev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_14
LBB0_8:
	movq	_drv@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r13), %edx
	movl	8(%r15), %r8d
	leaq	L_.str.2(%rip), %rcx
	movq	%r13, %rdi
	callq	_netif_dbg
	movq	%r15, %rdi
	callq	_phy_device_register
	movl	(%r13), %edi
	testl	%eax, %eax
	je	LBB0_11
## %bb.9:
	movl	%eax, %r12d
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_netdev_err
	jmp	LBB0_10
LBB0_11:
	movl	4(%r15), %edx
	movq	_PHY_INTERFACE_MODE_SGMII@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rsi
	callq	_phy_attach_direct
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %r12d
	movl	(%r13), %edi
	leaq	L_.str.4(%rip), %rsi
	xorl	%eax, %eax
	callq	_netdev_err
	movq	%r15, %rdi
	callq	_phy_device_remove
LBB0_10:
	movq	%r15, %rdi
	callq	_phy_device_free
	movl	%r12d, %r14d
LBB0_14:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	%r15, 16(%rbx)
	movq	%r13, %rdi
	callq	_xgbe_phy_external_phy_quirks
	movl	(%r15), %edi
	movl	32(%r13), %edx
	movl	%edi, %esi
	callq	_linkmode_and
	movq	16(%rbx), %rdi
	callq	_phy_start_aneg
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_XGBE_MDIO_MODE_NONE,8,3        ## @XGBE_MDIO_MODE_NONE
	.comm	_XGBE_PORT_MODE_SFP,8,3         ## @XGBE_PORT_MODE_SFP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mdio port/clause not compatible (%u/%u)\n"

	.comm	_XGBE_MDIO_MODE_CL45,8,3        ## @XGBE_MDIO_MODE_CL45
L_.str.1:                               ## @.str.1
	.asciz	"get_phy_device failed\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_drv,4,2                        ## @drv
L_.str.2:                               ## @.str.2
	.asciz	"external PHY id is %#010x\n"

L_.str.3:                               ## @.str.3
	.asciz	"phy_device_register failed\n"

	.comm	_PHY_INTERFACE_MODE_SGMII,4,2   ## @PHY_INTERFACE_MODE_SGMII
L_.str.4:                               ## @.str.4
	.asciz	"phy_attach_direct failed\n"

	.no_dead_strip	_xgbe_phy_find_phy_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xgbe_phy_find_phy_device
_xgbe_phy_find_phy_device:              ; @xgbe_phy_find_phy_device
	.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
	ldr	x22, [x0, #24]
	ldr	x8, [x22, #16]
	cbnz	x8, LBB0_2
; %bb.1:
	mov	x19, x0
	str	xzr, [x0, #16]
	ldr	x2, [x22]
Lloh0:
	adrp	x8, _XGBE_MDIO_MODE_NONE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _XGBE_MDIO_MODE_NONE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x2, x8
	b.ne	LBB0_4
LBB0_2:
	mov	w21, #0
LBB0_3:
	mov	x0, x21
	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_4:
	ldr	x8, [x22, #8]
Lloh3:
	adrp	x9, _XGBE_PORT_MODE_SFP@GOTPAGE
Lloh4:
	ldr	x9, [x9, _XGBE_PORT_MODE_SFP@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
	ldr	w8, [x22, #32]
	cbz	w8, LBB0_2
LBB0_6:
	ldr	x8, [x19, #8]
	ldr	w1, [x22, #24]
	mov	x0, x19
	blr	x8
	cbz	w0, LBB0_8
; %bb.7:
	mov	x21, x0
	ldr	w0, [x19]
	ldr	x8, [x22]
	ldr	w9, [x22, #24]
	stp	x9, x8, [sp]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_netdev_err
	b	LBB0_3
LBB0_8:
	ldp	w1, w0, [x22, #24]
	ldr	x8, [x22]
Lloh8:
	adrp	x9, _XGBE_MDIO_MODE_CL45@GOTPAGE
Lloh9:
	ldr	x9, [x9, _XGBE_MDIO_MODE_CL45@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w2, eq
	bl	_get_phy_device
	mov	x20, x0
	bl	_IS_ERR
	cbz	x0, LBB0_10
; %bb.9:
	ldr	w0, [x19]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_netdev_err
Lloh13:
	adrp	x8, _ENODEV@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_3
LBB0_10:
Lloh16:
	adrp	x8, _drv@GOTPAGE
Lloh17:
	ldr	x8, [x8, _drv@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	ldr	w2, [x19]
	ldr	w4, [x20, #8]
Lloh19:
	adrp	x3, l_.str.2@PAGE
Lloh20:
	add	x3, x3, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_netif_dbg
	mov	x0, x20
	bl	_phy_device_register
	mov	x21, x0
	ldr	w0, [x19]
	cbz	w21, LBB0_12
; %bb.11:
Lloh21:
	adrp	x1, l_.str.3@PAGE
Lloh22:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_netdev_err
	b	LBB0_14
LBB0_12:
	ldr	w2, [x20, #4]
Lloh23:
	adrp	x8, _PHY_INTERFACE_MODE_SGMII@GOTPAGE
Lloh24:
	ldr	x8, [x8, _PHY_INTERFACE_MODE_SGMII@GOTPAGEOFF]
Lloh25:
	ldr	w3, [x8]
	mov	x1, x20
	bl	_phy_attach_direct
	mov	x21, x0
	cbz	w0, LBB0_15
; %bb.13:
	ldr	w0, [x19]
Lloh26:
	adrp	x1, l_.str.4@PAGE
Lloh27:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_netdev_err
	mov	x0, x20
	bl	_phy_device_remove
LBB0_14:
	mov	x0, x20
	bl	_phy_device_free
	b	LBB0_3
LBB0_15:
	str	x20, [x22, #16]
	mov	x0, x19
	bl	_xgbe_phy_external_phy_quirks
	ldr	w0, [x20]
	ldr	w2, [x19, #32]
	mov	x1, x0
	bl	_linkmode_and
	ldr	x0, [x22, #16]
	bl	_phy_start_aneg
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_XGBE_MDIO_MODE_NONE,8,3        ; @XGBE_MDIO_MODE_NONE
	.comm	_XGBE_PORT_MODE_SFP,8,3         ; @XGBE_PORT_MODE_SFP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mdio port/clause not compatible (%u/%u)\n"

	.comm	_XGBE_MDIO_MODE_CL45,8,3        ; @XGBE_MDIO_MODE_CL45
l_.str.1:                               ; @.str.1
	.asciz	"get_phy_device failed\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_drv,4,2                        ; @drv
l_.str.2:                               ; @.str.2
	.asciz	"external PHY id is %#010x\n"

l_.str.3:                               ; @.str.3
	.asciz	"phy_device_register failed\n"

	.comm	_PHY_INTERFACE_MODE_SGMII,4,2   ; @PHY_INTERFACE_MODE_SGMII
l_.str.4:                               ; @.str.4
	.asciz	"phy_attach_direct failed\n"

	.no_dead_strip	_xgbe_phy_find_phy_device
.subsections_via_symbols
