	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cnic_alloc_bnx2x_resc
_cnic_alloc_bnx2x_resc:                 ## @cnic_alloc_bnx2x_resc
	.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, %r14
	movq	16(%rdi), %r13
	movl	8(%rdi), %edi
	callq	_netdev_priv
	movq	%rax, %r12
	movq	16(%r13), %rbx
	movq	16(%rbx), %rax
	movq	_MAX_ISCSI_TBL_SZ@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	movl	%ecx, (%r13)
	movq	%rax, 80(%r13)
	movslq	(%r15), %rcx
	addq	%rax, %rcx
	movq	%rcx, 72(%r13)
	movq	%r12, %rdi
	callq	_BNX2X_CHIP_IS_E2_PLUS
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	(%r14), %eax
	addl	%eax, (%r13)
	movl	(%rbx), %eax
	testl	%eax, %eax
	movl	$16, %ecx
	cmovnel	%eax, %ecx
	movl	%ecx, 4(%r13)
LBB0_2:
	movl	(%r15), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movl	$4, %esi
	callq	_kcalloc
	movq	%rax, 64(%r13)
	testq	%rax, %rax
	je	LBB0_27
## %bb.3:
	movl	(%r13), %edi
	movl	(%rbx), %edx
	movl	$4, %esi
	callq	_kcalloc
	movq	%rax, 56(%r13)
	testq	%rax, %rax
	je	LBB0_27
## %bb.4:
	movl	(%r15), %edx
	testl	%edx, %edx
	jle	LBB0_7
## %bb.5:
	movq	64(%r13), %rcx
	leaq	24(%rax), %rsi
	xorl	%edi, %edi
	movq	_CNIC_ULP_ISCSI@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rcx, (%rsi)
	movl	(%rbx), %edx
	movl	%edx, -8(%rsi)
	incq	%rdi
	movslq	(%r15), %rdx
	addq	$4, %rcx
	addq	$32, %rsi
	cmpq	%rdx, %rdi
	jl	LBB0_6
LBB0_7:
	leaq	88(%r13), %r15
	movslq	(%r13), %rdi
	cmpl	%edi, %edx
	jge	LBB0_15
## %bb.8:
	movslq	%edx, %r8
	movl	%edi, %esi
	subl	%edx, %esi
	movq	%r8, %r9
	notq	%r9
	addq	%rdi, %r9
	andq	$3, %rsi
	je	LBB0_12
## %bb.9:
	movq	%r8, %rcx
	shlq	$5, %rcx
	leaq	(%rcx,%rax), %rbx
	addq	$16, %rbx
	negq	%rsi
	xorl	%ecx, %ecx
	movq	_CNIC_ULP_FCOE@GOTPCREL(%rip), %r10
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r10), %edx
	movl	%edx, (%rbx)
	decq	%rcx
	addq	$32, %rbx
	cmpq	%rcx, %rsi
	jne	LBB0_10
## %bb.11:
	subq	%rcx, %r8
LBB0_12:
	cmpq	$3, %r9
	jb	LBB0_15
## %bb.13:
	movq	%rdi, %rdx
	subq	%r8, %rdx
	shlq	$5, %r8
	addq	%r8, %rax
	addq	$112, %rax
	movq	_CNIC_ULP_FCOE@GOTPCREL(%rip), %rcx
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rcx), %esi
	movl	%esi, -96(%rax)
	movl	(%rcx), %esi
	movl	%esi, -64(%rax)
	movl	(%rcx), %esi
	movl	%esi, -32(%rax)
	movl	(%rcx), %esi
	movl	%esi, (%rax)
	subq	$-128, %rax
	addq	$-4, %rdx
	jne	LBB0_14
LBB0_15:
	movq	_CNIC_KWQ16_DATA_SIZE@GOTPCREL(%rip), %rbx
	imull	(%rbx), %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_CNIC_PAGE_ALIGN
	movq	_CNIC_PAGE_SIZE@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	xorl	%ecx, %ecx
	callq	_cnic_alloc_dma
	testl	%eax, %eax
	jne	LBB0_27
## %bb.16:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	_CNIC_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	(%rbx), %r8d
	cltd
	idivl	%r8d
	movl	(%r13), %r10d
	testl	%r10d, %r10d
	jle	LBB0_19
## %bb.17:
	movl	%eax, %r9d
	movq	96(%r13), %r11
	movq	56(%r13), %rcx
	movq	88(%r13), %r15
	movl	%eax, %edi
	decl	%edi
	addq	$8, %rcx
	xorl	%esi, %esi
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movl	%esi, %eax
	cltd
	idivl	%r9d
	movl	%edx, %eax
	imull	%r8d, %eax
	cltq
	movl	%ebx, %r14d
	movq	(%r11,%r14,8), %r12
	addq	%rax, %r12
	movq	%r12, (%rcx)
	addq	(%r15,%r14,8), %rax
	movq	%rax, -8(%rcx)
	xorl	%eax, %eax
	cmpl	%edi, %edx
	sete	%al
	addl	%eax, %ebx
	incq	%rsi
	addq	$32, %rcx
	cmpq	%rsi, %r10
	jne	LBB0_18
LBB0_19:
	leaq	52(%r13), %rsi
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_cnic_alloc_kcq
	testl	%eax, %eax
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	je	LBB0_20
LBB0_27:
	movq	%r14, %rdi
	callq	_cnic_free_resc
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_28:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	callq	_CNIC_SUPPORTS_FCOE
	testq	%rax, %rax
	je	LBB0_22
## %bb.21:
	leaq	48(%r13), %rsi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_cnic_alloc_kcq
	testl	%eax, %eax
	jne	LBB0_27
LBB0_22:
	movq	_BNX2X_ISCSI_GLB_BUF_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_CNIC_PAGE_ALIGN
	cltd
	movq	_CNIC_PAGE_SIZE@GOTPCREL(%rip), %rcx
	idivl	(%rcx)
	leaq	32(%r13), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	xorl	%ecx, %ecx
	callq	_cnic_alloc_dma
	testl	%eax, %eax
	jne	LBB0_27
## %bb.23:
	movq	%r14, %rdi
	callq	_cnic_alloc_bnx2x_context
	testl	%eax, %eax
	jne	LBB0_27
## %bb.24:
	movq	16(%r13), %rax
	movq	_CNIC_DRV_STATE_NO_ISCSI@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%ebx, %ebx
	testl	%ecx, 4(%rax)
	jne	LBB0_28
## %bb.25:
	movq	8(%rax), %rax
	movl	4(%rax), %eax
	movl	%eax, 24(%r13)
	movl	$15, 8(%r13)
	movq	%r14, %rdi
	movl	$4, %esi
	callq	_cnic_alloc_uio_rings
	testl	%eax, %eax
	jne	LBB0_27
## %bb.26:
	movq	%r14, %rdi
	callq	_cnic_init_uio
	testl	%eax, %eax
	jne	LBB0_27
	jmp	LBB0_28
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_ISCSI_TBL_SZ,4,2           ## @MAX_ISCSI_TBL_SZ
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_CNIC_ULP_ISCSI,4,2             ## @CNIC_ULP_ISCSI
	.comm	_CNIC_ULP_FCOE,4,2              ## @CNIC_ULP_FCOE
	.comm	_CNIC_KWQ16_DATA_SIZE,4,2       ## @CNIC_KWQ16_DATA_SIZE
	.comm	_CNIC_PAGE_SIZE,4,2             ## @CNIC_PAGE_SIZE
	.comm	_BNX2X_ISCSI_GLB_BUF_SIZE,4,2   ## @BNX2X_ISCSI_GLB_BUF_SIZE
	.comm	_CNIC_DRV_STATE_NO_ISCSI,4,2    ## @CNIC_DRV_STATE_NO_ISCSI
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_cnic_alloc_bnx2x_resc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cnic_alloc_bnx2x_resc
_cnic_alloc_bnx2x_resc:                 ; @cnic_alloc_bnx2x_resc
	.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	x19, x0
	ldr	x22, [x0, #16]
	ldr	w0, [x0, #8]
	bl	_netdev_priv
	mov	x20, x0
	ldr	x21, [x22, #16]
	ldr	x8, [x21, #16]
Lloh0:
	adrp	x23, _MAX_ISCSI_TBL_SZ@GOTPAGE
Lloh1:
	ldr	x23, [x23, _MAX_ISCSI_TBL_SZ@GOTPAGEOFF]
	ldr	w9, [x23]
	str	w9, [x22]
	ldrsw	x9, [x23]
	add	x9, x8, x9
	stp	x9, x8, [x22, #72]
	bl	_BNX2X_CHIP_IS_E2_PLUS
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w8, [x19]
	ldr	w9, [x22]
	add	w8, w9, w8
	ldr	w9, [x21]
	mov	w10, #16
	cmp	w9, #0
	csel	w9, w10, w9, eq
	stp	w8, w9, [x22]
LBB0_2:
	ldr	w0, [x23]
Lloh2:
	adrp	x21, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x21, [x21, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x21]
	mov	w1, #4
	bl	_kcalloc
	str	x0, [x22, #64]
	cbz	x0, LBB0_16
; %bb.3:
	ldr	w0, [x22]
	ldr	w2, [x21]
	mov	w1, #4
	bl	_kcalloc
	str	x0, [x22, #56]
	cbz	x0, LBB0_16
; %bb.4:
	add	x21, x22, #88
	ldr	w9, [x23]
	cmp	w9, #1
	b.lt	LBB0_8
; %bb.5:
	mov	x8, #0
	ldr	x9, [x22, #64]
	add	x10, x0, #24
Lloh4:
	adrp	x11, _CNIC_ULP_ISCSI@GOTPAGE
Lloh5:
	ldr	x11, [x11, _CNIC_ULP_ISCSI@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	str	x9, [x10]
	ldr	w12, [x11]
	stur	w12, [x10, #-8]
	add	x8, x8, #1
	ldrsw	x12, [x23]
	add	x9, x9, #4
	add	x10, x10, #32
	cmp	x8, x12
	b.lt	LBB0_6
; %bb.7:
	mov	x9, x12
LBB0_8:
	ldrsw	x8, [x22]
	cmp	w9, w8
	b.ge	LBB0_11
; %bb.9:
	sxtw	x10, w9
	add	x9, x0, x10, lsl #5
	add	x9, x9, #16
	sub	x10, x8, x10
Lloh6:
	adrp	x11, _CNIC_ULP_FCOE@GOTPAGE
Lloh7:
	ldr	x11, [x11, _CNIC_ULP_FCOE@GOTPAGEOFF]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x11]
	str	w12, [x9], #32
	subs	x10, x10, #1
	b.ne	LBB0_10
LBB0_11:
Lloh8:
	adrp	x24, _CNIC_KWQ16_DATA_SIZE@GOTPAGE
Lloh9:
	ldr	x24, [x24, _CNIC_KWQ16_DATA_SIZE@GOTPAGEOFF]
	ldr	w9, [x24]
	mul	w0, w9, w8
	bl	_CNIC_PAGE_ALIGN
Lloh10:
	adrp	x23, _CNIC_PAGE_SIZE@GOTPAGE
Lloh11:
	ldr	x23, [x23, _CNIC_PAGE_SIZE@GOTPAGEOFF]
	ldr	w8, [x23]
	sdiv	w2, w0, w8
	mov	x0, x19
	mov	x1, x21
	mov	w3, #0
	bl	_cnic_alloc_dma
	cbnz	w0, LBB0_16
; %bb.12:
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.13:
	mov	x9, #0
	mov	w10, #0
	ldr	w12, [x23]
	ldr	w11, [x24]
	sdiv	w12, w12, w11
	ldr	x16, [x22, #56]
	ldp	x14, x13, [x22, #88]
	sub	w15, w12, #1
	add	x16, x16, #8
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	sdiv	w17, w9, w12
	msub	w17, w17, w12, w9
	mul	w0, w17, w11
	mov	w1, w10
	lsl	x1, x1, #3
	ldr	x2, [x13, x1]
	sxtw	x0, w0
	add	x2, x2, x0
	str	x2, [x16]
	ldr	x1, [x14, x1]
	add	x0, x1, x0
	stur	x0, [x16, #-8]
	cmp	w17, w15
	cinc	w10, w10, eq
	add	x9, x9, #1
	add	x16, x16, #32
	cmp	x8, x9
	b.ne	LBB0_14
LBB0_15:
	add	x1, x22, #52
	mov	x0, x19
	mov	w2, #0
	bl	_cnic_alloc_kcq
	cbz	w0, LBB0_18
LBB0_16:
	mov	x0, x19
	bl	_cnic_free_resc
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_17:
	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_18:
	mov	x0, x20
	bl	_CNIC_SUPPORTS_FCOE
	cbz	x0, LBB0_20
; %bb.19:
	add	x1, x22, #48
	mov	x0, x19
	mov	w2, #1
	bl	_cnic_alloc_kcq
	cbnz	w0, LBB0_16
LBB0_20:
Lloh15:
	adrp	x8, _BNX2X_ISCSI_GLB_BUF_SIZE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _BNX2X_ISCSI_GLB_BUF_SIZE@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	bl	_CNIC_PAGE_ALIGN
	ldr	w8, [x23]
	add	x1, x22, #32
	sdiv	w2, w0, w8
	mov	x0, x19
	mov	w3, #0
	bl	_cnic_alloc_dma
	cbnz	w0, LBB0_16
; %bb.21:
	mov	x0, x19
	bl	_cnic_alloc_bnx2x_context
	cbnz	w0, LBB0_16
; %bb.22:
	ldr	x8, [x22, #16]
	ldr	w9, [x8, #4]
Lloh18:
	adrp	x10, _CNIC_DRV_STATE_NO_ISCSI@GOTPAGE
Lloh19:
	ldr	x10, [x10, _CNIC_DRV_STATE_NO_ISCSI@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_24
; %bb.23:
	mov	w0, #0
	b	LBB0_17
LBB0_24:
	ldr	x8, [x8, #8]
	ldr	w8, [x8, #4]
	str	w8, [x22, #24]
	mov	w8, #15
	str	w8, [x22, #8]
	mov	x0, x19
	mov	w1, #4
	bl	_cnic_alloc_uio_rings
	cbnz	w0, LBB0_16
; %bb.25:
	mov	x0, x19
	bl	_cnic_init_uio
	cbnz	w0, LBB0_16
	b	LBB0_17
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_ISCSI_TBL_SZ,4,2           ; @MAX_ISCSI_TBL_SZ
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_CNIC_ULP_ISCSI,4,2             ; @CNIC_ULP_ISCSI
	.comm	_CNIC_ULP_FCOE,4,2              ; @CNIC_ULP_FCOE
	.comm	_CNIC_KWQ16_DATA_SIZE,4,2       ; @CNIC_KWQ16_DATA_SIZE
	.comm	_CNIC_PAGE_SIZE,4,2             ; @CNIC_PAGE_SIZE
	.comm	_BNX2X_ISCSI_GLB_BUF_SIZE,4,2   ; @BNX2X_ISCSI_GLB_BUF_SIZE
	.comm	_CNIC_DRV_STATE_NO_ISCSI,4,2    ; @CNIC_DRV_STATE_NO_ISCSI
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_cnic_alloc_bnx2x_resc
.subsections_via_symbols
