	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function octeon_mgmt_reset_hw
_octeon_mgmt_reset_hw:                  ## @octeon_mgmt_reset_hw
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	_MIX_CTL@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	addq	8(%rbx), %rdi
	xorl	%esi, %esi
	callq	_cvmx_write_csr
	movq	(%r14), %rdi
	addq	8(%rbx), %rdi
	callq	_cvmx_read_csr
	movabsq	$-4294967296, %rsi              ## imm = 0xFFFFFFFF00000000
	andq	%rax, %rsi
	orq	$1, %rsi
	movq	(%r14), %rdi
	addq	8(%rbx), %rdi
	callq	_cvmx_write_csr
	movq	(%r14), %rdi
	addq	8(%rbx), %rdi
	callq	_cvmx_read_csr
	movl	$64, %edi
	callq	_octeon_io_clk_delay
	movq	_MIX_BIST@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%rbx), %rdi
	callq	_cvmx_read_csr
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movq	%rax, %rdx
	callq	_dev_warn
LBB0_2:
	movq	_CVMX_AGL_GMX_BIST@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_cvmx_read_csr
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movl	(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%rax, %rdx
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_dev_warn                       ## TAILCALL
LBB0_3:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MIX_CTL,8,3                    ## @MIX_CTL
	.comm	_MIX_BIST,8,3                   ## @MIX_BIST
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MIX failed BIST (0x%016llx)\n"

	.comm	_CVMX_AGL_GMX_BIST,8,3          ## @CVMX_AGL_GMX_BIST
L_.str.1:                               ## @.str.1
	.asciz	"AGL failed BIST (0x%016llx)\n"

	.no_dead_strip	_octeon_mgmt_reset_hw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function octeon_mgmt_reset_hw
_octeon_mgmt_reset_hw:                  ; @octeon_mgmt_reset_hw
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x20, _MIX_CTL@GOTPAGE
Lloh1:
	ldr	x20, [x20, _MIX_CTL@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x0, x9, x8
	mov	x1, #0
	bl	_cvmx_write_csr
	ldr	x8, [x19, #8]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_cvmx_read_csr
	and	x8, x0, #0xffffffff00000000
	orr	x1, x8, #0x1
	ldr	x8, [x19, #8]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_cvmx_write_csr
	ldr	x8, [x19, #8]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_cvmx_read_csr
	mov	w0, #64
	bl	_octeon_io_clk_delay
	ldr	x8, [x19, #8]
Lloh2:
	adrp	x9, _MIX_BIST@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MIX_BIST@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_cvmx_read_csr
	cbz	x0, LBB0_2
; %bb.1:
	mov	x2, x0
	ldr	w0, [x19]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
LBB0_2:
Lloh7:
	adrp	x8, _CVMX_AGL_GMX_BIST@GOTPAGE
Lloh8:
	ldr	x8, [x8, _CVMX_AGL_GMX_BIST@GOTPAGEOFF]
Lloh9:
	ldr	x0, [x8]
	bl	_cvmx_read_csr
	cbz	x0, LBB0_4
; %bb.3:
	mov	x2, x0
	ldr	w0, [x19]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_dev_warn
LBB0_4:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_MIX_CTL,8,3                    ; @MIX_CTL
	.comm	_MIX_BIST,8,3                   ; @MIX_BIST
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MIX failed BIST (0x%016llx)\n"

	.comm	_CVMX_AGL_GMX_BIST,8,3          ; @CVMX_AGL_GMX_BIST
l_.str.1:                               ; @.str.1
	.asciz	"AGL failed BIST (0x%016llx)\n"

	.no_dead_strip	_octeon_mgmt_reset_hw
.subsections_via_symbols
