	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rdma_rw_ctx_init               ## -- Begin function rdma_rw_ctx_init
	.p2align	4, 0x90
_rdma_rw_ctx_init:                      ## @rdma_rw_ctx_init
	.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
	movq	%r9, %rbx
	movq	%r8, %r15
	movq	%rcx, %r12
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movl	32(%rbp), %r13d
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	8(%rsi), %rax
	movq	(%rax), %r14
	movq	%rcx, %rdi
	callq	_sg_page
	movl	%eax, %edi
	callq	_is_pci_p2pdma_page
	testq	%rax, %rax
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	je	LBB0_2
## %bb.1:
	movl	(%r14), %edi
	movq	%r12, %rsi
	movq	%r15, %rdx
	movl	%r13d, %ecx
	callq	_pci_p2pdma_map_sg
	testl	%eax, %eax
	je	LBB0_4
LBB0_5:
	movslq	%eax, %r13
	movq	%r12, %rdi
	callq	_sg_dma_len
	cmpq	%rbx, %rax
	jg	LBB0_7
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	subq	%rax, %rbx
	movq	%r12, %rdi
	callq	_sg_next
	movq	%rax, %r12
	decq	%r13
	movq	%rax, %rdi
	callq	_sg_dma_len
	cmpq	%rax, %rbx
	jge	LBB0_6
LBB0_7:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	xorl	%edi, %edi
	testq	%r13, %r13
	sete	%dil
	callq	_WARN_ON_ONCE
	testq	%rax, %rax
	je	LBB0_8
LBB0_15:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movq	%r13, %rdx
	movl	32(%rbp), %ecx
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_ib_dma_unmap_sg
	jmp	LBB0_16
LBB0_2:
	movq	%r14, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	movl	%r13d, %ecx
	callq	_ib_dma_map_sg
	testl	%eax, %eax
	jne	LBB0_5
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_16
LBB0_8:
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movl	(%r14), %edi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	32(%rbp), %r15d
	movl	%r15d, %edx
	movq	%r13, %rcx
	callq	_rdma_rw_io_needs_mr
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	subq	$8, %rsp
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	%r12, %rcx
	movq	%r13, %r8
	movq	%rbx, %r9
	pushq	%r15
	pushq	24(%rbp)
	movl	16(%rbp), %eax
	pushq	%rax
	callq	_rdma_rw_init_mr_wrs
	addq	$32, %rsp
	jmp	LBB0_14
LBB0_10:
	cmpq	$2, %r13
	movq	%r14, %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	24(%rbp), %r10
	movl	16(%rbp), %r9d
	jl	LBB0_12
## %bb.11:
	movq	%r12, %rdx
	movq	%r13, %rcx
	movq	%rbx, %r8
                                        ## kill: def $r9d killed $r9d killed $r9
	movl	32(%rbp), %eax
	pushq	%rax
	pushq	%r10
	callq	_rdma_rw_init_map_wrs
	jmp	LBB0_13
LBB0_12:
	subq	$8, %rsp
	movq	%r12, %rdx
	movq	%rbx, %rcx
	movl	%r9d, %r8d
	movq	%r10, %r9
	movl	32(%rbp), %eax
	pushq	%rax
	callq	_rdma_rw_init_single_wr
LBB0_13:
	addq	$16, %rsp
LBB0_14:
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_15
LBB0_16:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EIO,4,2                        ## @EIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rdma_rw_ctx_init               ; -- Begin function rdma_rw_ctx_init
	.p2align	2
_rdma_rw_ctx_init:                      ; @rdma_rw_ctx_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x25, x7
	mov	x23, x6
	mov	x24, x5
	mov	x22, x4
	mov	x20, x3
	mov	x28, x2
	mov	x26, x1
	mov	x27, x0
	ldr	w19, [x29, #16]
	ldr	x8, [x1, #8]
	ldr	x21, [x8]
	mov	x0, x3
	bl	_sg_page
	bl	_is_pci_p2pdma_page
	cbz	x0, LBB0_8
; %bb.1:
	ldr	w0, [x21]
	mov	x1, x20
	mov	x2, x22
	mov	x3, x19
	bl	_pci_p2pdma_map_sg
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_9
LBB0_2:
	str	x25, [sp, #8]                   ; 8-byte Folded Spill
	sxtw	x25, w0
	mov	x0, x20
	bl	_sg_dma_len
	cmp	x0, x24
	b.gt	LBB0_5
; %bb.3:
	mov	x22, x0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_sg_next
	mov	x20, x0
	sub	x24, x24, x22
	sub	x25, x25, #1
	bl	_sg_dma_len
	mov	x22, x0
	cmp	x24, x0
	b.ge	LBB0_4
LBB0_5:
Lloh0:
	adrp	x8, _EIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	cmp	x25, #0
	cset	w0, eq
	bl	_WARN_ON_ONCE
	cbz	x0, LBB0_10
; %bb.6:
	neg	w22, w22
LBB0_7:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x25
	mov	x3, x19
	bl	_ib_dma_unmap_sg
	b	LBB0_16
LBB0_8:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x22
	mov	x3, x19
	bl	_ib_dma_map_sg
                                        ; kill: def $w0 killed $w0 def $x0
	cbnz	w0, LBB0_2
LBB0_9:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_16
LBB0_10:
	ldr	w0, [x26]
	mov	x1, x28
	mov	x2, x19
	mov	x3, x25
	bl	_rdma_rw_io_needs_mr
	cbz	x0, LBB0_12
; %bb.11:
	str	w19, [sp]
	mov	x0, x27
	mov	x1, x26
	mov	x2, x28
	mov	x3, x20
	mov	x4, x25
	mov	x5, x24
	mov	x6, x23
	ldr	x7, [sp, #8]                    ; 8-byte Folded Reload
	bl	_rdma_rw_init_mr_wrs
	b	LBB0_15
LBB0_12:
	mov	x0, x27
	mov	x1, x26
	mov	x2, x20
	cmp	x25, #2
	b.lt	LBB0_14
; %bb.13:
	mov	x3, x25
	mov	x4, x24
	mov	x5, x23
	ldr	x6, [sp, #8]                    ; 8-byte Folded Reload
	mov	x7, x19
	bl	_rdma_rw_init_map_wrs
	b	LBB0_15
LBB0_14:
	mov	x3, x24
	mov	x4, x23
	ldr	x5, [sp, #8]                    ; 8-byte Folded Reload
	mov	x6, x19
	bl	_rdma_rw_init_single_wr
LBB0_15:
	mov	x22, x0
	tbnz	w0, #31, LBB0_7
LBB0_16:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EIO,4,2                        ; @EIO
.subsections_via_symbols
