	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cnic_alloc_bnx2x_context
_cnic_alloc_bnx2x_context:              ## @cnic_alloc_bnx2x_context
	.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
	movq	%rdi, %r15
	movq	16(%rdi), %r12
	movl	8(%rdi), %edi
	callq	_netdev_priv
	movq	%rax, %rbx
	movq	32(%r12), %rcx
	movq	_BNX2X_CONTEXT_MEM_SIZE@GOTPCREL(%rip), %r14
	movl	(%r12), %eax
	imull	(%r14), %eax
	movl	(%rcx), %esi
	cltd
	idivl	%esi
	movl	%eax, %r13d
	cmpl	$1, %edx
	sbbl	$-1, %r13d
	cmpl	4(%rcx), %r13d
	jg	LBB0_1
## %bb.2:
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r13d, %edi
	movl	$4, %esi
	callq	_kcalloc
	movq	%rax, 24(%r12)
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movl	%r13d, 4(%r12)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 8(%r12)
	movq	%rbx, %rdi
	movl	%eax, %ebx
	callq	_CHIP_IS_E1
	testl	%eax, %eax
	cmovnel	%ebx, %eax
	movl	%eax, 12(%r12)
	movl	%ebx, %eax
	cltd
	idivl	(%r14)
	movl	%eax, 16(%r12)
	testl	%r13d, %r13d
	jle	LBB0_11
## %bb.4:
	xorl	%ebx, %ebx
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	incl	%ebx
	cmpl	%r13d, %ebx
	jge	LBB0_11
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rdi
	movl	8(%r12), %esi
	movslq	%ebx, %r14
	shlq	$4, %r14
	movq	24(%r12), %rdx
	addq	%r14, %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_alloc_coherent
	movq	24(%r12), %rcx
	movq	%rax, 8(%rcx,%r14)
	testq	%rax, %rax
	je	LBB0_1
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	12(%r12), %eax
	testl	%eax, %eax
	je	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	cmpl	%edx, 8(%r12)
	jne	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	decl	%eax
	testl	%eax, (%rcx,%r14)
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%r15, %rdi
	callq	_cnic_free_context
	movl	12(%r12), %eax
	addl	%eax, 8(%r12)
	movl	$-1, %ebx
	jmp	LBB0_10
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_12
LBB0_11:
	xorl	%eax, %eax
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BNX2X_CONTEXT_MEM_SIZE,4,2     ## @BNX2X_CONTEXT_MEM_SIZE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.no_dead_strip	_cnic_alloc_bnx2x_context
.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_context
_cnic_alloc_bnx2x_context:              ; @cnic_alloc_bnx2x_context
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	ldr	x22, [x0, #16]
	ldr	w0, [x0, #8]
	bl	_netdev_priv
	ldr	x8, [x22, #32]
Lloh0:
	adrp	x25, _BNX2X_CONTEXT_MEM_SIZE@GOTPAGE
Lloh1:
	ldr	x25, [x25, _BNX2X_CONTEXT_MEM_SIZE@GOTPAGEOFF]
	ldr	w9, [x25]
	ldr	w10, [x22]
	mul	w9, w10, w9
	ldp	w23, w8, [x8]
	sdiv	w10, w9, w23
	msub	w9, w10, w23, w9
	cmp	w9, #0
	cinc	w20, w10, ne
	cmp	w20, w8
	b.gt	LBB0_10
; %bb.1:
	mov	x21, x0
Lloh2:
	adrp	x24, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x24, [x24, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x24]
	mov	x0, x20
	mov	w1, #4
	bl	_kcalloc
	str	x0, [x22, #24]
	cbz	x0, LBB0_10
; %bb.2:
	stp	w20, w23, [x22, #4]
	mov	x0, x21
	bl	_CHIP_IS_E1
	cmp	w0, #0
	csel	w8, wzr, w23, eq
	ldr	w9, [x25]
	sdiv	w9, w23, w9
	stp	w8, w9, [x22, #12]
	cmp	w20, #1
	b.lt	LBB0_11
; %bb.3:
	mov	w21, #0
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w21, w21, #1
	cmp	w21, w20
	b.ge	LBB0_11
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x19]
	ldr	w1, [x22, #8]
	ldr	x8, [x22, #24]
	sbfiz	x25, x21, #4, #32
	add	x2, x8, x25
	ldr	w3, [x24]
	bl	_dma_alloc_coherent
	ldr	x8, [x22, #24]
	add	x9, x8, x25
	str	x0, [x9, #8]
	cbz	x0, LBB0_10
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w9, [x22, #12]
	cbz	w9, LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w10, [x22, #8]
	cmp	w10, w23
	b.ne	LBB0_4
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	sxtw	x10, w21
	lsl	x10, x10, #4
	ldr	w8, [x8, x10]
	sub	w9, w9, #1
	tst	w8, w9
	b.eq	LBB0_4
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x19
	bl	_cnic_free_context
	ldp	w9, w8, [x22, #8]
	add	w8, w9, w8
	str	w8, [x22, #8]
	mov	w21, #-1
	b	LBB0_4
LBB0_10:
Lloh4:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_11:
	mov	w0, #0
LBB0_12:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_BNX2X_CONTEXT_MEM_SIZE,4,2     ; @BNX2X_CONTEXT_MEM_SIZE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.no_dead_strip	_cnic_alloc_bnx2x_context
.subsections_via_symbols
