	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gem_init_phy
_gem_init_phy:                          ## @gem_init_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, %rbx
	movq	_MIF_CFG@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	addq	40(%rbx), %rdi
	callq	_readl
	movq	_MIF_CFG_BBMODE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	notl	%edi
	andl	%eax, %edi
	movq	(%r14), %rsi
	addq	40(%rbx), %rsi
	callq	_writel
	movq	48(%rbx), %rax
	movq	(%rax), %rcx
	movq	_PCI_VENDOR_ID_APPLE@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_6
## %bb.1:
	movq	_MII_BMCR@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_BMCR_RESET@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movq	%rbx, %rdi
	callq	_sungem_phy_write
	movl	$20, %edi
	callq	_msleep
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_sungem_phy_read
	cmpl	$65535, %eax                    ## imm = 0xFFFF
	jne	LBB0_5
## %bb.2:
	movl	(%r14), %esi
	movl	(%r15), %edx
	movq	%rbx, %rdi
	callq	_sungem_phy_write
	movl	$20, %edi
	callq	_msleep
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_sungem_phy_read
	cmpl	$65535, %eax                    ## imm = 0xFFFF
	jne	LBB0_5
## %bb.3:
	movl	(%r14), %esi
	movl	(%r15), %edx
	movq	%rbx, %rdi
	callq	_sungem_phy_write
	movl	$20, %edi
	callq	_msleep
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_sungem_phy_read
	cmpl	$65535, %eax                    ## imm = 0xFFFF
	jne	LBB0_5
## %bb.4:
	movl	16(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_netdev_warn
LBB0_5:
	movq	48(%rbx), %rax
	movq	(%rax), %rcx
LBB0_6:
	movq	_PCI_VENDOR_ID_SUN@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_16
## %bb.7:
	movq	8(%rax), %rax
	movq	_PCI_DEVICE_ID_SUN_GEM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_16
## %bb.8:
	movq	(%rbx), %rax
	movq	_phy_mii_mdio0@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_10
## %bb.9:
	movq	_phy_mii_mdio1@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_10
## %bb.11:
	movq	_phy_serialink@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_13
## %bb.12:
	movq	_PCS_DMODE_SM@GOTPCREL(%rip), %rax
	movq	_PCS_DMODE_GMOE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	jmp	LBB0_15
LBB0_10:
	movq	_PCS_DMODE_MGM@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_13:
	movq	_PCS_DMODE_ESM@GOTPCREL(%rip), %rax
LBB0_14:
	movl	(%rax), %edi
LBB0_15:
	movq	_PCS_DMODE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	40(%rbx), %rsi
	callq	_writel
LBB0_16:
	movq	(%rbx), %rax
	movq	_phy_mii_mdio0@GOTPCREL(%rip), %r12
	movq	_phy_mii_mdio1@GOTPCREL(%rip), %r15
	cmpq	(%r12), %rax
	je	LBB0_18
## %bb.17:
	cmpq	(%r15), %rax
	je	LBB0_18
## %bb.21:
	movq	%rbx, %rdi
	callq	_gem_pcs_reset
	movq	%rbx, %rdi
	callq	_gem_pcs_reinit_adv
	jmp	LBB0_22
LBB0_18:
	leaq	8(%rbx), %r14
	movl	32(%rbx), %esi
	movq	%r14, %rdi
	callq	_sungem_phy_probe
	movq	8(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_22
## %bb.19:
	movq	8(%rax), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_22
## %bb.20:
	movq	%r14, %rdi
	callq	*%rax
LBB0_22:
	movq	$0, 24(%rbx)
	movq	_link_down@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movl	16(%rbx), %edi
	callq	_netif_carrier_off
	movq	(%rbx), %rax
	cmpq	(%r12), %rax
	je	LBB0_24
## %bb.23:
	cmpq	(%r15), %rax
	jne	LBB0_28
LBB0_24:
	movl	16(%rbx), %edi
	movq	8(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_25
## %bb.26:
	movq	(%rax), %rdx
	jmp	LBB0_27
LBB0_25:
	leaq	L_.str.2(%rip), %rdx
LBB0_27:
	leaq	L_.str.1(%rip), %rsi
	callq	_netdev_info
LBB0_28:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gem_begin_auto_negotiation     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MIF_CFG,8,3                    ## @MIF_CFG
	.comm	_MIF_CFG_BBMODE,4,2             ## @MIF_CFG_BBMODE
	.comm	_PCI_VENDOR_ID_APPLE,8,3        ## @PCI_VENDOR_ID_APPLE
	.comm	_MII_BMCR,4,2                   ## @MII_BMCR
	.comm	_BMCR_RESET,4,2                 ## @BMCR_RESET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"GMAC PHY not responding !\n"

	.comm	_PCI_VENDOR_ID_SUN,8,3          ## @PCI_VENDOR_ID_SUN
	.comm	_PCI_DEVICE_ID_SUN_GEM,8,3      ## @PCI_DEVICE_ID_SUN_GEM
	.comm	_phy_mii_mdio0,8,3              ## @phy_mii_mdio0
	.comm	_phy_mii_mdio1,8,3              ## @phy_mii_mdio1
	.comm	_PCS_DMODE_MGM,4,2              ## @PCS_DMODE_MGM
	.comm	_phy_serialink,8,3              ## @phy_serialink
	.comm	_PCS_DMODE_SM,4,2               ## @PCS_DMODE_SM
	.comm	_PCS_DMODE_GMOE,4,2             ## @PCS_DMODE_GMOE
	.comm	_PCS_DMODE_ESM,4,2              ## @PCS_DMODE_ESM
	.comm	_PCS_DMODE,8,3                  ## @PCS_DMODE
	.comm	_link_down,4,2                  ## @link_down
L_.str.1:                               ## @.str.1
	.asciz	"Found %s PHY\n"

L_.str.2:                               ## @.str.2
	.asciz	"no"

	.comm	_PMAC_FTR_GMAC_PHY_RESET,4,2    ## @PMAC_FTR_GMAC_PHY_RESET
	.no_dead_strip	_gem_init_phy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gem_init_phy
_gem_init_phy:                          ; @gem_init_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	x19, x0
	ldr	x8, [x0, #40]
Lloh0:
	adrp	x20, _MIF_CFG@GOTPAGE
Lloh1:
	ldr	x20, [x20, _MIF_CFG@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readl
Lloh2:
	adrp	x8, _MIF_CFG_BBMODE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MIF_CFG_BBMODE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	bic	w0, w0, w8
	ldr	x8, [x19, #40]
	ldr	x9, [x20]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [x19, #48]
	ldr	x9, [x8]
Lloh5:
	adrp	x10, _PCI_VENDOR_ID_APPLE@GOTPAGE
Lloh6:
	ldr	x10, [x10, _PCI_VENDOR_ID_APPLE@GOTPAGEOFF]
Lloh7:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_6
; %bb.1:
Lloh8:
	adrp	x20, _MII_BMCR@GOTPAGE
Lloh9:
	ldr	x20, [x20, _MII_BMCR@GOTPAGEOFF]
	ldr	w1, [x20]
Lloh10:
	adrp	x21, _BMCR_RESET@GOTPAGE
Lloh11:
	ldr	x21, [x21, _BMCR_RESET@GOTPAGEOFF]
	ldr	w2, [x21]
	mov	x0, x19
	bl	_sungem_phy_write
	mov	w0, #20
	bl	_msleep
	ldr	w1, [x20]
	mov	x0, x19
	bl	_sungem_phy_read
	mov	w22, #65535
	cmp	w0, w22
	b.ne	LBB0_5
; %bb.2:
	ldr	w1, [x20]
	ldr	w2, [x21]
	mov	x0, x19
	bl	_sungem_phy_write
	mov	w0, #20
	bl	_msleep
	ldr	w1, [x20]
	mov	x0, x19
	bl	_sungem_phy_read
	cmp	w0, w22
	b.ne	LBB0_5
; %bb.3:
	ldr	w1, [x20]
	ldr	w2, [x21]
	mov	x0, x19
	bl	_sungem_phy_write
	mov	w0, #20
	bl	_msleep
	ldr	w1, [x20]
	mov	x0, x19
	bl	_sungem_phy_read
	mov	w8, #65535
	cmp	w0, w8
	b.ne	LBB0_5
; %bb.4:
	ldr	w0, [x19, #16]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_netdev_warn
LBB0_5:
	ldr	x8, [x19, #48]
	ldr	x9, [x8]
LBB0_6:
Lloh14:
	adrp	x10, _PCI_VENDOR_ID_SUN@GOTPAGE
Lloh15:
	ldr	x10, [x10, _PCI_VENDOR_ID_SUN@GOTPAGEOFF]
Lloh16:
	ldr	x10, [x10]
Lloh17:
	adrp	x22, _phy_mii_mdio0@GOTPAGE
Lloh18:
	ldr	x22, [x22, _phy_mii_mdio0@GOTPAGEOFF]
Lloh19:
	adrp	x21, _phy_mii_mdio1@GOTPAGE
Lloh20:
	ldr	x21, [x21, _phy_mii_mdio1@GOTPAGEOFF]
	cmp	x9, x10
	b.ne	LBB0_16
; %bb.7:
	ldr	x8, [x8, #8]
Lloh21:
	adrp	x9, _PCI_DEVICE_ID_SUN_GEM@GOTPAGE
Lloh22:
	ldr	x9, [x9, _PCI_DEVICE_ID_SUN_GEM@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_16
; %bb.8:
	ldr	x8, [x19]
	ldr	x9, [x22]
	cmp	x8, x9
	b.eq	LBB0_12
; %bb.9:
	ldr	x9, [x21]
	cmp	x8, x9
	b.eq	LBB0_12
; %bb.10:
Lloh24:
	adrp	x9, _phy_serialink@GOTPAGE
Lloh25:
	ldr	x9, [x9, _phy_serialink@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.11:
Lloh27:
	adrp	x8, _PCS_DMODE_SM@GOTPAGE
Lloh28:
	ldr	x8, [x8, _PCS_DMODE_SM@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
Lloh30:
	adrp	x9, _PCS_DMODE_GMOE@GOTPAGE
Lloh31:
	ldr	x9, [x9, _PCS_DMODE_GMOE@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	orr	w0, w9, w8
	b	LBB0_15
LBB0_12:
Lloh33:
	adrp	x8, _PCS_DMODE_MGM@GOTPAGE
Lloh34:
	ldr	x8, [x8, _PCS_DMODE_MGM@GOTPAGEOFF]
	b	LBB0_14
LBB0_13:
Lloh35:
	adrp	x8, _PCS_DMODE_ESM@GOTPAGE
Lloh36:
	ldr	x8, [x8, _PCS_DMODE_ESM@GOTPAGEOFF]
LBB0_14:
	ldr	w0, [x8]
LBB0_15:
	ldr	x8, [x19, #40]
Lloh37:
	adrp	x9, _PCS_DMODE@GOTPAGE
Lloh38:
	ldr	x9, [x9, _PCS_DMODE@GOTPAGEOFF]
Lloh39:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
LBB0_16:
	ldr	x8, [x19]
	ldr	x9, [x22]
	ldr	x10, [x21]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_20
; %bb.17:
	add	x20, x19, #8
	ldr	w1, [x19, #32]
	mov	x0, x20
	bl	_sungem_phy_probe
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_21
; %bb.18:
	ldr	x8, [x8, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_21
; %bb.19:
	mov	x0, x20
	blr	x8
	b	LBB0_21
LBB0_20:
	mov	x0, x19
	bl	_gem_pcs_reset
	mov	x0, x19
	bl	_gem_pcs_reinit_adv
LBB0_21:
	str	xzr, [x19, #24]
Lloh40:
	adrp	x8, _link_down@GOTPAGE
Lloh41:
	ldr	x8, [x8, _link_down@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	str	w8, [x19, #20]
	ldr	w0, [x19, #16]
	bl	_netif_carrier_off
	ldr	x8, [x19]
	ldr	x9, [x22]
	cmp	x8, x9
	b.eq	LBB0_23
; %bb.22:
	ldr	x9, [x21]
	cmp	x8, x9
	b.ne	LBB0_27
LBB0_23:
	ldr	w0, [x19, #16]
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_25
; %bb.24:
	ldr	x2, [x8]
	b	LBB0_26
LBB0_25:
Lloh43:
	adrp	x2, l_.str.2@PAGE
Lloh44:
	add	x2, x2, l_.str.2@PAGEOFF
LBB0_26:
Lloh45:
	adrp	x1, l_.str.1@PAGE
Lloh46:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_netdev_info
LBB0_27:
	mov	x0, x19
	mov	x1, #0
	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
	b	_gem_begin_auto_negotiation
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpAdd	Lloh45, Lloh46
	.cfi_endproc
                                        ; -- End function
	.comm	_MIF_CFG,8,3                    ; @MIF_CFG
	.comm	_MIF_CFG_BBMODE,4,2             ; @MIF_CFG_BBMODE
	.comm	_PCI_VENDOR_ID_APPLE,8,3        ; @PCI_VENDOR_ID_APPLE
	.comm	_MII_BMCR,4,2                   ; @MII_BMCR
	.comm	_BMCR_RESET,4,2                 ; @BMCR_RESET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"GMAC PHY not responding !\n"

	.comm	_PCI_VENDOR_ID_SUN,8,3          ; @PCI_VENDOR_ID_SUN
	.comm	_PCI_DEVICE_ID_SUN_GEM,8,3      ; @PCI_DEVICE_ID_SUN_GEM
	.comm	_phy_mii_mdio0,8,3              ; @phy_mii_mdio0
	.comm	_phy_mii_mdio1,8,3              ; @phy_mii_mdio1
	.comm	_PCS_DMODE_MGM,4,2              ; @PCS_DMODE_MGM
	.comm	_phy_serialink,8,3              ; @phy_serialink
	.comm	_PCS_DMODE_SM,4,2               ; @PCS_DMODE_SM
	.comm	_PCS_DMODE_GMOE,4,2             ; @PCS_DMODE_GMOE
	.comm	_PCS_DMODE_ESM,4,2              ; @PCS_DMODE_ESM
	.comm	_PCS_DMODE,8,3                  ; @PCS_DMODE
	.comm	_link_down,4,2                  ; @link_down
l_.str.1:                               ; @.str.1
	.asciz	"Found %s PHY\n"

l_.str.2:                               ; @.str.2
	.asciz	"no"

	.comm	_PMAC_FTR_GMAC_PHY_RESET,4,2    ; @PMAC_FTR_GMAC_PHY_RESET
	.no_dead_strip	_gem_init_phy
.subsections_via_symbols
