	.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, %r12
	movq	40(%rdi), %rax
	movq	48(%rdi), %rcx
	movq	%rax, 32(%rcx)
	leaq	12(%rax), %rdx
	movq	%rdx, 16(%rcx)
	leaq	8(%rax), %rdx
	movq	%rdx, 8(%rcx)
	movq	_BNX2_FLAG_MSIX_CAP@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, (%rdi)
	je	LBB0_4
## %bb.1:
	movl	4(%r12), %r9d
	cmpl	$2, %r9d
	jl	LBB0_4
## %bb.2:
	addq	$64, %rcx
	movl	$1, %esi
	movl	$16777216, %edi                 ## imm = 0x1000000
	movq	_BNX2_SBLK_MSIX_ALIGN_SIZE@GOTPCREL(%rip), %r8
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movslq	(%r8), %rbx
	movslq	%esi, %rdx
	imulq	%rbx, %rdx
	shlq	$4, %rdx
	leaq	(%rax,%rdx), %rbx
	movq	%rbx, (%rcx)
	addq	%rax, %rdx
	addq	$4, %rdx
	movq	%rdx, -8(%rcx)
	movq	%rbx, -16(%rcx)
	movl	%edi, -24(%rcx)
	incq	%rsi
	addl	$16777216, %edi                 ## imm = 0x1000000
	addq	$40, %rcx
	cmpq	%rsi, %r9
	jne	LBB0_3
LBB0_4:
	movq	%r12, %rdi
	callq	_BNX2_CHIP
	movq	_BNX2_CHIP_5709@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.5:
	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, 8(%r12)
	testl	%ecx, %ecx
	jle	LBB0_11
## %bb.6:
	movq	24(%r12), %rdx
	movq	32(%r12), %rdi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	callq	_dma_alloc_coherent
	movq	16(%r12), %rcx
	movl	%eax, (%rcx)
	testl	%eax, %eax
	je	LBB0_10
## %bb.7:
	movl	$4, %ebx
	movl	$1, %r13d
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movslq	8(%r12), %rax
	cmpq	%rax, %r13
	jge	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movl	(%r14), %esi
	movq	32(%r12), %rdi
	movq	24(%r12), %rdx
	addq	%rbx, %rdx
	movl	(%r15), %ecx
	callq	_dma_alloc_coherent
	movq	16(%r12), %rcx
	movl	%eax, (%rcx,%rbx)
	addq	$4, %rbx
	incq	%r13
	testl	%eax, %eax
	jne	LBB0_8
	jmp	LBB0_10
LBB0_11:
	movq	%r12, %rdi
	callq	_bnx2_alloc_rx_mem
	testl	%eax, %eax
	jne	LBB0_10
## %bb.12:
	movq	%r12, %rdi
	callq	_bnx2_alloc_tx_mem
	testl	%eax, %eax
	je	LBB0_13
LBB0_10:
	movq	%r12, %rdi
	callq	_bnx2_free_mem
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	xorl	%eax, %eax
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_BNX2_FLAG_MSIX_CAP,4,2         ## @BNX2_FLAG_MSIX_CAP
	.comm	_BNX2_SBLK_MSIX_ALIGN_SIZE,4,2  ## @BNX2_SBLK_MSIX_ALIGN_SIZE
	.comm	_BNX2_CHIP_5709,8,3             ## @BNX2_CHIP_5709
	.comm	_BNX2_PAGE_SIZE,4,2             ## @BNX2_PAGE_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.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
	ldp	x8, x10, [x0, #40]
	str	x8, [x10, #32]
	add	x9, x8, #12
	add	x11, x8, #8
	stp	x11, x9, [x10, #8]
	ldr	w9, [x0]
Lloh0:
	adrp	x11, _BNX2_FLAG_MSIX_CAP@GOTPAGE
Lloh1:
	ldr	x11, [x11, _BNX2_FLAG_MSIX_CAP@GOTPAGEOFF]
Lloh2:
	ldr	w11, [x11]
	tst	w11, w9
	b.eq	LBB0_4
; %bb.1:
	ldr	w9, [x19, #4]
	cmp	w9, #2
	b.lt	LBB0_4
; %bb.2:
	add	x10, x10, #64
	mov	w11, #16777216
	mov	w12, #1
Lloh3:
	adrp	x13, _BNX2_SBLK_MSIX_ALIGN_SIZE@GOTPAGE
Lloh4:
	ldr	x13, [x13, _BNX2_SBLK_MSIX_ALIGN_SIZE@GOTPAGEOFF]
	mov	w14, #16777216
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w15, [x13]
	mul	w15, w15, w12
	add	x15, x8, w15, sxtw #4
	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_3
LBB0_4:
	mov	x0, x19
	bl	_BNX2_CHIP
Lloh5:
	adrp	x8, _BNX2_CHIP_5709@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BNX2_CHIP_5709@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_10
; %bb.5:
Lloh8:
	adrp	x20, _BNX2_PAGE_SIZE@GOTPAGE
Lloh9:
	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, #8]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.6:
	ldp	x2, x0, [x19, #24]
Lloh10:
	adrp	x21, _GFP_KERNEL@GOTPAGE
Lloh11:
	ldr	x21, [x21, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w3, [x21]
	bl	_dma_alloc_coherent
	ldr	x8, [x19, #16]
	str	w0, [x8]
	cbz	w0, LBB0_12
; %bb.7:
	mov	w22, #4
	mov	w23, #1
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldrsw	x8, [x19, #8]
	cmp	x23, x8
	b.ge	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 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	w0, [x8, x22]
	add	x22, x22, #4
	add	x23, x23, #1
	cbnz	w0, LBB0_8
	b	LBB0_12
LBB0_10:
	mov	x0, x19
	bl	_bnx2_alloc_rx_mem
	cbnz	w0, LBB0_12
; %bb.11:
	mov	x0, x19
	bl	_bnx2_alloc_tx_mem
	cbz	w0, LBB0_13
LBB0_12:
	mov	x0, x19
	bl	_bnx2_free_mem
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_BNX2_FLAG_MSIX_CAP,4,2         ; @BNX2_FLAG_MSIX_CAP
	.comm	_BNX2_SBLK_MSIX_ALIGN_SIZE,4,2  ; @BNX2_SBLK_MSIX_ALIGN_SIZE
	.comm	_BNX2_CHIP_5709,8,3             ; @BNX2_CHIP_5709
	.comm	_BNX2_PAGE_SIZE,4,2             ; @BNX2_PAGE_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_bnx2_alloc_mem
.subsections_via_symbols
