	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bnxt_re_alloc_res
_bnxt_re_alloc_res:                     ## @bnxt_re_alloc_res
	.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, %r13
	addq	$76, %rdi
	leaq	8(%r13), %r14
	movq	%rdi, 8(%r13)
	leaq	64(%r13), %rbx
	movl	72(%r13), %edx
	movq	%rbx, %rsi
	callq	_bnxt_qplib_get_dev_attr
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_13
## %bb.1:
	movq	56(%r13), %rax
	movl	(%rax), %esi
	movl	68(%r13), %edx
	movq	%r14, %rdi
	movq	%rbx, %rcx
	callq	_bnxt_qplib_alloc_res
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_13
## %bb.2:
	leaq	16(%r13), %r12
	leaq	24(%r13), %rbx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	%r13, %rdx
	callq	_bnxt_qplib_alloc_dpi
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_3
LBB0_12:
	movq	%r14, %rdi
	callq	_bnxt_qplib_free_res
LBB0_13:
	movq	$0, (%r14)
LBB0_14:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	cmpl	$2, (%r13)
	jl	LBB0_14
## %bb.4:
	leaq	40(%r13), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	32(%r13), %rax
	leaq	(%rax,%rbx), %rsi
	movq	%r14, 32(%rax,%rbx)
	movq	_BNXT_RE_MAX_CQ_COUNT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_BNXT_RE_MAX_SRQC_COUNT@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	leaq	2(%rcx,%rdx), %rcx
	movq	%rcx, 24(%rax,%rbx)
	movq	56(%r13), %rax
	movl	(%rax), %edi
	callq	_bnxt_qplib_alloc_nq
	testl	%eax, %eax
	jne	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_bnxt_qplib_get_ring_type
	movq	32(%r13), %rcx
	movq	48(%r13), %r9
	movq	8(%rcx,%rbx), %rdx
	movq	16(%rcx,%rbx), %rdi
	movq	_PBL_LVL_0@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	shlq	$4, %rsi
	movq	8(%rdi,%rsi), %rsi
	shlq	$4, %rdx
	movl	(%rdi,%rdx), %edx
	movq	_BNXT_QPLIB_NQE_MAX_CNT@GOTPCREL(%rip), %rdi
	movq	(%rdi), %r8
	decq	%r8
	movl	4(%r9,%r12,4), %r9d
	addq	%rbx, %rcx
	movq	%rcx, (%rsp)
	movq	%r13, %rdi
	movl	%eax, %ecx
	callq	_bnxt_re_net_ring_alloc
	testl	%eax, %eax
	jne	LBB0_8
## %bb.15:                              ##   in Loop: Header=BB0_5 Depth=1
	incq	%r12
	movslq	(%r13), %rax
	decq	%rax
	addq	$40, %rbx
	xorl	%r15d, %r15d
	cmpq	%rax, %r12
	jl	LBB0_5
	jmp	LBB0_14
LBB0_6:
	movl	%eax, %r15d
	movq	%r13, %rdi
	callq	_rdev_to_dev
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	movl	%r12d, %edx
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_9
LBB0_8:
	movl	%eax, %r15d
	movq	%r13, %rdi
	callq	_rdev_to_dev
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movq	32(%r13), %rdi
	addq	%rbx, %rdi
	callq	_bnxt_qplib_free_nq
LBB0_9:
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_bnxt_qplib_get_ring_type
	movq	32(%r13), %rcx
	movl	(%rcx,%rbx), %esi
	movq	%r13, %rdi
	movl	%eax, %edx
	callq	_bnxt_re_net_ring_free
	movq	32(%r13), %rdi
	addq	%rbx, %rdi
	callq	_bnxt_qplib_free_nq
	addq	$-40, %rbx
	cmpq	$-40, %rbx
	jne	LBB0_10
## %bb.11:
	movq	%r14, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	callq	_bnxt_qplib_dealloc_dpi
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_BNXT_RE_MAX_CQ_COUNT,8,3       ## @BNXT_RE_MAX_CQ_COUNT
	.comm	_BNXT_RE_MAX_SRQC_COUNT,8,3     ## @BNXT_RE_MAX_SRQC_COUNT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Alloc Failed NQ%d rc:%#x"

	.comm	_PBL_LVL_0,8,3                  ## @PBL_LVL_0
	.comm	_BNXT_QPLIB_NQE_MAX_CNT,8,3     ## @BNXT_QPLIB_NQE_MAX_CNT
L_.str.1:                               ## @.str.1
	.asciz	"Failed to allocate NQ fw id with rc = 0x%x"

	.no_dead_strip	_bnxt_re_alloc_res
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bnxt_re_alloc_res
_bnxt_re_alloc_res:                     ; @bnxt_re_alloc_res
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x0
	add	x0, x0, #76
	mov	x19, x20
	str	x0, [x19, #8]!
	add	x21, x19, #56
	ldr	w2, [x19, #64]
	mov	x1, x21
	bl	_bnxt_qplib_get_dev_attr
	mov	x24, x0
	cbnz	w0, LBB0_4
; %bb.1:
	ldr	x8, [x20, #56]
	ldr	w1, [x8]
	ldr	w2, [x20, #68]
	mov	x0, x19
	mov	x3, x21
	bl	_bnxt_qplib_alloc_res
	mov	x24, x0
	cbnz	w0, LBB0_4
; %bb.2:
	add	x21, x20, #16
	add	x22, x20, #24
	mov	x0, x21
	mov	x1, x22
	mov	x2, x20
	bl	_bnxt_qplib_alloc_dpi
	mov	x24, x0
	cbz	w0, LBB0_6
LBB0_3:
	mov	x0, x19
	bl	_bnxt_qplib_free_res
LBB0_4:
	str	xzr, [x19]
LBB0_5:
	mov	x0, x24
	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
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_6:
	ldr	w8, [x20]
	cmp	w8, #2
	b.lt	LBB0_11
; %bb.7:
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	mov	x26, #0
	mov	x25, #0
	add	x23, x20, #40
Lloh0:
	adrp	x27, _BNXT_RE_MAX_CQ_COUNT@GOTPAGE
Lloh1:
	ldr	x27, [x27, _BNXT_RE_MAX_CQ_COUNT@GOTPAGEOFF]
Lloh2:
	adrp	x28, _BNXT_RE_MAX_SRQC_COUNT@GOTPAGE
Lloh3:
	ldr	x28, [x28, _BNXT_RE_MAX_SRQC_COUNT@GOTPAGEOFF]
Lloh4:
	adrp	x21, _PBL_LVL_0@GOTPAGE
Lloh5:
	ldr	x21, [x21, _PBL_LVL_0@GOTPAGEOFF]
Lloh6:
	adrp	x22, _BNXT_QPLIB_NQE_MAX_CNT@GOTPAGE
Lloh7:
	ldr	x22, [x22, _BNXT_QPLIB_NQE_MAX_CNT@GOTPAGEOFF]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #32]
	add	x1, x8, x26
	ldr	x8, [x27]
	ldr	x9, [x28]
	add	x8, x8, x9
	add	x8, x8, #2
	stp	x8, x19, [x1, #24]
	ldr	x8, [x20, #56]
	ldr	w0, [x8]
	bl	_bnxt_qplib_alloc_nq
	cbnz	w0, LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x23
	bl	_bnxt_qplib_get_ring_type
	mov	x3, x0
	ldr	x8, [x20, #32]
	add	x6, x8, x26
	ldr	x8, [x21]
	ldp	x10, x9, [x6, #8]
	add	x8, x9, x8, lsl #4
	lsl	x10, x10, #4
	ldr	w2, [x9, x10]
	ldr	x1, [x8, #8]
	ldr	x8, [x22]
	sub	x4, x8, #1
	ldr	x8, [x20, #48]
	add	x8, x8, x25, lsl #2
	ldr	w5, [x8, #4]
	mov	x0, x20
	bl	_bnxt_re_net_ring_alloc
	mov	x24, x0
	cbnz	w0, LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	add	x25, x25, #1
	ldrsw	x8, [x20]
	sub	x8, x8, #1
	add	x26, x26, #40
	cmp	x25, x8
	b.lt	LBB0_8
	b	LBB0_5
LBB0_11:
	mov	w24, #0
	b	LBB0_5
LBB0_12:
	mov	x24, x0
	mov	x0, x20
	bl	_rdev_to_dev
	str	x24, [sp]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x25
	bl	_dev_err
	b	LBB0_14
LBB0_13:
	mov	x0, x20
	bl	_rdev_to_dev
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x24
	bl	_dev_err
	ldr	x8, [x20, #32]
	add	x0, x8, x26
	bl	_bnxt_qplib_free_nq
LBB0_14:
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	bl	_bnxt_qplib_get_ring_type
	mov	x2, x0
	ldr	x8, [x20, #32]
	ldr	w1, [x8, x26]
	mov	x0, x20
	bl	_bnxt_re_net_ring_free
	ldr	x8, [x20, #32]
	add	x0, x8, x26
	bl	_bnxt_qplib_free_nq
	sub	x26, x26, #40
	cmn	x26, #40
	b.ne	LBB0_15
; %bb.16:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	bl	_bnxt_qplib_dealloc_dpi
	b	LBB0_3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_BNXT_RE_MAX_CQ_COUNT,8,3       ; @BNXT_RE_MAX_CQ_COUNT
	.comm	_BNXT_RE_MAX_SRQC_COUNT,8,3     ; @BNXT_RE_MAX_SRQC_COUNT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Alloc Failed NQ%d rc:%#x"

	.comm	_PBL_LVL_0,8,3                  ; @PBL_LVL_0
	.comm	_BNXT_QPLIB_NQE_MAX_CNT,8,3     ; @BNXT_QPLIB_NQE_MAX_CNT
l_.str.1:                               ; @.str.1
	.asciz	"Failed to allocate NQ fw id with rc = 0x%x"

	.no_dead_strip	_bnxt_re_alloc_res
.subsections_via_symbols
