	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function emac_miibus_writereg
_emac_miibus_writereg:                  ## @emac_miibus_writereg
	.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	%ecx, %r15d
	movl	%edx, %r12d
	movl	%esi, %ebx
	movl	%edi, %r14d
	callq	_device_get_softc
	movq	%rax, %r13
	movq	_EMAC_MAC_MADR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	shll	$8, %ebx
	orl	%r12d, %ebx
	movq	%r13, %rdi
	movl	%ebx, %edx
	callq	_EMAC_WRITE_REG
	movq	_EMAC_MAC_MWTD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	%r15d, %edx
	callq	_EMAC_WRITE_REG
	movq	_EMAC_MAC_MCMD@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r13, %rdi
	movl	$1, %edx
	callq	_EMAC_WRITE_REG
	movq	%r13, %rdi
	callq	_emac_miibus_iowait
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	(%rbx), %esi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_EMAC_WRITE_REG
	jmp	LBB0_3
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	callq	_device_printf
LBB0_3:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EMAC_MAC_MADR,4,2              ## @EMAC_MAC_MADR
	.comm	_EMAC_MAC_MWTD,4,2              ## @EMAC_MAC_MWTD
	.comm	_EMAC_MAC_MCMD,4,2              ## @EMAC_MAC_MCMD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timeout waiting for mii write\n"

	.no_dead_strip	_emac_miibus_writereg
.subsections_via_symbols

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

	.no_dead_strip	_emac_miibus_writereg
.subsections_via_symbols
