	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bnxt_qplib_alloc_rcfw_channel  ## -- Begin function bnxt_qplib_alloc_rcfw_channel
	.p2align	4, 0x90
_bnxt_qplib_alloc_rcfw_channel:         ## @bnxt_qplib_alloc_rcfw_channel
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r14d
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, 32(%rsi)
	movq	_BNXT_QPLIB_CREQE_MAX_CNT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leaq	40(%rsi), %rbx
	movl	%eax, 40(%rsi)
	movl	44(%rsi), %edi
	callq	_bnxt_qplib_get_hwq_type
                                        ## kill: def $eax killed $eax def $rax
	movq	32(%r12), %rdi
	movq	_BNXT_QPLIB_CREQE_UNITS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r10d
	movq	%rbx, %rsi
	xorl	%edx, %edx
	movq	%rbx, %rcx
	xorl	%r9d, %r9d
	pushq	%rax
	pushq	%r10
	callq	_bnxt_qplib_alloc_init_hwq
	addq	$16, %rsp
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_3:
	movq	(%r15), %rax
	movq	_HWRM_VERSION_RCFW_CMDQ_DEPTH_CHECK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_4
## %bb.5:
	movq	_BNXT_QPLIB_CMDQE_MAX_CNT_256@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_4:
	movq	_BNXT_QPLIB_CMDQE_MAX_CNT_8192@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %edi
	movl	%edi, (%r12)
	leaq	24(%r12), %rbx
	movl	%edi, 24(%r12)
	movq	32(%r12), %r15
	movq	_BNXT_QPLIB_CMDQE_UNITS@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	callq	_bnxt_qplib_cmdqe_page_size
                                        ## kill: def $eax killed $eax def $rax
	movq	_HWQ_TYPE_CTX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r10d
	movq	%r15, %rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	movq	%rbx, %rcx
	movl	%r13d, %r8d
	xorl	%r9d, %r9d
	pushq	%r10
	pushq	%rax
	callq	_bnxt_qplib_alloc_init_hwq
	addq	$16, %rsp
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	leaq	L_.str.1(%rip), %rsi
LBB0_2:
	movq	32(%r12), %rdi
	callq	_dev_err
LBB0_10:
	movq	%r12, %rdi
	callq	_bnxt_qplib_free_rcfw_channel
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	24(%r12), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movl	$1, %esi
	callq	_kcalloc
	movq	%rax, 16(%r12)
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movl	%r14d, 4(%r12)
	movl	(%rbx), %edx
	movl	%r14d, %edi
	movl	$4, %esi
	callq	_kcalloc
	movq	%rax, %rcx
	movq	%rax, 8(%r12)
	xorl	%eax, %eax
	testq	%rcx, %rcx
	jne	LBB0_11
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_BNXT_QPLIB_CREQE_MAX_CNT,4,2   ## @BNXT_QPLIB_CREQE_MAX_CNT
	.comm	_BNXT_QPLIB_CREQE_UNITS,4,2     ## @BNXT_QPLIB_CREQE_UNITS
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"HW channel CREQ allocation failed\n"

	.comm	_HWRM_VERSION_RCFW_CMDQ_DEPTH_CHECK,8,3 ## @HWRM_VERSION_RCFW_CMDQ_DEPTH_CHECK
	.comm	_BNXT_QPLIB_CMDQE_MAX_CNT_256,4,2 ## @BNXT_QPLIB_CMDQE_MAX_CNT_256
	.comm	_BNXT_QPLIB_CMDQE_MAX_CNT_8192,4,2 ## @BNXT_QPLIB_CMDQE_MAX_CNT_8192
	.comm	_BNXT_QPLIB_CMDQE_UNITS,4,2     ## @BNXT_QPLIB_CMDQE_UNITS
	.comm	_HWQ_TYPE_CTX,4,2               ## @HWQ_TYPE_CTX
L_.str.1:                               ## @.str.1
	.asciz	"HW channel CMDQ allocation failed\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bnxt_qplib_alloc_rcfw_channel  ; -- Begin function bnxt_qplib_alloc_rcfw_channel
	.p2align	2
_bnxt_qplib_alloc_rcfw_channel:         ; @bnxt_qplib_alloc_rcfw_channel
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x3
	mov	x21, x2
	mov	x19, x1
Lloh0:
	adrp	x8, _BNXT_QPLIB_CREQE_MAX_CNT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BNXT_QPLIB_CREQE_MAX_CNT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	mov	x22, x1
	str	w8, [x22, #40]!
	stur	x0, [x22, #-8]
	ldr	w0, [x22, #4]
	bl	_bnxt_qplib_get_hwq_type
	mov	x7, x0
	ldur	x0, [x22, #-8]
Lloh3:
	adrp	x8, _BNXT_QPLIB_CREQE_UNITS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BNXT_QPLIB_CREQE_UNITS@GOTPAGEOFF]
Lloh5:
	ldr	w4, [x8]
Lloh6:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	w6, [x8]
	mov	x1, x22
	mov	x2, #0
	mov	x3, x22
	mov	w5, #0
	bl	_bnxt_qplib_alloc_init_hwq
	cbz	x0, LBB0_2
; %bb.1:
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:
	ldr	x8, [x21]
Lloh11:
	adrp	x9, _HWRM_VERSION_RCFW_CMDQ_DEPTH_CHECK@GOTPAGE
Lloh12:
	ldr	x9, [x9, _HWRM_VERSION_RCFW_CMDQ_DEPTH_CHECK@GOTPAGEOFF]
Lloh13:
	adrp	x10, _BNXT_QPLIB_CMDQE_MAX_CNT_256@GOTPAGE
Lloh14:
	ldr	x10, [x10, _BNXT_QPLIB_CMDQE_MAX_CNT_256@GOTPAGEOFF]
Lloh15:
	adrp	x11, _BNXT_QPLIB_CMDQE_MAX_CNT_8192@GOTPAGE
Lloh16:
	ldr	x11, [x11, _BNXT_QPLIB_CMDQE_MAX_CNT_8192@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x8, x9
	csel	x8, x10, x11, lt
	ldr	w0, [x8]
	str	w0, [x19]
	mov	x21, x19
	str	w0, [x21, #24]!
	ldr	x22, [x19, #32]
Lloh18:
	adrp	x8, _BNXT_QPLIB_CMDQE_UNITS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _BNXT_QPLIB_CMDQE_UNITS@GOTPAGEOFF]
Lloh20:
	ldr	w23, [x8]
	bl	_bnxt_qplib_cmdqe_page_size
	mov	x6, x0
Lloh21:
	adrp	x8, _HWQ_TYPE_CTX@GOTPAGE
Lloh22:
	ldr	x8, [x8, _HWQ_TYPE_CTX@GOTPAGEOFF]
Lloh23:
	ldr	w7, [x8]
	mov	x0, x22
	mov	x1, x21
	mov	x2, #0
	mov	x3, x21
	mov	x4, x23
	mov	w5, #0
	bl	_bnxt_qplib_alloc_init_hwq
	cbz	x0, LBB0_7
; %bb.3:
Lloh24:
	adrp	x1, l_.str.1@PAGE
Lloh25:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_4:
	ldr	x0, [x19, #32]
	bl	_dev_err
LBB0_5:
	mov	x0, x19
	bl	_bnxt_qplib_free_rcfw_channel
Lloh26:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_7:
	ldr	w0, [x19, #24]
Lloh29:
	adrp	x21, _GFP_KERNEL@GOTPAGE
Lloh30:
	ldr	x21, [x21, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x21]
	mov	w1, #1
	bl	_kcalloc
	str	x0, [x19, #16]
	cbz	x0, LBB0_5
; %bb.8:
	str	w20, [x19, #4]
	ldr	w2, [x21]
	mov	x0, x20
	mov	w1, #4
	bl	_kcalloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_5
; %bb.9:
	mov	w0, #0
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh17
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_BNXT_QPLIB_CREQE_MAX_CNT,4,2   ; @BNXT_QPLIB_CREQE_MAX_CNT
	.comm	_BNXT_QPLIB_CREQE_UNITS,4,2     ; @BNXT_QPLIB_CREQE_UNITS
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"HW channel CREQ allocation failed\n"

	.comm	_HWRM_VERSION_RCFW_CMDQ_DEPTH_CHECK,8,3 ; @HWRM_VERSION_RCFW_CMDQ_DEPTH_CHECK
	.comm	_BNXT_QPLIB_CMDQE_MAX_CNT_256,4,2 ; @BNXT_QPLIB_CMDQE_MAX_CNT_256
	.comm	_BNXT_QPLIB_CMDQE_MAX_CNT_8192,4,2 ; @BNXT_QPLIB_CMDQE_MAX_CNT_8192
	.comm	_BNXT_QPLIB_CMDQE_UNITS,4,2     ; @BNXT_QPLIB_CMDQE_UNITS
	.comm	_HWQ_TYPE_CTX,4,2               ; @HWQ_TYPE_CTX
l_.str.1:                               ; @.str.1
	.asciz	"HW channel CMDQ allocation failed\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
