	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar8316_hw_init
_ar8316_hw_init:                        ## @ar8316_hw_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, %r15
	movq	_AR8316_REG_POSTRIP@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	callq	_ar8xxx_read
	movl	%eax, %r14d
	movq	8(%r15), %rax
	movq	(%rax), %rsi
	movq	_PHY_INTERFACE_MODE_RGMII@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rsi
	jne	LBB0_8
## %bb.1:
	cmpq	$0, 16(%r15)
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str(%rip), %rdi
	cmoveq	%rax, %rdi
	movl	$19274722, %eax                 ## imm = 0x1261BE2
	movl	$-2126111766, %ebx              ## imm = 0x81461BEA
	cmovel	%eax, %ebx
	callq	_pr_info
	jmp	LBB0_2
LBB0_8:
	movq	_PHY_INTERFACE_MODE_GMII@GOTPCREL(%rip), %rax
	movl	$17718129, %ebx                 ## imm = 0x10E5B71
	cmpq	(%rax), %rsi
	jne	LBB0_9
LBB0_2:
	cmpl	%ebx, %r14d
	je	LBB0_7
## %bb.3:
	movl	(%r13), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_ar8xxx_write
	cmpq	$0, 16(%r15)
	je	LBB0_6
## %bb.4:
	movq	8(%r15), %rax
	movq	(%rax), %rax
	cmpq	(%r12), %rax
	jne	LBB0_6
## %bb.5:
	movq	%r15, %rdi
	movl	$4, %esi
	movl	$18, %edx
	movl	$18444, %ecx                    ## imm = 0x480C
	callq	_ar8xxx_phy_dbg_write
	movq	%r15, %rdi
	movl	$4, %esi
	xorl	%edx, %edx
	movl	$33358, %ecx                    ## imm = 0x824E
	callq	_ar8xxx_phy_dbg_write
	movq	%r15, %rdi
	movl	$4, %esi
	movl	$5, %edx
	movl	$15687, %ecx                    ## imm = 0x3D47
	callq	_ar8xxx_phy_dbg_write
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_msleep
LBB0_6:
	movq	%r15, %rdi
	callq	_ar8xxx_phy_init
LBB0_7:
	movl	$1, (%r15)
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_9:
	leaq	L_.str.2(%rip), %rdi
	callq	_pr_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AR8316_REG_POSTRIP,4,2         ## @AR8316_REG_POSTRIP
	.comm	_PHY_INTERFACE_MODE_RGMII,8,3   ## @PHY_INTERFACE_MODE_RGMII
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ar8316: Using port 4 as PHY\n"

L_.str.1:                               ## @.str.1
	.asciz	"ar8316: Using port 4 as switch port\n"

	.comm	_PHY_INTERFACE_MODE_GMII,8,3    ## @PHY_INTERFACE_MODE_GMII
L_.str.2:                               ## @.str.2
	.asciz	"ar8316: unsupported mii mode: %d.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_ar8316_hw_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ar8316_hw_init
_ar8316_hw_init:                        ; @ar8316_hw_init
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
Lloh0:
	adrp	x23, _AR8316_REG_POSTRIP@GOTPAGE
Lloh1:
	ldr	x23, [x23, _AR8316_REG_POSTRIP@GOTPAGEOFF]
	ldr	w1, [x23]
	bl	_ar8xxx_read
	mov	x20, x0
	ldr	x8, [x19, #8]
	ldr	x1, [x8]
Lloh2:
	adrp	x22, _PHY_INTERFACE_MODE_RGMII@GOTPAGE
Lloh3:
	ldr	x22, [x22, _PHY_INTERFACE_MODE_RGMII@GOTPAGEOFF]
	ldr	x8, [x22]
	cmp	x1, x8
	b.ne	LBB0_2
; %bb.1:
Lloh4:
	adrp	x8, l_.str@PAGE
Lloh5:
	add	x8, x8, l_.str@PAGEOFF
Lloh6:
	adrp	x9, l_.str.1@PAGE
Lloh7:
	add	x9, x9, l_.str.1@PAGEOFF
	ldr	x10, [x19, #16]
	cmp	x10, #0
	csel	x0, x9, x8, eq
	mov	w8, #7146
	movk	w8, #33094, lsl #16
	mov	w9, #7138
	movk	w9, #294, lsl #16
	csel	w21, w9, w8, eq
	bl	_pr_info
	cmp	w20, w21
	b.ne	LBB0_4
	b	LBB0_8
LBB0_2:
Lloh8:
	adrp	x8, _PHY_INTERFACE_MODE_GMII@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PHY_INTERFACE_MODE_GMII@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	cmp	x1, x8
	b.ne	LBB0_9
; %bb.3:
	mov	w21, #23409
	movk	w21, #270, lsl #16
	cmp	w20, w21
	b.eq	LBB0_8
LBB0_4:
	ldr	w1, [x23]
	mov	x0, x19
	mov	x2, x21
	bl	_ar8xxx_write
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_7
; %bb.5:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.6:
	mov	x0, x19
	mov	w1, #4
	mov	w2, #18
	mov	w3, #18444
	bl	_ar8xxx_phy_dbg_write
	mov	x0, x19
	mov	w1, #4
	mov	w2, #0
	mov	w3, #33358
	bl	_ar8xxx_phy_dbg_write
	mov	x0, x19
	mov	w1, #4
	mov	w2, #5
	mov	w3, #15687
	bl	_ar8xxx_phy_dbg_write
	mov	w0, #1000
	bl	_msleep
LBB0_7:
	mov	x0, x19
	bl	_ar8xxx_phy_init
LBB0_8:
	mov	w0, #0
	mov	w8, #1
	str	w8, [x19]
	b	LBB0_10
LBB0_9:
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_err
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_AR8316_REG_POSTRIP,4,2         ; @AR8316_REG_POSTRIP
	.comm	_PHY_INTERFACE_MODE_RGMII,8,3   ; @PHY_INTERFACE_MODE_RGMII
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ar8316: Using port 4 as PHY\n"

l_.str.1:                               ; @.str.1
	.asciz	"ar8316: Using port 4 as switch port\n"

	.comm	_PHY_INTERFACE_MODE_GMII,8,3    ; @PHY_INTERFACE_MODE_GMII
l_.str.2:                               ; @.str.2
	.asciz	"ar8316: unsupported mii mode: %d.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_ar8316_hw_init
.subsections_via_symbols
