	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bnx2_alloc_mem
_bnx2_alloc_mem:                        ## @bnx2_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, %r13
	movl	$4, %edi
	callq	_L1_CACHE_ALIGN
	movl	%eax, %r14d
	movq	_BNX2_FLAG_MSIX_CAP@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	testl	%eax, (%r13)
	je	LBB0_2
## %bb.1:
	movq	_BNX2_MAX_MSIX_HW_VEC@GOTPCREL(%rip), %rax
	movq	_BNX2_SBLK_MSIX_ALIGN_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	imull	(%rax), %edi
	callq	_L1_CACHE_ALIGN
	movl	%eax, %r14d
LBB0_2:
	leal	4(%r14), %esi
	movl	%esi, 4(%r13)
	movq	32(%r13), %rdi
	leaq	40(%r13), %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r15
	movq	___GFP_ZERO@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	orl	(%r15), %ecx
	callq	_dma_alloc_coherent
	testq	%rax, %rax
	je	LBB0_13
## %bb.3:
	movslq	%r14d, %r8
	movq	64(%r13), %rdx
	movq	%rax, 32(%rdx)
	leaq	4(%rax), %rcx
	movq	%rcx, 16(%rdx)
	movq	%rax, 8(%rdx)
	movl	(%r12), %ecx
	testl	%ecx, (%r13)
	je	LBB0_7
## %bb.4:
	movl	8(%r13), %r10d
	cmpl	$2, %r10d
	jl	LBB0_7
## %bb.5:
	addq	$64, %rdx
	movl	$1, %edi
	movl	$16777216, %ebx                 ## imm = 0x1000000
	movq	_BNX2_SBLK_MSIX_ALIGN_SIZE@GOTPCREL(%rip), %r9
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movslq	(%r9), %rcx
	movslq	%edi, %rsi
	imulq	%rcx, %rsi
	leaq	(%rax,%rsi), %rcx
	movq	%rcx, (%rdx)
	addq	%rax, %rsi
	addq	$4, %rsi
	movq	%rsi, -8(%rdx)
	movq	%rcx, -16(%rdx)
	movl	%ebx, -24(%rdx)
	incq	%rdi
	addl	$16777216, %ebx                 ## imm = 0x1000000
	addq	$40, %rdx
	cmpq	%rdi, %r10
	jne	LBB0_6
LBB0_7:
	addq	%r8, %rax
	movq	%rax, 56(%r13)
	addq	40(%r13), %r8
	movq	%r8, 48(%r13)
	movq	%r13, %rdi
	callq	_BNX2_CHIP
	movq	_BNX2_CHIP_5709@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_14
## %bb.8:
	movq	_BNX2_PAGE_SIZE@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movl	$8192, %eax                     ## imm = 0x2000
	xorl	%edx, %edx
	idivl	%esi
	testl	%eax, %eax
	movl	$1, %ecx
	cmovnel	%eax, %ecx
	movl	%ecx, 12(%r13)
	testl	%ecx, %ecx
	jle	LBB0_14
## %bb.9:
	movq	24(%r13), %rdx
	movq	32(%r13), %rdi
	movl	(%r15), %ecx
	callq	_dma_alloc_coherent
	movq	16(%r13), %rcx
	movq	%rax, (%rcx)
	movq	16(%r13), %rax
	cmpq	$0, (%rax)
	je	LBB0_13
## %bb.10:
	movl	$8, %ebx
	movl	$1, %r12d
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movslq	12(%r13), %rax
	cmpq	%rax, %r12
	jge	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	(%r14), %esi
	movq	32(%r13), %rdi
	movq	24(%r13), %rdx
	addq	%rbx, %rdx
	movl	(%r15), %ecx
	callq	_dma_alloc_coherent
	movq	16(%r13), %rcx
	movq	%rax, (%rcx,%rbx)
	movq	16(%r13), %rax
	incq	%r12
	cmpq	$0, (%rax,%rbx)
	leaq	8(%rbx), %rbx
	jne	LBB0_11
	jmp	LBB0_13
LBB0_14:
	movq	%r13, %rdi
	callq	_bnx2_alloc_rx_mem
	testl	%eax, %eax
	jne	LBB0_13
## %bb.15:
	movq	%r13, %rdi
	callq	_bnx2_alloc_tx_mem
	testl	%eax, %eax
	je	LBB0_16
LBB0_13:
	movq	%r13, %rdi
	callq	_bnx2_free_mem
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_17:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	xorl	%eax, %eax
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_BNX2_FLAG_MSIX_CAP,4,2         ## @BNX2_FLAG_MSIX_CAP
	.comm	_BNX2_MAX_MSIX_HW_VEC,4,2       ## @BNX2_MAX_MSIX_HW_VEC
	.comm	_BNX2_SBLK_MSIX_ALIGN_SIZE,4,2  ## @BNX2_SBLK_MSIX_ALIGN_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	___GFP_ZERO,4,2                 ## @__GFP_ZERO
	.comm	_BNX2_CHIP_5709,8,3             ## @BNX2_CHIP_5709
	.comm	_BNX2_PAGE_SIZE,4,2             ## @BNX2_PAGE_SIZE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_bnx2_alloc_mem
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bnx2_alloc_mem
_bnx2_alloc_mem:                        ; @bnx2_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
	mov	w0, #4
	bl	_L1_CACHE_ALIGN
	ldr	w8, [x19]
Lloh0:
	adrp	x22, _BNX2_FLAG_MSIX_CAP@GOTPAGE
Lloh1:
	ldr	x22, [x22, _BNX2_FLAG_MSIX_CAP@GOTPAGEOFF]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _BNX2_MAX_MSIX_HW_VEC@GOTPAGE
Lloh3:
	ldr	x8, [x8, _BNX2_MAX_MSIX_HW_VEC@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _BNX2_SBLK_MSIX_ALIGN_SIZE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _BNX2_SBLK_MSIX_ALIGN_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	mul	w0, w9, w8
	bl	_L1_CACHE_ALIGN
LBB0_2:
	mov	x20, x0
	add	w1, w0, #4
	str	w1, [x19, #4]
	ldr	x0, [x19, #32]
Lloh8:
	adrp	x21, _GFP_KERNEL@GOTPAGE
Lloh9:
	ldr	x21, [x21, _GFP_KERNEL@GOTPAGEOFF]
	add	x2, x19, #40
	ldr	w8, [x21]
Lloh10:
	adrp	x9, ___GFP_ZERO@GOTPAGE
Lloh11:
	ldr	x9, [x9, ___GFP_ZERO@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	orr	w3, w9, w8
	bl	_dma_alloc_coherent
	cbz	x0, LBB0_15
; %bb.3:
	sxtw	x8, w20
	ldr	x10, [x19, #64]
	str	x0, [x10, #32]
	add	x9, x0, #4
	stp	x0, x9, [x10, #8]
	ldr	w9, [x19]
	ldr	w11, [x22]
	tst	w11, w9
	b.eq	LBB0_7
; %bb.4:
	ldr	w9, [x19, #8]
	cmp	w9, #2
	b.lt	LBB0_7
; %bb.5:
	add	x10, x10, #64
	mov	w11, #16777216
	mov	w12, #1
Lloh13:
	adrp	x13, _BNX2_SBLK_MSIX_ALIGN_SIZE@GOTPAGE
Lloh14:
	ldr	x13, [x13, _BNX2_SBLK_MSIX_ALIGN_SIZE@GOTPAGEOFF]
	mov	w14, #16777216
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldrsw	x15, [x13]
	sxtw	x16, w12
	madd	x15, x15, x16, x0
	add	x16, x15, #4
	stp	x16, x15, [x10, #-8]
	stur	x15, [x10, #-16]
	stur	w14, [x10, #-24]
	add	x12, x12, #1
	add	w14, w14, w11
	add	x10, x10, #40
	cmp	x9, x12
	b.ne	LBB0_6
LBB0_7:
	add	x9, x0, x8
	ldr	x10, [x19, #40]
	add	x8, x10, x8
	stp	x8, x9, [x19, #48]
	mov	x0, x19
	bl	_BNX2_CHIP
Lloh15:
	adrp	x8, _BNX2_CHIP_5709@GOTPAGE
Lloh16:
	ldr	x8, [x8, _BNX2_CHIP_5709@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_13
; %bb.8:
Lloh18:
	adrp	x20, _BNX2_PAGE_SIZE@GOTPAGE
Lloh19:
	ldr	x20, [x20, _BNX2_PAGE_SIZE@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	w8, #8192
	sdiv	w8, w8, w1
	cmp	w8, #0
	csinc	w8, w8, wzr, ne
	str	w8, [x19, #12]
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.9:
	ldp	x2, x0, [x19, #24]
	ldr	w3, [x21]
	bl	_dma_alloc_coherent
	ldr	x8, [x19, #16]
	str	x0, [x8]
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	cbz	x8, LBB0_15
; %bb.10:
	mov	w22, #8
	mov	w23, #1
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldrsw	x8, [x19, #12]
	cmp	x23, x8
	b.ge	LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	w1, [x20]
	ldp	x8, x0, [x19, #24]
	add	x2, x8, x22
	ldr	w3, [x21]
	bl	_dma_alloc_coherent
	ldr	x8, [x19, #16]
	str	x0, [x8, x22]
	ldr	x8, [x19, #16]
	ldr	x8, [x8, x22]
	add	x22, x22, #8
	add	x23, x23, #1
	cbnz	x8, LBB0_11
	b	LBB0_15
LBB0_13:
	mov	x0, x19
	bl	_bnx2_alloc_rx_mem
	cbnz	w0, LBB0_15
; %bb.14:
	mov	x0, x19
	bl	_bnx2_alloc_tx_mem
	cbz	w0, LBB0_16
LBB0_15:
	mov	x0, x19
	bl	_bnx2_free_mem
Lloh20:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_16:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_BNX2_FLAG_MSIX_CAP,4,2         ; @BNX2_FLAG_MSIX_CAP
	.comm	_BNX2_MAX_MSIX_HW_VEC,4,2       ; @BNX2_MAX_MSIX_HW_VEC
	.comm	_BNX2_SBLK_MSIX_ALIGN_SIZE,4,2  ; @BNX2_SBLK_MSIX_ALIGN_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	___GFP_ZERO,4,2                 ; @__GFP_ZERO
	.comm	_BNX2_CHIP_5709,8,3             ; @BNX2_CHIP_5709
	.comm	_BNX2_PAGE_SIZE,4,2             ; @BNX2_PAGE_SIZE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_bnx2_alloc_mem
.subsections_via_symbols
