	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sun8i_dwmac_reset
_sun8i_dwmac_reset:                     ## @sun8i_dwmac_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_EMAC_BASIC_CTL1@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	addq	8(%r14), %rdi
	callq	_readl
	movl	%eax, %r15d
	movl	%eax, %ebx
	notl	%ebx
	movl	%eax, %edi
	orl	$1, %edi
	movq	(%r12), %rsi
	addq	8(%r14), %rsi
	callq	_writel
	movq	(%r12), %rdi
	addq	8(%r14), %rdi
	andl	$1, %ebx
	movl	%r15d, %esi
	movl	%ebx, %edx
	movl	$100, %ecx
	movl	$100000, %r8d                   ## imm = 0x186A0
	callq	_readl_poll_timeout
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EFAULT@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_3
LBB0_1:
	xorl	%eax, %eax
LBB0_3:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EMAC_BASIC_CTL1,8,3            ## @EMAC_BASIC_CTL1
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"EMAC reset timeout\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
	.no_dead_strip	_sun8i_dwmac_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sun8i_dwmac_reset
_sun8i_dwmac_reset:                     ; @sun8i_dwmac_reset
	.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
	mov	x19, x0
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x21, _EMAC_BASIC_CTL1@GOTPAGE
Lloh1:
	ldr	x21, [x21, _EMAC_BASIC_CTL1@GOTPAGEOFF]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readl
	mov	x20, x0
	mvn	w22, w0
	orr	w0, w0, #0x1
	ldr	x8, [x19, #8]
	ldr	x9, [x21]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [x19, #8]
	ldr	x9, [x21]
	add	x0, x9, x8
	and	w2, w22, #0x1
	mov	x1, x20
	mov	w3, #100
	mov	w4, #34464
	movk	w4, #1, lsl #16
	bl	_readl_poll_timeout
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w0, [x19]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh4:
	adrp	x8, _EFAULT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_2:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_EMAC_BASIC_CTL1,8,3            ; @EMAC_BASIC_CTL1
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"EMAC reset timeout\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
	.no_dead_strip	_sun8i_dwmac_reset
.subsections_via_symbols
