	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlxsw_sp_sb_occ_max_clear      ## -- Begin function mlxsw_sp_sb_occ_max_clear
	.p2align	4, 0x90
_mlxsw_sp_sb_occ_max_clear:             ## @mlxsw_sp_sb_occ_max_clear
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_mlxsw_core_driver_priv
	movq	%rax, %r14
	movq	_bulk_list@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_LIST_HEAD
	movq	_MLXSW_REG_SBSR_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	_MLXSW_PORT_CPU_PORT@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	movq	_MLXSW_SP_SB_ING_TC_COUNT@GOTPCREL(%rip), %r13
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
                                        ##     Child Loop BB0_8 Depth 2
                                        ##     Child Loop BB0_11 Depth 2
                                        ##       Child Loop BB0_17 Depth 3
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_mlxsw_reg_sbsr_pack
	cmpl	$0, (%r13)
	jle	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	$1, %edx
	callq	_mlxsw_reg_sbsr_pg_buff_mask_set
	incl	%ebx
	cmpl	(%r13), %ebx
	jl	LBB0_5
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_MLXSW_SP_SB_EG_TC_COUNT@GOTPCREL(%rip), %r13
	cmpl	$0, (%r13)
	jle	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	$1, %edx
	callq	_mlxsw_reg_sbsr_tclass_mask_set
	incl	%ebx
	cmpl	(%r13), %ebx
	jl	LBB0_8
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	callq	_mlxsw_core_max_ports
	cmpq	%rax, %r12
	jae	LBB0_20
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	xorl	%ebx, %ebx
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_11 Depth=2
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	incl	%ebx
	movq	_MASKED_COUNT_MAX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	je	LBB0_20
LBB0_19:                                ##   in Loop: Header=BB0_11 Depth=2
	incq	%r12
	movq	%r13, %rdi
	callq	_mlxsw_core_max_ports
	cmpq	%rax, %r12
	jae	LBB0_20
LBB0_11:                                ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_17 Depth 3
	movq	8(%r14), %rax
	cmpl	$0, (%rax,%r12,4)
	je	LBB0_19
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=2
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	_MLXSW_PORT_CPU_PORT@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=2
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	$1, %edx
	callq	_mlxsw_reg_sbsr_ingress_port_mask_set
LBB0_14:                                ##   in Loop: Header=BB0_11 Depth=2
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	$1, %edx
	callq	_mlxsw_reg_sbsr_egress_port_mask_set
	movq	(%r14), %rax
	cmpl	$0, (%rax)
	jle	LBB0_18
## %bb.15:                              ##   in Loop: Header=BB0_11 Depth=2
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_17:                                ##   Parent Loop BB0_3 Depth=1
                                        ##     Parent Loop BB0_11 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	%r13d, %edx
	movq	_bulk_list@GOTPCREL(%rip), %rcx
	callq	_mlxsw_sp_sb_pm_occ_clear
	testl	%eax, %eax
	jne	LBB0_21
## %bb.16:                              ##   in Loop: Header=BB0_17 Depth=3
	movq	%r14, %rcx
	incl	%r13d
	movq	(%r14), %rax
	cmpl	(%rax), %r13d
	jl	LBB0_17
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rbx
	movq	_sbsr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_MLXSW_REG
	movq	%r13, %rdi
	movl	%eax, %esi
	movq	%r15, %rdx
	movq	_bulk_list@GOTPCREL(%rip), %rcx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_mlxsw_reg_trans_query
	testl	%eax, %eax
	jne	LBB0_21
## %bb.22:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, %rdi
	callq	_mlxsw_core_max_ports
	leaq	1(%r12), %rcx
	cmpq	%rax, %r12
	movq	%rcx, %r12
	movq	%rbx, %r14
	movq	_MLXSW_SP_SB_ING_TC_COUNT@GOTPCREL(%rip), %r13
	jb	LBB0_3
## %bb.23:
	movq	_bulk_list@GOTPCREL(%rip), %rdi
	callq	_mlxsw_reg_trans_bulk_wait
	movl	%eax, %r14d
	jmp	LBB0_24
LBB0_21:
	movl	%eax, %r14d
	movq	_bulk_list@GOTPCREL(%rip), %rdi
	callq	_mlxsw_reg_trans_bulk_wait
LBB0_24:
	movq	%r15, %rdi
	callq	_kfree
	jmp	LBB0_25
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_25:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_bulk_list,4,2                  ## @bulk_list
	.comm	_MLXSW_REG_SBSR_LEN,4,2         ## @MLXSW_REG_SBSR_LEN
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MLXSW_PORT_CPU_PORT,8,3        ## @MLXSW_PORT_CPU_PORT
	.comm	_MLXSW_SP_SB_ING_TC_COUNT,4,2   ## @MLXSW_SP_SB_ING_TC_COUNT
	.comm	_MLXSW_SP_SB_EG_TC_COUNT,4,2    ## @MLXSW_SP_SB_EG_TC_COUNT
	.comm	_MASKED_COUNT_MAX,4,2           ## @MASKED_COUNT_MAX
	.comm	_sbsr,4,2                       ## @sbsr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlxsw_sp_sb_occ_max_clear      ; -- Begin function mlxsw_sp_sb_occ_max_clear
	.p2align	2
_mlxsw_sp_sb_occ_max_clear:             ; @mlxsw_sp_sb_occ_max_clear
	.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	x20, x0
	bl	_mlxsw_core_driver_priv
	mov	x21, x0
Lloh0:
	adrp	x8, _bulk_list@GOTPAGE
Lloh1:
	ldr	x8, [x8, _bulk_list@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_LIST_HEAD
Lloh3:
	adrp	x8, _MLXSW_REG_SBSR_LEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MLXSW_REG_SBSR_LEN@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_kmalloc
	cbz	x0, LBB0_24
; %bb.1:
	mov	x19, x0
Lloh9:
	adrp	x8, _MLXSW_PORT_CPU_PORT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MLXSW_PORT_CPU_PORT@GOTPAGEOFF]
Lloh11:
	ldr	x22, [x8]
Lloh12:
	adrp	x27, _MLXSW_SP_SB_ING_TC_COUNT@GOTPAGE
Lloh13:
	ldr	x27, [x27, _MLXSW_SP_SB_ING_TC_COUNT@GOTPAGEOFF]
Lloh14:
	adrp	x28, _MLXSW_SP_SB_EG_TC_COUNT@GOTPAGE
Lloh15:
	ldr	x28, [x28, _MLXSW_SP_SB_EG_TC_COUNT@GOTPAGEOFF]
Lloh16:
	adrp	x23, _bulk_list@GOTPAGE
Lloh17:
	ldr	x23, [x23, _bulk_list@GOTPAGEOFF]
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
                                        ;     Child Loop BB0_7 Depth 2
                                        ;     Child Loop BB0_12 Depth 2
                                        ;       Child Loop BB0_17 Depth 3
	mov	x0, x19
	mov	w1, #1
	bl	_mlxsw_reg_sbsr_pack
	ldr	w8, [x27]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w24, #0
LBB0_4:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x19
	mov	x1, x24
	mov	w2, #1
	bl	_mlxsw_reg_sbsr_pg_buff_mask_set
	add	w24, w24, #1
	ldr	w8, [x27]
	cmp	w24, w8
	b.lt	LBB0_4
LBB0_5:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [x28]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w24, #0
LBB0_7:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x19
	mov	x1, x24
	mov	w2, #1
	bl	_mlxsw_reg_sbsr_tclass_mask_set
	add	w24, w24, #1
	ldr	w8, [x28]
	cmp	w24, w8
	b.lt	LBB0_7
LBB0_8:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x20
	bl	_mlxsw_core_max_ports
	cmp	x22, x0
	b.hs	LBB0_19
; %bb.9:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w26, #0
	b	LBB0_12
LBB0_10:                                ;   in Loop: Header=BB0_12 Depth=2
	add	w26, w26, #1
Lloh18:
	adrp	x8, _MASKED_COUNT_MAX@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MASKED_COUNT_MAX@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	cmp	w26, w8
	b.eq	LBB0_19
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=2
	add	x22, x22, #1
	mov	x0, x20
	bl	_mlxsw_core_max_ports
	cmp	x22, x0
	b.hs	LBB0_19
LBB0_12:                                ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_17 Depth 3
	ldr	x8, [x21, #8]
	ldr	w8, [x8, x22, lsl #2]
	cbz	w8, LBB0_11
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=2
Lloh21:
	adrp	x8, _MLXSW_PORT_CPU_PORT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MLXSW_PORT_CPU_PORT@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	cmp	x22, x8
	b.eq	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=2
	mov	x0, x19
	mov	x1, x22
	mov	w2, #1
	bl	_mlxsw_reg_sbsr_ingress_port_mask_set
LBB0_15:                                ;   in Loop: Header=BB0_12 Depth=2
	mov	x0, x19
	mov	x1, x22
	mov	w2, #1
	bl	_mlxsw_reg_sbsr_egress_port_mask_set
	ldr	x8, [x21]
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.16:                               ;   in Loop: Header=BB0_12 Depth=2
	mov	w25, #0
LBB0_17:                                ;   Parent Loop BB0_2 Depth=1
                                        ;     Parent Loop BB0_12 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	mov	x0, x21
	mov	x1, x22
	mov	x2, x25
	mov	x3, x23
	bl	_mlxsw_sp_sb_pm_occ_clear
	cbnz	w0, LBB0_22
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=3
	add	w25, w25, #1
	ldr	x8, [x21]
	ldr	w8, [x8]
	cmp	w25, w8
	b.lt	LBB0_17
	b	LBB0_10
LBB0_19:                                ;   in Loop: Header=BB0_2 Depth=1
Lloh24:
	adrp	x8, _sbsr@GOTPAGE
Lloh25:
	ldr	x8, [x8, _sbsr@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	bl	_MLXSW_REG
	mov	x1, x0
	mov	x0, x20
	mov	x2, x19
	mov	x3, x23
	mov	x4, #0
	mov	w5, #0
	bl	_mlxsw_reg_trans_query
	cbnz	w0, LBB0_22
; %bb.20:                               ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x20
	bl	_mlxsw_core_max_ports
	add	x8, x22, #1
	cmp	x22, x0
	mov	x22, x8
	b.lo	LBB0_2
; %bb.21:
Lloh27:
	adrp	x0, _bulk_list@GOTPAGE
Lloh28:
	ldr	x0, [x0, _bulk_list@GOTPAGEOFF]
	bl	_mlxsw_reg_trans_bulk_wait
	mov	x24, x0
	b	LBB0_23
LBB0_22:
	mov	x24, x0
Lloh29:
	adrp	x0, _bulk_list@GOTPAGE
Lloh30:
	ldr	x0, [x0, _bulk_list@GOTPAGEOFF]
	bl	_mlxsw_reg_trans_bulk_wait
LBB0_23:
	mov	x0, x19
	bl	_kfree
	b	LBB0_25
LBB0_24:
Lloh31:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_25:
	mov	x0, x24
	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 AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_bulk_list,4,2                  ; @bulk_list
	.comm	_MLXSW_REG_SBSR_LEN,4,2         ; @MLXSW_REG_SBSR_LEN
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MLXSW_PORT_CPU_PORT,8,3        ; @MLXSW_PORT_CPU_PORT
	.comm	_MLXSW_SP_SB_ING_TC_COUNT,4,2   ; @MLXSW_SP_SB_ING_TC_COUNT
	.comm	_MLXSW_SP_SB_EG_TC_COUNT,4,2    ; @MLXSW_SP_SB_EG_TC_COUNT
	.comm	_MASKED_COUNT_MAX,4,2           ; @MASKED_COUNT_MAX
	.comm	_sbsr,4,2                       ; @sbsr
.subsections_via_symbols
