	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns_mdio_reset
_hns_mdio_reset:                        ## @hns_mdio_reset
	.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	%rdi, %r14
	movq	8(%rdi), %rdi
	movq	16(%r14), %rbx
	callq	_dev_of_node
	testq	%rax, %rax
	je	LBB0_12
## %bb.1:
	cmpl	$0, 24(%rbx)
	je	LBB0_2
## %bb.3:
	movl	8(%rbx), %ecx
	movl	20(%rbx), %esi
	movq	_MDIO_CHECK_SET_ST@GOTPCREL(%rip), %r12
	movl	(%r12), %r9d
	movq	%rbx, %rdi
	movl	$1, %edx
	movl	$1, %r8d
	callq	_mdio_sc_cfg_reg_write
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:
	movl	%eax, %r15d
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_5
LBB0_12:
	movq	8(%r14), %rax
	movl	(%rax), %edi
	callq	_is_acpi_node
	testq	%rax, %rax
	je	LBB0_15
## %bb.13:
	movq	8(%r14), %rdi
	callq	_ACPI_HANDLE
	leaq	L_.str.4(%rip), %rsi
	xorl	%r15d, %r15d
	movl	%eax, %edi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_acpi_evaluate_object
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_ACPI_FAILURE
	testq	%rax, %rax
	je	LBB0_17
## %bb.14:
	leaq	L_.str.5(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_2:
	leaq	L_.str(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_6:
	movl	(%rbx), %ecx
	movl	16(%rbx), %esi
	movq	_MDIO_CHECK_CLR_ST@GOTPCREL(%rip), %r13
	movl	(%r13), %r9d
	movq	%rbx, %rdi
	movl	$1, %edx
	movl	$1, %r8d
	callq	_mdio_sc_cfg_reg_write
	testl	%eax, %eax
	jne	LBB0_7
## %bb.8:
	movl	8(%rbx), %ecx
	movl	12(%rbx), %esi
	movl	(%r13), %r9d
	movq	%rbx, %rdi
	movl	$1, %edx
	movl	$1, %r8d
	callq	_mdio_sc_cfg_reg_write
	testl	%eax, %eax
	je	LBB0_9
LBB0_7:
	movl	%eax, %r15d
	leaq	L_.str.2(%rip), %rsi
LBB0_5:
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_17
LBB0_15:
	leaq	L_.str.6(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENXIO@GOTPCREL(%rip), %rax
LBB0_16:
	subl	(%rax), %r15d
LBB0_17:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movl	(%rbx), %ecx
	movl	4(%rbx), %esi
	movl	(%r12), %r9d
	movq	%rbx, %rdi
	movl	$1, %edx
	movl	$1, %r8d
	callq	_mdio_sc_cfg_reg_write
	testl	%eax, %eax
	je	LBB0_10
## %bb.11:
	movl	%eax, %r15d
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_5
LBB0_10:
	xorl	%r15d, %r15d
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mdio sys ctl reg has not maped\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_MDIO_CHECK_SET_ST,4,2          ## @MDIO_CHECK_SET_ST
L_.str.1:                               ## @.str.1
	.asciz	"MDIO reset fail\n"

	.comm	_MDIO_CHECK_CLR_ST,4,2          ## @MDIO_CHECK_CLR_ST
L_.str.2:                               ## @.str.2
	.asciz	"MDIO dis clk fail\n"

L_.str.3:                               ## @.str.3
	.asciz	"MDIO en clk fail\n"

L_.str.4:                               ## @.str.4
	.asciz	"_RST"

L_.str.5:                               ## @.str.5
	.asciz	"Reset failed, return:%#x\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
L_.str.6:                               ## @.str.6
	.asciz	"Can not get cfg data from DT or ACPI\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.no_dead_strip	_hns_mdio_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hns_mdio_reset
_hns_mdio_reset:                        ; @hns_mdio_reset
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	ldp	x0, x20, [x0, #8]
	bl	_dev_of_node
	cbz	x0, LBB0_4
; %bb.1:
	ldr	w8, [x20, #24]
	cbz	w8, LBB0_7
; %bb.2:
	ldr	w1, [x20, #20]
	ldr	w3, [x20, #8]
Lloh0:
	adrp	x22, _MDIO_CHECK_SET_ST@GOTPAGE
Lloh1:
	ldr	x22, [x22, _MDIO_CHECK_SET_ST@GOTPAGEOFF]
	ldr	w5, [x22]
	mov	x0, x20
	mov	w2, #1
	mov	w4, #1
	bl	_mdio_sc_cfg_reg_write
	cbz	w0, LBB0_8
; %bb.3:
	mov	x21, x0
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_11
LBB0_4:
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	bl	_is_acpi_node
	cbz	x0, LBB0_12
; %bb.5:
	ldr	x0, [x19, #8]
	bl	_ACPI_HANDLE
Lloh4:
	adrp	x1, l_.str.4@PAGE
Lloh5:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x2, #0
	mov	x3, #0
	bl	_acpi_evaluate_object
	mov	x20, x0
	bl	_ACPI_FAILURE
	cbz	x0, LBB0_15
; %bb.6:
	str	x20, [sp]
Lloh6:
	adrp	x1, l_.str.5@PAGE
Lloh7:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh8:
	adrp	x8, _EBUSY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_13
LBB0_7:
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh12:
	adrp	x8, _ENODEV@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_13
LBB0_8:
	ldr	w1, [x20, #16]
	ldr	w3, [x20]
Lloh14:
	adrp	x23, _MDIO_CHECK_CLR_ST@GOTPAGE
Lloh15:
	ldr	x23, [x23, _MDIO_CHECK_CLR_ST@GOTPAGEOFF]
	ldr	w5, [x23]
	mov	x0, x20
	mov	w2, #1
	mov	w4, #1
	bl	_mdio_sc_cfg_reg_write
	cbnz	w0, LBB0_10
; %bb.9:
	ldp	w3, w1, [x20, #8]
	ldr	w5, [x23]
	mov	x0, x20
	mov	w2, #1
	mov	w4, #1
	bl	_mdio_sc_cfg_reg_write
	cbz	w0, LBB0_16
LBB0_10:
	mov	x21, x0
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_11:
	mov	x0, x19
	bl	_dev_err
	b	LBB0_14
LBB0_12:
Lloh18:
	adrp	x1, l_.str.6@PAGE
Lloh19:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh20:
	adrp	x8, _ENXIO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
LBB0_13:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_14:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_15:
	mov	w21, #0
	b	LBB0_14
LBB0_16:
	ldp	w3, w1, [x20]
	ldr	w5, [x22]
	mov	x0, x20
	mov	w2, #1
	mov	w4, #1
	bl	_mdio_sc_cfg_reg_write
	mov	x21, x0
	cbz	w0, LBB0_14
; %bb.17:
Lloh22:
	adrp	x1, l_.str.3@PAGE
Lloh23:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_11
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mdio sys ctl reg has not maped\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_MDIO_CHECK_SET_ST,4,2          ; @MDIO_CHECK_SET_ST
l_.str.1:                               ; @.str.1
	.asciz	"MDIO reset fail\n"

	.comm	_MDIO_CHECK_CLR_ST,4,2          ; @MDIO_CHECK_CLR_ST
l_.str.2:                               ; @.str.2
	.asciz	"MDIO dis clk fail\n"

l_.str.3:                               ; @.str.3
	.asciz	"MDIO en clk fail\n"

l_.str.4:                               ; @.str.4
	.asciz	"_RST"

l_.str.5:                               ; @.str.5
	.asciz	"Reset failed, return:%#x\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
l_.str.6:                               ; @.str.6
	.asciz	"Can not get cfg data from DT or ACPI\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.no_dead_strip	_hns_mdio_reset
.subsections_via_symbols
