	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ag71xx_mdio_mii_read
_ag71xx_mdio_mii_read:                  ## @ag71xx_mdio_mii_read
	.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
	movq	(%rdi), %r12
	movq	%r12, %rdi
	callq	_ag71xx_mdio_wait_busy
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_3
## %bb.1:
	movl	%r15d, %eax
	andl	$31, %eax
	movq	_MII_ADDR_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	movq	_AG71XX_REG_MII_ADDR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movzbl	%r14b, %edx
	orl	%eax, %edx
	movq	%r12, %rdi
	callq	_ag71xx_wr
	movq	_AG71XX_REG_MII_CMD@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_MII_CMD_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_ag71xx_wr
	movq	%r12, %rdi
	callq	_ag71xx_mdio_wait_busy
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	movq	_AG71XX_REG_MII_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_ag71xx_rr
	movl	%eax, %ebx
	movl	(%r13), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_ag71xx_wr
	movq	_link@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12), %edx
	movl	%ebx, (%rsp)
	leaq	L_.str(%rip), %rcx
	movq	%r12, %rdi
	movl	%r15d, %r8d
	movl	%r14d, %r9d
	callq	_netif_dbg
LBB0_3:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AG71XX_REG_MII_ADDR,4,2        ## @AG71XX_REG_MII_ADDR
	.comm	_MII_ADDR_SHIFT,4,2             ## @MII_ADDR_SHIFT
	.comm	_AG71XX_REG_MII_CMD,4,2         ## @AG71XX_REG_MII_CMD
	.comm	_MII_CMD_READ,4,2               ## @MII_CMD_READ
	.comm	_AG71XX_REG_MII_STATUS,4,2      ## @AG71XX_REG_MII_STATUS
	.comm	_link,4,2                       ## @link
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mii_read: addr=%04x, reg=%04x, value=%04x\n"

	.no_dead_strip	_ag71xx_mdio_mii_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ag71xx_mdio_mii_read
_ag71xx_mdio_mii_read:                  ; @ag71xx_mdio_mii_read
	.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, x2
	mov	x20, x1
	ldr	x21, [x0]
	mov	x0, x21
	bl	_ag71xx_mdio_wait_busy
	mov	x22, x0
	cbnz	w0, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _AG71XX_REG_MII_ADDR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AG71XX_REG_MII_ADDR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	and	w8, w20, #0x1f
Lloh3:
	adrp	x9, _MII_ADDR_SHIFT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MII_ADDR_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	lsl	w8, w8, w9
	and	w9, w19, #0xff
	orr	w2, w8, w9
	mov	x0, x21
	bl	_ag71xx_wr
Lloh6:
	adrp	x23, _AG71XX_REG_MII_CMD@GOTPAGE
Lloh7:
	ldr	x23, [x23, _AG71XX_REG_MII_CMD@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh8:
	adrp	x8, _MII_CMD_READ@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MII_CMD_READ@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x0, x21
	bl	_ag71xx_wr
	mov	x0, x21
	bl	_ag71xx_mdio_wait_busy
	mov	x22, x0
	cbnz	w0, LBB0_3
; %bb.2:
Lloh11:
	adrp	x8, _AG71XX_REG_MII_STATUS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AG71XX_REG_MII_STATUS@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_ag71xx_rr
	mov	x22, x0
	ldr	w1, [x23]
	mov	x0, x21
	mov	w2, #0
	bl	_ag71xx_wr
Lloh14:
	adrp	x8, _link@GOTPAGE
Lloh15:
	ldr	x8, [x8, _link@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	ldr	w2, [x21]
Lloh17:
	adrp	x3, l_.str@PAGE
Lloh18:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x21
	mov	x4, x20
	mov	x5, x19
	mov	x6, x22
	bl	_netif_dbg
LBB0_3:
	mov	x0, x22
	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	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_AG71XX_REG_MII_ADDR,4,2        ; @AG71XX_REG_MII_ADDR
	.comm	_MII_ADDR_SHIFT,4,2             ; @MII_ADDR_SHIFT
	.comm	_AG71XX_REG_MII_CMD,4,2         ; @AG71XX_REG_MII_CMD
	.comm	_MII_CMD_READ,4,2               ; @MII_CMD_READ
	.comm	_AG71XX_REG_MII_STATUS,4,2      ; @AG71XX_REG_MII_STATUS
	.comm	_link,4,2                       ; @link
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mii_read: addr=%04x, reg=%04x, value=%04x\n"

	.no_dead_strip	_ag71xx_mdio_mii_read
.subsections_via_symbols
