	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qca8k_mdio_read
_qca8k_mdio_read:                       ## @qca8k_mdio_read
	.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	_QCA8K_MDIO_MASTER_MAX_REG@GOTPCREL(%rip), %rax
	cmpq	%rdx, (%rax)
	jle	LBB0_1
## %bb.3:
	movq	%rdx, %r15
	movq	%rdi, %r14
	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_4
## %bb.5:
	cqto
	idivq	%rcx
	movq	%rdx, %rdi
	jmp	LBB0_6
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_4:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
	movl	%edx, %edi
LBB0_6:
	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_READ@GOTPCREL(%rip), %rax
	orq	(%rax), %rbx
	callq	_QCA8K_MDIO_MASTER_PHY_ADDR
	orq	%rax, %rbx
	movq	%r15, %rdi
	callq	_QCA8K_MDIO_MASTER_REG_ADDR
	orq	%rax, %rbx
	movq	_QCA8K_MDIO_MASTER_CTRL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	movq	%rbx, %rdx
	callq	_qca8k_write
	movl	(%r15), %esi
	movq	(%r12), %rdx
	movq	%r14, %rdi
	callq	_qca8k_busy_wait
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_9
LBB0_8:
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_qca8k_read
	movq	_QCA8K_MDIO_MASTER_DATA_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
LBB0_9:
                                        ## kill: def $eax killed $eax killed $rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.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_READ,8,3     ## @QCA8K_MDIO_MASTER_READ
	.comm	_QCA8K_MDIO_MASTER_CTRL,4,2     ## @QCA8K_MDIO_MASTER_CTRL
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_QCA8K_MDIO_MASTER_DATA_MASK,8,3 ## @QCA8K_MDIO_MASTER_DATA_MASK
	.no_dead_strip	_qca8k_mdio_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qca8k_mdio_read
_qca8k_mdio_read:                       ; @qca8k_mdio_read
	.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, _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_3
; %bb.1:
	mov	x20, 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	x21, _QCA8K_MDIO_MASTER_BUSY@GOTPAGE
Lloh7:
	ldr	x21, [x21, _QCA8K_MDIO_MASTER_BUSY@GOTPAGEOFF]
	ldr	x8, [x21]
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_READ@GOTPAGE
Lloh12:
	ldr	x9, [x9, _QCA8K_MDIO_MASTER_READ@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	orr	x22, x8, x9
	bl	_QCA8K_MDIO_MASTER_PHY_ADDR
	orr	x22, x22, x0
	mov	x0, x20
	bl	_QCA8K_MDIO_MASTER_REG_ADDR
	orr	x2, x22, 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, [x21]
	mov	x0, x19
	bl	_qca8k_busy_wait
	cbz	x0, LBB0_5
; %bb.2:
Lloh16:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_5:
	ldr	w1, [x20]
	mov	x0, x19
	bl	_qca8k_read
Lloh20:
	adrp	x8, _QCA8K_MDIO_MASTER_DATA_MASK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _QCA8K_MDIO_MASTER_DATA_MASK@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	and	w0, w8, w0
LBB0_6:
	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	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.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_READ,8,3     ; @QCA8K_MDIO_MASTER_READ
	.comm	_QCA8K_MDIO_MASTER_CTRL,4,2     ; @QCA8K_MDIO_MASTER_CTRL
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_QCA8K_MDIO_MASTER_DATA_MASK,8,3 ; @QCA8K_MDIO_MASTER_DATA_MASK
	.no_dead_strip	_qca8k_mdio_read
.subsections_via_symbols
