	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ar8xxx_phy_init                ## -- Begin function ar8xxx_phy_init
	.p2align	4, 0x90
_ar8xxx_phy_init:                       ## @ar8xxx_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
	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	16(%rdi), %r15
	testq	%r15, %r15
	jne	LBB0_2
## %bb.1:
	movq	8(%r14), %r15
LBB0_2:
	movq	_AR8XXX_NUM_PHYS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_9
## %bb.3:
	xorl	%ebx, %ebx
	movq	_BMCR_RESET@GOTPCREL(%rip), %r13
	movq	_BMCR_ANENABLE@GOTPCREL(%rip), %r12
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	_MII_BMCR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	(%r12), %ecx
	orl	(%r13), %ecx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_mdiobus_write
	incl	%ebx
	movq	_AR8XXX_NUM_PHYS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jge	LBB0_9
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	*%rax
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	_MII_ADVERTISE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_ADVERTISE_PAUSE_CAP@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_ADVERTISE_ALL@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_ADVERTISE_PAUSE_ASYM@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_mdiobus_write
	movq	%r14, %rdi
	callq	_ar8xxx_has_gige
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_MII_CTRL1000@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_ADVERTISE_1000FULL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_mdiobus_write
	jmp	LBB0_8
LBB0_9:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ar8xxx_phy_poll_reset          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AR8XXX_NUM_PHYS,4,2            ## @AR8XXX_NUM_PHYS
	.comm	_MII_ADVERTISE,4,2              ## @MII_ADVERTISE
	.comm	_ADVERTISE_ALL,4,2              ## @ADVERTISE_ALL
	.comm	_ADVERTISE_PAUSE_CAP,4,2        ## @ADVERTISE_PAUSE_CAP
	.comm	_ADVERTISE_PAUSE_ASYM,4,2       ## @ADVERTISE_PAUSE_ASYM
	.comm	_MII_CTRL1000,4,2               ## @MII_CTRL1000
	.comm	_ADVERTISE_1000FULL,4,2         ## @ADVERTISE_1000FULL
	.comm	_MII_BMCR,4,2                   ## @MII_BMCR
	.comm	_BMCR_RESET,4,2                 ## @BMCR_RESET
	.comm	_BMCR_ANENABLE,4,2              ## @BMCR_ANENABLE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ar8xxx_phy_init                ; -- Begin function ar8xxx_phy_init
	.p2align	2
_ar8xxx_phy_init:                       ; @ar8xxx_phy_init
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	ldr	x20, [x0, #16]
	cbnz	x20, LBB0_2
; %bb.1:
	ldr	x20, [x19, #8]
LBB0_2:
Lloh0:
	adrp	x8, _AR8XXX_NUM_PHYS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AR8XXX_NUM_PHYS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.3:
	mov	w21, #0
Lloh3:
	adrp	x23, _MII_ADVERTISE@GOTPAGE
Lloh4:
	ldr	x23, [x23, _MII_ADVERTISE@GOTPAGEOFF]
Lloh5:
	adrp	x24, _ADVERTISE_ALL@GOTPAGE
Lloh6:
	ldr	x24, [x24, _ADVERTISE_ALL@GOTPAGEOFF]
Lloh7:
	adrp	x25, _ADVERTISE_PAUSE_CAP@GOTPAGE
Lloh8:
	ldr	x25, [x25, _ADVERTISE_PAUSE_CAP@GOTPAGEOFF]
Lloh9:
	adrp	x26, _ADVERTISE_PAUSE_ASYM@GOTPAGE
Lloh10:
	ldr	x26, [x26, _ADVERTISE_PAUSE_ASYM@GOTPAGEOFF]
Lloh11:
	adrp	x27, _MII_BMCR@GOTPAGE
Lloh12:
	ldr	x27, [x27, _MII_BMCR@GOTPAGEOFF]
Lloh13:
	adrp	x28, _BMCR_RESET@GOTPAGE
Lloh14:
	ldr	x28, [x28, _BMCR_RESET@GOTPAGEOFF]
Lloh15:
	adrp	x22, _BMCR_ANENABLE@GOTPAGE
Lloh16:
	ldr	x22, [x22, _BMCR_ANENABLE@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w2, [x27]
	ldr	w8, [x28]
	ldr	w9, [x22]
	orr	w3, w9, w8
	mov	x0, x20
	mov	x1, x21
	bl	_mdiobus_write
	add	w21, w21, #1
Lloh17:
	adrp	x8, _AR8XXX_NUM_PHYS@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AR8XXX_NUM_PHYS@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	cmp	w21, w8
	b.ge	LBB0_9
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	ldr	x8, [x8]
	cbz	x8, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x19
	mov	x1, x21
	blr	x8
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w2, [x23]
	ldr	w8, [x24]
	ldr	w9, [x25]
	orr	w8, w9, w8
	ldr	w9, [x26]
	orr	w3, w8, w9
	mov	x0, x20
	mov	x1, x21
	bl	_mdiobus_write
	mov	x0, x19
	bl	_ar8xxx_has_gige
	cbz	x0, LBB0_4
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh20:
	adrp	x8, _MII_CTRL1000@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MII_CTRL1000@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
Lloh23:
	adrp	x8, _ADVERTISE_1000FULL@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ADVERTISE_1000FULL@GOTPAGEOFF]
Lloh25:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x21
	bl	_mdiobus_write
	b	LBB0_4
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_ar8xxx_phy_poll_reset
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_AR8XXX_NUM_PHYS,4,2            ; @AR8XXX_NUM_PHYS
	.comm	_MII_ADVERTISE,4,2              ; @MII_ADVERTISE
	.comm	_ADVERTISE_ALL,4,2              ; @ADVERTISE_ALL
	.comm	_ADVERTISE_PAUSE_CAP,4,2        ; @ADVERTISE_PAUSE_CAP
	.comm	_ADVERTISE_PAUSE_ASYM,4,2       ; @ADVERTISE_PAUSE_ASYM
	.comm	_MII_CTRL1000,4,2               ; @MII_CTRL1000
	.comm	_ADVERTISE_1000FULL,4,2         ; @ADVERTISE_1000FULL
	.comm	_MII_BMCR,4,2                   ; @MII_BMCR
	.comm	_BMCR_RESET,4,2                 ; @BMCR_RESET
	.comm	_BMCR_ANENABLE,4,2              ; @BMCR_ANENABLE
.subsections_via_symbols
