	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bnx2x_alloc_mem                ## -- Begin function bnx2x_alloc_mem
	.p2align	4, 0x90
_bnx2x_alloc_mem:                       ## @bnx2x_alloc_mem
	.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, %r14
	callq	_CONFIGURE_NIC_MODE
	testl	%eax, %eax
	jne	LBB0_3
## %bb.1:
	cmpl	$0, 52(%r14)
	jne	LBB0_3
## %bb.2:
	leaq	48(%r14), %rsi
	movq	_SRC_T2_SZ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%edi, %edi
	callq	_BNX2X_PCI_ALLOC
LBB0_3:
	movl	44(%r14), %edi
	leaq	40(%r14), %rsi
	movl	$4, %edx
	callq	_BNX2X_PCI_ALLOC
	movl	36(%r14), %edi
	leaq	32(%r14), %rsi
	movl	$4, %edx
	callq	_BNX2X_PCI_ALLOC
	movq	%r14, %rdi
	callq	_BNX2X_L2_CID_COUNT
	movl	%eax, %r15d
	shll	$2, %r15d
	testl	%r15d, %r15d
	jle	LBB0_6
## %bb.4:
	xorl	%r12d, %r12d
	movl	$4, %ebx
	movq	_CDU_ILT_PAGE_SZ@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %edi
	movl	%r15d, %esi
	subl	%r12d, %esi
	callq	_min
	movq	24(%r14), %rcx
	leaq	(%rcx,%rbx), %rsi
	movl	%eax, -4(%rcx,%rbx)
	movl	4(%rcx,%rbx), %edi
	movl	%eax, %edx
	callq	_BNX2X_PCI_ALLOC
	movq	24(%r14), %rax
	addl	-4(%rax,%rbx), %r12d
	addq	$12, %rbx
	cmpl	%r12d, %r15d
	jg	LBB0_5
LBB0_6:
	movq	16(%r14), %rax
	movl	(%rax), %edi
	movq	_ILT_MAX_LINES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	shll	$2, %esi
	callq	_BNX2X_ALLOC
	movq	_ILT_MEMOP_ALLOC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_bnx2x_ilt_mem_op
	testq	%rax, %rax
	jne	LBB0_9
## %bb.7:
	movq	%r14, %rdi
	callq	_bnx2x_iov_alloc_mem
	testq	%rax, %rax
	je	LBB0_8
LBB0_9:
	movq	%r14, %rdi
	callq	_bnx2x_free_mem
	leaq	L_.str(%rip), %rdi
	callq	_BNX2X_ERR
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	12(%r14), %edi
	leaq	8(%r14), %rsi
	movq	_BCM_PAGE_SIZE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	callq	_BNX2X_PCI_ALLOC
	movl	4(%r14), %edi
	movq	_NUM_EQ_PAGES@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	imull	(%rbx), %edx
	movq	%r14, %rsi
	callq	_BNX2X_PCI_ALLOC
	xorl	%eax, %eax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_SRC_T2_SZ,4,2                  ## @SRC_T2_SZ
	.comm	_CDU_ILT_PAGE_SZ,4,2            ## @CDU_ILT_PAGE_SZ
	.comm	_ILT_MAX_LINES,4,2              ## @ILT_MAX_LINES
	.comm	_ILT_MEMOP_ALLOC,4,2            ## @ILT_MEMOP_ALLOC
	.comm	_BCM_PAGE_SIZE,4,2              ## @BCM_PAGE_SIZE
	.comm	_NUM_EQ_PAGES,4,2               ## @NUM_EQ_PAGES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't allocate memory\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bnx2x_alloc_mem                ; -- Begin function bnx2x_alloc_mem
	.p2align	2
_bnx2x_alloc_mem:                       ; @bnx2x_alloc_mem
	.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
	bl	_CONFIGURE_NIC_MODE
	cbnz	w0, LBB0_3
; %bb.1:
	ldr	w8, [x19, #52]
	cbnz	w8, LBB0_3
; %bb.2:
	add	x1, x19, #48
Lloh0:
	adrp	x8, _SRC_T2_SZ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SRC_T2_SZ@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w0, #0
	bl	_BNX2X_PCI_ALLOC
LBB0_3:
	ldr	w0, [x19, #44]
	add	x1, x19, #40
	mov	w2, #4
	bl	_BNX2X_PCI_ALLOC
	ldr	w0, [x19, #36]
	add	x1, x19, #32
	mov	w2, #4
	bl	_BNX2X_PCI_ALLOC
	mov	x0, x19
	bl	_BNX2X_L2_CID_COUNT
	lsl	w20, w0, #2
	cmp	w20, #1
	b.lt	LBB0_6
; %bb.4:
	mov	x21, #0
	mov	w22, #0
Lloh3:
	adrp	x23, _CDU_ILT_PAGE_SZ@GOTPAGE
Lloh4:
	ldr	x23, [x23, _CDU_ILT_PAGE_SZ@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x23]
	sub	w1, w20, w22
	bl	_min
	mov	x2, x0
	ldr	x8, [x19, #24]
	add	x8, x8, x21
	str	w0, [x8]
	ldr	w0, [x8, #8]
	add	x1, x8, #4
	bl	_BNX2X_PCI_ALLOC
	ldr	x8, [x19, #24]
	ldr	w8, [x8, x21]
	add	x21, x21, #12
	add	w22, w8, w22
	cmp	w20, w22
	b.gt	LBB0_5
LBB0_6:
	ldr	x8, [x19, #16]
	ldr	w0, [x8]
Lloh5:
	adrp	x8, _ILT_MAX_LINES@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ILT_MAX_LINES@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	lsl	w1, w8, #2
	bl	_BNX2X_ALLOC
Lloh8:
	adrp	x8, _ILT_MEMOP_ALLOC@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ILT_MEMOP_ALLOC@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_bnx2x_ilt_mem_op
	cbnz	x0, LBB0_8
; %bb.7:
	mov	x0, x19
	bl	_bnx2x_iov_alloc_mem
	cbz	x0, LBB0_10
LBB0_8:
	mov	x0, x19
	bl	_bnx2x_free_mem
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_BNX2X_ERR
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	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_10:
	ldr	w0, [x19, #12]
	add	x1, x19, #8
Lloh16:
	adrp	x20, _BCM_PAGE_SIZE@GOTPAGE
Lloh17:
	ldr	x20, [x20, _BCM_PAGE_SIZE@GOTPAGEOFF]
	ldr	w2, [x20]
	bl	_BNX2X_PCI_ALLOC
	ldr	w0, [x19, #4]
	ldr	w8, [x20]
Lloh18:
	adrp	x9, _NUM_EQ_PAGES@GOTPAGE
Lloh19:
	ldr	x9, [x9, _NUM_EQ_PAGES@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	mul	w2, w9, w8
	mov	x1, x19
	bl	_BNX2X_PCI_ALLOC
	mov	w0, #0
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_SRC_T2_SZ,4,2                  ; @SRC_T2_SZ
	.comm	_CDU_ILT_PAGE_SZ,4,2            ; @CDU_ILT_PAGE_SZ
	.comm	_ILT_MAX_LINES,4,2              ; @ILT_MAX_LINES
	.comm	_ILT_MEMOP_ALLOC,4,2            ; @ILT_MEMOP_ALLOC
	.comm	_BCM_PAGE_SIZE,4,2              ; @BCM_PAGE_SIZE
	.comm	_NUM_EQ_PAGES,4,2               ; @NUM_EQ_PAGES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't allocate memory\n"

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