	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bnx2x_alloc_rx_sge
_bnx2x_alloc_rx_sge:                    ## @bnx2x_alloc_rx_sge
	.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	%rdx, %r12
	movq	%rsi, %rbx
	movq	%rdi, %r13
	movq	_PAGES_PER_SGE_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ecx, %edi
	callq	_alloc_pages
	movq	%rax, %r15
	leaq	(,%r12,8), %r14
	addq	8(%rbx), %r14
	movq	(%rbx), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%edi, %edi
	testq	%r15, %r15
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_BNX2X_ERR
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_5
LBB0_2:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	(%r13), %rdi
	movq	_SGE_PAGES@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	xorl	%r12d, %r12d
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_dma_map_page
	movl	%eax, %ebx
	movq	(%r13), %rdi
	movl	%eax, %esi
	callq	_dma_mapping_error
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_PAGES_PER_SGE_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	___free_pages
	leaq	L_.str.1(%rip), %rdi
	callq	_BNX2X_ERR
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_5
LBB0_4:
	movq	%r15, (%r14)
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%ebx, %edx
	callq	_dma_unmap_addr_set
	movl	%ebx, %edi
	callq	_U64_HI
	movl	%eax, %edi
	callq	_cpu_to_le32
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	shlq	$4, %r15
	movq	%rax, 8(%r14,%r15)
	movl	%ebx, %edi
	callq	_U64_LO
	movl	%eax, %edi
	callq	_cpu_to_le32
	movq	%rax, (%r14,%r15)
LBB0_5:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGES_PER_SGE_SHIFT,4,2        ## @PAGES_PER_SGE_SHIFT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't alloc sge\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_SGE_PAGES,4,2                  ## @SGE_PAGES
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
L_.str.1:                               ## @.str.1
	.asciz	"Can't map sge\n"

	.no_dead_strip	_bnx2x_alloc_rx_sge
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bnx2x_alloc_rx_sge
_bnx2x_alloc_rx_sge:                    ; @bnx2x_alloc_rx_sge
	.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, x2
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x24, _PAGES_PER_SGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x24, [x24, _PAGES_PER_SGE_SHIFT@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x3
	bl	_alloc_pages
	mov	x20, x0
	ldp	x23, x25, [x21]
	cmp	x0, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:
	ldr	x0, [x22]
Lloh4:
	adrp	x8, _SGE_PAGES@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SGE_PAGES@GOTPAGEOFF]
Lloh6:
	ldr	w3, [x8]
Lloh7:
	adrp	x8, _DMA_FROM_DEVICE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh9:
	ldr	w4, [x8]
	mov	x1, x20
	mov	w2, #0
	bl	_dma_map_page
	mov	x21, x0
	ldr	x0, [x22]
	mov	x1, x21
	bl	_dma_mapping_error
	bl	_unlikely
	cbz	x0, LBB0_6
; %bb.3:
	ldr	w1, [x24]
	mov	x0, x20
	bl	___free_pages
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_4:
	bl	_BNX2X_ERR
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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
LBB0_6:
	add	x0, x25, x19, lsl #3
	str	x20, [x0]
	mov	x1, x21
	mov	x2, x21
	bl	_dma_unmap_addr_set
	mov	x0, x21
	bl	_U64_HI
	bl	_cpu_to_le32
	add	x19, x23, x19, lsl #4
	str	x0, [x19, #8]
	mov	x0, x21
	bl	_U64_LO
	bl	_cpu_to_le32
	mov	x8, x0
	mov	w0, #0
	str	x8, [x19]
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGES_PER_SGE_SHIFT,4,2        ; @PAGES_PER_SGE_SHIFT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't alloc sge\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_SGE_PAGES,4,2                  ; @SGE_PAGES
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
l_.str.1:                               ; @.str.1
	.asciz	"Can't map sge\n"

	.no_dead_strip	_bnx2x_alloc_rx_sge
.subsections_via_symbols
