	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlxsw_sp_mc_write_mdb_entry
_mlxsw_sp_mc_write_mdb_entry:           ## @mlxsw_sp_mc_write_mdb_entry
	.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	%rdx, %r15
	movq	%rsi, %r14
	movq	%rdi, %r13
	movq	(%rdi), %rax
	movl	(%rax), %edi
	movq	_MLXSW_SP_MID_MAX@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rsi
	callq	_find_first_zero_bit
	movq	%rax, %r12
	xorl	%eax, %eax
	cmpq	(%rbx), %r12
	je	LBB0_7
## %bb.1:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %rbx
	movl	8(%r13), %edi
	callq	_mlxsw_core_max_ports
	movl	%eax, %r15d
	movl	%eax, %edi
	callq	_BITS_TO_LONGS
                                        ## kill: def $eax killed $eax def $rax
	leal	(,%rax,8), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movq	%rax, %r14
	movl	24(%rbx), %esi
	movq	%rax, %rdi
	movl	%r15d, %edx
	callq	_bitmap_copy
	movq	%r14, %rdi
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rsi
	movq	%r13, %rdx
	callq	_mlxsw_sp_mc_get_mrouters_bitmap
	movq	%r12, 16(%rbx)
	movl	(%r15), %ecx
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r14, %rdx
	callq	_mlxsw_sp_port_smid_full_entry
	movl	%eax, %r15d
	movq	%r14, %rdi
	callq	_kfree
	testl	%r15d, %r15d
	je	LBB0_5
LBB0_4:
	xorl	%eax, %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	4(%rbx), %edx
	movl	8(%rbx), %esi
	movq	%r13, %rdi
	movq	%r12, %rcx
	movl	$1, %r8d
	callq	_mlxsw_sp_port_mdb_op
	testl	%eax, %eax
	movl	$0, %eax
	jne	LBB0_7
## %bb.6:
	movq	(%r13), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_set_bit
	movl	$1, (%rbx)
	movl	$1, %eax
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_MLXSW_SP_MID_MAX,8,3           ## @MLXSW_SP_MID_MAX
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.no_dead_strip	_mlxsw_sp_mc_write_mdb_entry
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlxsw_sp_mc_write_mdb_entry
_mlxsw_sp_mc_write_mdb_entry:           ; @mlxsw_sp_mc_write_mdb_entry
	.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	x22, x2
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x0]
	ldr	w0, [x8]
Lloh0:
	adrp	x23, _MLXSW_SP_MID_MAX@GOTPAGE
Lloh1:
	ldr	x23, [x23, _MLXSW_SP_MID_MAX@GOTPAGEOFF]
	ldr	x1, [x23]
	bl	_find_first_zero_bit
	ldr	x8, [x23]
	cmp	x0, x8
	b.eq	LBB0_4
; %bb.1:
	mov	x21, x0
	ldr	w0, [x20, #8]
	bl	_mlxsw_core_max_ports
	mov	x24, x0
	bl	_BITS_TO_LONGS
	lsl	w0, w0, #3
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	bl	_kzalloc
	cbz	x0, LBB0_4
; %bb.2:
	mov	x23, x0
	ldr	w1, [x19, #24]
	mov	x2, x24
	bl	_bitmap_copy
	mov	x0, x23
	mov	x1, x22
	mov	x2, x20
	bl	_mlxsw_sp_mc_get_mrouters_bitmap
	str	x21, [x19, #16]
	ldr	w3, [x22]
	mov	x0, x20
	mov	x1, x21
	mov	x2, x23
	bl	_mlxsw_sp_port_smid_full_entry
	mov	x22, x0
	mov	x0, x23
	bl	_kfree
	cbnz	w22, LBB0_4
; %bb.3:
	ldp	w2, w1, [x19, #4]
	mov	w22, #1
	mov	x0, x20
	mov	x3, x21
	mov	w4, #1
	bl	_mlxsw_sp_port_mdb_op
	cbz	w0, LBB0_6
LBB0_4:
	mov	w22, #0
LBB0_5:
	mov	x0, x22
	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
LBB0_6:
	ldr	x8, [x20]
	ldr	w1, [x8]
	mov	x0, x21
	bl	_set_bit
	str	w22, [x19]
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_MLXSW_SP_MID_MAX,8,3           ; @MLXSW_SP_MID_MAX
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.no_dead_strip	_mlxsw_sp_mc_write_mdb_entry
.subsections_via_symbols
