	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fec_enet_mii_init
_fec_enet_mii_init:                     ## @fec_enet_mii_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_platform_get_drvdata
	movq	%rax, %rdi
	callq	_netdev_priv
	movq	%rax, %r15
	movq	_FEC_QUIRK_SINGLE_MDIO@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	testl	%eax, (%r15)
	je	LBB0_5
## %bb.1:
	cmpq	$0, 8(%r15)
	jle	LBB0_5
## %bb.2:
	movq	_mii_cnt@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_10
## %bb.3:
	movq	_fec_enet_mii_init.fec0_mii_bus(%rip), %rdx
	testq	%rdx, %rdx
	je	LBB0_10
## %bb.4:
	movq	%rdx, 24(%r15)
	incq	%rcx
	movq	%rcx, (%rax)
	xorl	%ebx, %ebx
	jmp	LBB0_13
LBB0_5:
	movl	40(%r15), %edi
	callq	_clk_get_rate
	movl	%eax, %edi
	movl	$5000000, %esi                  ## imm = 0x4C4B40
	callq	_DIV_ROUND_UP
	movl	%eax, %ebx
	movq	_FEC_QUIRK_ENET_MAC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%r15), %eax
	cmpl	$1, %eax
	adcl	$-1, %ebx
	cmpl	$64, %ebx
	jl	LBB0_7
## %bb.6:
	addq	$8, %r14
	movl	40(%r15), %edi
	callq	_clk_get_rate
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_7:
	movl	40(%r15), %edi
	callq	_clk_get_rate
	movl	%eax, %edi
	movl	$100000000, %esi                ## imm = 0x5F5E100
	callq	_DIV_ROUND_UP
                                        ## kill: def $eax killed $eax def $rax
	addl	%ebx, %ebx
	shll	$8, %eax
	leal	-256(%rax), %edi
	orl	%ebx, %edi
	movl	%edi, 16(%r15)
	movq	_FEC_MII_SPEED@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	32(%r15), %rsi
	callq	_writel
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_mdiobus_alloc
	movq	%rax, 24(%r15)
	testq	%rax, %rax
	je	LBB0_14
## %bb.8:
	leaq	L_.str.1(%rip), %rcx
	movq	%rcx, (%rax)
	movq	_fec_enet_mdio_read@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 32(%rax)
	movq	_fec_enet_mdio_write@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 28(%rax)
	movl	24(%rax), %edi
	movq	_MII_BUS_ID_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r14), %rcx
	movq	8(%r15), %r8
	incq	%r8
	leaq	L_.str.2(%rip), %rdx
	callq	_snprintf
	movq	24(%r15), %rax
	movq	%r15, 16(%rax)
	leaq	8(%r14), %rcx
	movq	%rcx, 8(%rax)
	movl	8(%r14), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_of_get_child_by_name
	movq	%rax, %r14
	movq	24(%r15), %rdi
	movq	%rax, %rsi
	callq	_of_mdiobus_register
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_of_node_put
	testl	%ebx, %ebx
	je	LBB0_15
## %bb.9:
	movq	24(%r15), %rdi
	callq	_mdiobus_free
	jmp	LBB0_13
LBB0_10:
	movq	_ENOENT@GOTPCREL(%rip), %rax
LBB0_11:
	xorl	%ebx, %ebx
LBB0_12:
	subl	(%rax), %ebx
LBB0_13:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_15:
	movq	_mii_cnt@GOTPCREL(%rip), %rax
	incq	(%rax)
	movl	(%r12), %eax
	xorl	%ebx, %ebx
	testl	%eax, (%r15)
	je	LBB0_13
## %bb.16:
	movq	24(%r15), %rax
	movq	%rax, _fec_enet_mii_init.fec0_mii_bus(%rip)
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_fec_enet_mii_init.fec0_mii_bus,8,3 ## @fec_enet_mii_init.fec0_mii_bus
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_FEC_QUIRK_SINGLE_MDIO,4,2      ## @FEC_QUIRK_SINGLE_MDIO
	.comm	_mii_cnt,8,3                    ## @mii_cnt
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_FEC_QUIRK_ENET_MAC,4,2         ## @FEC_QUIRK_ENET_MAC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fec clock (%lu) too fast to get right mii speed\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_FEC_MII_SPEED,8,3              ## @FEC_MII_SPEED
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"fec_enet_mii_bus"

	.comm	_fec_enet_mdio_read,4,2         ## @fec_enet_mdio_read
	.comm	_fec_enet_mdio_write,4,2        ## @fec_enet_mdio_write
	.comm	_MII_BUS_ID_SIZE,4,2            ## @MII_BUS_ID_SIZE
L_.str.2:                               ## @.str.2
	.asciz	"%s-%x"

L_.str.3:                               ## @.str.3
	.asciz	"mdio"

	.no_dead_strip	_fec_enet_mii_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fec_enet_mii_init
_fec_enet_mii_init:                     ; @fec_enet_mii_init
	.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	x20, x0
	bl	_platform_get_drvdata
	bl	_netdev_priv
	mov	x19, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x22, _FEC_QUIRK_SINGLE_MDIO@GOTPAGE
Lloh1:
	ldr	x22, [x22, _FEC_QUIRK_SINGLE_MDIO@GOTPAGEOFF]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.1:
	ldr	x8, [x19, #8]
	cmp	x8, #1
	b.lt	LBB0_4
; %bb.2:
Lloh2:
	adrp	x8, _mii_cnt@GOTPAGE
Lloh3:
	ldr	x8, [x8, _mii_cnt@GOTPAGEOFF]
	ldr	x9, [x8]
Lloh4:
	adrp	x10, _fec_enet_mii_init.fec0_mii_bus@PAGE
Lloh5:
	ldr	x10, [x10, _fec_enet_mii_init.fec0_mii_bus@PAGEOFF]
	cmp	x9, #0
	ccmp	x10, #0, #4, ne
	b.ne	LBB0_9
; %bb.3:
Lloh6:
	adrp	x8, _ENOENT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_11
LBB0_4:
	ldr	w0, [x19, #40]
	bl	_clk_get_rate
	mov	w1, #19264
	movk	w1, #76, lsl #16
	bl	_DIV_ROUND_UP
Lloh8:
	adrp	x8, _FEC_QUIRK_ENET_MAC@GOTPAGE
Lloh9:
	ldr	x8, [x8, _FEC_QUIRK_ENET_MAC@GOTPAGEOFF]
	ldr	w9, [x19]
Lloh10:
	ldr	w8, [x8]
	tst	w8, w9
	cset	w8, ne
	sub	w21, w0, w8
	cmp	w21, #64
	b.lt	LBB0_6
; %bb.5:
	add	x20, x20, #8
	ldr	w0, [x19, #40]
	bl	_clk_get_rate
	mov	x2, x0
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_11
LBB0_6:
	ldr	w0, [x19, #40]
	bl	_clk_get_rate
	mov	w1, #57600
	movk	w1, #1525, lsl #16
	bl	_DIV_ROUND_UP
	lsl	w8, w0, #8
	sub	w8, w8, #256
	orr	w0, w8, w21, lsl #1
	str	w0, [x19, #16]
	ldr	x8, [x19, #32]
Lloh15:
	adrp	x9, _FEC_MII_SPEED@GOTPAGE
Lloh16:
	ldr	x9, [x9, _FEC_MII_SPEED@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	bl	_mdiobus_alloc
	str	x0, [x19, #24]
	cbz	x0, LBB0_10
; %bb.7:
Lloh18:
	adrp	x8, l_.str.1@PAGE
Lloh19:
	add	x8, x8, l_.str.1@PAGEOFF
	str	x8, [x0]
Lloh20:
	adrp	x8, _fec_enet_mdio_read@GOTPAGE
Lloh21:
	ldr	x8, [x8, _fec_enet_mdio_read@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
Lloh23:
	adrp	x9, _fec_enet_mdio_write@GOTPAGE
Lloh24:
	ldr	x9, [x9, _fec_enet_mdio_write@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	stp	w9, w8, [x0, #28]
	ldr	w0, [x0, #24]
Lloh26:
	adrp	x8, _MII_BUS_ID_SIZE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _MII_BUS_ID_SIZE@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	ldr	x3, [x20]
	ldr	x8, [x19, #8]
	add	x4, x8, #1
Lloh29:
	adrp	x2, l_.str.2@PAGE
Lloh30:
	add	x2, x2, l_.str.2@PAGEOFF
	bl	_snprintf
	ldr	x8, [x19, #24]
	ldr	w0, [x20, #8]!
	stp	x20, x19, [x8, #8]
Lloh31:
	adrp	x1, l_.str.3@PAGE
Lloh32:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_of_get_child_by_name
	mov	x21, x0
	ldr	x0, [x19, #24]
	mov	x1, x21
	bl	_of_mdiobus_register
	mov	x20, x0
	mov	x0, x21
	bl	_of_node_put
	cbz	w20, LBB0_13
; %bb.8:
	ldr	x0, [x19, #24]
	bl	_mdiobus_free
	b	LBB0_12
LBB0_9:
	mov	w20, #0
	str	x10, [x19, #24]
	add	x9, x9, #1
	str	x9, [x8]
	b	LBB0_12
LBB0_10:
Lloh33:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_12:
	mov	x0, x20
	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
LBB0_13:
Lloh35:
	adrp	x8, _mii_cnt@GOTPAGE
Lloh36:
	ldr	x8, [x8, _mii_cnt@GOTPAGEOFF]
	ldr	x9, [x8]
	add	x9, x9, #1
	str	x9, [x8]
	ldr	w8, [x19]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_15
; %bb.14:
	mov	w20, #0
	ldr	x8, [x19, #24]
	adrp	x9, _fec_enet_mii_init.fec0_mii_bus@PAGE
	str	x8, [x9, _fec_enet_mii_init.fec0_mii_bus@PAGEOFF]
	b	LBB0_12
LBB0_15:
	mov	w20, #0
	b	LBB0_12
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdr	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_fec_enet_mii_init.fec0_mii_bus,8,3 ; @fec_enet_mii_init.fec0_mii_bus
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_FEC_QUIRK_SINGLE_MDIO,4,2      ; @FEC_QUIRK_SINGLE_MDIO
	.comm	_mii_cnt,8,3                    ; @mii_cnt
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_FEC_QUIRK_ENET_MAC,4,2         ; @FEC_QUIRK_ENET_MAC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fec clock (%lu) too fast to get right mii speed\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_FEC_MII_SPEED,8,3              ; @FEC_MII_SPEED
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"fec_enet_mii_bus"

	.comm	_fec_enet_mdio_read,4,2         ; @fec_enet_mdio_read
	.comm	_fec_enet_mdio_write,4,2        ; @fec_enet_mdio_write
	.comm	_MII_BUS_ID_SIZE,4,2            ; @MII_BUS_ID_SIZE
l_.str.2:                               ; @.str.2
	.asciz	"%s-%x"

l_.str.3:                               ; @.str.3
	.asciz	"mdio"

	.no_dead_strip	_fec_enet_mii_init
.subsections_via_symbols
