	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ag71xx_mdio_probe
_ag71xx_mdio_probe:                     ## @ag71xx_mdio_probe
	.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	(%rdi), %r15
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$16, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_syscon_regmap_lookup_by_phandle
	movl	%eax, 12(%rbx)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_3
## %bb.15:
	movl	12(%rbx), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_3:
	movq	%r14, %rdi
	callq	_devm_mdiobus_alloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.4:
	movq	%rax, %r12
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_devm_reset_control_get_exclusive
	movl	%eax, 8(%rbx)
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	callq	_of_property_read_bool
	movl	%eax, %r13d
	leaq	L_.str.3(%rip), %rax
	movq	%rax, (%r12)
	movq	_ag71xx_mdio_mii_read@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 56(%r12)
	movq	_ag71xx_mdio_mii_write@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 52(%r12)
	movq	_ag71xx_mdio_reset@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%r12)
	movq	%rbx, 40(%r12)
	movq	%r14, 32(%r12)
	movl	24(%r12), %edi
	movq	_MII_BUS_ID_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r15), %rcx
	movq	_bus_count@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	leal	1(%r8), %edx
	movl	%edx, (%rax)
	leaq	L_.str.4(%rip), %rdx
                                        ## kill: def $r8d killed $r8d killed $r8
	callq	_snprintf
	testl	%r13d, %r13d
	jne	LBB0_7
## %bb.5:
	movq	%r12, %r13
	addq	$16, %r13
	leaq	L_.str.5(%rip), %rsi
	movq	%r15, %rdi
	movq	%r13, %rdx
	callq	_of_property_read_u32
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	$0, (%r13)
LBB0_7:
	movq	_PHY_MAX_ADDR@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_10
## %bb.8:
	movq	8(%r12), %rcx
	xorl	%edx, %edx
	movq	_PHY_POLL@GOTPCREL(%rip), %rsi
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rsi), %edi
	movl	%edi, (%rcx,%rdx,4)
	incq	%rdx
	movslq	(%rax), %rdi
	cmpq	%rdi, %rdx
	jl	LBB0_9
LBB0_10:
	movl	8(%rbx), %edi
	callq	_IS_ERR
	testq	%rax, %rax
	jne	LBB0_12
## %bb.11:
	movl	8(%rbx), %edi
	callq	_reset_control_assert
	movl	$100, %edi
	callq	_msleep
	movl	8(%rbx), %edi
	callq	_reset_control_deassert
	movl	$200, %edi
	callq	_msleep
LBB0_12:
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_of_mdiobus_register
	testl	%eax, %eax
	jne	LBB0_14
## %bb.13:
	movq	%r12, (%rbx)
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_platform_set_drvdata
	xorl	%eax, %eax
	jmp	LBB0_14
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"regmap"

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

L_.str.2:                               ## @.str.2
	.asciz	"builtin-switch"

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

	.comm	_ag71xx_mdio_mii_read,4,2       ## @ag71xx_mdio_mii_read
	.comm	_ag71xx_mdio_mii_write,4,2      ## @ag71xx_mdio_mii_write
	.comm	_ag71xx_mdio_reset,4,2          ## @ag71xx_mdio_reset
	.comm	_MII_BUS_ID_SIZE,4,2            ## @MII_BUS_ID_SIZE
L_.str.4:                               ## @.str.4
	.asciz	"%s.%d"

	.comm	_bus_count,4,2                  ## @bus_count
L_.str.5:                               ## @.str.5
	.asciz	"phy-mask"

	.comm	_PHY_MAX_ADDR,4,2               ## @PHY_MAX_ADDR
	.comm	_PHY_POLL,4,2                   ## @PHY_POLL
	.no_dead_strip	_ag71xx_mdio_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ag71xx_mdio_probe
_ag71xx_mdio_probe:                     ; @ag71xx_mdio_probe
	.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
	ldr	x21, [x0]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w1, #16
	bl	_devm_kzalloc
	cbz	x0, LBB0_14
; %bb.1:
	mov	x20, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_syscon_regmap_lookup_by_phandle
	str	w0, [x20, #12]
	bl	_IS_ERR
	cbz	x0, LBB0_3
; %bb.2:
	ldr	w0, [x20, #12]
	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
	b	_PTR_ERR
LBB0_3:
	mov	x0, x19
	bl	_devm_mdiobus_alloc
	cbz	x0, LBB0_14
; %bb.4:
	mov	x22, x0
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_devm_reset_control_get_exclusive
	str	w0, [x20, #8]
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_of_property_read_bool
	mov	x23, x0
Lloh9:
	adrp	x8, l_.str.3@PAGE
Lloh10:
	add	x8, x8, l_.str.3@PAGEOFF
	str	x8, [x22]
Lloh11:
	adrp	x8, _ag71xx_mdio_mii_read@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ag71xx_mdio_mii_read@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	str	w8, [x22, #56]
Lloh14:
	adrp	x8, _ag71xx_mdio_mii_write@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ag71xx_mdio_mii_write@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	adrp	x9, _ag71xx_mdio_reset@GOTPAGE
Lloh18:
	ldr	x9, [x9, _ag71xx_mdio_reset@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	stp	w9, w8, [x22, #48]
	stp	x19, x20, [x22, #32]
	ldr	w0, [x22, #24]
Lloh20:
	adrp	x8, _MII_BUS_ID_SIZE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MII_BUS_ID_SIZE@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	ldr	x3, [x21]
Lloh23:
	adrp	x8, _bus_count@GOTPAGE
Lloh24:
	ldr	x8, [x8, _bus_count@GOTPAGEOFF]
	ldr	w4, [x8]
	add	w9, w4, #1
	str	w9, [x8]
Lloh25:
	adrp	x2, l_.str.4@PAGE
Lloh26:
	add	x2, x2, l_.str.4@PAGEOFF
	bl	_snprintf
	cbnz	w23, LBB0_7
; %bb.5:
	add	x23, x22, #16
Lloh27:
	adrp	x1, l_.str.5@PAGE
Lloh28:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x21
	mov	x2, x23
	bl	_of_property_read_u32
	cbz	x0, LBB0_7
; %bb.6:
	str	xzr, [x23]
LBB0_7:
Lloh29:
	adrp	x8, _PHY_MAX_ADDR@GOTPAGE
Lloh30:
	ldr	x8, [x8, _PHY_MAX_ADDR@GOTPAGEOFF]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_10
; %bb.8:
	mov	x9, #0
	ldr	x10, [x22, #8]
Lloh31:
	adrp	x11, _PHY_POLL@GOTPAGE
Lloh32:
	ldr	x11, [x11, _PHY_POLL@GOTPAGEOFF]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x11]
	str	w12, [x10, x9, lsl #2]
	add	x9, x9, #1
	ldrsw	x12, [x8]
	cmp	x9, x12
	b.lt	LBB0_9
LBB0_10:
	ldr	w0, [x20, #8]
	bl	_IS_ERR
	cbnz	x0, LBB0_12
; %bb.11:
	ldr	w0, [x20, #8]
	bl	_reset_control_assert
	mov	w0, #100
	bl	_msleep
	ldr	w0, [x20, #8]
	bl	_reset_control_deassert
	mov	w0, #200
	bl	_msleep
LBB0_12:
	mov	x0, x22
	mov	x1, x21
	bl	_of_mdiobus_register
	cbnz	w0, LBB0_15
; %bb.13:
	str	x22, [x20]
	mov	x0, x19
	mov	x1, x20
	bl	_platform_set_drvdata
	mov	w0, #0
	b	LBB0_15
LBB0_14:
Lloh33:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_15:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"regmap"

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

l_.str.2:                               ; @.str.2
	.asciz	"builtin-switch"

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

	.comm	_ag71xx_mdio_mii_read,4,2       ; @ag71xx_mdio_mii_read
	.comm	_ag71xx_mdio_mii_write,4,2      ; @ag71xx_mdio_mii_write
	.comm	_ag71xx_mdio_reset,4,2          ; @ag71xx_mdio_reset
	.comm	_MII_BUS_ID_SIZE,4,2            ; @MII_BUS_ID_SIZE
l_.str.4:                               ; @.str.4
	.asciz	"%s.%d"

	.comm	_bus_count,4,2                  ; @bus_count
l_.str.5:                               ; @.str.5
	.asciz	"phy-mask"

	.comm	_PHY_MAX_ADDR,4,2               ; @PHY_MAX_ADDR
	.comm	_PHY_POLL,4,2                   ; @PHY_POLL
	.no_dead_strip	_ag71xx_mdio_probe
.subsections_via_symbols
