	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function niu_alloc_channels
LCPI0_0:
	.long	64                              ## 0x40
	.long	64                              ## 0x40
	.long	16                              ## 0x10
	.long	8                               ## 0x8
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_niu_alloc_channels:                    ## @niu_alloc_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	%rdi, %r10
	movq	40(%rdi), %rax
	movslq	(%rdi), %r9
	movq	(%rax), %rcx
	movq	8(%rax), %rdx
	movl	$0, %r15d
	movl	$0, %r14d
	testq	%r9, %r9
	jle	LBB0_11
## %bb.1:
	movl	%r9d, %esi
	cmpl	$8, %esi
	jae	LBB0_3
## %bb.2:
	xorl	%edi, %edi
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
	jmp	LBB0_10
LBB0_3:
	movl	%esi, %edi
	andl	$-8, %edi
	leaq	-8(%rdi), %rax
	movq	%rax, %r8
	shrq	$3, %r8
	incq	%r8
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%r8, %rax
	andq	$-2, %rax
	pxor	%xmm0, %xmm0
	xorl	%ebx, %ebx
	pxor	%xmm2, %xmm2
	pxor	%xmm1, %xmm1
	pxor	%xmm3, %xmm3
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	(%rcx,%rbx,4), %xmm4
	paddd	%xmm0, %xmm4
	movdqu	16(%rcx,%rbx,4), %xmm5
	paddd	%xmm2, %xmm5
	movdqu	32(%rcx,%rbx,4), %xmm0
	paddd	%xmm4, %xmm0
	movdqu	48(%rcx,%rbx,4), %xmm2
	paddd	%xmm5, %xmm2
	movdqu	(%rdx,%rbx,4), %xmm4
	paddd	%xmm1, %xmm4
	movdqu	16(%rdx,%rbx,4), %xmm5
	paddd	%xmm3, %xmm5
	movdqu	32(%rdx,%rbx,4), %xmm1
	paddd	%xmm4, %xmm1
	movdqu	48(%rdx,%rbx,4), %xmm3
	paddd	%xmm5, %xmm3
	addq	$16, %rbx
	addq	$-2, %rax
	jne	LBB0_6
## %bb.7:
	testb	$1, %r8b
	je	LBB0_9
LBB0_8:
	movdqu	(%rcx,%rbx,4), %xmm4
	paddd	%xmm4, %xmm0
	movdqu	16(%rcx,%rbx,4), %xmm4
	paddd	%xmm4, %xmm2
	movdqu	(%rdx,%rbx,4), %xmm4
	paddd	%xmm4, %xmm1
	movdqu	16(%rdx,%rbx,4), %xmm4
	paddd	%xmm4, %xmm3
LBB0_9:
	paddd	%xmm2, %xmm0
	paddd	%xmm3, %xmm1
	pshufd	$238, %xmm1, %xmm2              ## xmm2 = xmm1[2,3,2,3]
	paddd	%xmm1, %xmm2
	pshufd	$85, %xmm2, %xmm1               ## xmm1 = xmm2[1,1,1,1]
	paddd	%xmm2, %xmm1
	movd	%xmm1, %r15d
	pshufd	$238, %xmm0, %xmm1              ## xmm1 = xmm0[2,3,2,3]
	paddd	%xmm0, %xmm1
	pshufd	$85, %xmm1, %xmm0               ## xmm0 = xmm1[1,1,1,1]
	paddd	%xmm1, %xmm0
	movd	%xmm0, %r14d
	cmpq	%rsi, %rdi
	je	LBB0_11
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	addl	(%rcx,%rdi,4), %r14d
	addl	(%rdx,%rdi,4), %r15d
	incq	%rdi
	cmpq	%rdi, %rsi
	jne	LBB0_10
LBB0_11:
	movl	(%rcx,%r9,4), %ebx
	movl	(%rdx,%r9,4), %r13d
	movl	32(%r10), %edi
	movl	%r13d, %esi
	movq	%r10, -48(%rbp)                 ## 8-byte Spill
	callq	_netif_set_real_num_tx_queues
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%ebx, -56(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edi
	movl	$72, %esi
	callq	_kcalloc
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	testq	%rax, %rax
	je	LBB0_12
## %bb.13:
	movq	%rax, %r12
	movl	%r13d, -60(%rbp)                ## 4-byte Spill
	movl	-56(%rbp), %eax                 ## 4-byte Reload
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movl	%eax, 4(%rbx)
	xorl	%eax, %eax
	callq	_smp_wmb
	movq	%r12, 24(%rbx)
	cmpl	$0, 4(%rbx)
	jle	LBB0_21
## %bb.14:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, 64(%r12)
	movl	%r14d, (%r12)
	movq	%rbx, %rdi
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movq	%r12, %rsi
	callq	_niu_alloc_rx_ring_info
	movl	%eax, %r13d
	testl	%eax, %eax
	movq	%rbx, %rdi
	jne	LBB0_29
## %bb.15:
	movl	%r14d, %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	$72, %r13d
	movl	$1, %r14d
	xorl	%eax, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	callq	_niu_size_rbr
	movq	-40(%rbx,%r13), %rax
	movq	-32(%rbx,%r13), %rcx
	addq	$-64, %rcx
	movq	%rcx, -16(%rbx,%r13)
	movq	%rcx, -24(%rbx,%r13)
	movdqa	LCPI0_0(%rip), %xmm0            ## xmm0 = [64,64,16,8]
	movdqu	%xmm0, -68(%rbx,%r13)
	movq	_RBR_REFILL_MIN@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rax, %rcx
	cmovgq	%rcx, %rax
	movq	%rax, -48(%rbx,%r13)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	callq	_niu_rbr_fill
	testl	%eax, %eax
	jne	LBB0_20
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movslq	4(%rax), %rax
	cmpq	%rax, %r14
	jge	LBB0_21
## %bb.18:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	incq	%rax
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	24(%rdi), %rbx
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	(%rax,%rax,8), %rax
	leaq	(%rbx,%rax,8), %r12
	leaq	(%rbx,%r13), %rsi
	movq	%rdi, 64(%rbx,%r13)
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	addl	%r14d, %eax
	movl	%eax, (%rbx,%r13)
	callq	_niu_alloc_rx_ring_info
	addq	$72, %r13
	incq	%r14
	testl	%eax, %eax
	je	LBB0_16
## %bb.19:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %r13d
	jmp	LBB0_29
LBB0_12:
	xorl	%r13d, %r13d
	subl	(%rcx), %r13d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_29
LBB0_21:
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	-60(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edi
	movl	$16, %esi
	callq	_kcalloc
	testq	%rax, %rax
	je	LBB0_22
## %bb.23:
	movq	%rax, %r14
	movl	%ebx, 8(%r12)
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_smp_wmb
	movq	%r14, 16(%r12)
	cmpl	$0, 8(%r12)
	jle	LBB0_30
## %bb.24:
	movq	%r12, %rdi
	movq	%r12, 8(%r14)
	movl	%r15d, (%r14)
	movq	%r14, %rsi
	callq	_niu_alloc_tx_ring_info
	movq	%r12, %rdi
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_29
## %bb.25:
	movl	%r15d, %r14d
	movl	$16, %ebx
	movl	$1, %r15d
	.p2align	4, 0x90
LBB0_26:                                ## =>This Inner Loop Header: Depth=1
	movslq	8(%rdi), %rax
	cmpq	%rax, %r15
	jge	LBB0_27
## %bb.28:                              ##   in Loop: Header=BB0_26 Depth=1
	movq	16(%rdi), %rax
	leaq	(%rax,%rbx), %rsi
	movq	%rdi, 8(%rax,%rbx)
	leal	(%r14,%r15), %ecx
	movl	%ecx, (%rax,%rbx)
	callq	_niu_alloc_tx_ring_info
	movq	%r12, %rdi
	movl	%eax, %r13d
	addq	$16, %rbx
	incq	%r15
	testl	%eax, %eax
	je	LBB0_26
	jmp	LBB0_29
LBB0_4:
	pxor	%xmm0, %xmm0
	xorl	%ebx, %ebx
	pxor	%xmm2, %xmm2
	pxor	%xmm1, %xmm1
	pxor	%xmm3, %xmm3
	testb	$1, %r8b
	jne	LBB0_8
	jmp	LBB0_9
LBB0_22:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	movq	%r12, %rdi
LBB0_29:
	callq	_niu_free_channels
	movl	%r13d, %ebx
LBB0_30:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	movl	%eax, %ebx
	jmp	LBB0_30
LBB0_27:
	xorl	%ebx, %ebx
	jmp	LBB0_30
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_RBR_REFILL_MIN,8,3             ## @RBR_REFILL_MIN
	.no_dead_strip	_niu_alloc_channels
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; -- Begin function niu_alloc_channels
lCPI0_0:
	.long	64                              ; 0x40
	.long	64                              ; 0x40
	.long	16                              ; 0x10
	.long	8                               ; 0x8
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_niu_alloc_channels:                    ; @niu_alloc_channels
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x0
	ldr	x10, [x0, #40]
	ldr	w11, [x0]
	sxtw	x8, w11
	ldp	x9, x10, [x10]
	cmp	w11, #1
	b.lt	LBB0_3
; %bb.1:
	cmp	w11, #16
	b.hs	LBB0_4
; %bb.2:
	mov	x12, #0
	mov	w25, #0
	mov	w23, #0
	b	LBB0_7
LBB0_3:
	mov	w23, #0
	mov	w25, #0
	b	LBB0_9
LBB0_4:
	movi.2d	v0, #0000000000000000
	and	x12, x11, #0xfffffff0
	movi.2d	v1, #0000000000000000
	add	x13, x10, #32
	add	x14, x9, #32
	mov	x15, x12
	movi.2d	v3, #0000000000000000
	movi.2d	v2, #0000000000000000
	movi.2d	v4, #0000000000000000
	movi.2d	v5, #0000000000000000
	movi.2d	v6, #0000000000000000
	movi.2d	v7, #0000000000000000
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q16, q17, [x14, #-32]
	ldp	q18, q19, [x14], #64
	add.4s	v0, v16, v0
	add.4s	v1, v17, v1
	add.4s	v3, v18, v3
	add.4s	v2, v19, v2
	ldp	q16, q17, [x13, #-32]
	ldp	q18, q19, [x13], #64
	add.4s	v4, v16, v4
	add.4s	v5, v17, v5
	add.4s	v6, v18, v6
	add.4s	v7, v19, v7
	subs	x15, x15, #16
	b.ne	LBB0_5
; %bb.6:
	add.4s	v4, v5, v4
	add.4s	v4, v6, v4
	add.4s	v4, v7, v4
	addv.4s	s4, v4
	fmov	w23, s4
	add.4s	v0, v1, v0
	add.4s	v0, v3, v0
	add.4s	v0, v2, v0
	addv.4s	s0, v0
	fmov	w25, s0
	cmp	x12, x11
	b.eq	LBB0_9
LBB0_7:
	lsl	x14, x12, #2
	add	x13, x10, x14
	add	x14, x9, x14
	sub	x11, x11, x12
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x14], #4
	add	w25, w12, w25
	ldr	w12, [x13], #4
	add	w23, w12, w23
	subs	x11, x11, #1
	b.ne	LBB0_8
LBB0_9:
	lsl	x8, x8, #2
	ldr	w22, [x9, x8]
	ldr	w20, [x10, x8]
	ldr	w0, [x19, #32]
	mov	x1, x20
	bl	_netif_set_real_num_tx_queues
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x22
	mov	w1, #72
	bl	_kcalloc
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	cbz	x0, LBB0_24
; %bb.10:
	mov	x26, x0
	str	w22, [x19, #4]
	bl	_smp_wmb
	str	x26, [x19, #24]
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.lt	LBB0_17
; %bb.11:
	str	x19, [x26, #64]
	str	w25, [x26]
	mov	x0, x19
	mov	x1, x26
	bl	_niu_alloc_rx_ring_info
	mov	x22, x0
	cbnz	w0, LBB0_25
; %bb.12:
	mov	x27, #0
	mov	w28, #136
	mov	w24, #1
Lloh5:
	adrp	x8, lCPI0_0@PAGE
Lloh6:
	ldr	q0, [x8, lCPI0_0@PAGEOFF]
	str	q0, [sp]                        ; 16-byte Folded Spill
	mov	x21, x26
	mov	w25, w25
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x26
	bl	_niu_size_rbr
	add	x8, x21, x28
	ldp	x10, x9, [x8, #-104]
	sub	x9, x9, #64
	stp	x9, x9, [x8, #-88]
	ldr	q0, [sp]                        ; 16-byte Folded Reload
	stur	q0, [x8, #-132]
Lloh7:
	adrp	x9, _RBR_REFILL_MIN@GOTPAGE
Lloh8:
	ldr	x9, [x9, _RBR_REFILL_MIN@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x9, x10
	csel	x9, x9, x10, gt
	stur	x9, [x8, #-112]
Lloh10:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x26
	bl	_niu_rbr_fill
	cbnz	w0, LBB0_28
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldrsw	x8, [x19, #4]
	cmp	x24, x8
	b.ge	LBB0_17
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=1
	add	x27, x27, #1
	ldr	x21, [x19, #24]
	mov	w8, #72
	madd	x26, x27, x8, x21
	add	x1, x21, x28
	str	x19, [x1]
	add	w8, w25, w24
	str	w8, [x1, #-64]!
	mov	x0, x19
	bl	_niu_alloc_rx_ring_info
	add	x28, x28, #72
	add	x24, x24, #1
	cbz	w0, LBB0_13
; %bb.16:
	mov	x22, x0
	b	LBB0_25
LBB0_17:
Lloh13:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	mov	x0, x20
	mov	w1, #16
	bl	_kcalloc
	cbz	x0, LBB0_23
; %bb.18:
	mov	x21, x0
	str	w20, [x19, #8]
	bl	_smp_wmb
	str	x21, [x19, #16]
	ldr	w8, [x19, #8]
	cmp	w8, #1
	b.lt	LBB0_27
; %bb.19:
	str	x19, [x21, #8]
	str	w23, [x21]
	mov	x0, x19
	mov	x1, x21
	bl	_niu_alloc_tx_ring_info
	mov	x22, x0
	cbnz	w0, LBB0_25
; %bb.20:
	mov	x20, #0
	mov	w21, w23
	mov	w23, #1
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	ldrsw	x8, [x19, #8]
	cmp	x23, x8
	b.ge	LBB0_27
; %bb.22:                               ;   in Loop: Header=BB0_21 Depth=1
	ldr	x8, [x19, #16]
	add	x1, x8, x20
	add	w8, w21, w23
	str	w8, [x1, #16]!
	str	x19, [x1, #8]
	mov	x0, x19
	bl	_niu_alloc_tx_ring_info
	mov	x22, x0
	add	x20, x20, #16
	add	x23, x23, #1
	cbz	w0, LBB0_21
	b	LBB0_25
LBB0_23:
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_24:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_25:
	mov	x0, x19
	bl	_niu_free_channels
LBB0_26:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_27:
	mov	w22, #0
	b	LBB0_26
LBB0_28:
	mov	x22, x0
	b	LBB0_26
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdr	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_RBR_REFILL_MIN,8,3             ; @RBR_REFILL_MIN
	.no_dead_strip	_niu_alloc_channels
.subsections_via_symbols
