	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_arbel_map_phys_fmr       ## -- Begin function mthca_arbel_map_phys_fmr
	.p2align	4, 0x90
_mthca_arbel_map_phys_fmr:              ## @mthca_arbel_map_phys_fmr
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r14d
	movl	%edx, %r13d
	movq	%rsi, %r12
	movq	%rdi, %rbx
	callq	_to_mfmr
	movq	%rax, %r15
	movl	(%rbx), %edi
	callq	_to_mdev
	movq	%rax, %rbx
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	%r13d, %edx
	movl	%r14d, %ecx
	callq	_mthca_check_fmr
	testl	%eax, %eax
	jne	LBB0_8
## %bb.1:
	incl	40(%r15)
	movl	36(%r15), %edi
	callq	_arbel_key_to_hw_index
	movq	_MTHCA_FLAG_SINAI_OPT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	(%rbx), %ecx
	movl	%r14d, -52(%rbp)                ## 4-byte Spill
	je	LBB0_2
## %bb.3:
	movq	_SINAI_FMR_KEY_INC@GOTPCREL(%rip), %rcx
	jmp	LBB0_4
LBB0_2:
	movq	%rbx, %rcx
	addq	$16, %rcx
LBB0_4:
	addl	(%rcx), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	%eax, %edi
	callq	_arbel_hw_index_to_key
	movl	%eax, 32(%r15)
	movl	%eax, 36(%r15)
	movq	_MTHCA_MPT_STATUS_SW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%r15), %rcx
	movl	%eax, (%rcx)
	xorl	%eax, %eax
	callq	_wmb
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	8(%rbx), %rdi
	movl	8(%r15), %esi
	movl	%r13d, %r14d
	leal	(,%r13,4), %edx
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	callq	_dma_sync_single_for_cpu
	testl	%r13d, %r13d
	jle	LBB0_7
## %bb.5:
	xorl	%ebx, %ebx
	movq	_MTHCA_MTT_FLAG_PRESENT@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %edi
	orl	(%r12,%rbx,4), %edi
	callq	_cpu_to_be64
	movq	16(%r15), %rcx
	movq	%rax, (%rcx,%rbx,8)
	incq	%rbx
	cmpq	%rbx, %r14
	jne	LBB0_6
LBB0_7:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rdi
	movl	8(%r15), %esi
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_dma_sync_single_for_device
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edi
	callq	_cpu_to_be32
	movq	(%r15), %rcx
	movq	%rax, 24(%rcx)
	movl	%ebx, %edi
	callq	_cpu_to_be32
	movq	(%r15), %rcx
	movq	%rax, 16(%rcx)
	movb	24(%r15), %cl
	shlq	%cl, %r14
	movl	%r14d, %edi
	callq	_cpu_to_be64
	movq	(%r15), %rcx
	movq	%rax, 8(%rcx)
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	callq	_cpu_to_be64
	movq	(%r15), %rcx
	movq	%rax, (%rcx)
	xorl	%eax, %eax
	callq	_wmb
	movq	_MTHCA_MPT_STATUS_HW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%r15), %rcx
	movl	%eax, (%rcx)
	xorl	%eax, %eax
	callq	_wmb
	xorl	%eax, %eax
LBB0_8:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTHCA_FLAG_SINAI_OPT,4,2       ## @MTHCA_FLAG_SINAI_OPT
	.comm	_SINAI_FMR_KEY_INC,8,3          ## @SINAI_FMR_KEY_INC
	.comm	_MTHCA_MPT_STATUS_SW,4,2        ## @MTHCA_MPT_STATUS_SW
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.comm	_MTHCA_MTT_FLAG_PRESENT,4,2     ## @MTHCA_MTT_FLAG_PRESENT
	.comm	_MTHCA_MPT_STATUS_HW,4,2        ## @MTHCA_MPT_STATUS_HW
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_arbel_map_phys_fmr       ; -- Begin function mthca_arbel_map_phys_fmr
	.p2align	2
_mthca_arbel_map_phys_fmr:              ; @mthca_arbel_map_phys_fmr
	.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	x20, x3
	mov	x23, x2
	mov	x21, x1
	mov	x22, x0
	bl	_to_mfmr
	mov	x19, x0
	ldr	w0, [x22]
	bl	_to_mdev
	mov	x22, x0
	mov	x0, x19
	mov	x1, x21
	mov	x2, x23
	mov	x3, x20
	bl	_mthca_check_fmr
	cbnz	w0, LBB0_5
; %bb.1:
	ldp	w0, w8, [x19, #36]
	add	w8, w8, #1
	str	w8, [x19, #40]
	bl	_arbel_key_to_hw_index
	ldr	w8, [x22]
Lloh0:
	adrp	x9, _MTHCA_FLAG_SINAI_OPT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MTHCA_FLAG_SINAI_OPT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	add	x10, x22, #16
Lloh3:
	adrp	x11, _SINAI_FMR_KEY_INC@GOTPAGE
Lloh4:
	ldr	x11, [x11, _SINAI_FMR_KEY_INC@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x10, x11, eq
	ldr	w8, [x8]
	add	w24, w0, w8
	mov	x0, x24
	bl	_arbel_hw_index_to_key
	stp	w0, w0, [x19, #32]
Lloh5:
	adrp	x8, _MTHCA_MPT_STATUS_SW@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MTHCA_MPT_STATUS_SW@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	ldr	x9, [x19]
	str	w8, [x9]
	bl	_wmb
	ldr	x0, [x22, #8]
	ldr	w1, [x19, #8]
	mov	w26, w23
	lsl	w25, w23, #2
Lloh8:
	adrp	x27, _DMA_TO_DEVICE@GOTPAGE
Lloh9:
	ldr	x27, [x27, _DMA_TO_DEVICE@GOTPAGEOFF]
	ldr	w3, [x27]
	mov	x2, x25
	bl	_dma_sync_single_for_cpu
	cmp	w23, #1
	b.lt	LBB0_4
; %bb.2:
	mov	x23, #0
Lloh10:
	adrp	x28, _MTHCA_MTT_FLAG_PRESENT@GOTPAGE
Lloh11:
	ldr	x28, [x28, _MTHCA_MTT_FLAG_PRESENT@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x21, x23, lsl #2]
	ldr	w9, [x28]
	orr	w0, w9, w8
	bl	_cpu_to_be64
	ldr	x8, [x19, #16]
	str	x0, [x8, x23, lsl #3]
	add	x23, x23, #1
	cmp	x26, x23
	b.ne	LBB0_3
LBB0_4:
	ldr	x0, [x22, #8]
	ldr	w1, [x19, #8]
	ldr	w3, [x27]
	mov	x2, x25
	bl	_dma_sync_single_for_device
	mov	x0, x24
	bl	_cpu_to_be32
	ldr	x8, [x19]
	str	x0, [x8, #24]
	mov	x0, x24
	bl	_cpu_to_be32
	ldr	x8, [x19]
	str	x0, [x8, #16]
	ldr	x8, [x19, #24]
	lsl	x0, x26, x8
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_cpu_to_be64
	ldr	x8, [x19]
	str	x0, [x8, #8]
	mov	x0, x20
	bl	_cpu_to_be64
	ldr	x8, [x19]
	str	x0, [x8]
	bl	_wmb
Lloh12:
	adrp	x8, _MTHCA_MPT_STATUS_HW@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MTHCA_MPT_STATUS_HW@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	ldr	x9, [x19]
	str	w8, [x9]
	bl	_wmb
	mov	w0, #0
LBB0_5:
	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	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_MTHCA_FLAG_SINAI_OPT,4,2       ; @MTHCA_FLAG_SINAI_OPT
	.comm	_SINAI_FMR_KEY_INC,8,3          ; @SINAI_FMR_KEY_INC
	.comm	_MTHCA_MPT_STATUS_SW,4,2        ; @MTHCA_MPT_STATUS_SW
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.comm	_MTHCA_MTT_FLAG_PRESENT,4,2     ; @MTHCA_MTT_FLAG_PRESENT
	.comm	_MTHCA_MPT_STATUS_HW,4,2        ; @MTHCA_MPT_STATUS_HW
.subsections_via_symbols
