	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cnic_alloc_kcq
_cnic_alloc_kcq:                        ## @cnic_alloc_kcq
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %rbx
	xorl	%ecx, %ecx
	testl	%edx, %edx
	setne	%cl
	movq	_KCQ_PAGE_CNT@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	callq	_cnic_alloc_dma
                                        ## kill: def $eax killed $eax def $rax
	testl	%eax, %eax
	jne	LBB0_5
## %bb.1:
	movq	8(%rbx), %r8
	movq	%r8, 24(%rbx)
	movq	_cnic_bnx2_next_idx@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movq	_cnic_bnx2_hw_idx@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	xorl	%eax, %eax
	testl	%r14d, %r14d
	jne	LBB0_5
## %bb.2:
	movq	_cnic_bnx2x_next_idx@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, 20(%rbx)
	movq	_cnic_bnx2x_hw_idx@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, 16(%rbx)
	movl	(%r15), %esi
	testl	%esi, %esi
	jle	LBB0_5
## %bb.3:
	movq	_MAX_KCQE_CNT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	(%rbx), %rdi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r8,%rbx,8), %rcx
	incq	%rbx
	movslq	%esi, %rsi
	cmpq	%rsi, %rbx
	movl	$0, %esi
	cmovlq	%rbx, %rsi
	movl	(%rdi,%rsi,4), %esi
	movl	%esi, 4(%rcx,%rdx,4)
	movslq	(%r15), %rsi
	cmpq	%rsi, %rbx
	jl	LBB0_4
LBB0_5:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KCQ_PAGE_CNT,4,2               ## @KCQ_PAGE_CNT
	.comm	_cnic_bnx2_next_idx,4,2         ## @cnic_bnx2_next_idx
	.comm	_cnic_bnx2_hw_idx,4,2           ## @cnic_bnx2_hw_idx
	.comm	_cnic_bnx2x_next_idx,4,2        ## @cnic_bnx2x_next_idx
	.comm	_cnic_bnx2x_hw_idx,4,2          ## @cnic_bnx2x_hw_idx
	.comm	_MAX_KCQE_CNT,8,3               ## @MAX_KCQE_CNT
	.no_dead_strip	_cnic_alloc_kcq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cnic_alloc_kcq
_cnic_alloc_kcq:                        ; @cnic_alloc_kcq
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x2
	mov	x19, x1
	cmp	w2, #0
	cset	w3, ne
Lloh0:
	adrp	x21, _KCQ_PAGE_CNT@GOTPAGE
Lloh1:
	ldr	x21, [x21, _KCQ_PAGE_CNT@GOTPAGEOFF]
	ldr	w2, [x21]
	bl	_cnic_alloc_dma
	cbnz	w0, LBB0_6
; %bb.1:
	ldr	x8, [x19, #8]
	str	x8, [x19, #24]
Lloh2:
	adrp	x9, _cnic_bnx2_next_idx@GOTPAGE
Lloh3:
	ldr	x9, [x9, _cnic_bnx2_next_idx@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
Lloh5:
	adrp	x10, _cnic_bnx2_hw_idx@GOTPAGE
Lloh6:
	ldr	x10, [x10, _cnic_bnx2_hw_idx@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	stp	w10, w9, [x19, #16]
	cbnz	w20, LBB0_5
; %bb.2:
Lloh8:
	adrp	x9, _cnic_bnx2x_next_idx@GOTPAGE
Lloh9:
	ldr	x9, [x9, _cnic_bnx2x_next_idx@GOTPAGEOFF]
Lloh10:
	adrp	x10, _cnic_bnx2x_hw_idx@GOTPAGE
Lloh11:
	ldr	x10, [x10, _cnic_bnx2x_hw_idx@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
Lloh13:
	ldr	w10, [x10]
	stp	w10, w9, [x19, #16]
	ldr	w9, [x21]
	cmp	w9, #1
	b.lt	LBB0_5
; %bb.3:
	mov	x12, #0
Lloh14:
	adrp	x10, _MAX_KCQE_CNT@GOTPAGE
Lloh15:
	ldr	x10, [x10, _MAX_KCQE_CNT@GOTPAGEOFF]
Lloh16:
	ldr	x10, [x10]
	ldr	x11, [x19]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x13, [x8, x12, lsl #3]
	add	x13, x13, x10, lsl #2
	add	x14, x12, #1
	cmp	x14, w9, sxtw
	csinc	x9, xzr, x12, ge
	ldr	w9, [x11, x9, lsl #2]
	str	w9, [x13, #4]
	ldrsw	x9, [x21]
	mov	x12, x14
	cmp	x14, x9
	b.lt	LBB0_4
LBB0_5:
	mov	w0, #0
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh12
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_KCQ_PAGE_CNT,4,2               ; @KCQ_PAGE_CNT
	.comm	_cnic_bnx2_next_idx,4,2         ; @cnic_bnx2_next_idx
	.comm	_cnic_bnx2_hw_idx,4,2           ; @cnic_bnx2_hw_idx
	.comm	_cnic_bnx2x_next_idx,4,2        ; @cnic_bnx2x_next_idx
	.comm	_cnic_bnx2x_hw_idx,4,2          ; @cnic_bnx2x_hw_idx
	.comm	_MAX_KCQE_CNT,8,3               ; @MAX_KCQE_CNT
	.no_dead_strip	_cnic_alloc_kcq
.subsections_via_symbols
