	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlxsw_sp_ports_create
_mlxsw_sp_ports_create:                 ## @mlxsw_sp_ports_create
	.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, %r15
	movl	16(%rdi), %edi
	callq	_mlxsw_core_max_ports
	movl	%eax, %r14d
	leaq	(,%r14,8), %rdi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_kzalloc
	movq	%rax, (%r15)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movl	(%rbx), %edx
	movl	%r14d, %edi
	movl	$4, %esi
	callq	_kmalloc_array
	movq	%rax, 8(%r15)
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%r15, %rdi
	callq	_mlxsw_sp_cpu_port_create
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_5
LBB0_16:
	movq	8(%r15), %rdi
	callq	_kfree
	jmp	LBB0_17
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_18
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_17:
	movq	(%r15), %rdi
	callq	_kfree
LBB0_18:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	xorl	%ebx, %ebx
	cmpl	$2, %r14d
	jb	LBB0_18
## %bb.6:
	movl	$1, %r12d
	movl	$-2, %r13d
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_7 Depth=1
	incq	%r12
	decl	%r13d
	xorl	%ebx, %ebx
	cmpq	%r12, %r14
	je	LBB0_18
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rax
	movl	$-1, (%rax,%r12,4)
	movq	%r15, %rdi
	movl	%r12d, %esi
	leaq	-48(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	leaq	-52(%rbp), %r8
	callq	_mlxsw_sp_port_module_info_get
	testl	%eax, %eax
	jne	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	cmpl	$0, -44(%rbp)
	je	LBB0_19
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	-48(%rbp), %eax
	movq	8(%r15), %rcx
	movl	%eax, (%rcx,%r12,4)
	movl	-48(%rbp), %ecx
	movl	-44(%rbp), %r8d
	movl	-52(%rbp), %r9d
	movq	%r15, %rdi
	movl	%r12d, %esi
	xorl	%edx, %edx
	callq	_mlxsw_sp_port_create
	testl	%eax, %eax
	je	LBB0_19
LBB0_10:
	movl	%eax, %ebx
	cmpl	$2, %r12d
	jb	LBB0_15
## %bb.11:
	negl	%r13d
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_12 Depth=1
	decl	%r13d
	cmpl	$2, %r13d
	jle	LBB0_15
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	leal	-2(%r13), %r14d
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_mlxsw_sp_port_created
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_mlxsw_sp_port_remove
	jmp	LBB0_14
LBB0_15:
	movq	%r15, %rdi
	callq	_mlxsw_sp_cpu_port_remove
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_mlxsw_sp_ports_create
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlxsw_sp_ports_create
_mlxsw_sp_ports_create:                 ; @mlxsw_sp_ports_create
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	w0, [x0, #16]
	bl	_mlxsw_core_max_ports
	mov	w21, w0
	lsl	x0, x21, #3
Lloh0:
	adrp	x20, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x20, [x20, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x20]
	bl	_kzalloc
	str	x0, [x19]
	cbz	x0, LBB0_4
; %bb.1:
	ldr	w2, [x20]
	mov	x0, x21
	mov	w1, #4
	bl	_kmalloc_array
	str	x0, [x19, #8]
	cbz	x0, LBB0_5
; %bb.2:
	mov	x0, x19
	bl	_mlxsw_sp_cpu_port_create
	mov	x20, x0
	cbz	w0, LBB0_8
LBB0_3:
	ldr	x0, [x19, #8]
	bl	_kfree
	b	LBB0_6
LBB0_4:
Lloh2:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_7
LBB0_5:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_6:
	ldr	x0, [x19]
	bl	_kfree
LBB0_7:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_8:
	cmp	w21, #2
	b.lo	LBB0_19
; %bb.9:
	mov	x22, #0
	sub	x23, x21, #1
	mov	w24, #-1
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	mov	w20, #0
	add	x22, x22, #1
	cmp	x23, x22
	b.eq	LBB0_7
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x8, x8, x22, lsl #2
	str	w24, [x8, #4]
	add	x21, x22, #1
	add	x2, sp, #12
	add	x3, sp, #8
	add	x4, sp, #4
	mov	x0, x19
	mov	x1, x21
	bl	_mlxsw_sp_port_module_info_get
	cbnz	w0, LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	w8, [sp, #8]
	cbz	w8, LBB0_10
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	w8, [sp, #12]
	ldr	x9, [x19, #8]
	add	x9, x9, x22, lsl #2
	str	w8, [x9, #4]
	ldp	w4, w3, [sp, #8]
	ldr	w5, [sp, #4]
	mov	x0, x19
	mov	x1, x21
	mov	w2, #0
	bl	_mlxsw_sp_port_create
	cbz	w0, LBB0_10
LBB0_14:
	mov	x20, x0
	add	w8, w22, #1
	cmp	w8, #2
	b.lo	LBB0_20
; %bb.15:
	add	x22, x22, #2
	b	LBB0_17
LBB0_16:                                ;   in Loop: Header=BB0_17 Depth=1
	sub	w22, w22, #1
	cmp	w22, #2
	b.le	LBB0_20
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	sub	w21, w22, #2
	mov	x0, x19
	mov	x1, x21
	bl	_mlxsw_sp_port_created
	cbz	x0, LBB0_16
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	_mlxsw_sp_port_remove
	b	LBB0_16
LBB0_19:
	mov	w20, #0
	b	LBB0_7
LBB0_20:
	mov	x0, x19
	bl	_mlxsw_sp_cpu_port_remove
	b	LBB0_3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_mlxsw_sp_ports_create
.subsections_via_symbols
