	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fabric_serdes_reset            ## -- Begin function fabric_serdes_reset
	.p2align	4, 0x90
_fabric_serdes_reset:                   ## @fabric_serdes_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	_fw_fabric_serdes_load@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_6
## %bb.1:
	movq	%rdi, %rbx
	movq	_CR_SBUS@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_SBUS_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_acquire_chip_resource
	testl	%eax, %eax
	je	LBB0_2
## %bb.7:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dd_dev_err                     ## TAILCALL
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%rbx, %rdi
	callq	_set_sbus_fast_mode
	movq	%rbx, %rdi
	callq	_is_ax
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_fabric_serdes_broadcast@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rbx), %rcx
	movl	(%rax,%rcx,4), %r14d
	movq	_WRITE_SBUS_RECEIVER@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	$7, %edx
	movl	$17, %r8d
	callq	_sbus_request
	movl	$1, %edi
	callq	_udelay
	movl	(%r12), %ecx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	$7, %edx
	movl	$16, %r8d
	callq	_sbus_request
	movl	(%r12), %ecx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	$7, %edx
	movl	$2, %r8d
	callq	_sbus_request
	jmp	LBB0_5
LBB0_4:
	movq	_SPICO_FABRIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_turn_off_spicos
	movq	_fw_fabric@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	callq	_load_fabric_serdes_firmware
LBB0_5:
	movq	%rbx, %rdi
	callq	_clear_sbus_fast_mode
	movl	(%r15), %esi
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_release_chip_resource          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_fw_fabric_serdes_load,4,2      ## @fw_fabric_serdes_load
	.comm	_CR_SBUS,4,2                    ## @CR_SBUS
	.comm	_SBUS_TIMEOUT,4,2               ## @SBUS_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot acquire SBus resource to reset fabric SerDes - perhaps you should reboot\n"

	.comm	_fabric_serdes_broadcast,8,3    ## @fabric_serdes_broadcast
	.comm	_WRITE_SBUS_RECEIVER,4,2        ## @WRITE_SBUS_RECEIVER
	.comm	_SPICO_FABRIC,4,2               ## @SPICO_FABRIC
	.comm	_fw_fabric,4,2                  ## @fw_fabric
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fabric_serdes_reset            ; -- Begin function fabric_serdes_reset
	.p2align	2
_fabric_serdes_reset:                   ; @fabric_serdes_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
Lloh0:
	adrp	x8, _fw_fabric_serdes_load@GOTPAGE
Lloh1:
	ldr	x8, [x8, _fw_fabric_serdes_load@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbz	w8, LBB0_3
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x21, _CR_SBUS@GOTPAGE
Lloh4:
	ldr	x21, [x21, _CR_SBUS@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh5:
	adrp	x8, _SBUS_TIMEOUT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SBUS_TIMEOUT@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	bl	_acquire_chip_resource
	cbz	w0, LBB0_4
; %bb.2:
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	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
	b	_dd_dev_err
LBB0_3:
	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
LBB0_4:
	mov	x0, x19
	bl	_set_sbus_fast_mode
	mov	x0, x19
	bl	_is_ax
	cbz	x0, LBB0_6
; %bb.5:
Lloh10:
	adrp	x8, _fabric_serdes_broadcast@GOTPAGE
Lloh11:
	ldr	x8, [x8, _fabric_serdes_broadcast@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	ldr	x9, [x19]
	ldr	w20, [x8, x9, lsl #2]
Lloh13:
	adrp	x22, _WRITE_SBUS_RECEIVER@GOTPAGE
Lloh14:
	ldr	x22, [x22, _WRITE_SBUS_RECEIVER@GOTPAGEOFF]
	ldr	w3, [x22]
	mov	x0, x19
	mov	x1, x20
	mov	w2, #7
	mov	w4, #17
	bl	_sbus_request
	mov	w0, #1
	bl	_udelay
	ldr	w3, [x22]
	mov	x0, x19
	mov	x1, x20
	mov	w2, #7
	mov	w4, #16
	bl	_sbus_request
	ldr	w3, [x22]
	mov	x0, x19
	mov	x1, x20
	mov	w2, #7
	mov	w4, #2
	bl	_sbus_request
	b	LBB0_7
LBB0_6:
Lloh15:
	adrp	x8, _SPICO_FABRIC@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SPICO_FABRIC@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_turn_off_spicos
Lloh18:
	adrp	x1, _fw_fabric@GOTPAGE
Lloh19:
	ldr	x1, [x1, _fw_fabric@GOTPAGEOFF]
	mov	x0, x19
	bl	_load_fabric_serdes_firmware
LBB0_7:
	mov	x0, x19
	bl	_clear_sbus_fast_mode
	ldr	w1, [x21]
	mov	x0, x19
	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
	b	_release_chip_resource
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_fw_fabric_serdes_load,4,2      ; @fw_fabric_serdes_load
	.comm	_CR_SBUS,4,2                    ; @CR_SBUS
	.comm	_SBUS_TIMEOUT,4,2               ; @SBUS_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot acquire SBus resource to reset fabric SerDes - perhaps you should reboot\n"

	.comm	_fabric_serdes_broadcast,8,3    ; @fabric_serdes_broadcast
	.comm	_WRITE_SBUS_RECEIVER,4,2        ; @WRITE_SBUS_RECEIVER
	.comm	_SPICO_FABRIC,4,2               ; @SPICO_FABRIC
	.comm	_fw_fabric,4,2                  ; @fw_fabric
.subsections_via_symbols
