	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function spider_net_setup_phy
_spider_net_setup_phy:                  ## @spider_net_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	leaq	8(%rdi), %r14
	movq	_SPIDER_NET_GDTDMASEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SPIDER_NET_DMASEL_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_spider_net_write_reg
	movq	_SPIDER_NET_GPCCTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SPIDER_NET_PHY_CTRL_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_spider_net_write_reg
	movl	(%rbx), %edi
	movl	%edi, 36(%rbx)
	movq	_spider_net_read_phy@GOTPCREL(%rip), %rax
	movq	%rax, 8(%rbx)
	movq	_spider_net_write_phy@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movl	$1, 16(%rbx)
	movl	$1, %esi
	movq	_MII_BMSR@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edx
	callq	_spider_net_read_phy
                                        ## kill: def $ax killed $ax def $eax
	decl	%eax
	cmpw	$-3, %ax
	ja	LBB0_5
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	16(%rbx), %esi
	movq	%r14, %rdi
	callq	_sungem_phy_probe
	testl	%eax, %eax
	je	LBB0_3
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	16(%rbx), %eax
	leal	1(%rax), %esi
	movl	%esi, 16(%rbx)
	cmpl	$30, %eax
	jg	LBB0_4
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	(%rbx), %edi
	jmp	LBB0_1
LBB0_3:
	movq	24(%rbx), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	callq	_pr_info
LBB0_4:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SPIDER_NET_GDTDMASEL,4,2       ## @SPIDER_NET_GDTDMASEL
	.comm	_SPIDER_NET_DMASEL_VALUE,4,2    ## @SPIDER_NET_DMASEL_VALUE
	.comm	_SPIDER_NET_GPCCTRL,4,2         ## @SPIDER_NET_GPCCTRL
	.comm	_SPIDER_NET_PHY_CTRL_VALUE,4,2  ## @SPIDER_NET_PHY_CTRL_VALUE
	.comm	_spider_net_write_phy,4,2       ## @spider_net_write_phy
	.comm	_MII_BMSR,4,2                   ## @MII_BMSR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Found %s.\n"

	.no_dead_strip	_spider_net_setup_phy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function spider_net_setup_phy
_spider_net_setup_phy:                  ; @spider_net_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	x19, x0
Lloh0:
	adrp	x8, _SPIDER_NET_GDTDMASEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SPIDER_NET_GDTDMASEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _SPIDER_NET_DMASEL_VALUE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SPIDER_NET_DMASEL_VALUE@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	bl	_spider_net_write_reg
Lloh6:
	adrp	x8, _SPIDER_NET_GPCCTRL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SPIDER_NET_GPCCTRL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _SPIDER_NET_PHY_CTRL_VALUE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SPIDER_NET_PHY_CTRL_VALUE@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_spider_net_write_reg
Lloh12:
	adrp	x8, _spider_net_read_phy@GOTPAGE
Lloh13:
	ldr	x8, [x8, _spider_net_read_phy@GOTPAGEOFF]
	mov	x20, x19
	str	x8, [x20, #8]!
	ldr	w0, [x19]
Lloh14:
	adrp	x8, _spider_net_write_phy@GOTPAGE
Lloh15:
	ldr	x8, [x8, _spider_net_write_phy@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	stp	w8, w0, [x19, #32]
	mov	w1, #1
	str	w1, [x19, #16]
Lloh17:
	adrp	x21, _MII_BMSR@GOTPAGE
Lloh18:
	ldr	x21, [x21, _MII_BMSR@GOTPAGEOFF]
	mov	w22, #65533
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w2, [x21]
	bl	_spider_net_read_phy
	sub	w8, w0, #1
	cmp	w8, w22
	b.hi	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w1, [x19, #16]
	mov	x0, x20
	bl	_sungem_phy_probe
	cbz	w0, LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [x19, #16]
	add	w1, w8, #1
	str	w1, [x19, #16]
	cmp	w8, #30
	b.gt	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w0, [x19]
	b	LBB0_1
LBB0_5:
	ldr	x8, [x19, #24]
	ldr	w1, [x8]
Lloh19:
	adrp	x0, l_.str@PAGE
Lloh20:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_info
LBB0_6:
	mov	w0, #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
	ret
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_SPIDER_NET_GDTDMASEL,4,2       ; @SPIDER_NET_GDTDMASEL
	.comm	_SPIDER_NET_DMASEL_VALUE,4,2    ; @SPIDER_NET_DMASEL_VALUE
	.comm	_SPIDER_NET_GPCCTRL,4,2         ; @SPIDER_NET_GPCCTRL
	.comm	_SPIDER_NET_PHY_CTRL_VALUE,4,2  ; @SPIDER_NET_PHY_CTRL_VALUE
	.comm	_spider_net_write_phy,4,2       ; @spider_net_write_phy
	.comm	_MII_BMSR,4,2                   ; @MII_BMSR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Found %s.\n"

	.no_dead_strip	_spider_net_setup_phy
.subsections_via_symbols
