	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gem_reset
_gem_reset:                             ## @gem_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, %r13
	movq	_GREG_IMASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	24(%rdi), %rsi
	movl	$-1, %edi
	callq	_writel
	movq	_GREG_SWRST_TXRST@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	orl	(%r13), %edi
	movq	_GREG_SWRST_RXRST@GOTPCREL(%rip), %r15
	orl	(%r15), %edi
	movq	_GREG_SWRST@GOTPCREL(%rip), %r12
	movq	(%r12), %rsi
	addq	24(%r13), %rsi
	callq	_writel
	movq	_STOP_TRIES@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	incl	%ebx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	$20, %edi
	callq	_udelay
	movq	(%r12), %rdi
	addq	24(%r13), %rdi
	callq	_readl
	decl	%ebx
	testl	%ebx, %ebx
	jle	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r15), %ecx
	orl	(%r14), %ecx
	testl	%eax, %ecx
	jne	LBB0_1
	jmp	LBB0_4
LBB0_3:
	movl	16(%r13), %edi
	leaq	L_.str(%rip), %rsi
	callq	_netdev_err
LBB0_4:
	movq	8(%r13), %rax
	movq	_phy_serialink@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.5:
	movq	_phy_serdes@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%r13, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gem_pcs_reinit_adv             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_GREG_IMASK,8,3                 ## @GREG_IMASK
	.comm	_GREG_SWRST_TXRST,4,2           ## @GREG_SWRST_TXRST
	.comm	_GREG_SWRST_RXRST,4,2           ## @GREG_SWRST_RXRST
	.comm	_GREG_SWRST,8,3                 ## @GREG_SWRST
	.comm	_STOP_TRIES,4,2                 ## @STOP_TRIES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SW reset is ghetto\n"

	.comm	_phy_serialink,8,3              ## @phy_serialink
	.comm	_phy_serdes,8,3                 ## @phy_serdes
	.no_dead_strip	_gem_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gem_reset
_gem_reset:                             ; @gem_reset
	.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
	mov	x19, x0
	ldr	x8, [x0, #24]
Lloh0:
	adrp	x9, _GREG_IMASK@GOTPAGE
Lloh1:
	ldr	x9, [x9, _GREG_IMASK@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #-1
	bl	_writel
Lloh3:
	adrp	x20, _GREG_SWRST_TXRST@GOTPAGE
Lloh4:
	ldr	x20, [x20, _GREG_SWRST_TXRST@GOTPAGEOFF]
	ldr	w8, [x19]
	ldr	w9, [x20]
	orr	w8, w9, w8
Lloh5:
	adrp	x21, _GREG_SWRST_RXRST@GOTPAGE
Lloh6:
	ldr	x21, [x21, _GREG_SWRST_RXRST@GOTPAGEOFF]
	ldr	w9, [x21]
	orr	w0, w8, w9
	ldr	x8, [x19, #24]
Lloh7:
	adrp	x22, _GREG_SWRST@GOTPAGE
Lloh8:
	ldr	x22, [x22, _GREG_SWRST@GOTPAGEOFF]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_writel
Lloh9:
	adrp	x8, _STOP_TRIES@GOTPAGE
Lloh10:
	ldr	x8, [x8, _STOP_TRIES@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	add	w23, w8, #1
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #20
	bl	_udelay
	ldr	x8, [x19, #24]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_readl
	sub	w23, w23, #1
	cmp	w23, #1
	b.lt	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [x20]
	ldr	w9, [x21]
	orr	w8, w9, w8
	tst	w8, w0
	b.ne	LBB0_1
	b	LBB0_4
LBB0_3:
	ldr	w0, [x19, #16]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_netdev_err
LBB0_4:
	ldr	x8, [x19, #8]
Lloh14:
	adrp	x9, _phy_serialink@GOTPAGE
Lloh15:
	ldr	x9, [x9, _phy_serialink@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
Lloh17:
	adrp	x10, _phy_serdes@GOTPAGE
Lloh18:
	ldr	x10, [x10, _phy_serdes@GOTPAGEOFF]
Lloh19:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_6
; %bb.5:
	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	_gem_pcs_reinit_adv
LBB0_6:
	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	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_GREG_IMASK,8,3                 ; @GREG_IMASK
	.comm	_GREG_SWRST_TXRST,4,2           ; @GREG_SWRST_TXRST
	.comm	_GREG_SWRST_RXRST,4,2           ; @GREG_SWRST_RXRST
	.comm	_GREG_SWRST,8,3                 ; @GREG_SWRST
	.comm	_STOP_TRIES,4,2                 ; @STOP_TRIES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SW reset is ghetto\n"

	.comm	_phy_serialink,8,3              ; @phy_serialink
	.comm	_phy_serdes,8,3                 ; @phy_serdes
	.no_dead_strip	_gem_reset
.subsections_via_symbols
