	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qca8k_mdio_write
_qca8k_mdio_write:                      ## @qca8k_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_QCA8K_MDIO_MASTER_MAX_REG@GOTPCREL(%rip), %rax
	cmpq	%rdx, (%rax)
	jle	LBB0_5
## %bb.1:
	movl	%ecx, %r14d
	movq	%rdx, %r13
	movq	%rdi, %r15
	movl	%esi, %edi
	callq	_qca8k_port_to_phy
	movq	_PHY_MAX_ADDR@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_2
## %bb.3:
	cqto
	idivq	%rcx
	movq	%rdx, %rdi
	jmp	LBB0_4
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
	movl	%edx, %edi
LBB0_4:
	movq	_QCA8K_MDIO_MASTER_BUSY@GOTPCREL(%rip), %r12
	movq	_QCA8K_MDIO_MASTER_EN@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	orq	(%r12), %rbx
	movq	_QCA8K_MDIO_MASTER_WRITE@GOTPCREL(%rip), %rax
	orq	(%rax), %rbx
	callq	_QCA8K_MDIO_MASTER_PHY_ADDR
	orq	%rax, %rbx
	movq	%r13, %rdi
	callq	_QCA8K_MDIO_MASTER_REG_ADDR
	movq	%rax, %r13
	movl	%r14d, %edi
	callq	_QCA8K_MDIO_MASTER_DATA
	orq	%rax, %r13
	orq	%rbx, %r13
	movq	_QCA8K_MDIO_MASTER_CTRL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	movq	%r13, %rdx
	callq	_qca8k_write
	movl	(%rbx), %esi
	movq	(%r12), %rdx
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_qca8k_busy_wait                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_QCA8K_MDIO_MASTER_MAX_REG,8,3  ## @QCA8K_MDIO_MASTER_MAX_REG
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PHY_MAX_ADDR,8,3               ## @PHY_MAX_ADDR
	.comm	_QCA8K_MDIO_MASTER_BUSY,8,3     ## @QCA8K_MDIO_MASTER_BUSY
	.comm	_QCA8K_MDIO_MASTER_EN,8,3       ## @QCA8K_MDIO_MASTER_EN
	.comm	_QCA8K_MDIO_MASTER_WRITE,8,3    ## @QCA8K_MDIO_MASTER_WRITE
	.comm	_QCA8K_MDIO_MASTER_CTRL,4,2     ## @QCA8K_MDIO_MASTER_CTRL
	.no_dead_strip	_qca8k_mdio_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qca8k_mdio_write
_qca8k_mdio_write:                      ; @qca8k_mdio_write
	.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
Lloh0:
	adrp	x8, _QCA8K_MDIO_MASTER_MAX_REG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _QCA8K_MDIO_MASTER_MAX_REG@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x2
	b.le	LBB0_2
; %bb.1:
	mov	x20, x3
	mov	x21, x2
	mov	x19, x0
	mov	x0, x1
	bl	_qca8k_port_to_phy
Lloh3:
	adrp	x8, _PHY_MAX_ADDR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PHY_MAX_ADDR@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	sdiv	x9, x0, x8
	msub	x0, x9, x8, x0
Lloh6:
	adrp	x22, _QCA8K_MDIO_MASTER_BUSY@GOTPAGE
Lloh7:
	ldr	x22, [x22, _QCA8K_MDIO_MASTER_BUSY@GOTPAGEOFF]
	ldr	x8, [x22]
Lloh8:
	adrp	x9, _QCA8K_MDIO_MASTER_EN@GOTPAGE
Lloh9:
	ldr	x9, [x9, _QCA8K_MDIO_MASTER_EN@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	orr	x8, x9, x8
Lloh11:
	adrp	x9, _QCA8K_MDIO_MASTER_WRITE@GOTPAGE
Lloh12:
	ldr	x9, [x9, _QCA8K_MDIO_MASTER_WRITE@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	orr	x23, x8, x9
	bl	_QCA8K_MDIO_MASTER_PHY_ADDR
	orr	x23, x23, x0
	mov	x0, x21
	bl	_QCA8K_MDIO_MASTER_REG_ADDR
	orr	x21, x23, x0
	mov	x0, x20
	bl	_QCA8K_MDIO_MASTER_DATA
	orr	x2, x21, x0
Lloh14:
	adrp	x20, _QCA8K_MDIO_MASTER_CTRL@GOTPAGE
Lloh15:
	ldr	x20, [x20, _QCA8K_MDIO_MASTER_CTRL@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_qca8k_write
	ldr	w1, [x20]
	ldr	x2, [x22]
	mov	x0, x19
	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
	b	_qca8k_busy_wait
LBB0_2:
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w0, w8
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_QCA8K_MDIO_MASTER_MAX_REG,8,3  ; @QCA8K_MDIO_MASTER_MAX_REG
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PHY_MAX_ADDR,8,3               ; @PHY_MAX_ADDR
	.comm	_QCA8K_MDIO_MASTER_BUSY,8,3     ; @QCA8K_MDIO_MASTER_BUSY
	.comm	_QCA8K_MDIO_MASTER_EN,8,3       ; @QCA8K_MDIO_MASTER_EN
	.comm	_QCA8K_MDIO_MASTER_WRITE,8,3    ; @QCA8K_MDIO_MASTER_WRITE
	.comm	_QCA8K_MDIO_MASTER_CTRL,4,2     ; @QCA8K_MDIO_MASTER_CTRL
	.no_dead_strip	_qca8k_mdio_write
.subsections_via_symbols
