	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function octeon_mgmt_update_link
_octeon_mgmt_update_link:               ## @octeon_mgmt_update_link
	.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, %r14
	movq	16(%rdi), %rax
	movq	(%rax), %r12
	movq	_AGL_GMX_PRT_CFG@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	addq	(%r14), %rdi
	callq	_cvmx_read_csr
	movq	%rax, %rbx
	cmpl	$0, 8(%r12)
	je	LBB0_1
## %bb.2:
	movl	(%r12), %r15d
	jmp	LBB0_3
LBB0_1:
	movl	$1, %r15d
LBB0_3:
	movabsq	$-4294967296, %rcx              ## imm = 0xFFFFFFFF00000000
	movl	4(%r12), %eax
	cmpl	$10, %eax
	je	LBB0_8
## %bb.4:
	cmpl	$100, %eax
	je	LBB0_8
## %bb.5:
	andq	%rcx, %rbx
	orq	%r15, %rbx
	cmpl	$1000, %eax                     ## imm = 0x3E8
	jne	LBB0_6
## %bb.7:
	movq	_OCTEON_CN6XXX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_OCTEON_IS_MODEL
	movabsq	$4294967296, %rcx               ## imm = 0x100000000
	orq	%rcx, %r15
	testq	%rax, %rax
	cmoveq	%rbx, %r15
	jmp	LBB0_9
LBB0_8:
	movq	_OCTEON_CN6XXX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_OCTEON_IS_MODEL
	jmp	LBB0_9
LBB0_6:
	movq	%rbx, %r15
LBB0_9:
	movq	(%r13), %rdi
	addq	(%r14), %rdi
	movq	%r15, %rsi
	callq	_cvmx_write_csr
	movq	(%r13), %rdi
	addq	(%r14), %rdi
	callq	_cvmx_read_csr
	movq	_OCTEON_CN6XXX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_OCTEON_IS_MODEL
	testq	%rax, %rax
	je	LBB0_17
## %bb.10:
	movq	8(%r14), %rdi
	callq	_cvmx_read_csr
	movq	%rax, %rbx
	movq	_AGL_GMX_TX_CLK@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	addq	(%r14), %rdi
	callq	_cvmx_read_csr
	movabsq	$-4294967296, %rcx              ## imm = 0xFFFFFFFF00000000
	andq	%rcx, %rax
	movq	%rax, %rsi
	orq	$1, %rsi
	testq	%rbx, %rbx
	jne	LBB0_16
## %bb.11:
	movl	4(%r12), %ecx
	cmpl	$100, %ecx
	je	LBB0_14
## %bb.12:
	cmpl	$10, %ecx
	jne	LBB0_16
## %bb.13:
	orq	$50, %rax
	jmp	LBB0_15
LBB0_17:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	orq	$5, %rax
LBB0_15:
	movq	%rax, %rsi
LBB0_16:
	movq	(%r15), %rdi
	addq	(%r14), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_cvmx_write_csr                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AGL_GMX_PRT_CFG,8,3            ## @AGL_GMX_PRT_CFG
	.comm	_OCTEON_CN6XXX,4,2              ## @OCTEON_CN6XXX
	.comm	_AGL_GMX_TX_CLK,8,3             ## @AGL_GMX_TX_CLK
	.no_dead_strip	_octeon_mgmt_update_link
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function octeon_mgmt_update_link
_octeon_mgmt_update_link:               ; @octeon_mgmt_update_link
	.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, #16]
	ldr	x21, [x8]
	ldr	x8, [x0]
Lloh0:
	adrp	x22, _AGL_GMX_PRT_CFG@GOTPAGE
Lloh1:
	ldr	x22, [x22, _AGL_GMX_PRT_CFG@GOTPAGEOFF]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_cvmx_read_csr
	ldr	w8, [x21, #8]
	cbz	w8, LBB0_2
; %bb.1:
	ldr	w24, [x21]
	b	LBB0_3
LBB0_2:
	mov	w24, #1
LBB0_3:
	ldr	w8, [x21, #4]
Lloh2:
	adrp	x23, _OCTEON_CN6XXX@GOTPAGE
Lloh3:
	ldr	x23, [x23, _OCTEON_CN6XXX@GOTPAGEOFF]
	cmp	w8, #10
	b.eq	LBB0_7
; %bb.4:
	cmp	w8, #100
	b.eq	LBB0_7
; %bb.5:
	and	x9, x0, #0xffffffff00000000
	orr	x20, x9, x24
	cmp	w8, #1000
	b.ne	LBB0_8
; %bb.6:
	ldr	w0, [x23]
	bl	_OCTEON_IS_MODEL
	orr	x8, x24, #0x100000000
	cmp	x0, #0
	csel	x20, x20, x8, eq
	b	LBB0_8
LBB0_7:
	ldr	w0, [x23]
	bl	_OCTEON_IS_MODEL
	mov	x20, x24
LBB0_8:
	ldr	x8, [x19]
	ldr	x9, [x22]
	add	x0, x9, x8
	mov	x1, x20
	bl	_cvmx_write_csr
	ldr	x8, [x19]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_cvmx_read_csr
	ldr	w0, [x23]
	bl	_OCTEON_IS_MODEL
	cbz	x0, LBB0_12
; %bb.9:
	ldr	x0, [x19, #8]
	bl	_cvmx_read_csr
	mov	x20, x0
	ldr	x8, [x19]
Lloh4:
	adrp	x22, _AGL_GMX_TX_CLK@GOTPAGE
Lloh5:
	ldr	x22, [x22, _AGL_GMX_TX_CLK@GOTPAGEOFF]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_cvmx_read_csr
	and	x8, x0, #0xffffffff00000000
	orr	x1, x8, #0x1
	cbnz	x20, LBB0_11
; %bb.10:
	ldr	w9, [x21, #4]
	mov	w10, #5
	orr	x10, x8, x10
	cmp	w9, #10
	mov	w11, #50
	orr	x8, x8, x11
	csel	x8, x1, x8, ne
	cmp	w9, #100
	csel	x1, x10, x8, eq
LBB0_11:
	ldr	x8, [x19]
	ldr	x9, [x22]
	add	x0, x9, x8
	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	_cvmx_write_csr
LBB0_12:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_AGL_GMX_PRT_CFG,8,3            ; @AGL_GMX_PRT_CFG
	.comm	_OCTEON_CN6XXX,4,2              ; @OCTEON_CN6XXX
	.comm	_AGL_GMX_TX_CLK,8,3             ; @AGL_GMX_TX_CLK
	.no_dead_strip	_octeon_mgmt_update_link
.subsections_via_symbols
