	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sr9800_reset
_sr9800_reset:                          ## @sr9800_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	_SR_GPIO_RSE@GOTPCREL(%rip), %rax
	movq	_SR_GPIO_GPO_2@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	%rdi, %r14
	movq	_SR_GPIO_GPO2EN@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movl	$5, %edx
	callq	_sr_write_gpio
	testl	%eax, %eax
	js	LBB0_14
## %bb.1:
	movq	%r14, %rdi
	callq	_sr_get_phy_addr
	movl	%eax, %r15d
	andl	$31, %r15d
	xorl	%edx, %edx
	cmpl	$16, %r15d
	sete	%dl
	movq	_SR_CMD_SW_PHY_SELECT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_sr_write_cmd
	testl	%eax, %eax
	js	LBB0_2
## %bb.3:
	movq	_SR_SWRESET_IPPD@GOTPCREL(%rip), %rax
	movq	_SR_SWRESET_PRL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	orl	(%rax), %esi
	movq	%r14, %rdi
	callq	_sr_sw_reset
	testl	%eax, %eax
	js	LBB0_14
## %bb.4:
	movl	$150, %edi
	callq	_msleep
	movq	_SR_SWRESET_CLEAR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_sr_sw_reset
	testl	%eax, %eax
	js	LBB0_14
## %bb.5:
	movl	$150, %edi
	callq	_msleep
	cmpl	$16, %r15d
	jne	LBB0_7
## %bb.6:
	movq	_SR_SWRESET_IPRL@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_2:
	movl	%eax, %ebx
	movq	(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_netdev_dbg
	jmp	LBB0_15
LBB0_7:
	movq	_SR_SWRESET_PRTE@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_sr_sw_reset
	testl	%eax, %eax
	js	LBB0_14
## %bb.9:
	movl	$150, %edi
	callq	_msleep
	movq	%r14, %rdi
	callq	_sr_read_rx_ctl
	movq	(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	callq	_netdev_dbg
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_sr_write_rx_ctl
	testl	%eax, %eax
	js	LBB0_14
## %bb.10:
	movq	%r14, %rdi
	callq	_sr_read_rx_ctl
	movq	(%r14), %rdi
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edx
	callq	_netdev_dbg
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_sr_sw_reset
	testl	%eax, %eax
	js	LBB0_14
## %bb.11:
	movl	$150, %edi
	callq	_msleep
	movq	_SR_SWRESET_IPRL@GOTPCREL(%rip), %rax
	movl	(%r12), %esi
	orl	(%rax), %esi
	movq	%r14, %rdi
	callq	_sr_sw_reset
	testl	%eax, %eax
	js	LBB0_14
## %bb.12:
	movl	$150, %edi
	callq	_msleep
	movq	%r14, %rdi
	callq	_sr9800_set_default_mode
	testl	%eax, %eax
	js	LBB0_14
## %bb.13:
	movq	(%r14), %rax
	movq	8(%r14), %rdi
	movl	(%rax), %esi
	movq	_ETH_ALEN@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	callq	_memcpy
	movq	_SR_CMD_WRITE_NODE_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %r8d
	movq	8(%r14), %r9
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_sr_write_cmd
	testl	%eax, %eax
	jns	LBB0_15
LBB0_14:
	movl	%eax, %ebx
LBB0_15:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SR_GPIO_RSE,4,2                ## @SR_GPIO_RSE
	.comm	_SR_GPIO_GPO_2,4,2              ## @SR_GPIO_GPO_2
	.comm	_SR_GPIO_GPO2EN,4,2             ## @SR_GPIO_GPO2EN
	.comm	_SR_CMD_SW_PHY_SELECT,4,2       ## @SR_CMD_SW_PHY_SELECT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Select PHY #1 failed: %d\n"

	.comm	_SR_SWRESET_IPPD,4,2            ## @SR_SWRESET_IPPD
	.comm	_SR_SWRESET_PRL,4,2             ## @SR_SWRESET_PRL
	.comm	_SR_SWRESET_CLEAR,4,2           ## @SR_SWRESET_CLEAR
	.comm	_SR_SWRESET_IPRL,4,2            ## @SR_SWRESET_IPRL
	.comm	_SR_SWRESET_PRTE,4,2            ## @SR_SWRESET_PRTE
L_.str.1:                               ## @.str.1
	.asciz	"RX_CTL is 0x%04x after software reset\n"

L_.str.2:                               ## @.str.2
	.asciz	"RX_CTL is 0x%04x setting to 0x0000\n"

	.comm	_ETH_ALEN,4,2                   ## @ETH_ALEN
	.comm	_SR_CMD_WRITE_NODE_ID,4,2       ## @SR_CMD_WRITE_NODE_ID
	.no_dead_strip	_sr9800_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sr9800_reset
_sr9800_reset:                          ; @sr9800_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
Lloh0:
	adrp	x8, _SR_GPIO_RSE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SR_GPIO_RSE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _SR_GPIO_GPO_2@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SR_GPIO_GPO_2@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh6:
	adrp	x9, _SR_GPIO_GPO2EN@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SR_GPIO_GPO2EN@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w1, w8, w9
	mov	w2, #5
	bl	_sr_write_gpio
	tbnz	w0, #31, LBB0_14
; %bb.1:
	mov	x0, x19
	bl	_sr_get_phy_addr
	and	w22, w0, #0x1f
	cmp	w22, #16
	cset	w2, eq
Lloh9:
	adrp	x8, _SR_CMD_SW_PHY_SELECT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SR_CMD_SW_PHY_SELECT@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w3, #0
	mov	w4, #0
	mov	x5, #0
	bl	_sr_write_cmd
	tbnz	w0, #31, LBB0_6
; %bb.2:
Lloh12:
	adrp	x8, _SR_SWRESET_IPPD@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SR_SWRESET_IPPD@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x21, _SR_SWRESET_PRL@GOTPAGE
Lloh16:
	ldr	x21, [x21, _SR_SWRESET_PRL@GOTPAGEOFF]
	ldr	w9, [x21]
	orr	w1, w9, w8
	mov	x0, x19
	bl	_sr_sw_reset
	tbnz	w0, #31, LBB0_14
; %bb.3:
	mov	w0, #150
	bl	_msleep
Lloh17:
	adrp	x8, _SR_SWRESET_CLEAR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SR_SWRESET_CLEAR@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_sr_sw_reset
	tbnz	w0, #31, LBB0_14
; %bb.4:
	mov	w0, #150
	bl	_msleep
	cmp	w22, #16
	b.ne	LBB0_7
; %bb.5:
Lloh20:
	adrp	x8, _SR_SWRESET_IPRL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SR_SWRESET_IPRL@GOTPAGEOFF]
	b	LBB0_8
LBB0_6:
	mov	x20, x0
	ldr	x0, [x19]
Lloh22:
	adrp	x1, l_.str@PAGE
Lloh23:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_netdev_dbg
	b	LBB0_15
LBB0_7:
Lloh24:
	adrp	x8, _SR_SWRESET_PRTE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _SR_SWRESET_PRTE@GOTPAGEOFF]
LBB0_8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_sr_sw_reset
	tbnz	w0, #31, LBB0_14
; %bb.9:
	mov	w0, #150
	bl	_msleep
	mov	x0, x19
	bl	_sr_read_rx_ctl
	mov	x2, x0
	ldr	x0, [x19]
Lloh26:
	adrp	x1, l_.str.1@PAGE
Lloh27:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_netdev_dbg
	mov	x0, x19
	mov	w1, #0
	bl	_sr_write_rx_ctl
	tbnz	w0, #31, LBB0_14
; %bb.10:
	mov	x0, x19
	bl	_sr_read_rx_ctl
	mov	x2, x0
	ldr	x0, [x19]
Lloh28:
	adrp	x1, l_.str.2@PAGE
Lloh29:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_netdev_dbg
	ldr	w1, [x21]
	mov	x0, x19
	bl	_sr_sw_reset
	tbnz	w0, #31, LBB0_14
; %bb.11:
	mov	w0, #150
	bl	_msleep
Lloh30:
	adrp	x8, _SR_SWRESET_IPRL@GOTPAGE
Lloh31:
	ldr	x8, [x8, _SR_SWRESET_IPRL@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	ldr	w9, [x21]
	orr	w1, w9, w8
	mov	x0, x19
	bl	_sr_sw_reset
	tbnz	w0, #31, LBB0_14
; %bb.12:
	mov	w0, #150
	bl	_msleep
	mov	x0, x19
	bl	_sr9800_set_default_mode
	tbnz	w0, #31, LBB0_14
; %bb.13:
	ldp	x8, x0, [x19]
	ldr	w1, [x8]
Lloh33:
	adrp	x20, _ETH_ALEN@GOTPAGE
Lloh34:
	ldr	x20, [x20, _ETH_ALEN@GOTPAGEOFF]
	ldr	w2, [x20]
	bl	_memcpy
Lloh35:
	adrp	x8, _SR_CMD_WRITE_NODE_ID@GOTPAGE
Lloh36:
	ldr	x8, [x8, _SR_CMD_WRITE_NODE_ID@GOTPAGEOFF]
Lloh37:
	ldr	w1, [x8]
	ldr	w4, [x20]
	ldr	x5, [x19, #8]
	mov	x0, x19
	mov	w2, #0
	mov	w3, #0
	bl	_sr_write_cmd
	mov	w20, #0
	tbz	w0, #31, LBB0_15
LBB0_14:
	mov	x20, x0
LBB0_15:
	mov	x0, x20
	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	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_SR_GPIO_RSE,4,2                ; @SR_GPIO_RSE
	.comm	_SR_GPIO_GPO_2,4,2              ; @SR_GPIO_GPO_2
	.comm	_SR_GPIO_GPO2EN,4,2             ; @SR_GPIO_GPO2EN
	.comm	_SR_CMD_SW_PHY_SELECT,4,2       ; @SR_CMD_SW_PHY_SELECT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Select PHY #1 failed: %d\n"

	.comm	_SR_SWRESET_IPPD,4,2            ; @SR_SWRESET_IPPD
	.comm	_SR_SWRESET_PRL,4,2             ; @SR_SWRESET_PRL
	.comm	_SR_SWRESET_CLEAR,4,2           ; @SR_SWRESET_CLEAR
	.comm	_SR_SWRESET_IPRL,4,2            ; @SR_SWRESET_IPRL
	.comm	_SR_SWRESET_PRTE,4,2            ; @SR_SWRESET_PRTE
l_.str.1:                               ; @.str.1
	.asciz	"RX_CTL is 0x%04x after software reset\n"

l_.str.2:                               ; @.str.2
	.asciz	"RX_CTL is 0x%04x setting to 0x0000\n"

	.comm	_ETH_ALEN,4,2                   ; @ETH_ALEN
	.comm	_SR_CMD_WRITE_NODE_ID,4,2       ; @SR_CMD_WRITE_NODE_ID
	.no_dead_strip	_sr9800_reset
.subsections_via_symbols
