	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ef4_mdio_wait_reset_mmds       ## -- Begin function ef4_mdio_wait_reset_mmds
	.p2align	4, 0x90
_ef4_mdio_wait_reset_mmds:              ## @ef4_mdio_wait_reset_mmds
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r12
	movq	_MDIO45_RESET_TIME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_MDIO45_RESET_ITERS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cltd
	idivl	%ecx
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_MDIO_CTRL1@GOTPCREL(%rip), %r14
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	testl	%r15d, %r15d
	je	LBB0_15
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_4 Depth=2
	movl	%r15d, %eax
	sarl	%eax
	incl	%ebx
	cmpl	$1, %r15d
	movl	%eax, %r15d
	jbe	LBB0_8
LBB0_4:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	testb	$1, %r15b
	je	LBB0_3
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	(%r14), %edx
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_ef4_mdio_read
	testl	%eax, %eax
	js	LBB0_11
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	_MDIO_CTRL1_RESET@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_3
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=2
	btsl	%ebx, %r13d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_1 Depth=1
	testl	%r13d, %r13d
	je	LBB0_15
## %bb.9:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_msleep
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	decl	%ecx
	movl	-48(%rbp), %r15d                ## 4-byte Reload
	jne	LBB0_1
## %bb.10:
	movq	_hw@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12), %edx
	leaq	L_.str.1(%rip), %rcx
	movq	%r12, %rdi
	movl	%r13d, %r8d
	callq	_netif_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	jmp	LBB0_12
LBB0_11:
	movq	_hw@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12), %edx
	leaq	L_.str(%rip), %rcx
	movq	%r12, %rdi
	movl	%ebx, %r8d
	callq	_netif_err
	movq	_EIO@GOTPCREL(%rip), %rcx
LBB0_12:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	xorl	%eax, %eax
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_MDIO45_RESET_TIME,4,2          ## @MDIO45_RESET_TIME
	.comm	_MDIO45_RESET_ITERS,4,2         ## @MDIO45_RESET_ITERS
	.comm	_MDIO_CTRL1,4,2                 ## @MDIO_CTRL1
	.comm	_hw,4,2                         ## @hw
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to read status of MMD %d\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_MDIO_CTRL1_RESET,4,2           ## @MDIO_CTRL1_RESET
L_.str.1:                               ## @.str.1
	.asciz	"not all MMDs came out of reset in time. MMDs still in reset: %x\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ef4_mdio_wait_reset_mmds       ; -- Begin function ef4_mdio_wait_reset_mmds
	.p2align	2
_ef4_mdio_wait_reset_mmds:              ; @ef4_mdio_wait_reset_mmds
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _MDIO45_RESET_TIME@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MDIO45_RESET_TIME@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _MDIO45_RESET_ITERS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MDIO45_RESET_ITERS@GOTPAGEOFF]
Lloh5:
	ldr	w24, [x9]
	sdiv	w21, w8, w24
Lloh6:
	adrp	x25, _MDIO_CTRL1@GOTPAGE
Lloh7:
	ldr	x25, [x25, _MDIO_CTRL1@GOTPAGEOFF]
Lloh8:
	adrp	x26, _MDIO_CTRL1_RESET@GOTPAGE
Lloh9:
	ldr	x26, [x26, _MDIO_CTRL1_RESET@GOTPAGEOFF]
	mov	w27, #1
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
	cbz	w20, LBB0_14
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	w23, #0
	mov	w22, #0
	mov	x28, x20
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=2
	asr	w8, w28, #1
	add	w23, w23, #1
	cmp	w28, #1
	mov	x28, x8
	b.ls	LBB0_8
LBB0_4:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	tbz	w28, #0, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=2
	ldr	w2, [x25]
	mov	x0, x19
	mov	x1, x23
	bl	_ef4_mdio_read
	tbnz	w0, #31, LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=2
	ldr	w8, [x26]
	tst	w8, w0
	b.eq	LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=2
	lsl	w8, w27, w23
	orr	w22, w8, w22
	b	LBB0_3
LBB0_8:                                 ;   in Loop: Header=BB0_1 Depth=1
	cbz	w22, LBB0_14
; %bb.9:                                ;   in Loop: Header=BB0_1 Depth=1
	sub	w24, w24, #1
	mov	x0, x21
	bl	_msleep
	cbnz	w24, LBB0_1
; %bb.10:
Lloh10:
	adrp	x8, _hw@GOTPAGE
Lloh11:
	ldr	x8, [x8, _hw@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	ldr	w2, [x19]
Lloh13:
	adrp	x3, l_.str.1@PAGE
Lloh14:
	add	x3, x3, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x4, x22
	bl	_netif_err
Lloh15:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:
Lloh17:
	adrp	x8, _hw@GOTPAGE
Lloh18:
	ldr	x8, [x8, _hw@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	ldr	w2, [x19]
Lloh20:
	adrp	x3, l_.str@PAGE
Lloh21:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x19
	mov	x4, x23
	bl	_netif_err
Lloh22:
	adrp	x8, _EIO@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	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
	ret
LBB0_14:
	mov	w0, #0
	b	LBB0_13
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_MDIO45_RESET_TIME,4,2          ; @MDIO45_RESET_TIME
	.comm	_MDIO45_RESET_ITERS,4,2         ; @MDIO45_RESET_ITERS
	.comm	_MDIO_CTRL1,4,2                 ; @MDIO_CTRL1
	.comm	_hw,4,2                         ; @hw
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to read status of MMD %d\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_MDIO_CTRL1_RESET,4,2           ; @MDIO_CTRL1_RESET
l_.str.1:                               ; @.str.1
	.asciz	"not all MMDs came out of reset in time. MMDs still in reset: %x\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
.subsections_via_symbols
