	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar8216_phy_write
_ar8216_phy_write:                      ## @ar8216_phy_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %ebx
	movq	_AR8216_NUM_PORTS@GOTPCREL(%rip), %rcx
	cmpl	%esi, (%rcx)
	jle	LBB0_1
## %bb.2:
	movl	%esi, %eax
	movq	%rdi, %r14
	movq	_AR8216_MDIO_CTRL_PHY_ADDR_S@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	movq	_AR8216_MDIO_CTRL_REG_ADDR_S@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	movq	_AR8216_MDIO_CTRL_MASTER_EN@GOTPCREL(%rip), %rcx
	movq	_AR8216_MDIO_CTRL_BUSY@GOTPCREL(%rip), %r15
	movq	_AR8216_MDIO_CTRL_CMD_WRITE@GOTPCREL(%rip), %rsi
	orl	%ebx, %eax
	orl	%edx, %eax
	orl	(%rcx), %eax
	orl	(%r15), %eax
	orl	(%rsi), %eax
	movq	_AR8216_REG_MDIO_CTRL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movl	%eax, %edx
	callq	_ar8xxx_write
	movl	(%rbx), %esi
	movl	(%r15), %edx
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	movl	$5, %r8d
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ar8xxx_reg_wait                ## TAILCALL
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AR8216_NUM_PORTS,4,2           ## @AR8216_NUM_PORTS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AR8216_MDIO_CTRL_PHY_ADDR_S,4,2 ## @AR8216_MDIO_CTRL_PHY_ADDR_S
	.comm	_AR8216_MDIO_CTRL_REG_ADDR_S,4,2 ## @AR8216_MDIO_CTRL_REG_ADDR_S
	.comm	_AR8216_MDIO_CTRL_MASTER_EN,4,2 ## @AR8216_MDIO_CTRL_MASTER_EN
	.comm	_AR8216_MDIO_CTRL_BUSY,4,2      ## @AR8216_MDIO_CTRL_BUSY
	.comm	_AR8216_MDIO_CTRL_CMD_WRITE,4,2 ## @AR8216_MDIO_CTRL_CMD_WRITE
	.comm	_AR8216_REG_MDIO_CTRL,4,2       ## @AR8216_REG_MDIO_CTRL
	.no_dead_strip	_ar8216_phy_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ar8216_phy_write
_ar8216_phy_write:                      ; @ar8216_phy_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
Lloh0:
	adrp	x8, _AR8216_NUM_PORTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AR8216_NUM_PORTS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.le	LBB0_2
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x8, _AR8216_MDIO_CTRL_PHY_ADDR_S@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AR8216_MDIO_CTRL_PHY_ADDR_S@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	w8, w1, w8
Lloh6:
	adrp	x9, _AR8216_MDIO_CTRL_REG_ADDR_S@GOTPAGE
Lloh7:
	ldr	x9, [x9, _AR8216_MDIO_CTRL_REG_ADDR_S@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	lsl	w9, w2, w9
Lloh9:
	adrp	x10, _AR8216_MDIO_CTRL_MASTER_EN@GOTPAGE
Lloh10:
	ldr	x10, [x10, _AR8216_MDIO_CTRL_MASTER_EN@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
Lloh12:
	adrp	x20, _AR8216_MDIO_CTRL_BUSY@GOTPAGE
Lloh13:
	ldr	x20, [x20, _AR8216_MDIO_CTRL_BUSY@GOTPAGEOFF]
	ldr	w11, [x20]
Lloh14:
	adrp	x12, _AR8216_MDIO_CTRL_CMD_WRITE@GOTPAGE
Lloh15:
	ldr	x12, [x12, _AR8216_MDIO_CTRL_CMD_WRITE@GOTPAGEOFF]
Lloh16:
	ldr	w12, [x12]
	orr	w8, w8, w3
	orr	w8, w8, w9
	orr	w8, w8, w10
	orr	w8, w8, w11
	orr	w2, w8, w12
Lloh17:
	adrp	x21, _AR8216_REG_MDIO_CTRL@GOTPAGE
Lloh18:
	ldr	x21, [x21, _AR8216_REG_MDIO_CTRL@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_ar8xxx_write
	ldr	w1, [x21]
	ldr	w2, [x20]
	mov	x0, x19
	mov	w3, #0
	mov	w4, #5
	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	_ar8xxx_reg_wait
LBB0_2:
Lloh19:
	adrp	x8, _EINVAL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w0, w8
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_AR8216_NUM_PORTS,4,2           ; @AR8216_NUM_PORTS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AR8216_MDIO_CTRL_PHY_ADDR_S,4,2 ; @AR8216_MDIO_CTRL_PHY_ADDR_S
	.comm	_AR8216_MDIO_CTRL_REG_ADDR_S,4,2 ; @AR8216_MDIO_CTRL_REG_ADDR_S
	.comm	_AR8216_MDIO_CTRL_MASTER_EN,4,2 ; @AR8216_MDIO_CTRL_MASTER_EN
	.comm	_AR8216_MDIO_CTRL_BUSY,4,2      ; @AR8216_MDIO_CTRL_BUSY
	.comm	_AR8216_MDIO_CTRL_CMD_WRITE,4,2 ; @AR8216_MDIO_CTRL_CMD_WRITE
	.comm	_AR8216_REG_MDIO_CTRL,4,2       ; @AR8216_REG_MDIO_CTRL
	.no_dead_strip	_ar8216_phy_write
.subsections_via_symbols
