	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gmac_setup_phy
_gmac_setup_phy:                        ## @gmac_setup_phy
	.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
	callq	_netdev_priv
	movq	%rax, %r15
	movq	8(%rax), %rax
	movl	(%rax), %esi
	movq	_gmac_speed_set@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_of_phy_get_and_connect
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r12
	movq	%rax, (%r14)
	movq	_SPEED_1000@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_phy_set_max_speed
	movq	%r12, %rdi
	callq	_phy_support_asym_pause
	movl	(%r12), %eax
	addl	$-128, %eax
	cmpl	$3, %eax
	jae	LBB0_4
## %bb.5:
	cltq
	leaq	l_reltable.gmac_setup_phy(%rip), %rcx
	movslq	(%rcx,%rax,4), %rsi
	addq	%rcx, %rsi
	leaq	l_switch.table.gmac_setup_phy.4(%rip), %rcx
	movq	(%rcx,%rax,8), %rbx
	movq	%r14, %rdi
	callq	_netdev_dbg
	movl	(%rbx), %edi
	movq	_GMAC_STATUS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	callq	_writel
	movq	%r15, %rdi
	callq	_netif_msg_link
	xorl	%ebx, %ebx
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	%r12, %rdi
	callq	_phy_attached_info
	jmp	LBB0_7
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_4:
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	callq	_netdev_err
	movq	%r12, %rdi
	callq	_phy_disconnect
	movq	$0, (%r14)
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_gmac_speed_set,4,2             ## @gmac_speed_set
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_SPEED_1000,4,2                 ## @SPEED_1000
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MII: set GMAC0 to GMII mode, GMAC1 disabled\n"

	.comm	_GMAC_PHY_MII,4,2               ## @GMAC_PHY_MII
L_.str.1:                               ## @.str.1
	.asciz	"GMII: set GMAC0 to GMII mode, GMAC1 disabled\n"

	.comm	_GMAC_PHY_GMII,4,2              ## @GMAC_PHY_GMII
L_.str.2:                               ## @.str.2
	.asciz	"RGMII: set GMAC0 and GMAC1 to MII/RGMII mode\n"

	.comm	_GMAC_PHY_RGMII_100_10,4,2      ## @GMAC_PHY_RGMII_100_10
L_.str.3:                               ## @.str.3
	.asciz	"Unsupported MII interface\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GMAC_STATUS,8,3                ## @GMAC_STATUS
	.no_dead_strip	_gmac_setup_phy
	.section	__TEXT,__const
	.p2align	2                               ## @reltable.gmac_setup_phy
l_reltable.gmac_setup_phy:
	.long	L_.str.2-l_reltable.gmac_setup_phy
	.long	L_.str-l_reltable.gmac_setup_phy
	.long	L_.str.1-l_reltable.gmac_setup_phy

	.section	__DATA,__const
	.p2align	3                               ## @switch.table.gmac_setup_phy.4
l_switch.table.gmac_setup_phy.4:
	.quad	_GMAC_PHY_RGMII_100_10
	.quad	_GMAC_PHY_MII
	.quad	_GMAC_PHY_GMII

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gmac_setup_phy
_gmac_setup_phy:                        ; @gmac_setup_phy
	.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
	mov	x20, x0
	bl	_netdev_priv
	mov	x21, x0
	ldr	x8, [x0, #8]
	ldr	w1, [x8]
Lloh0:
	adrp	x8, _gmac_speed_set@GOTPAGE
Lloh1:
	ldr	x8, [x8, _gmac_speed_set@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_of_phy_get_and_connect
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x0
	str	x0, [x20]
Lloh3:
	adrp	x8, _SPEED_1000@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SPEED_1000@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_phy_set_max_speed
	mov	x0, x19
	bl	_phy_support_asym_pause
	ldr	w8, [x19]
	sub	w8, w8, #128
	cmp	w8, #3
	b.hs	LBB0_5
; %bb.2:
	sbfiz	x8, x8, #3, #32
Lloh6:
	adrp	x9, l_switch.table.gmac_setup_phy@PAGE
Lloh7:
	add	x9, x9, l_switch.table.gmac_setup_phy@PAGEOFF
	ldr	x1, [x9, x8]
Lloh8:
	adrp	x9, l_switch.table.gmac_setup_phy.4@PAGE
Lloh9:
	add	x9, x9, l_switch.table.gmac_setup_phy.4@PAGEOFF
	ldr	x22, [x9, x8]
	mov	x0, x20
	bl	_netdev_dbg
	ldr	w0, [x22]
	ldr	x8, [x21]
Lloh10:
	adrp	x9, _GMAC_STATUS@GOTPAGE
Lloh11:
	ldr	x9, [x9, _GMAC_STATUS@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	mov	x0, x21
	bl	_netif_msg_link
	cbz	x0, LBB0_7
; %bb.3:
	mov	x0, x19
	bl	_phy_attached_info
	mov	w0, #0
	b	LBB0_7
LBB0_4:
Lloh13:
	adrp	x8, _ENODEV@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_netdev_err
	mov	x0, x19
	bl	_phy_disconnect
	str	xzr, [x20]
Lloh17:
	adrp	x8, _EINVAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_gmac_speed_set,4,2             ; @gmac_speed_set
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_SPEED_1000,4,2                 ; @SPEED_1000
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MII: set GMAC0 to GMII mode, GMAC1 disabled\n"

	.comm	_GMAC_PHY_MII,4,2               ; @GMAC_PHY_MII
l_.str.1:                               ; @.str.1
	.asciz	"GMII: set GMAC0 to GMII mode, GMAC1 disabled\n"

	.comm	_GMAC_PHY_GMII,4,2              ; @GMAC_PHY_GMII
l_.str.2:                               ; @.str.2
	.asciz	"RGMII: set GMAC0 and GMAC1 to MII/RGMII mode\n"

	.comm	_GMAC_PHY_RGMII_100_10,4,2      ; @GMAC_PHY_RGMII_100_10
l_.str.3:                               ; @.str.3
	.asciz	"Unsupported MII interface\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GMAC_STATUS,8,3                ; @GMAC_STATUS
	.no_dead_strip	_gmac_setup_phy
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.gmac_setup_phy
l_switch.table.gmac_setup_phy:
	.quad	l_.str.2
	.quad	l_.str
	.quad	l_.str.1

	.p2align	3                               ; @switch.table.gmac_setup_phy.4
l_switch.table.gmac_setup_phy.4:
	.quad	_GMAC_PHY_RGMII_100_10
	.quad	_GMAC_PHY_MII
	.quad	_GMAC_PHY_GMII

.subsections_via_symbols
