	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	40(%rdi), %rax
	movslq	(%rdi), %r9
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	movq	(%rax), %rcx
	movq	8(%rax), %rdx
	movl	$0, %r15d
	movl	$0, %r13d
	testq	%r9, %r9
	jle	LBB0_11
## %bb.1:
	movl	%r9d, %esi
	cmpl	$8, %esi
	jae	LBB0_3
## %bb.2:
	xorl	%edi, %edi
	xorl	%r13d, %r13d
	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, %r13d
	cmpq	%rsi, %rdi
	je	LBB0_11
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	addl	(%rcx,%rdi,4), %r13d
	addl	(%rdx,%rdi,4), %r15d
	incq	%rdi
	cmpq	%rdi, %rsi
	jne	LBB0_10
LBB0_11:
	movl	(%rcx,%r9,4), %edi
	movl	(%rdx,%r9,4), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%edi, %r14d
	movl	$72, %esi
	callq	_kcalloc
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	testq	%rax, %rax
	je	LBB0_12
## %bb.14:
	movq	%rax, %rbx
	movl	%r14d, 4(%r12)
	xorl	%eax, %eax
	callq	_smp_wmb
	movq	%rbx, 32(%r12)
	movl	24(%r12), %edi
	movl	%r14d, %esi
	callq	_netif_set_real_num_rx_queues
	cmpl	$0, 4(%r12)
	jle	LBB0_21
## %bb.15:
	movl	%r13d, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%r13d, %r13d
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %r14
	movq	32(%r12), %r12
	leaq	(%r12,%r13), %rbx
	movq	%r14, 64(%r12,%r13)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	addl	%ecx, %eax
	movl	%eax, (%r12,%r13)
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_niu_alloc_rx_ring_info
	testl	%eax, %eax
	jne	LBB0_19
## %bb.16:                              ##   in Loop: Header=BB0_18 Depth=1
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_niu_size_rbr
	movq	32(%r12,%r13), %rax
	movq	40(%r12,%r13), %rcx
	addq	$-64, %rcx
	movq	%rcx, 56(%r12,%r13)
	movq	%rcx, 48(%r12,%r13)
	movdqa	LCPI0_0(%rip), %xmm0            ## xmm0 = [64,64,16,8]
	movdqu	%xmm0, 4(%r12,%r13)
	movq	_RBR_REFILL_MIN@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rax, %rcx
	cmovgq	%rcx, %rax
	movq	%rax, 24(%r12,%r13)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_niu_rbr_fill
	testl	%eax, %eax
	jne	LBB0_28
## %bb.17:                              ##   in Loop: Header=BB0_18 Depth=1
	movq	%r14, %r12
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	incq	%rcx
	movslq	4(%r14), %rax
	addq	$72, %r13
	cmpq	%rax, %rcx
	jl	LBB0_18
LBB0_21:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	-52(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %edi
	movl	$16, %esi
	callq	_kcalloc
	testq	%rax, %rax
	je	LBB0_22
## %bb.23:
	movq	%rax, %rbx
	movl	%r14d, 8(%r12)
	xorl	%eax, %eax
	callq	_smp_wmb
	movq	%rbx, 16(%r12)
	movl	24(%r12), %edi
	movl	%r14d, %esi
	callq	_netif_set_real_num_tx_queues
	xorl	%eax, %eax
	cmpl	$0, 8(%r12)
	jle	LBB0_28
## %bb.24:
	movl	%r15d, %r14d
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_25:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r12), %rax
	leaq	(%rax,%rbx), %rsi
	movq	%r12, 8(%rax,%rbx)
	leal	(%r14,%r15), %ecx
	movl	%ecx, (%rax,%rbx)
	movq	%r12, %rdi
	callq	_niu_alloc_tx_ring_info
	testl	%eax, %eax
	jne	LBB0_13
## %bb.26:                              ##   in Loop: Header=BB0_25 Depth=1
	incq	%r15
	movslq	8(%r12), %rax
	addq	$16, %rbx
	cmpq	%rax, %r15
	jl	LBB0_25
## %bb.27:
	xorl	%eax, %eax
	jmp	LBB0_28
LBB0_12:
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	subl	(%rcx), %eax
LBB0_13:
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	jmp	LBB0_20
LBB0_19:
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	%r14, %r12
	jmp	LBB0_20
LBB0_22:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
LBB0_20:
	movq	%r12, %rdi
	callq	_niu_free_channels
	movl	-48(%rbp), %eax                 ## 4-byte Reload
LBB0_28:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
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
	.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	w24, #0
	mov	w23, #0
	b	LBB0_7
LBB0_3:
	mov	w23, #0
	mov	w24, #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	w24, 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	w24, w12, w24
	ldr	w12, [x13], #4
	add	w23, w12, w23
	subs	x11, x11, #1
	b.ne	LBB0_8
LBB0_9:
	lsl	x8, x8, #2
	ldr	w21, [x9, x8]
	ldr	w20, [x10, x8]
Lloh0:
	adrp	x26, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x26, [x26, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x26]
	mov	x0, x21
	mov	w1, #72
	bl	_kcalloc
Lloh2:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	cbz	x0, LBB0_24
; %bb.10:
	mov	x22, x0
	str	w21, [x19, #4]
	bl	_smp_wmb
	str	x22, [x19, #32]
	ldr	w0, [x19, #24]
	mov	x1, x21
	bl	_netif_set_real_num_rx_queues
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.11:
	mov	x27, #0
	mov	x28, #0
Lloh4:
	adrp	x8, lCPI0_0@PAGE
Lloh5:
	ldr	q0, [x8, lCPI0_0@PAGEOFF]
	str	q0, [sp]                        ; 16-byte Folded Spill
Lloh6:
	adrp	x25, _RBR_REFILL_MIN@GOTPAGE
Lloh7:
	ldr	x25, [x25, _RBR_REFILL_MIN@GOTPAGEOFF]
	mov	w24, w24
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #32]
	add	x22, x8, x27
	str	x19, [x22, #64]
	add	w8, w24, w28
	str	w8, [x22]
	mov	x0, x19
	mov	x1, x22
	bl	_niu_alloc_rx_ring_info
	cbnz	w0, LBB0_21
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x19
	mov	x1, x22
	bl	_niu_size_rbr
	ldp	x9, x8, [x22, #32]
	sub	x8, x8, #64
	stp	x8, x8, [x22, #48]
	ldr	q0, [sp]                        ; 16-byte Folded Reload
	stur	q0, [x22, #4]
	ldr	x8, [x25]
	cmp	x8, x9
	csel	x8, x8, x9, gt
	str	x8, [x22, #24]
	ldr	w2, [x26]
	mov	x0, x19
	mov	x1, x22
	bl	_niu_rbr_fill
	cbnz	w0, LBB0_22
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=1
	add	x28, x28, #1
	ldrsw	x8, [x19, #4]
	add	x27, x27, #72
	cmp	x28, x8
	b.lt	LBB0_12
LBB0_15:
	ldr	w2, [x26]
	mov	x0, x20
	mov	w1, #16
	bl	_kcalloc
	cbz	x0, LBB0_23
; %bb.16:
	mov	x21, x0
	str	w20, [x19, #8]
	bl	_smp_wmb
	str	x21, [x19, #16]
	ldr	w0, [x19, #24]
	mov	x1, x20
	bl	_netif_set_real_num_tx_queues
	ldr	w8, [x19, #8]
	cmp	w8, #1
	b.lt	LBB0_20
; %bb.17:
	mov	x20, #0
	mov	x22, #0
	mov	w23, w23
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	add	x1, x8, x20
	str	x19, [x1, #8]
	add	w8, w23, w22
	str	w8, [x1]
	mov	x0, x19
	bl	_niu_alloc_tx_ring_info
	cbnz	w0, LBB0_21
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	add	x22, x22, #1
	ldrsw	x8, [x19, #8]
	add	x20, x20, #16
	cmp	x22, x8
	b.lt	LBB0_18
LBB0_20:
	mov	w21, #0
	b	LBB0_26
LBB0_21:
	mov	x21, x0
	b	LBB0_25
LBB0_22:
	mov	x21, x0
	b	LBB0_26
LBB0_23:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_24:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_25:
	mov	x0, x19
	bl	_niu_free_channels
LBB0_26:
	mov	x0, x21
	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
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdr	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.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
