	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlxsw_sp_qdisc_prio_replace
_mlxsw_sp_qdisc_prio_replace:           ## @mlxsw_sp_qdisc_prio_replace
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	cmpl	$0, (%rdx)
	movl	$0, %ebx
	jle	LBB0_9
## %bb.1:
	movq	%rdx, %r12
	xorl	%ebx, %ebx
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_2 Depth=1
	incl	%ebx
	cmpl	(%r12), %ebx
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	jge	LBB0_9
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movl	%ebx, %edi
	callq	_MLXSW_SP_PRIO_BAND_TO_TCLASS
	movq	(%r13), %r15
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	cltq
	shlq	$4, %rax
	leaq	(%r15,%rax), %r13
	movl	(%r15,%rax), %r14d
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	$0, (%r15,%rax)
	movq	_IEEE_8021QAZ_MAX_TCS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	movl	$0, %eax
	jle	LBB0_13
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=2
	incq	%r15
	movq	_IEEE_8021QAZ_MAX_TCS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %r15
	jge	LBB0_12
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%r12), %rax
	cmpl	%ebx, (%rax,%r15,4)
	jne	LBB0_11
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	%r15d, %edi
	callq	_BIT
	orl	%eax, (%r13)
	movl	%r15d, %edi
	callq	_BIT
	testl	%r14d, %eax
	jne	LBB0_11
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_mlxsw_sp_port_prio_tc_set
	testl	%eax, %eax
	je	LBB0_11
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r13), %eax
	movq	-72(%rbp), %r15                 ## 8-byte Reload
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	cmpl	%eax, %r14d
	je	LBB0_17
## %bb.14:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	8(%r15,%rax), %rax
	testq	%rax, %rax
	je	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movl	4(%r15,%r14), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	callq	*%rax
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 4(%r15,%r14)
	jmp	LBB0_17
LBB0_9:
	movq	_IEEE_8021QAZ_MAX_TCS@GOTPCREL(%rip), %r14
	cmpl	(%r14), %ebx
	movl	$0, %r15d
	jge	LBB0_8
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_MLXSW_SP_PRIO_BAND_TO_TCLASS
	movq	(%r13), %rcx
	cltq
	shlq	$4, %rax
	leaq	(%rcx,%rax), %rsi
	movl	$0, (%rcx,%rax)
	movq	%r13, %rdi
	callq	_mlxsw_sp_qdisc_destroy
	incl	%ebx
	cmpl	(%r14), %ebx
	jl	LBB0_10
	jmp	LBB0_8
LBB0_7:
	movl	%eax, %r15d
LBB0_8:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IEEE_8021QAZ_MAX_TCS,4,2       ## @IEEE_8021QAZ_MAX_TCS
	.no_dead_strip	_mlxsw_sp_qdisc_prio_replace
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlxsw_sp_qdisc_prio_replace
_mlxsw_sp_qdisc_prio_replace:           ; @mlxsw_sp_qdisc_prio_replace
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	ldr	w8, [x2]
Lloh0:
	adrp	x25, _IEEE_8021QAZ_MAX_TCS@GOTPAGE
Lloh1:
	ldr	x25, [x25, _IEEE_8021QAZ_MAX_TCS@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.1:
	mov	x21, x2
	mov	w20, #0
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w20, w20, #1
	ldr	w8, [x21]
	cmp	w20, w8
	b.ge	LBB0_16
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	mov	x0, x20
	bl	_MLXSW_SP_PRIO_BAND_TO_TCLASS
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	x26, [x19]
	sxtw	x23, w0
	add	x22, x26, w0, sxtw #4
	ldr	w27, [x22]
	str	wzr, [x22]
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x24, #0
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=2
	add	x24, x24, #1
	ldrsw	x8, [x25]
	cmp	x24, x8
	b.ge	LBB0_9
LBB0_6:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x21, #8]
	ldr	w8, [x8, x24, lsl #2]
	cmp	w8, w20
	b.ne	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	mov	x0, x24
	bl	_BIT
	ldr	w8, [x22]
	orr	w8, w8, w0
	str	w8, [x22]
	mov	x0, x24
	bl	_BIT
	tst	w0, w27
	b.ne	LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=2
	mov	x0, x19
	mov	x1, x24
	mov	x2, x23
	bl	_mlxsw_sp_port_prio_tc_set
	cbz	w0, LBB0_5
	b	LBB0_18
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x22]
	cmp	w27, w8
	b.eq	LBB0_2
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w8, #0
	cmp	w27, w8
	b.eq	LBB0_2
LBB0_11:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x8, x26, x23, lsl #4
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_2
; %bb.12:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.13:                               ;   in Loop: Header=BB0_3 Depth=1
	add	x23, x26, x23, lsl #4
	ldr	w24, [x23, #4]
	mov	x0, x19
	mov	x1, x22
	blr	x8
	str	w24, [x23, #4]
	b	LBB0_2
LBB0_14:
	mov	w20, #0
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=1
	mov	x0, x20
	bl	_MLXSW_SP_PRIO_BAND_TO_TCLASS
	ldr	x8, [x19]
	add	x1, x8, w0, sxtw #4
	str	wzr, [x1]
	mov	x0, x19
	bl	_mlxsw_sp_qdisc_destroy
	add	w20, w20, #1
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x25]
	cmp	w20, w8
	b.lt	LBB0_15
; %bb.17:
	mov	w0, #0
LBB0_18:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_IEEE_8021QAZ_MAX_TCS,4,2       ; @IEEE_8021QAZ_MAX_TCS
	.no_dead_strip	_mlxsw_sp_qdisc_prio_replace
.subsections_via_symbols
