	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_asix_mdio_write                ## -- Begin function asix_mdio_write
	.p2align	4, 0x90
_asix_mdio_write:                       ## @asix_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r12d
	movl	%edx, %r14d
	movl	%esi, %r15d
	callq	_netdev_priv
	movq	%rax, %rbx
	movl	%r12d, %edi
	callq	_cpu_to_le16
	movl	%eax, -56(%rbp)
	movl	4(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movl	%r15d, %edx
	movl	%r14d, -48(%rbp)                ## 4-byte Spill
	movl	%r14d, %ecx
	movl	%r12d, %r8d
	callq	_netdev_dbg
	movq	%rbx, %rdi
	callq	_mutex_lock
	xorl	%r14d, %r14d
	movq	_ENODEV@GOTPCREL(%rip), %r13
	leaq	-52(%rbp), %r12
	movq	_AX_HOST_EN@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_asix_set_sw_mii
	movl	(%r13), %ecx
	movl	%eax, %edx
	addl	%ecx, %edx
	je	LBB0_6
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	$1000, %edi                     ## imm = 0x3E8
	movl	$1100, %esi                     ## imm = 0x44C
	callq	_usleep_range
	movq	_AX_CMD_STATMNGSTS_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$0, (%rsp)
	movq	%rbx, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	movq	%r12, %r9
	callq	_asix_read_cmd
	movl	(%r15), %ecx
	testl	%ecx, -52(%rbp)
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$30, %r14d
	jae	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	incl	%r14d
	movl	(%r13), %ecx
	movl	%eax, %edx
	addl	%ecx, %edx
	jne	LBB0_1
LBB0_6:
	addl	%eax, %ecx
	je	LBB0_8
LBB0_7:
	movq	_AX_CMD_WRITE_MII_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$0, (%rsp)
	leaq	-56(%rbp), %r9
	movq	%rbx, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	movl	$2, %r8d
	callq	_asix_write_cmd
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_asix_set_hw_mii
LBB0_8:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	(%r13), %ecx
	addl	%eax, %ecx
	jne	LBB0_7
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"asix_mdio_write() phy_id=0x%02x, loc=0x%02x, val=0x%04x\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_AX_CMD_STATMNGSTS_REG,4,2      ## @AX_CMD_STATMNGSTS_REG
	.comm	_AX_HOST_EN,4,2                 ## @AX_HOST_EN
	.comm	_AX_CMD_WRITE_MII_REG,4,2       ## @AX_CMD_WRITE_MII_REG
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_asix_mdio_write                ; -- Begin function asix_mdio_write
	.p2align	2
_asix_mdio_write:                       ; @asix_mdio_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x22, x3
	mov	x20, x2
	mov	x21, x1
	bl	_netdev_priv
	mov	x19, x0
	mov	x0, x22
	bl	_cpu_to_le16
	str	w0, [sp, #12]
	ldr	w0, [x19, #4]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	mov	x3, x20
	mov	x4, x22
	bl	_netdev_dbg
	mov	x0, x19
	bl	_mutex_lock
	mov	w22, #0
Lloh2:
	adrp	x23, _ENODEV@GOTPAGE
Lloh3:
	ldr	x23, [x23, _ENODEV@GOTPAGEOFF]
Lloh4:
	adrp	x24, _AX_CMD_STATMNGSTS_REG@GOTPAGE
Lloh5:
	ldr	x24, [x24, _AX_CMD_STATMNGSTS_REG@GOTPAGEOFF]
Lloh6:
	adrp	x25, _AX_HOST_EN@GOTPAGE
Lloh7:
	ldr	x25, [x25, _AX_HOST_EN@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	w1, #0
	bl	_asix_set_sw_mii
	ldr	w8, [x23]
	cmn	w0, w8
	b.eq	LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	w0, #1000
	mov	w1, #1100
	bl	_usleep_range
	ldr	w1, [x24]
	add	x5, sp, #8
	mov	x0, x19
	mov	w2, #0
	mov	w3, #0
	mov	w4, #1
	mov	w6, #0
	bl	_asix_read_cmd
	ldr	w8, [sp, #8]
	ldr	w9, [x25]
	and	w8, w9, w8
	cmp	w8, #0
	ccmp	w22, #30, #2, eq
	b.hs	LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	add	w22, w22, #1
	ldr	w8, [x23]
	cmn	w0, w8
	b.ne	LBB0_1
LBB0_4:
	cmn	w0, w8
	b.eq	LBB0_6
LBB0_5:
Lloh8:
	adrp	x8, _AX_CMD_WRITE_MII_REG@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AX_CMD_WRITE_MII_REG@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	add	x5, sp, #12
	mov	x0, x19
	mov	x2, x21
	mov	x3, x20
	mov	w4, #2
	mov	w6, #0
	bl	_asix_write_cmd
	mov	x0, x19
	mov	w1, #0
	bl	_asix_set_hw_mii
LBB0_6:
	mov	x0, x19
	bl	_mutex_unlock
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_7:
	ldr	w8, [x23]
	cmn	w0, w8
	b.ne	LBB0_5
	b	LBB0_6
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"asix_mdio_write() phy_id=0x%02x, loc=0x%02x, val=0x%04x\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_AX_CMD_STATMNGSTS_REG,4,2      ; @AX_CMD_STATMNGSTS_REG
	.comm	_AX_HOST_EN,4,2                 ; @AX_HOST_EN
	.comm	_AX_CMD_WRITE_MII_REG,4,2       ; @AX_CMD_WRITE_MII_REG
.subsections_via_symbols
