	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns_mdio_read
_hns_mdio_read:                         ## @hns_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	%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	%edx, %ebx
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r12
	movl	%edx, %r14d
	shrl	$16, %r14d
	andl	$31, %r14d
	movq	_MII_ADDR_C45@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%r13d, %r13d
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	testl	%edx, %eax
	setne	%r13b
	movzwl	%bx, %r15d
	movq	8(%rdi), %rax
	movl	4(%rdi), %edx
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	(%rax), %ecx
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	%r13d, %ecx
	movl	%r14d, %r8d
	movl	%r15d, -52(%rbp)                ## 4-byte Spill
	movl	%r15d, %r9d
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	%r12, %rdi
	callq	_hns_mdio_wait_ready
	testl	%eax, %eax
	je	LBB0_2
LBB0_1:
	movl	%eax, %r15d
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	callq	_dev_err
LBB0_10:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	-52(%rbp), %r8d                 ## 4-byte Reload
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movl	-48(%rbp), %r15d                ## 4-byte Reload
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	testl	%ebx, -56(%rbp)                 ## 4-byte Folded Reload
	je	LBB0_3
## %bb.4:
	movq	_MDIO_ADDR_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MDIO_ADDR_DATA_M@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_MDIO_ADDR_DATA_S@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r13, %rdi
	callq	_MDIO_SET_REG_FIELD
	movq	_MDIO_C45_WRITE_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%r15d, %ebx
	movl	%r15d, %ecx
	movl	%r14d, %r8d
	callq	_hns_mdio_cmd_write
	movq	%r12, %rdi
	callq	_hns_mdio_wait_ready
	testl	%eax, %eax
	jne	LBB0_1
## %bb.5:
	movq	_MDIO_C45_READ@GOTPCREL(%rip), %rax
	movl	%r14d, %r8d
	jmp	LBB0_6
LBB0_3:
	movq	_MDIO_C22_READ@GOTPCREL(%rip), %rax
	movl	%r15d, %ebx
LBB0_6:
	movl	(%rax), %edx
	movq	%r13, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%ebx, %ecx
	callq	_hns_mdio_cmd_write
	movq	%r12, %rdi
	callq	_hns_mdio_wait_ready
	testl	%eax, %eax
	jne	LBB0_1
## %bb.7:
	movq	_MDIO_STA_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MDIO_STATE_STA_B@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_MDIO_GET_REG_BIT
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	leaq	L_.str.3(%rip), %rsi
	movq	%r12, %rdi
	callq	_dev_err
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_10
LBB0_9:
	movq	_MDIO_RDATA_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MDIO_RDATA_DATA_M@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_MDIO_RDATA_DATA_S@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r13, %rdi
	callq	_MDIO_GET_REG_FIELD
	movq	%rax, %r15
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_MII_ADDR_C45,4,2               ## @MII_ADDR_C45
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mdio read %s,base is %p\n"

L_.str.1:                               ## @.str.1
	.asciz	"phy id=%d, is_c45=%d, devad=%d, reg=%#x!\n"

L_.str.2:                               ## @.str.2
	.asciz	"MDIO bus is busy\n"

	.comm	_MDIO_C22_READ,4,2              ## @MDIO_C22_READ
	.comm	_MDIO_ADDR_REG,4,2              ## @MDIO_ADDR_REG
	.comm	_MDIO_ADDR_DATA_M,4,2           ## @MDIO_ADDR_DATA_M
	.comm	_MDIO_ADDR_DATA_S,4,2           ## @MDIO_ADDR_DATA_S
	.comm	_MDIO_C45_WRITE_ADDR,4,2        ## @MDIO_C45_WRITE_ADDR
	.comm	_MDIO_C45_READ,4,2              ## @MDIO_C45_READ
	.comm	_MDIO_STA_REG,4,2               ## @MDIO_STA_REG
	.comm	_MDIO_STATE_STA_B,4,2           ## @MDIO_STATE_STA_B
L_.str.3:                               ## @.str.3
	.asciz	" ERROR! MDIO Read failed!\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_MDIO_RDATA_REG,4,2             ## @MDIO_RDATA_REG
	.comm	_MDIO_RDATA_DATA_M,4,2          ## @MDIO_RDATA_DATA_M
	.comm	_MDIO_RDATA_DATA_S,4,2          ## @MDIO_RDATA_DATA_S
	.no_dead_strip	_hns_mdio_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hns_mdio_read
_hns_mdio_read:                         ; @hns_mdio_read
	.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	x21, x1
	mov	x19, x0
	ubfx	w23, w2, #16, #5
Lloh0:
	adrp	x8, _MII_ADDR_C45@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MII_ADDR_C45@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ands	w26, w8, w2
	cset	w22, ne
	and	w24, w2, #0xffff
	ldr	x20, [x0, #8]
	ldr	w2, [x0, #4]
	ldr	w3, [x20]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	stp	x23, x24, [sp]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	mov	x3, x22
	bl	_dev_dbg
	mov	x0, x19
	bl	_hns_mdio_wait_ready
	cbz	w0, LBB0_3
LBB0_1:
	mov	x25, x0
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_err
LBB0_2:
	mov	x0, x25
	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_3:
	cbz	w26, LBB0_6
; %bb.4:
Lloh9:
	adrp	x8, _MDIO_ADDR_REG@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MDIO_ADDR_REG@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x8, _MDIO_ADDR_DATA_M@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MDIO_ADDR_DATA_M@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
Lloh15:
	adrp	x8, _MDIO_ADDR_DATA_S@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MDIO_ADDR_DATA_S@GOTPAGEOFF]
Lloh17:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x4, x24
	bl	_MDIO_SET_REG_FIELD
Lloh18:
	adrp	x8, _MDIO_C45_WRITE_ADDR@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MDIO_C45_WRITE_ADDR@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x22
	mov	x3, x21
	mov	x4, x23
	bl	_hns_mdio_cmd_write
	mov	x0, x19
	bl	_hns_mdio_wait_ready
	cbnz	w0, LBB0_1
; %bb.5:
Lloh21:
	adrp	x8, _MDIO_C45_READ@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MDIO_C45_READ@GOTPAGEOFF]
	mov	x24, x23
	b	LBB0_7
LBB0_6:
Lloh23:
	adrp	x8, _MDIO_C22_READ@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MDIO_C22_READ@GOTPAGEOFF]
LBB0_7:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x22
	mov	x3, x21
	mov	x4, x24
	bl	_hns_mdio_cmd_write
	mov	x0, x19
	bl	_hns_mdio_wait_ready
	cbnz	w0, LBB0_1
; %bb.8:
Lloh25:
	adrp	x8, _MDIO_STA_REG@GOTPAGE
Lloh26:
	ldr	x8, [x8, _MDIO_STA_REG@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
Lloh28:
	adrp	x8, _MDIO_STATE_STA_B@GOTPAGE
Lloh29:
	ldr	x8, [x8, _MDIO_STATE_STA_B@GOTPAGEOFF]
Lloh30:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_MDIO_GET_REG_BIT
	cbz	w0, LBB0_10
; %bb.9:
Lloh31:
	adrp	x1, l_.str.3@PAGE
Lloh32:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh33:
	adrp	x8, _EBUSY@GOTPAGE
Lloh34:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	neg	w25, w8
	b	LBB0_2
LBB0_10:
Lloh36:
	adrp	x8, _MDIO_RDATA_REG@GOTPAGE
Lloh37:
	ldr	x8, [x8, _MDIO_RDATA_REG@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
Lloh39:
	adrp	x8, _MDIO_RDATA_DATA_M@GOTPAGE
Lloh40:
	ldr	x8, [x8, _MDIO_RDATA_DATA_M@GOTPAGEOFF]
Lloh41:
	ldr	w2, [x8]
Lloh42:
	adrp	x8, _MDIO_RDATA_DATA_S@GOTPAGE
Lloh43:
	ldr	x8, [x8, _MDIO_RDATA_DATA_S@GOTPAGEOFF]
Lloh44:
	ldr	w3, [x8]
	mov	x0, x20
	bl	_MDIO_GET_REG_FIELD
	mov	x25, x0
	b	LBB0_2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_MII_ADDR_C45,4,2               ; @MII_ADDR_C45
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mdio read %s,base is %p\n"

l_.str.1:                               ; @.str.1
	.asciz	"phy id=%d, is_c45=%d, devad=%d, reg=%#x!\n"

l_.str.2:                               ; @.str.2
	.asciz	"MDIO bus is busy\n"

	.comm	_MDIO_C22_READ,4,2              ; @MDIO_C22_READ
	.comm	_MDIO_ADDR_REG,4,2              ; @MDIO_ADDR_REG
	.comm	_MDIO_ADDR_DATA_M,4,2           ; @MDIO_ADDR_DATA_M
	.comm	_MDIO_ADDR_DATA_S,4,2           ; @MDIO_ADDR_DATA_S
	.comm	_MDIO_C45_WRITE_ADDR,4,2        ; @MDIO_C45_WRITE_ADDR
	.comm	_MDIO_C45_READ,4,2              ; @MDIO_C45_READ
	.comm	_MDIO_STA_REG,4,2               ; @MDIO_STA_REG
	.comm	_MDIO_STATE_STA_B,4,2           ; @MDIO_STATE_STA_B
l_.str.3:                               ; @.str.3
	.asciz	" ERROR! MDIO Read failed!\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_MDIO_RDATA_REG,4,2             ; @MDIO_RDATA_REG
	.comm	_MDIO_RDATA_DATA_M,4,2          ; @MDIO_RDATA_DATA_M
	.comm	_MDIO_RDATA_DATA_S,4,2          ; @MDIO_RDATA_DATA_S
	.no_dead_strip	_hns_mdio_read
.subsections_via_symbols
