	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ocrdma_build_reg
_ocrdma_build_reg:                      ## @ocrdma_build_reg
	.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, %r15
	movq	%rsi, %r14
	movl	8(%rdx), %edi
	callq	_get_ocrdma_mr
	movq	%rax, %r12
	movq	24(%rax), %r13
	movq	_OCRDMA_WQE_ALIGN_BYTES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$48, %edi
	callq	_roundup
	movq	_OCRDMA_FR_MR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_OCRDMA_WQE_OPCODE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %esi
	orl	(%r14), %esi
	movl	%esi, (%r14)
	movq	_OCRDMA_WQE_STRIDE@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movq	_OCRDMA_WQE_SIZE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	orl	%esi, %eax
	movl	%eax, (%r14)
	movl	(%r15), %eax
	movq	_IB_ACCESS_LOCAL_WRITE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_2
## %bb.1:
	movq	_OCRDMA_LKEY_FLAG_LOCAL_WR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, 12(%r14)
LBB0_2:
	movq	_IB_ACCESS_REMOTE_WRITE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_4
## %bb.3:
	movq	_OCRDMA_LKEY_FLAG_REMOTE_WR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, 12(%r14)
LBB0_4:
	movq	_IB_ACCESS_REMOTE_READ@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.5:
	movq	_OCRDMA_LKEY_FLAG_REMOTE_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 12(%r14)
LBB0_6:
	movl	4(%r15), %eax
	movl	%eax, 8(%r14)
	movl	40(%r12), %eax
	movl	%eax, 4(%r14)
	movl	32(%r12), %edi
	movq	(%r12), %rax
	movl	%edi, %r15d
	subl	(%rax), %r15d
	callq	_upper_32_bits
	movq	%rax, 40(%r14)
	movl	32(%r12), %eax
	movl	%eax, 16(%r14)
	movl	%r15d, %edi
	callq	_upper_32_bits
	movq	%rax, 32(%r14)
	movl	%r15d, 20(%r14)
	movl	8(%r12), %eax
	movl	%eax, 24(%r14)
	movl	36(%r12), %edi
	callq	_get_encoded_page_size
	movl	%eax, 28(%r14)
	cmpl	$0, 8(%r12)
	jle	LBB0_12
## %bb.7:
	movq	(%r13), %r15
	xorl	%r14d, %r14d
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	8(%r13), %r15
	addq	$8, %r13
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	movslq	8(%r12), %rax
	cmpq	%rax, %r14
	jge	LBB0_12
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	movl	(%rax,%r14,4), %ebx
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	andl	%ebx, %edi
	callq	_cpu_to_le32
	movq	%rax, 8(%r15)
	movl	%ebx, %edi
	callq	_upper_32_bits
	movl	%eax, %edi
	callq	_cpu_to_le32
	movq	%rax, (%r15)
	incq	%r14
	movslq	16(%r12), %rax
	shrq	$2, %rax
	cmpq	%rax, %r14
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	addq	$16, %r15
	jmp	LBB0_11
LBB0_12:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_OCRDMA_WQE_ALIGN_BYTES,4,2     ## @OCRDMA_WQE_ALIGN_BYTES
	.comm	_OCRDMA_FR_MR,4,2               ## @OCRDMA_FR_MR
	.comm	_OCRDMA_WQE_OPCODE_SHIFT,4,2    ## @OCRDMA_WQE_OPCODE_SHIFT
	.comm	_OCRDMA_WQE_STRIDE,4,2          ## @OCRDMA_WQE_STRIDE
	.comm	_OCRDMA_WQE_SIZE_SHIFT,4,2      ## @OCRDMA_WQE_SIZE_SHIFT
	.comm	_IB_ACCESS_LOCAL_WRITE,4,2      ## @IB_ACCESS_LOCAL_WRITE
	.comm	_OCRDMA_LKEY_FLAG_LOCAL_WR,4,2  ## @OCRDMA_LKEY_FLAG_LOCAL_WR
	.comm	_IB_ACCESS_REMOTE_WRITE,4,2     ## @IB_ACCESS_REMOTE_WRITE
	.comm	_OCRDMA_LKEY_FLAG_REMOTE_WR,4,2 ## @OCRDMA_LKEY_FLAG_REMOTE_WR
	.comm	_IB_ACCESS_REMOTE_READ,4,2      ## @IB_ACCESS_REMOTE_READ
	.comm	_OCRDMA_LKEY_FLAG_REMOTE_RD,4,2 ## @OCRDMA_LKEY_FLAG_REMOTE_RD
	.comm	_PAGE_MASK,4,2                  ## @PAGE_MASK
	.no_dead_strip	_ocrdma_build_reg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ocrdma_build_reg
_ocrdma_build_reg:                      ; @ocrdma_build_reg
	.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	x21, x2
	mov	x20, x1
	ldr	w0, [x2, #8]
	bl	_get_ocrdma_mr
	mov	x19, x0
	ldr	x22, [x0, #24]
Lloh0:
	adrp	x8, _OCRDMA_WQE_ALIGN_BYTES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _OCRDMA_WQE_ALIGN_BYTES@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #48
	bl	_roundup
Lloh3:
	adrp	x8, _OCRDMA_FR_MR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _OCRDMA_FR_MR@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _OCRDMA_WQE_OPCODE_SHIFT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _OCRDMA_WQE_OPCODE_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	lsl	w8, w8, w9
	ldr	w9, [x20]
	orr	w8, w9, w8
	str	w8, [x20]
Lloh9:
	adrp	x9, _OCRDMA_WQE_STRIDE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _OCRDMA_WQE_STRIDE@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	sdiv	w9, w0, w9
Lloh12:
	adrp	x10, _OCRDMA_WQE_SIZE_SHIFT@GOTPAGE
Lloh13:
	ldr	x10, [x10, _OCRDMA_WQE_SIZE_SHIFT@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w8, w9, w8
	str	w8, [x20]
	ldr	w8, [x21]
Lloh15:
	adrp	x9, _IB_ACCESS_LOCAL_WRITE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _IB_ACCESS_LOCAL_WRITE@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
Lloh18:
	adrp	x9, _OCRDMA_LKEY_FLAG_LOCAL_WR@GOTPAGE
Lloh19:
	ldr	x9, [x9, _OCRDMA_LKEY_FLAG_LOCAL_WR@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	ldr	w10, [x20, #12]
	orr	w9, w10, w9
	str	w9, [x20, #12]
LBB0_2:
Lloh21:
	adrp	x9, _IB_ACCESS_REMOTE_WRITE@GOTPAGE
Lloh22:
	ldr	x9, [x9, _IB_ACCESS_REMOTE_WRITE@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
Lloh24:
	adrp	x9, _OCRDMA_LKEY_FLAG_REMOTE_WR@GOTPAGE
Lloh25:
	ldr	x9, [x9, _OCRDMA_LKEY_FLAG_REMOTE_WR@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	ldr	w10, [x20, #12]
	orr	w9, w10, w9
	str	w9, [x20, #12]
LBB0_4:
Lloh27:
	adrp	x9, _IB_ACCESS_REMOTE_READ@GOTPAGE
Lloh28:
	ldr	x9, [x9, _IB_ACCESS_REMOTE_READ@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
Lloh30:
	adrp	x8, _OCRDMA_LKEY_FLAG_REMOTE_RD@GOTPAGE
Lloh31:
	ldr	x8, [x8, _OCRDMA_LKEY_FLAG_REMOTE_RD@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	ldr	w9, [x20, #12]
	orr	w8, w9, w8
	str	w8, [x20, #12]
LBB0_6:
	ldr	w8, [x21, #4]
	ldr	w9, [x19, #40]
	stp	w9, w8, [x20, #4]
	ldr	w0, [x19, #32]
	ldr	x8, [x19]
	ldr	w8, [x8]
	sub	w21, w0, w8
	bl	_upper_32_bits
	str	x0, [x20, #40]
	ldr	w8, [x19, #32]
	str	w8, [x20, #16]
	mov	x0, x21
	bl	_upper_32_bits
	str	x0, [x20, #32]
	ldr	w8, [x19, #8]
	stp	w21, w8, [x20, #20]
	ldr	w0, [x19, #36]
	bl	_get_encoded_page_size
	str	w0, [x20, #28]
	ldr	w8, [x19, #8]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.7:
	mov	x21, #0
	ldr	x23, [x22]
Lloh33:
	adrp	x24, _PAGE_MASK@GOTPAGE
Lloh34:
	ldr	x24, [x24, _PAGE_MASK@GOTPAGEOFF]
	b	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=1
	ldr	x23, [x22, #8]!
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	ldrsw	x8, [x19, #8]
	cmp	x21, x8
	b.ge	LBB0_12
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	ldr	w20, [x8, x21, lsl #2]
	ldr	w8, [x24]
	and	w0, w8, w20
	bl	_cpu_to_le32
	str	x0, [x23, #8]
	mov	x0, x20
	bl	_upper_32_bits
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_cpu_to_le32
	str	x0, [x23]
	add	x21, x21, #1
	ldrsw	x8, [x19, #16]
	cmp	x21, x8, lsr #2
	b.eq	LBB0_8
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	add	x23, x23, #16
	b	LBB0_9
LBB0_12:
	mov	w0, #0
	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	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_OCRDMA_WQE_ALIGN_BYTES,4,2     ; @OCRDMA_WQE_ALIGN_BYTES
	.comm	_OCRDMA_FR_MR,4,2               ; @OCRDMA_FR_MR
	.comm	_OCRDMA_WQE_OPCODE_SHIFT,4,2    ; @OCRDMA_WQE_OPCODE_SHIFT
	.comm	_OCRDMA_WQE_STRIDE,4,2          ; @OCRDMA_WQE_STRIDE
	.comm	_OCRDMA_WQE_SIZE_SHIFT,4,2      ; @OCRDMA_WQE_SIZE_SHIFT
	.comm	_IB_ACCESS_LOCAL_WRITE,4,2      ; @IB_ACCESS_LOCAL_WRITE
	.comm	_OCRDMA_LKEY_FLAG_LOCAL_WR,4,2  ; @OCRDMA_LKEY_FLAG_LOCAL_WR
	.comm	_IB_ACCESS_REMOTE_WRITE,4,2     ; @IB_ACCESS_REMOTE_WRITE
	.comm	_OCRDMA_LKEY_FLAG_REMOTE_WR,4,2 ; @OCRDMA_LKEY_FLAG_REMOTE_WR
	.comm	_IB_ACCESS_REMOTE_READ,4,2      ; @IB_ACCESS_REMOTE_READ
	.comm	_OCRDMA_LKEY_FLAG_REMOTE_RD,4,2 ; @OCRDMA_LKEY_FLAG_REMOTE_RD
	.comm	_PAGE_MASK,4,2                  ; @PAGE_MASK
	.no_dead_strip	_ocrdma_build_reg
.subsections_via_symbols
