	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pch_gbe_init_phy
_pch_gbe_init_phy:                      ## @pch_gbe_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	%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	%rdi, %r14
	movq	48(%rdi), %r15
	movq	_PCH_GBE_PHY_REGS_LEN@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_1
## %bb.2:
	movq	_MII_BMSR@GOTPCREL(%rip), %r12
	xorl	%ebx, %ebx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	incl	%ebx
	movq	_PCH_GBE_PHY_REGS_LEN@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jge	LBB0_6
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$1, %ebx
	movl	%ebx, %esi
	movl	$0, %eax
	cmovel	%eax, %esi
	testl	%ebx, %ebx
	movl	$1, %eax
	cmovel	%eax, %esi
	movl	%esi, (%r14)
	movq	_MII_BMCR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_pch_gbe_mdio_read
	movl	%eax, %r13d
	movl	(%r14), %esi
	movl	(%r12), %edx
	movq	%r15, %rdi
	callq	_pch_gbe_mdio_read
	movl	(%r14), %esi
	movl	(%r12), %edx
	movq	%r15, %rdi
	callq	_pch_gbe_mdio_read
	cmpl	$65535, %r13d                   ## imm = 0xFFFF
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	orl	%r13d, %eax
	je	LBB0_5
	jmp	LBB0_6
LBB0_1:
	xorl	%ebx, %ebx
LBB0_6:
	movl	(%r14), %edx
	movl	%edx, 56(%r14)
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_netdev_dbg
	movq	_PCH_GBE_PHY_REGS_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %ebx
	jne	LBB0_7
## %bb.15:
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_14
LBB0_7:
	testl	%eax, %eax
	jle	LBB0_13
## %bb.8:
	xorl	%ebx, %ebx
	movq	_MII_BMCR@GOTPCREL(%rip), %r12
	movq	_BMCR_ISOLATE@GOTPCREL(%rip), %r13
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_pch_gbe_mdio_read
	movl	(%r12), %edx
	movl	(%r13), %ecx
	notl	%ecx
	andl	%eax, %ecx
LBB0_12:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_pch_gbe_mdio_write
	incl	%ebx
	movq	_PCH_GBE_PHY_REGS_LEN@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jge	LBB0_13
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %edx
	cmpl	(%r14), %ebx
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	(%r13), %ecx
	jmp	LBB0_12
LBB0_13:
	movabsq	$133143986207, %rax             ## imm = 0x1F0000001F
	movq	%rax, 4(%r14)
	movq	48(%r14), %rax
	movq	%rax, 40(%r14)
	movq	_pch_gbe_mdio_read@GOTPCREL(%rip), %rax
	movq	%rax, 16(%r14)
	movq	_pch_gbe_mdio_write@GOTPCREL(%rip), %rax
	movq	%rax, 32(%r14)
	movq	%r14, %rdi
	callq	_mii_check_gmii_support
	movl	%eax, 24(%r14)
	xorl	%eax, %eax
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCH_GBE_PHY_REGS_LEN,4,2       ## @PCH_GBE_PHY_REGS_LEN
	.comm	_MII_BMCR,4,2                   ## @MII_BMCR
	.comm	_MII_BMSR,4,2                   ## @MII_BMSR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"phy_addr = %d\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_BMCR_ISOLATE,4,2               ## @BMCR_ISOLATE
	.no_dead_strip	_pch_gbe_init_phy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pch_gbe_init_phy
_pch_gbe_init_phy:                      ; @pch_gbe_init_phy
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	ldr	x20, [x0, #48]
Lloh0:
	adrp	x22, _PCH_GBE_PHY_REGS_LEN@GOTPAGE
Lloh1:
	ldr	x22, [x22, _PCH_GBE_PHY_REGS_LEN@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.1:
	mov	w23, #0
Lloh2:
	adrp	x24, _MII_BMCR@GOTPAGE
Lloh3:
	ldr	x24, [x24, _MII_BMCR@GOTPAGEOFF]
Lloh4:
	adrp	x25, _MII_BMSR@GOTPAGE
Lloh5:
	ldr	x25, [x25, _MII_BMSR@GOTPAGEOFF]
	mov	w26, #65535
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w23, #1
	csel	w8, wzr, w23, eq
	cmp	w23, #0
	csinc	w1, w8, wzr, ne
	str	w1, [x19]
	ldr	w2, [x24]
	mov	x0, x20
	bl	_pch_gbe_mdio_read
	mov	x21, x0
	ldr	w1, [x19]
	ldr	w2, [x25]
	mov	x0, x20
	bl	_pch_gbe_mdio_read
	ldr	w1, [x19]
	ldr	w2, [x25]
	mov	x0, x20
	bl	_pch_gbe_mdio_read
	cmp	w21, w26
	orr	w8, w0, w21
	ccmp	w8, #0, #4, ne
	b.ne	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w23, w23, #1
	ldr	w8, [x22]
	cmp	w23, w8
	b.lt	LBB0_2
	b	LBB0_5
LBB0_4:
	mov	w23, #0
LBB0_5:
	ldr	w2, [x19]
	str	w2, [x19, #56]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_netdev_dbg
	ldr	w8, [x22]
	cmp	w23, w8
	b.ne	LBB0_7
; %bb.6:
Lloh8:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_14
LBB0_7:
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.8:
	mov	w21, #0
Lloh11:
	adrp	x23, _MII_BMCR@GOTPAGE
Lloh12:
	ldr	x23, [x23, _MII_BMCR@GOTPAGEOFF]
Lloh13:
	adrp	x24, _BMCR_ISOLATE@GOTPAGE
Lloh14:
	ldr	x24, [x24, _BMCR_ISOLATE@GOTPAGEOFF]
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_pch_gbe_mdio_read
	ldr	w2, [x23]
	ldr	w8, [x24]
	bic	w3, w0, w8
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_pch_gbe_mdio_write
	add	w21, w21, #1
	ldr	w8, [x22]
	cmp	w21, w8
	b.ge	LBB0_13
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x19]
	ldr	w2, [x23]
	cmp	w21, w8
	b.eq	LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	w3, [x24]
	b	LBB0_10
LBB0_13:
	movi.2s	v0, #31
	stur	d0, [x19, #4]
Lloh15:
	adrp	x8, _pch_gbe_mdio_read@GOTPAGE
Lloh16:
	ldr	x8, [x8, _pch_gbe_mdio_read@GOTPAGEOFF]
	ldr	x9, [x19, #48]
	str	x8, [x19, #16]
Lloh17:
	adrp	x8, _pch_gbe_mdio_write@GOTPAGE
Lloh18:
	ldr	x8, [x8, _pch_gbe_mdio_write@GOTPAGEOFF]
	stp	x8, x9, [x19, #32]
	mov	x0, x19
	bl	_mii_check_gmii_support
	mov	x8, x0
	mov	w0, #0
	str	w8, [x19, #24]
LBB0_14:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_PCH_GBE_PHY_REGS_LEN,4,2       ; @PCH_GBE_PHY_REGS_LEN
	.comm	_MII_BMCR,4,2                   ; @MII_BMCR
	.comm	_MII_BMSR,4,2                   ; @MII_BMSR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"phy_addr = %d\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_BMCR_ISOLATE,4,2               ; @BMCR_ISOLATE
	.no_dead_strip	_pch_gbe_init_phy
.subsections_via_symbols
