	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movq	24(%rsi), %r15
	movq	8(%rsi), %rsi
	movq	16(%rbx), %r13
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.1:
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %rdx
LBB0_5:
	movq	(%r12), %rdi
	movq	_SGE_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	callq	_dma_map_page
	movl	%eax, %r13d
	movq	(%r12), %rdi
	movl	%eax, %esi
	callq	_dma_mapping_error
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	leaq	L_.str(%rip), %rdi
	callq	_BNX2X_ERR
	jmp	LBB0_3
LBB0_2:
	movq	_PAGES_PER_SGE_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ecx, %edi
	callq	_alloc_pages
	movq	%rax, 8(%rbx)
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_4
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_11
LBB0_7:
	shlq	$4, %r14
	movq	8(%rbx), %rax
	movq	%rax, 8(%r15,%r14)
	addq	%r14, %r15
	movq	(%rbx), %rax
	movq	%rax, (%r15)
	movq	%r15, %rdi
	movl	%r13d, %esi
	movl	%r13d, %edx
	callq	_dma_unmap_addr_set
	movl	%r13d, %edi
	callq	_U64_HI
	movl	%eax, %edi
	callq	_cpu_to_le32
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	%rax, 8(%r15,%r14)
	movl	%r13d, %edi
	callq	_U64_LO
	movl	%eax, %edi
	callq	_cpu_to_le32
	movq	%rax, (%r15,%r14)
	movq	(%rbx), %rax
	movq	_SGE_PAGE_SIZE@GOTPCREL(%rip), %rdx
	addq	(%rdx), %rax
	movq	%rax, (%rbx)
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	subq	%rax, %rcx
	cmpq	(%rdx), %rcx
	jge	LBB0_8
## %bb.9:
	movq	$0, 8(%rbx)
	jmp	LBB0_10
LBB0_4:
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	$0, (%rbx)
	movq	8(%rbx), %rsi
	xorl	%edx, %edx
	jmp	LBB0_5
LBB0_8:
	movq	8(%rbx), %rdi
	callq	_get_page
LBB0_10:
	xorl	%eax, %eax
LBB0_11:
	addq	$8, %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
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_SGE_PAGE_SIZE,8,3              ## @SGE_PAGE_SIZE
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't map sge\n"

	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.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	x20, x2
	mov	x19, x1
	mov	x21, x0
	ldp	x23, x24, [x1, #16]
	ldr	x1, [x1, #8]
	cbz	x1, LBB0_4
; %bb.1:
	ldr	x2, [x19]
LBB0_2:
	ldr	x0, [x21]
Lloh0:
	adrp	x25, _SGE_PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x25, [x25, _SGE_PAGE_SIZE@GOTPAGEOFF]
	ldr	x3, [x25]
Lloh2:
	adrp	x8, _DMA_FROM_DEVICE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh4:
	ldr	w4, [x8]
	bl	_dma_map_page
	mov	x22, x0
	ldr	x0, [x21]
	mov	x1, x22
	bl	_dma_mapping_error
	bl	_unlikely
	cbz	x0, LBB0_7
; %bb.3:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_BNX2X_ERR
	b	LBB0_5
LBB0_4:
Lloh7:
	adrp	x8, _PAGES_PER_SGE_SHIFT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PAGES_PER_SGE_SHIFT@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x3
	bl	_alloc_pages
	str	x0, [x19, #8]
	cmp	x0, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_9
LBB0_5:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	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_7:
	add	x0, x24, x20, lsl #4
	lsl	x20, x20, #4
	ldp	x9, x8, [x19]
	add	x10, x24, x20
	str	x8, [x10, #8]
	str	x9, [x0]
	mov	x1, x22
	mov	x2, x22
	bl	_dma_unmap_addr_set
	mov	x0, x22
	bl	_U64_HI
	bl	_cpu_to_le32
	add	x20, x23, x20
	str	x0, [x20, #8]
	mov	x0, x22
	bl	_U64_LO
	bl	_cpu_to_le32
	str	x0, [x20]
	ldr	x8, [x25]
	ldr	x9, [x19]
	add	x8, x9, x8
	str	x8, [x19]
Lloh13:
	adrp	x9, _PAGE_SIZE@GOTPAGE
Lloh14:
	ldr	x9, [x9, _PAGE_SIZE@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	sub	x8, x9, x8
	ldr	x9, [x25]
	cmp	x8, x9
	b.ge	LBB0_10
; %bb.8:
	mov	w0, #0
	str	xzr, [x19, #8]
	b	LBB0_6
LBB0_9:
	mov	x2, #0
	str	xzr, [x19]
	ldr	x1, [x19, #8]
	b	LBB0_2
LBB0_10:
	ldr	x0, [x19, #8]
	bl	_get_page
	mov	w0, #0
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGES_PER_SGE_SHIFT,4,2        ; @PAGES_PER_SGE_SHIFT
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_SGE_PAGE_SIZE,8,3              ; @SGE_PAGE_SIZE
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't map sge\n"

	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.no_dead_strip	_bnx2x_alloc_rx_sge
.subsections_via_symbols
