	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sh_eth_phy_init
_sh_eth_phy_init:                       ## @sh_eth_phy_init
	.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, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %rax
	movq	(%rax), %rbx
	callq	_netdev_priv
	movq	%rax, %r15
	xorps	%xmm0, %xmm0
	movups	%xmm0, 32(%rax)
	movl	$-1, (%rax)
	testq	%rbx, %rbx
	je	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rsi
	xorl	%r12d, %r12d
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_of_parse_phandle
	movq	%rax, %rbx
	movq	_sh_eth_adjust_link@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	16(%r15), %r8d
	movq	%r14, %rdi
	movq	%rbx, %rsi
	xorl	%ecx, %ecx
	callq	_of_phy_connect
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	_of_node_put
	testq	%r13, %r13
	jne	LBB0_4
## %bb.2:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	movl	%r12d, %edi
	callq	_ERR_PTR
	movq	%rax, %r13
	jmp	LBB0_4
LBB0_3:
	movq	%rsp, -56(%rbp)                 ## 8-byte Spill
	movq	_MII_BUS_ID_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	addl	$3, %ebx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	movq	_PHY_ID_FMT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	24(%r15), %rax
	movl	(%rax), %ecx
	movl	20(%r15), %r8d
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_snprintf
	movq	_sh_eth_adjust_link@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	16(%r15), %ecx
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_phy_connect
	movq	%rax, %r13
	movq	-56(%rbp), %rsp                 ## 8-byte Reload
LBB0_4:
	movq	%r13, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_netdev_err
	movq	%r13, %rdi
	callq	_PTR_ERR
	movl	%eax, %r15d
	jmp	LBB0_10
LBB0_6:
	movq	8(%r15), %rax
	movq	(%rax), %rax
	movq	_SH_ETH_REG_GIGABIT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_9
## %bb.7:
	movq	_SPEED_100@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_phy_set_max_speed
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	%eax, %r15d
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_netdev_err
	movq	%r13, %rdi
	callq	_phy_disconnect
	jmp	LBB0_10
LBB0_9:
	movq	%r13, %rdi
	callq	_phy_attached_info
	xorl	%r15d, %r15d
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	movl	%r15d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"phy-handle"

	.comm	_sh_eth_adjust_link,4,2         ## @sh_eth_adjust_link
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_MII_BUS_ID_SIZE,4,2            ## @MII_BUS_ID_SIZE
	.comm	_PHY_ID_FMT,8,3                 ## @PHY_ID_FMT
L_.str.1:                               ## @.str.1
	.asciz	"failed to connect PHY\n"

	.comm	_SH_ETH_REG_GIGABIT,8,3         ## @SH_ETH_REG_GIGABIT
	.comm	_SPEED_100,4,2                  ## @SPEED_100
L_.str.2:                               ## @.str.2
	.asciz	"failed to limit PHY to 100 Mbit/s\n"

	.no_dead_strip	_sh_eth_phy_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sh_eth_phy_init
_sh_eth_phy_init:                       ; @sh_eth_phy_init
	.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
	sub	sp, sp, #16
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	ldr	x8, [x0]
	ldr	x21, [x8]
	bl	_netdev_priv
	mov	x20, x0
	stp	xzr, xzr, [x0, #32]
	mov	w8, #-1
	str	w8, [x0]
	cbz	x21, LBB0_3
; %bb.1:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	w2, #0
	bl	_of_parse_phandle
	mov	x22, x0
Lloh5:
	adrp	x8, _sh_eth_adjust_link@GOTPAGE
Lloh6:
	ldr	x8, [x8, _sh_eth_adjust_link@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	ldr	w4, [x20, #16]
	mov	x0, x19
	mov	x1, x22
	mov	w3, #0
	bl	_of_phy_connect
	mov	x21, x0
	mov	x0, x22
	bl	_of_node_put
	cbnz	x21, LBB0_4
; %bb.2:
Lloh8:
	adrp	x8, _ENOENT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
	bl	_ERR_PTR
	mov	x21, x0
	b	LBB0_4
LBB0_3:
	mov	x22, sp
Lloh11:
	adrp	x8, _MII_BUS_ID_SIZE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MII_BUS_ID_SIZE@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	add	w1, w8, #3
	mov	x9, x1
Lloh14:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh15:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x1, #15
	and	x9, x9, #0x1fffffff0
	sub	x21, x8, x9
	mov	sp, x21
Lloh16:
	adrp	x8, _PHY_ID_FMT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PHY_ID_FMT@GOTPAGEOFF]
Lloh18:
	ldr	x2, [x8]
	ldr	x8, [x20, #24]
	ldr	w3, [x8]
	ldr	w4, [x20, #20]
	mov	x0, x21
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_snprintf
Lloh19:
	adrp	x8, _sh_eth_adjust_link@GOTPAGE
Lloh20:
	ldr	x8, [x8, _sh_eth_adjust_link@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x8]
	ldr	w3, [x20, #16]
	mov	x0, x19
	mov	x1, x21
	bl	_phy_connect
	mov	x21, x0
	mov	sp, x22
LBB0_4:
	mov	x0, x21
	bl	_IS_ERR
	cbz	x0, LBB0_6
; %bb.5:
Lloh22:
	adrp	x1, l_.str.1@PAGE
Lloh23:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_netdev_err
	mov	x0, x21
	bl	_PTR_ERR
	mov	x20, x0
	b	LBB0_10
LBB0_6:
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
Lloh24:
	adrp	x9, _SH_ETH_REG_GIGABIT@GOTPAGE
Lloh25:
	ldr	x9, [x9, _SH_ETH_REG_GIGABIT@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_9
; %bb.7:
Lloh27:
	adrp	x8, _SPEED_100@GOTPAGE
Lloh28:
	ldr	x8, [x8, _SPEED_100@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_phy_set_max_speed
	cbz	w0, LBB0_9
; %bb.8:
	mov	x20, x0
Lloh30:
	adrp	x1, l_.str.2@PAGE
Lloh31:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_netdev_err
	mov	x0, x21
	bl	_phy_disconnect
	b	LBB0_10
LBB0_9:
	mov	x0, x21
	bl	_phy_attached_info
	mov	w20, #0
LBB0_10:
	ldur	x8, [x29, #-40]
Lloh32:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh33:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh34:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	mov	x0, x20
	sub	sp, x29, #32
	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
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"phy-handle"

	.comm	_sh_eth_adjust_link,4,2         ; @sh_eth_adjust_link
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_MII_BUS_ID_SIZE,4,2            ; @MII_BUS_ID_SIZE
	.comm	_PHY_ID_FMT,8,3                 ; @PHY_ID_FMT
l_.str.1:                               ; @.str.1
	.asciz	"failed to connect PHY\n"

	.comm	_SH_ETH_REG_GIGABIT,8,3         ; @SH_ETH_REG_GIGABIT
	.comm	_SPEED_100,4,2                  ; @SPEED_100
l_.str.2:                               ; @.str.2
	.asciz	"failed to limit PHY to 100 Mbit/s\n"

	.no_dead_strip	_sh_eth_phy_init
.subsections_via_symbols
