	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rds_iw_recv_refill_one
_rds_iw_recv_refill_one:                ## @rds_iw_recv_refill_one
	.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
	movl	%edx, %ebx
	movq	%rsi, %r14
	movq	8(%rdi), %r13
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	cmpq	$0, 16(%rsi)
	je	LBB0_1
## %bb.6:
	cmpq	$0, (%r14)
	jne	LBB0_9
LBB0_7:
	movl	%ecx, %r12d
	movq	_rds_iw_frag_slab@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	callq	_kmem_cache_alloc
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_18
## %bb.8:
	addq	$24, %rax
	movq	%rax, %rdi
	callq	_INIT_LIST_HEAD
	movq	(%r14), %rax
	movq	$0, 8(%rax)
	movl	%r12d, %ecx
	jmp	LBB0_9
LBB0_1:
	movq	%rdi, %r12
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	_rds_iw_sysctl_max_recv_allocation@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_rds_iw_allocation@GOTPCREL(%rip), %rdi
	movl	$1, %esi
	callq	_atomic_add_unless
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	movq	_rds_iw_incoming_slab@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	callq	_kmem_cache_alloc
	movq	%rax, 16(%r14)
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	addq	$4, %rax
	movq	%rax, %rdi
	callq	_INIT_LIST_HEAD
	movq	16(%r14), %rdi
	movl	(%r12), %edx
	movq	%r12, %rsi
	callq	_rds_inc_init
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	cmpq	$0, (%r14)
	je	LBB0_7
LBB0_9:
	movq	8(%r13), %rsi
	testq	%rsi, %rsi
	je	LBB0_11
## %bb.10:
	movq	(%r13), %rdx
	jmp	LBB0_13
LBB0_11:
	movl	%ecx, %edi
	callq	_alloc_page
	movq	%rax, 8(%r13)
	testq	%rax, %rax
	je	LBB0_18
## %bb.12:
	movq	%rax, %rsi
	movq	$0, (%r13)
	xorl	%edx, %edx
LBB0_13:
	movq	32(%r13), %rax
	movl	(%rax), %edi
	movq	_RDS_FRAG_SIZE@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	callq	_ib_dma_map_page
	movq	%rax, %rbx
	movq	32(%r13), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_ib_dma_mapping_error
	testq	%rax, %rax
	jne	LBB0_18
## %bb.14:
	movq	8(%r13), %rax
	movq	(%r14), %rcx
	movq	%rax, 8(%rcx)
	movq	(%r13), %rax
	movq	%rax, (%rcx)
	movq	%rbx, 16(%rcx)
	movl	8(%r14), %esi
	movq	%r13, %rdi
	callq	_rds_iw_data_sge
	movq	%rbx, 8(%rax)
	movl	(%r12), %ecx
	movl	%ecx, (%rax)
	movl	8(%r14), %esi
	movq	%r13, %rdi
	callq	_rds_iw_header_sge
	movq	%r14, %rcx
	subq	16(%r13), %rcx
	sarq	$3, %rcx
	movabsq	$-6148914691236517204, %rdx     ## imm = 0xAAAAAAAAAAAAAAAC
	imulq	%rcx, %rdx
	addq	24(%r13), %rdx
	movq	%rdx, 8(%rax)
	movl	$4, (%rax)
	movq	(%r14), %rax
	movq	8(%rax), %rdi
	callq	_get_page
	movq	(%r13), %rax
	movq	_RDS_PAGE_LAST_OFF@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_16
## %bb.15:
	movslq	(%r12), %rcx
	addq	%rcx, %rax
	jmp	LBB0_17
LBB0_2:
	movq	_s_iw_rx_alloc_limit@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_rds_iw_stats_inc
	jmp	LBB0_18
LBB0_16:
	movq	8(%r13), %rdi
	callq	_put_page
	movq	$0, 8(%r13)
	xorl	%eax, %eax
LBB0_17:
	movq	%rax, (%r13)
	xorl	%r15d, %r15d
	jmp	LBB0_18
LBB0_4:
	movq	_rds_iw_allocation@GOTPCREL(%rip), %rdi
	callq	_atomic_dec
LBB0_18:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_rds_iw_allocation,4,2          ## @rds_iw_allocation
	.comm	_rds_iw_sysctl_max_recv_allocation,4,2 ## @rds_iw_sysctl_max_recv_allocation
	.comm	_s_iw_rx_alloc_limit,4,2        ## @s_iw_rx_alloc_limit
	.comm	_rds_iw_incoming_slab,4,2       ## @rds_iw_incoming_slab
	.comm	_rds_iw_frag_slab,4,2           ## @rds_iw_frag_slab
	.comm	_RDS_FRAG_SIZE,4,2              ## @RDS_FRAG_SIZE
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.comm	_RDS_PAGE_LAST_OFF,8,3          ## @RDS_PAGE_LAST_OFF
	.no_dead_strip	_rds_iw_recv_refill_one
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rds_iw_recv_refill_one
_rds_iw_recv_refill_one:                ; @rds_iw_recv_refill_one
	.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	x22, x3
	mov	x23, x2
	mov	x20, x1
	ldr	x19, [x0, #8]
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w21, w8
	ldr	x8, [x1, #16]
	cbz	x8, LBB0_4
; %bb.1:
	ldr	x8, [x20]
	cbz	x8, LBB0_7
LBB0_2:
	ldr	x1, [x19, #8]
	cbz	x1, LBB0_9
LBB0_3:
	ldr	x2, [x19]
	b	LBB0_11
LBB0_4:
	mov	x24, x0
Lloh3:
	adrp	x8, _rds_iw_sysctl_max_recv_allocation@GOTPAGE
Lloh4:
	ldr	x8, [x8, _rds_iw_sysctl_max_recv_allocation@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
Lloh6:
	adrp	x0, _rds_iw_allocation@GOTPAGE
Lloh7:
	ldr	x0, [x0, _rds_iw_allocation@GOTPAGEOFF]
	mov	w1, #1
	bl	_atomic_add_unless
	cbz	w0, LBB0_14
; %bb.5:
Lloh8:
	adrp	x8, _rds_iw_incoming_slab@GOTPAGE
Lloh9:
	ldr	x8, [x8, _rds_iw_incoming_slab@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	mov	x1, x23
	bl	_kmem_cache_alloc
	str	x0, [x20, #16]
	cbz	x0, LBB0_17
; %bb.6:
	add	x0, x0, #4
	bl	_INIT_LIST_HEAD
	ldr	x0, [x20, #16]
	ldr	w2, [x24]
	mov	x1, x24
	bl	_rds_inc_init
	ldr	x8, [x20]
	cbnz	x8, LBB0_2
LBB0_7:
Lloh11:
	adrp	x8, _rds_iw_frag_slab@GOTPAGE
Lloh12:
	ldr	x8, [x8, _rds_iw_frag_slab@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	mov	x1, x23
	bl	_kmem_cache_alloc
	str	x0, [x20]
	cbz	x0, LBB0_18
; %bb.8:
	add	x0, x0, #24
	bl	_INIT_LIST_HEAD
	ldr	x8, [x20]
	str	xzr, [x8, #8]
	ldr	x1, [x19, #8]
	cbnz	x1, LBB0_3
LBB0_9:
	mov	x0, x22
	bl	_alloc_page
	str	x0, [x19, #8]
	cbz	x0, LBB0_18
; %bb.10:
	mov	x1, x0
	mov	x2, #0
	str	xzr, [x19]
LBB0_11:
	ldr	x8, [x19, #32]
	ldr	w0, [x8]
Lloh14:
	adrp	x23, _RDS_FRAG_SIZE@GOTPAGE
Lloh15:
	ldr	x23, [x23, _RDS_FRAG_SIZE@GOTPAGEOFF]
	ldr	w3, [x23]
Lloh16:
	adrp	x8, _DMA_FROM_DEVICE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh18:
	ldr	w4, [x8]
	bl	_ib_dma_map_page
	mov	x22, x0
	ldr	x8, [x19, #32]
	ldr	w0, [x8]
	mov	x1, x22
	bl	_ib_dma_mapping_error
	cbnz	x0, LBB0_18
; %bb.12:
	ldr	x8, [x20]
	ldp	x10, x9, [x19]
	stp	x10, x9, [x8]
	str	x22, [x8, #16]
	ldr	w1, [x20, #8]
	mov	x0, x19
	bl	_rds_iw_data_sge
	str	x22, [x0, #8]
	ldr	w8, [x23]
	str	w8, [x0]
	ldr	w1, [x20, #8]
	mov	x0, x19
	bl	_rds_iw_header_sge
	ldp	x9, x8, [x19, #16]
	sub	x9, x20, x9
	asr	x9, x9, #3
	mov	x10, #-6148914691236517206
	movk	x10, #43692
	madd	x8, x9, x10, x8
	str	x8, [x0, #8]
	mov	w8, #4
	str	w8, [x0]
	ldr	x8, [x20]
	ldr	x0, [x8, #8]
	bl	_get_page
	ldr	x8, [x19]
Lloh19:
	adrp	x9, _RDS_PAGE_LAST_OFF@GOTPAGE
Lloh20:
	ldr	x9, [x9, _RDS_PAGE_LAST_OFF@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_15
; %bb.13:
	ldrsw	x9, [x23]
	add	x8, x8, x9
	b	LBB0_16
LBB0_14:
Lloh22:
	adrp	x8, _s_iw_rx_alloc_limit@GOTPAGE
Lloh23:
	ldr	x8, [x8, _s_iw_rx_alloc_limit@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	bl	_rds_iw_stats_inc
	b	LBB0_18
LBB0_15:
	ldr	x0, [x19, #8]
	bl	_put_page
	mov	x8, #0
	str	xzr, [x19, #8]
LBB0_16:
	mov	w21, #0
	str	x8, [x19]
	b	LBB0_18
LBB0_17:
Lloh25:
	adrp	x0, _rds_iw_allocation@GOTPAGE
Lloh26:
	ldr	x0, [x0, _rds_iw_allocation@GOTPAGEOFF]
	bl	_atomic_dec
LBB0_18:
	mov	x0, x21
	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	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_rds_iw_allocation,4,2          ; @rds_iw_allocation
	.comm	_rds_iw_sysctl_max_recv_allocation,4,2 ; @rds_iw_sysctl_max_recv_allocation
	.comm	_s_iw_rx_alloc_limit,4,2        ; @s_iw_rx_alloc_limit
	.comm	_rds_iw_incoming_slab,4,2       ; @rds_iw_incoming_slab
	.comm	_rds_iw_frag_slab,4,2           ; @rds_iw_frag_slab
	.comm	_RDS_FRAG_SIZE,4,2              ; @RDS_FRAG_SIZE
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.comm	_RDS_PAGE_LAST_OFF,8,3          ; @RDS_PAGE_LAST_OFF
	.no_dead_strip	_rds_iw_recv_refill_one
.subsections_via_symbols
