	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function axienet_mdio_write
_axienet_mdio_write:                    ## @axienet_mdio_write
	.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
	movq	%rcx, %r12
	movl	%edx, %ebx
	movl	%esi, %r15d
	movq	(%rdi), %r14
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	movl	%ebx, %ecx
	movq	%r12, %r8
	callq	_dev_dbg
	movq	%r14, %rdi
	callq	_axienet_mdio_wait_until_ready
	testl	%eax, %eax
	js	LBB0_2
## %bb.1:
	movq	_XAE_MDIO_MWD_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r12d, %edx
	callq	_axienet_iow
	movq	_XAE_MDIO_MCR_PHYAD_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r15d
	movq	_XAE_MDIO_MCR_PHYAD_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r15d
	movq	_XAE_MDIO_MCR_REGAD_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	movq	_XAE_MDIO_MCR_OFFSET@GOTPCREL(%rip), %rax
	movq	_XAE_MDIO_MCR_REGAD_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %ebx
	orl	%r15d, %ebx
	movq	_XAE_MDIO_MCR_INITIATE_MASK@GOTPCREL(%rip), %rcx
	orl	(%rcx), %ebx
	movl	(%rax), %esi
	movq	_XAE_MDIO_MCR_OP_WRITE_MASK@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_axienet_iow
	movq	%r14, %rdi
	callq	_axienet_mdio_wait_until_ready
	movl	%eax, %ecx
	sarl	$31, %ecx
	andl	%ecx, %eax
LBB0_2:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"axienet_mdio_write(phy_id=%i, reg=%x, val=%x)\n"

	.comm	_XAE_MDIO_MWD_OFFSET,4,2        ## @XAE_MDIO_MWD_OFFSET
	.comm	_XAE_MDIO_MCR_OFFSET,4,2        ## @XAE_MDIO_MCR_OFFSET
	.comm	_XAE_MDIO_MCR_PHYAD_SHIFT,4,2   ## @XAE_MDIO_MCR_PHYAD_SHIFT
	.comm	_XAE_MDIO_MCR_PHYAD_MASK,4,2    ## @XAE_MDIO_MCR_PHYAD_MASK
	.comm	_XAE_MDIO_MCR_REGAD_SHIFT,4,2   ## @XAE_MDIO_MCR_REGAD_SHIFT
	.comm	_XAE_MDIO_MCR_REGAD_MASK,4,2    ## @XAE_MDIO_MCR_REGAD_MASK
	.comm	_XAE_MDIO_MCR_INITIATE_MASK,4,2 ## @XAE_MDIO_MCR_INITIATE_MASK
	.comm	_XAE_MDIO_MCR_OP_WRITE_MASK,4,2 ## @XAE_MDIO_MCR_OP_WRITE_MASK
	.no_dead_strip	_axienet_mdio_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function axienet_mdio_write
_axienet_mdio_write:                    ; @axienet_mdio_write
	.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	x22, x3
	mov	x20, x2
	mov	x21, x1
	ldr	x19, [x0]
	ldr	w0, [x19]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	mov	x3, x20
	mov	x4, x22
	bl	_dev_dbg
	mov	x0, x19
	bl	_axienet_mdio_wait_until_ready
	tbnz	w0, #31, LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _XAE_MDIO_MWD_OFFSET@GOTPAGE
Lloh3:
	ldr	x8, [x8, _XAE_MDIO_MWD_OFFSET@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x22
	bl	_axienet_iow
Lloh5:
	adrp	x8, _XAE_MDIO_MCR_OFFSET@GOTPAGE
Lloh6:
	ldr	x8, [x8, _XAE_MDIO_MCR_OFFSET@GOTPAGEOFF]
Lloh7:
	adrp	x9, _XAE_MDIO_MCR_PHYAD_SHIFT@GOTPAGE
Lloh8:
	ldr	x9, [x9, _XAE_MDIO_MCR_PHYAD_SHIFT@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	lsl	w9, w21, w9
Lloh10:
	adrp	x10, _XAE_MDIO_MCR_PHYAD_MASK@GOTPAGE
Lloh11:
	ldr	x10, [x10, _XAE_MDIO_MCR_PHYAD_MASK@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x10]
	and	w9, w9, w10
Lloh13:
	adrp	x10, _XAE_MDIO_MCR_REGAD_SHIFT@GOTPAGE
Lloh14:
	ldr	x10, [x10, _XAE_MDIO_MCR_REGAD_SHIFT@GOTPAGEOFF]
Lloh15:
	ldr	w10, [x10]
	lsl	w10, w20, w10
Lloh16:
	adrp	x11, _XAE_MDIO_MCR_REGAD_MASK@GOTPAGE
Lloh17:
	ldr	x11, [x11, _XAE_MDIO_MCR_REGAD_MASK@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
Lloh19:
	ldr	w8, [x11]
	and	w8, w10, w8
	orr	w8, w8, w9
Lloh20:
	adrp	x9, _XAE_MDIO_MCR_INITIATE_MASK@GOTPAGE
Lloh21:
	ldr	x9, [x9, _XAE_MDIO_MCR_INITIATE_MASK@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh23:
	adrp	x9, _XAE_MDIO_MCR_OP_WRITE_MASK@GOTPAGE
Lloh24:
	ldr	x9, [x9, _XAE_MDIO_MCR_OP_WRITE_MASK@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_axienet_iow
	mov	x0, x19
	bl	_axienet_mdio_wait_until_ready
	cmp	w0, #0
	csel	w0, w0, wzr, lt
LBB0_2:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh19
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh18
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"axienet_mdio_write(phy_id=%i, reg=%x, val=%x)\n"

	.comm	_XAE_MDIO_MWD_OFFSET,4,2        ; @XAE_MDIO_MWD_OFFSET
	.comm	_XAE_MDIO_MCR_OFFSET,4,2        ; @XAE_MDIO_MCR_OFFSET
	.comm	_XAE_MDIO_MCR_PHYAD_SHIFT,4,2   ; @XAE_MDIO_MCR_PHYAD_SHIFT
	.comm	_XAE_MDIO_MCR_PHYAD_MASK,4,2    ; @XAE_MDIO_MCR_PHYAD_MASK
	.comm	_XAE_MDIO_MCR_REGAD_SHIFT,4,2   ; @XAE_MDIO_MCR_REGAD_SHIFT
	.comm	_XAE_MDIO_MCR_REGAD_MASK,4,2    ; @XAE_MDIO_MCR_REGAD_MASK
	.comm	_XAE_MDIO_MCR_INITIATE_MASK,4,2 ; @XAE_MDIO_MCR_INITIATE_MASK
	.comm	_XAE_MDIO_MCR_OP_WRITE_MASK,4,2 ; @XAE_MDIO_MCR_OP_WRITE_MASK
	.no_dead_strip	_axienet_mdio_write
.subsections_via_symbols
