	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function awg_miibus_readreg
_awg_miibus_readreg:                    ## @awg_miibus_readreg
	.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
	movl	%edx, %r14d
	movl	%esi, %r15d
	movl	%edi, %r12d
	callq	_device_get_softc
	movq	%rax, %rbx
	movl	(%rax), %eax
	movq	_MDC_DIV_RATIO_M_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	movq	_PHY_ADDR_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	shll	%cl, %r15d
	movq	_EMAC_MII_CMD@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	orl	%eax, %r15d
	movq	_PHY_REG_ADDR_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%r14d, -48(%rbp)                ## 4-byte Spill
	movl	%r14d, %edx
	shll	%cl, %edx
	orl	%r15d, %edx
	movq	_MII_BUSY@GOTPCREL(%rip), %r14
	orl	(%r14), %edx
	movq	%rbx, %rdi
	callq	_WR4
	movq	_MII_BUSY_RETRY@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	testl	%r15d, %r15d
	jle	LBB0_4
## %bb.1:
	incl	%r15d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_RD4
	testl	%eax, (%r14)
	je	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$10, %edi
	callq	_DELAY
	decl	%r15d
	cmpl	$1, %r15d
	jg	LBB0_2
	jmp	LBB0_5
LBB0_4:
	jne	LBB0_6
LBB0_5:
	leaq	L_.str(%rip), %rsi
	movl	%r12d, %edi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	callq	_device_printf
LBB0_6:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_EMAC_MII_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_RD4                            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_EMAC_MII_CMD,4,2               ## @EMAC_MII_CMD
	.comm	_MDC_DIV_RATIO_M_SHIFT,4,2      ## @MDC_DIV_RATIO_M_SHIFT
	.comm	_PHY_ADDR_SHIFT,4,2             ## @PHY_ADDR_SHIFT
	.comm	_PHY_REG_ADDR_SHIFT,4,2         ## @PHY_REG_ADDR_SHIFT
	.comm	_MII_BUSY,4,2                   ## @MII_BUSY
	.comm	_MII_BUSY_RETRY,4,2             ## @MII_BUSY_RETRY
	.comm	_EMAC_MII_DATA,4,2              ## @EMAC_MII_DATA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"phy read timeout, phy=%d reg=%d\n"

	.no_dead_strip	_awg_miibus_readreg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function awg_miibus_readreg
_awg_miibus_readreg:                    ; @awg_miibus_readreg
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	bl	_device_get_softc
	mov	x22, x0
Lloh0:
	adrp	x23, _EMAC_MII_CMD@GOTPAGE
Lloh1:
	ldr	x23, [x23, _EMAC_MII_CMD@GOTPAGEOFF]
	ldr	w1, [x23]
	ldr	w8, [x0]
Lloh2:
	adrp	x9, _MDC_DIV_RATIO_M_SHIFT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MDC_DIV_RATIO_M_SHIFT@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	lsl	w8, w8, w9
Lloh5:
	adrp	x9, _PHY_ADDR_SHIFT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PHY_ADDR_SHIFT@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	lsl	w9, w20, w9
	orr	w8, w9, w8
Lloh8:
	adrp	x9, _PHY_REG_ADDR_SHIFT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _PHY_REG_ADDR_SHIFT@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	lsl	w9, w19, w9
	orr	w8, w8, w9
Lloh11:
	adrp	x24, _MII_BUSY@GOTPAGE
Lloh12:
	ldr	x24, [x24, _MII_BUSY@GOTPAGEOFF]
	ldr	w9, [x24]
	orr	w2, w8, w9
	bl	_WR4
Lloh13:
	adrp	x8, _MII_BUSY_RETRY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MII_BUSY_RETRY@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.1:
	add	w25, w8, #1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x23]
	mov	x0, x22
	bl	_RD4
	ldr	w8, [x24]
	tst	w8, w0
	b.eq	LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #10
	bl	_DELAY
	sub	w25, w25, #1
	cmp	w25, #1
	b.gt	LBB0_2
	b	LBB0_5
LBB0_4:
	cbnz	w8, LBB0_6
LBB0_5:
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x20
	mov	x3, x19
	bl	_device_printf
LBB0_6:
	mov	w0, #0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_7:
Lloh18:
	adrp	x8, _EMAC_MII_DATA@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EMAC_MII_DATA@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_RD4
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_EMAC_MII_CMD,4,2               ; @EMAC_MII_CMD
	.comm	_MDC_DIV_RATIO_M_SHIFT,4,2      ; @MDC_DIV_RATIO_M_SHIFT
	.comm	_PHY_ADDR_SHIFT,4,2             ; @PHY_ADDR_SHIFT
	.comm	_PHY_REG_ADDR_SHIFT,4,2         ; @PHY_REG_ADDR_SHIFT
	.comm	_MII_BUSY,4,2                   ; @MII_BUSY
	.comm	_MII_BUSY_RETRY,4,2             ; @MII_BUSY_RETRY
	.comm	_EMAC_MII_DATA,4,2              ; @EMAC_MII_DATA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"phy read timeout, phy=%d reg=%d\n"

	.no_dead_strip	_awg_miibus_readreg
.subsections_via_symbols
