	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlx4_en_set_channels
_mlx4_en_set_channels:                  ## @mlx4_en_set_channels
	.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	%rsi, %rbx
	movq	%rdi, %r12
	callq	_netdev_priv
	cmpl	$0, (%rbx)
	je	LBB0_2
## %bb.1:
	cmpl	$0, 4(%rbx)
	je	LBB0_2
## %bb.4:
	movq	%rax, %r13
	movq	32(%rax), %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$40, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	8(%r13), %rax
	movq	_TX_XDP@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	$0, (%rax,%rcx,8)
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_7
## %bb.8:
	movl	4(%rbx), %r14d
	jmp	LBB0_9
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_19
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_7:
	xorl	%r14d, %r14d
LBB0_9:
	movq	16(%r13), %rsi
	movq	32(%r13), %rax
	movl	(%rsi), %ecx
	movl	(%rbx), %edx
	imull	%ecx, %edx
	addl	%r14d, %edx
	imull	4(%rax), %ecx
	cmpl	%ecx, %edx
	jle	LBB0_11
## %bb.10:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	_MAX_TX_RINGS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_en_err
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_18
LBB0_11:
	leaq	-72(%rbp), %rdi
	movl	$24, %edx
	callq	_memcpy
	movl	(%rbx), %eax
	movl	%eax, -72(%rbp)
	movq	16(%r13), %rcx
	imull	(%rcx), %eax
	movq	-64(%rbp), %rcx
	movq	_TX@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	%eax, (%rcx,%rdx,4)
	movq	_TX_XDP@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%r14d, (%rcx,%rax,4)
	movl	4(%rbx), %eax
	movl	%eax, -56(%rbp)
	movq	%r13, %rdi
	movq	%r15, %rsi
	leaq	-72(%rbp), %rdx
	movl	$1, %ecx
	callq	_mlx4_en_try_alloc_resources
	movl	%eax, %ebx
	testl	%eax, %eax
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	jne	LBB0_18
## %bb.12:
	movq	24(%r13), %rbx
	testq	%rbx, %rbx
	je	LBB0_14
## %bb.13:
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_mlx4_en_stop_port
LBB0_14:
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_mlx4_en_safe_replace_resources
	movq	(%r13), %rsi
	movq	%r12, %rdi
	callq	_netif_set_real_num_rx_queues
	movq	16(%r13), %rax
	movl	(%rax), %eax
	movq	_MLX4_EN_NUM_UP_LOW@GOTPCREL(%rip), %rcx
	xorl	%esi, %esi
	cmpl	(%rcx), %eax
	cmovnel	%eax, %esi
	movq	%r12, %rdi
	callq	_mlx4_en_setup_tc
	movq	8(%r13), %rax
	movq	_TX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rdx
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	callq	_en_warn
	movq	(%r13), %rdx
	leaq	L_.str.2(%rip), %rsi
	movq	%r13, %rdi
	callq	_en_warn
	testq	%rbx, %rbx
	je	LBB0_17
## %bb.15:
	movq	%r12, %rdi
	callq	_mlx4_en_start_port
	testl	%eax, %eax
	je	LBB0_17
## %bb.16:
	leaq	L_.str.3(%rip), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_en_err
LBB0_17:
	movq	%r13, %rdi
	callq	_mlx4_en_moderation_update
	movl	%eax, %ebx
LBB0_18:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	%r15, %rdi
	callq	_kfree
LBB0_19:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_TX_XDP,8,3                     ## @TX_XDP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Total number of TX and XDP rings (%d) exceeds the maximum supported (%d)\n"

	.comm	_MAX_TX_RINGS,4,2               ## @MAX_TX_RINGS
	.comm	_TX,8,3                         ## @TX
	.comm	_MLX4_EN_NUM_UP_LOW,4,2         ## @MLX4_EN_NUM_UP_LOW
L_.str.1:                               ## @.str.1
	.asciz	"Using %d TX rings\n"

L_.str.2:                               ## @.str.2
	.asciz	"Using %d RX rings\n"

L_.str.3:                               ## @.str.3
	.asciz	"Failed starting port\n"

	.no_dead_strip	_mlx4_en_set_channels
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlx4_en_set_channels
_mlx4_en_set_channels:                  ; @mlx4_en_set_channels
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x23, x1
	mov	x22, x0
	bl	_netdev_priv
	ldr	w8, [x23]
	cbz	w8, LBB0_5
; %bb.1:
	ldr	w8, [x23, #4]
	cbz	w8, LBB0_5
; %bb.2:
	mov	x21, x0
	ldr	x19, [x0, #32]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #40
	bl	_kzalloc
	cbz	x0, LBB0_7
; %bb.3:
	mov	x20, x0
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x21, #8]
Lloh3:
	adrp	x25, _TX_XDP@GOTPAGE
Lloh4:
	ldr	x25, [x25, _TX_XDP@GOTPAGEOFF]
	ldr	x9, [x25]
	ldr	x8, [x8, x9, lsl #3]
	cbz	x8, LBB0_8
; %bb.4:
	ldr	w26, [x23, #4]
	b	LBB0_9
LBB0_5:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_19
LBB0_7:
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_6
LBB0_8:
	mov	w26, #0
LBB0_9:
	ldr	w8, [x23]
	ldr	x1, [x21, #16]
	ldr	w9, [x1]
	madd	w8, w9, w8, w26
	ldr	x10, [x21, #32]
	ldr	w10, [x10, #4]
	mul	w9, w10, w9
	cmp	w8, w9
	b.le	LBB0_11
; %bb.10:
Lloh9:
	adrp	x9, _EINVAL@GOTPAGE
Lloh10:
	ldr	x9, [x9, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	neg	w23, w9
Lloh12:
	adrp	x9, _MAX_TX_RINGS@GOTPAGE
Lloh13:
	ldr	x9, [x9, _MAX_TX_RINGS@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	stp	x8, x9, [sp]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_en_err
	b	LBB0_18
LBB0_11:
	add	x0, sp, #24
	mov	w2, #24
	bl	_memcpy
	ldr	w8, [x23]
	str	w8, [sp, #24]
	ldr	x9, [x21, #16]
	ldr	w9, [x9]
	mul	w8, w9, w8
	ldr	x9, [sp, #32]
Lloh17:
	adrp	x24, _TX@GOTPAGE
Lloh18:
	ldr	x24, [x24, _TX@GOTPAGEOFF]
	ldr	x10, [x24]
	str	w8, [x9, x10, lsl #2]
	ldr	x8, [x25]
	str	w26, [x9, x8, lsl #2]
	ldr	w8, [x23, #4]
	str	w8, [sp, #40]
	add	x2, sp, #24
	mov	x0, x21
	mov	x1, x20
	mov	w3, #1
	bl	_mlx4_en_try_alloc_resources
	mov	x23, x0
	cbnz	w0, LBB0_18
; %bb.12:
	ldr	x23, [x21, #24]
	cbz	x23, LBB0_14
; %bb.13:
	mov	x0, x22
	mov	w1, #1
	bl	_mlx4_en_stop_port
LBB0_14:
	mov	x0, x21
	mov	x1, x20
	bl	_mlx4_en_safe_replace_resources
	ldr	x1, [x21]
	mov	x0, x22
	bl	_netif_set_real_num_rx_queues
	ldr	x8, [x21, #16]
	ldr	w8, [x8]
Lloh19:
	adrp	x9, _MLX4_EN_NUM_UP_LOW@GOTPAGE
Lloh20:
	ldr	x9, [x9, _MLX4_EN_NUM_UP_LOW@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	cmp	w8, w9
	csel	w1, wzr, w8, eq
	mov	x0, x22
	bl	_mlx4_en_setup_tc
	ldr	x8, [x21, #8]
	ldr	x9, [x24]
	ldr	x2, [x8, x9, lsl #3]
Lloh22:
	adrp	x1, l_.str.1@PAGE
Lloh23:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_en_warn
	ldr	x2, [x21]
Lloh24:
	adrp	x1, l_.str.2@PAGE
Lloh25:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_en_warn
	cbz	x23, LBB0_17
; %bb.15:
	mov	x0, x22
	bl	_mlx4_en_start_port
	cbz	w0, LBB0_17
; %bb.16:
Lloh26:
	adrp	x1, l_.str.3@PAGE
Lloh27:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_en_err
LBB0_17:
	mov	x0, x21
	bl	_mlx4_en_moderation_update
	mov	x23, x0
LBB0_18:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	bl	_kfree
LBB0_19:
	mov	x0, x23
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_TX_XDP,8,3                     ; @TX_XDP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Total number of TX and XDP rings (%d) exceeds the maximum supported (%d)\n"

	.comm	_MAX_TX_RINGS,4,2               ; @MAX_TX_RINGS
	.comm	_TX,8,3                         ; @TX
	.comm	_MLX4_EN_NUM_UP_LOW,4,2         ; @MLX4_EN_NUM_UP_LOW
l_.str.1:                               ; @.str.1
	.asciz	"Using %d TX rings\n"

l_.str.2:                               ; @.str.2
	.asciz	"Using %d RX rings\n"

l_.str.3:                               ; @.str.3
	.asciz	"Failed starting port\n"

	.no_dead_strip	_mlx4_en_set_channels
.subsections_via_symbols
