	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bnxt_alloc_rx_page
_bnxt_alloc_rx_page:                    ## @bnxt_alloc_rx_page
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movq	%rdx, %rbx
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	40(%rsi), %r12
	movq	%rdx, %rdi
	callq	_RX_RING
	movq	(%r12,%rax,8), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_RX_IDX
	movq	(%r14), %r14
	movq	(%r13), %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdx
	movq	_BNXT_RX_PAGE_SIZE@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rcx
	cmpq	%rcx, %rdx
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	jle	LBB0_9
## %bb.1:
	movq	32(%r13), %r12
	testq	%r12, %r12
	je	LBB0_3
## %bb.2:
	movl	8(%r13), %ebx
	jmp	LBB0_7
LBB0_9:
	movl	%r15d, %edi
	callq	_alloc_page
	testq	%rax, %rax
	je	LBB0_4
## %bb.10:
	movq	%rax, %r12
	xorl	%ebx, %ebx
	movq	_BNXT_RX_PAGE_SIZE@GOTPCREL(%rip), %rsi
	jmp	LBB0_12
LBB0_3:
	movl	%r15d, %edi
	callq	_alloc_page
	testq	%rax, %rax
	je	LBB0_4
## %bb.6:
	movq	%rax, %r12
	movq	%rax, 32(%r13)
	movq	_BNXT_RX_PAGE_SIZE@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rcx
	movq	(%rbx), %rdx
	xorl	%ebx, %ebx
LBB0_7:
	addl	%ebx, %ecx
	movl	%ecx, 8(%r13)
	cmpq	%rcx, %rdx
	jne	LBB0_11
## %bb.8:
	movq	$0, 32(%r13)
	jmp	LBB0_12
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_5
LBB0_11:
	movq	%r12, %rdi
	movq	%rsi, %r15
	callq	_get_page
	movq	%r15, %rsi
LBB0_12:
	movq	(%rsi), %rcx
	movq	_PCI_DMA_FROMDEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_DMA_ATTR_WEAK_ORDERING@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	%ebx, %edx
	callq	_dma_map_page_attrs
	movl	%eax, %r15d
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_dma_mapping_error
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	movq	%r12, %rdi
	callq	___free_page
	movq	_EIO@GOTPCREL(%rip), %rcx
LBB0_5:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_17
LBB0_14:
	movl	24(%r13), %esi
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_test_bit
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	je	LBB0_16
## %bb.15:
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_bnxt_find_next_agg_idx
	movq	%rax, %r14
LBB0_16:
	movl	24(%r13), %esi
	movq	%r14, %rdi
	callq	___set_bit
	movq	16(%r13), %rbx
	movq	%r14, %rdi
	callq	_NEXT_RX_AGG
	movq	%rax, (%r13)
	movq	%r14, %rax
	shlq	$4, %rax
	movq	%r12, 8(%rbx,%rax)
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, (%rbx,%rax)
	movl	%r15d, 4(%rbx,%rax)
	movl	%r15d, %edi
	callq	_cpu_to_le64
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	shlq	$4, %rcx
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movl	%eax, 8(%rdx,%rcx)
	movq	%r14, (%rdx,%rcx)
	xorl	%eax, %eax
LBB0_17:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_BNXT_RX_PAGE_SIZE,8,3          ## @BNXT_RX_PAGE_SIZE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PCI_DMA_FROMDEVICE,4,2         ## @PCI_DMA_FROMDEVICE
	.comm	_DMA_ATTR_WEAK_ORDERING,4,2     ## @DMA_ATTR_WEAK_ORDERING
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_bnxt_alloc_rx_page
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bnxt_alloc_rx_page
_bnxt_alloc_rx_page:                    ; @bnxt_alloc_rx_page
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x23, x3
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
	ldr	x22, [x1, #40]
	mov	x0, x2
	bl	_RX_RING
	ldr	x26, [x22, x0, lsl #3]
	mov	x0, x20
	bl	_RX_IDX
	mov	x20, x0
	ldr	x24, [x21]
Lloh0:
	adrp	x27, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x27, [x27, _PAGE_SIZE@GOTPAGEOFF]
	ldr	x21, [x19]
	ldr	x8, [x27]
Lloh2:
	adrp	x25, _BNXT_RX_PAGE_SIZE@GOTPAGE
Lloh3:
	ldr	x25, [x25, _BNXT_RX_PAGE_SIZE@GOTPAGEOFF]
	ldr	x9, [x25]
	cmp	x8, x9
	b.le	LBB0_3
; %bb.1:
	ldr	x22, [x19, #32]
	cbz	x22, LBB0_5
; %bb.2:
	ldr	w23, [x19, #8]
	b	LBB0_7
LBB0_3:
	mov	x0, x23
	bl	_alloc_page
	cbz	x0, LBB0_9
; %bb.4:
	mov	x22, x0
	mov	w23, #0
	b	LBB0_11
LBB0_5:
	mov	x0, x23
	bl	_alloc_page
	cbz	x0, LBB0_9
; %bb.6:
	mov	x22, x0
	mov	w23, #0
	str	x0, [x19, #32]
	ldr	x9, [x25]
	ldr	x8, [x27]
LBB0_7:
	add	w9, w23, w9
	cmp	x8, x9
	str	w9, [x19, #8]
	b.ne	LBB0_10
; %bb.8:
	str	xzr, [x19, #32]
	b	LBB0_11
LBB0_9:
Lloh4:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_13
LBB0_10:
	mov	x0, x22
	bl	_get_page
LBB0_11:
	ldr	x3, [x25]
Lloh6:
	adrp	x8, _PCI_DMA_FROMDEVICE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PCI_DMA_FROMDEVICE@GOTPAGEOFF]
Lloh8:
	ldr	w4, [x8]
Lloh9:
	adrp	x8, _DMA_ATTR_WEAK_ORDERING@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DMA_ATTR_WEAK_ORDERING@GOTPAGEOFF]
Lloh11:
	ldr	w5, [x8]
	mov	x0, x24
	mov	x1, x22
	mov	x2, x23
	bl	_dma_map_page_attrs
	mov	x25, x0
	mov	x0, x24
	mov	x1, x25
	bl	_dma_mapping_error
	cbz	x0, LBB0_14
; %bb.12:
	mov	x0, x22
	bl	___free_page
Lloh12:
	adrp	x8, _EIO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_13:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_17
LBB0_14:
	ldr	w1, [x19, #24]
	mov	x0, x21
	bl	_test_bit
	bl	_unlikely
	cbz	x0, LBB0_16
; %bb.15:
	mov	x0, x19
	mov	x1, x21
	bl	_bnxt_find_next_agg_idx
	mov	x21, x0
LBB0_16:
	ldr	w1, [x19, #24]
	mov	x0, x21
	bl	___set_bit
	ldr	x24, [x19, #16]
	mov	x0, x21
	bl	_NEXT_RX_AGG
	str	x0, [x19]
	add	x8, x24, x21, lsl #4
	str	x22, [x8, #8]
	stp	w23, w25, [x8]
	mov	x0, x25
	bl	_cpu_to_le64
	mov	x8, x0
	mov	w0, #0
	add	x9, x26, x20, lsl #4
	str	w8, [x9, #8]
	str	x21, [x9]
LBB0_17:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_BNXT_RX_PAGE_SIZE,8,3          ; @BNXT_RX_PAGE_SIZE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PCI_DMA_FROMDEVICE,4,2         ; @PCI_DMA_FROMDEVICE
	.comm	_DMA_ATTR_WEAK_ORDERING,4,2     ; @DMA_ATTR_WEAK_ORDERING
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_bnxt_alloc_rx_page
.subsections_via_symbols
