	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __mlxsw_sp_mc_alloc
___mlxsw_sp_mc_alloc:                   ## @__mlxsw_sp_mc_alloc
	.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
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	%rdx, %r13
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movl	$32, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	movq	%rax, %rbx
	movl	(%r15), %edi
	callq	_mlxsw_core_max_ports
	movl	%eax, %edi
	callq	_BITS_TO_LONGS
	movslq	%eax, %rdi
	shlq	$3, %rdi
	movl	(%r12), %esi
	callq	_kzalloc
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_6
## %bb.2:
	movl	24(%rbx), %edi
	movq	%r13, %rsi
	callq	_ether_addr_copy
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 20(%rbx)
	movl	$0, (%rbx)
	cmpl	$0, 4(%r14)
	je	LBB0_4
## %bb.3:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_mlxsw_sp_mc_write_mdb_entry
	testl	%eax, %eax
	je	LBB0_5
LBB0_4:
	movq	%rbx, %rdi
	addq	$16, %rdi
	movq	%r14, %rsi
	callq	_list_add_tail
	jmp	LBB0_8
LBB0_5:
	movq	8(%rbx), %rdi
	callq	_kfree
LBB0_6:
	movq	%rbx, %rdi
	callq	_kfree
LBB0_7:
	xorl	%ebx, %ebx
LBB0_8:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.no_dead_strip	___mlxsw_sp_mc_alloc
.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_alloc
___mlxsw_sp_mc_alloc:                   ; @__mlxsw_sp_mc_alloc
	.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, x3
	mov	x23, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x24, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x24, [x24, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	w0, #32
	bl	_kzalloc
	mov	x19, x0
	cbz	x0, LBB0_7
; %bb.1:
	ldr	w0, [x21]
	bl	_mlxsw_core_max_ports
	bl	_BITS_TO_LONGS
                                        ; kill: def $w0 killed $w0 def $x0
	sbfiz	x0, x0, #3, #32
	ldr	w1, [x24]
	bl	_kzalloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_6
; %bb.2:
	ldr	w0, [x19, #24]
	mov	x1, x23
	bl	_ether_addr_copy
	str	w22, [x19, #20]
	str	wzr, [x19]
	ldr	w8, [x20, #4]
	cbz	w8, LBB0_4
; %bb.3:
	mov	x0, x21
	mov	x1, x19
	mov	x2, x20
	bl	_mlxsw_sp_mc_write_mdb_entry
	cbz	w0, LBB0_5
LBB0_4:
	add	x0, x19, #16
	mov	x1, x20
	bl	_list_add_tail
	b	LBB0_7
LBB0_5:
	ldr	x0, [x19, #8]
	bl	_kfree
LBB0_6:
	mov	x0, x19
	bl	_kfree
	mov	x19, #0
LBB0_7:
	mov	x0, x19
	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
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.no_dead_strip	___mlxsw_sp_mc_alloc
.subsections_via_symbols
