	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function emac_miibus_readreg
_emac_miibus_readreg:                   ## @emac_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movl	%esi, %ebx
	movl	%edi, %r14d
	callq	_device_get_softc
	movq	%rax, %r12
	movq	_EMAC_MAC_MADR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	shll	$8, %ebx
	orl	%r15d, %ebx
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_EMAC_WRITE_REG
	movq	_EMAC_MAC_MCMD@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r12, %rdi
	movl	$1, %edx
	callq	_EMAC_WRITE_REG
	movq	%r12, %rdi
	callq	_emac_miibus_iowait
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	(%rbx), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_EMAC_WRITE_REG
	movq	_EMAC_MAC_MRDD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_EMAC_READ_REG                  ## TAILCALL
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	callq	_device_printf
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EMAC_MAC_MADR,4,2              ## @EMAC_MAC_MADR
	.comm	_EMAC_MAC_MCMD,4,2              ## @EMAC_MAC_MCMD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timeout waiting for mii read\n"

	.comm	_EMAC_MAC_MRDD,4,2              ## @EMAC_MAC_MRDD
	.no_dead_strip	_emac_miibus_readreg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function emac_miibus_readreg
_emac_miibus_readreg:                   ; @emac_miibus_readreg
	.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	x21, x2
	mov	x22, x1
	mov	x20, x0
	bl	_device_get_softc
	mov	x19, x0
Lloh0:
	adrp	x8, _EMAC_MAC_MADR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EMAC_MAC_MADR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	orr	w2, w21, w22, lsl #8
	bl	_EMAC_WRITE_REG
Lloh3:
	adrp	x21, _EMAC_MAC_MCMD@GOTPAGE
Lloh4:
	ldr	x21, [x21, _EMAC_MAC_MCMD@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	mov	w2, #1
	bl	_EMAC_WRITE_REG
	mov	x0, x19
	bl	_emac_miibus_iowait
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w1, [x21]
	mov	x0, x19
	mov	w2, #0
	bl	_EMAC_WRITE_REG
Lloh5:
	adrp	x8, _EMAC_MAC_MRDD@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EMAC_MAC_MRDD@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	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
	b	_EMAC_READ_REG
LBB0_2:
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_device_printf
	mov	w0, #0
	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
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_EMAC_MAC_MADR,4,2              ; @EMAC_MAC_MADR
	.comm	_EMAC_MAC_MCMD,4,2              ; @EMAC_MAC_MCMD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timeout waiting for mii read\n"

	.comm	_EMAC_MAC_MRDD,4,2              ; @EMAC_MAC_MRDD
	.no_dead_strip	_emac_miibus_readreg
.subsections_via_symbols
