	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_ib_rereg_user_mr          ## -- Begin function mlx4_ib_rereg_user_mr
	.p2align	4, 0x90
_mlx4_ib_rereg_user_mr:                 ## @mlx4_ib_rereg_user_mr
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -44(%rbp)                 ## 4-byte Spill
	movq	%r8, -88(%rbp)                  ## 8-byte Spill
	movq	%rcx, -96(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r13
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	callq	_to_mdev
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_to_mmr
	movq	%rax, %rbx
	leaq	-104(%rbp), %rax
	movq	%rax, -56(%rbp)
	movl	(%r12), %edi
	leaq	-56(%rbp), %rdx
	movq	%rbx, %rsi
	callq	_mlx4_mr_hw_get_mpt
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_19
## %bb.1:
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	_IB_MR_REREG_PD@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	movq	%r12, %rbx
	je	LBB0_3
## %bb.2:
	movq	16(%rbp), %rdi
	movl	(%rbx), %r15d
	movq	-56(%rbp), %rax
	movq	%rbx, %r12
	movq	(%rax), %rbx
	callq	_to_mpd
	movl	(%rax), %edx
	movl	%r15d, %edi
	movq	%rbx, %rsi
	movq	%r12, %rbx
	callq	_mlx4_mr_hw_change_pd
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_18
LBB0_3:
	movq	_IB_MR_REREG_ACCESS@GOTPCREL(%rip), %r13
	testl	%r14d, (%r13)
	je	LBB0_8
## %bb.4:
	movq	%rbx, %r12
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edi
	callq	_ib_access_writable
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	24(%rax), %rax
	cmpl	$0, (%rax)
	je	LBB0_6
LBB0_7:
	movl	(%r12), %r15d
	movq	-56(%rbp), %rax
	movl	%ebx, %edi
	movq	(%rax), %rbx
	callq	_convert_access
	movl	%r15d, %edi
	movq	%rbx, %rsi
	movq	%r12, %rbx
	movl	%eax, %edx
	callq	_mlx4_mr_hw_change_access
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_18
LBB0_8:
	movq	_IB_MR_REREG_TRANS@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_15
## %bb.9:
	movl	%r14d, -68(%rbp)                ## 4-byte Spill
	movq	24(%rbp), %r15
	movl	(%rbx), %edi
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rsi
	callq	_mlx4_mr_rereg_mem_cleanup
	movq	24(%r13), %rdi
	callq	_ib_umem_release
	movq	%r15, %rdi
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	movq	-96(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	callq	_mlx4_get_umem_mr
	movq	%rax, 24(%r13)
	movq	%rax, %rdi
	callq	_IS_ERR
	movq	24(%r13), %rdi
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	callq	_PTR_ERR
	movl	%eax, %r15d
	movq	$0, 24(%r13)
	jmp	LBB0_18
LBB0_6:
	movq	_EPERM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	movq	%r12, %rbx
	jmp	LBB0_18
LBB0_11:
	callq	_ib_umem_page_count
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r9d
	movl	(%rbx), %edi
	movq	-56(%rbp), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, (%rsp)
	movq	%r13, %rsi
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdx
	movq	%r12, %rcx
	movl	%eax, %r8d
	callq	_mlx4_mr_rereg_mem_write
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %r15d
	movq	24(%r13), %rdi
	callq	_ib_umem_release
	jmp	LBB0_18
LBB0_13:
	movq	%r14, 16(%r13)
	movq	%r12, 8(%r13)
	movq	%r13, %rsi
	addq	$4, %rsi
	movq	24(%r13), %rdx
	movq	%rbx, %rdi
	callq	_mlx4_ib_umem_write_mtt
	testl	%eax, %eax
	movl	-68(%rbp), %r14d                ## 4-byte Reload
	movq	_IB_MR_REREG_ACCESS@GOTPCREL(%rip), %r13
	je	LBB0_15
## %bb.14:
	movl	%eax, %r15d
	movl	(%rbx), %edi
	movq	%rbx, %r14
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_mlx4_mr_rereg_mem_cleanup
	movq	24(%rbx), %rdi
	movq	%r14, %rbx
	callq	_ib_umem_release
	jmp	LBB0_18
LBB0_15:
	movl	(%rbx), %edi
	movq	-56(%rbp), %rdx
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_mlx4_mr_hw_write_mpt
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_18
## %bb.16:
	xorl	%r15d, %r15d
	testl	%r14d, (%r13)
	je	LBB0_18
## %bb.17:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
LBB0_18:
	movl	(%rbx), %edi
	movq	-56(%rbp), %rsi
	callq	_mlx4_mr_hw_put_mpt
LBB0_19:
	movl	%r15d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IB_MR_REREG_PD,4,2             ## @IB_MR_REREG_PD
	.comm	_IB_MR_REREG_ACCESS,4,2         ## @IB_MR_REREG_ACCESS
	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_IB_MR_REREG_TRANS,4,2          ## @IB_MR_REREG_TRANS
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_ib_rereg_user_mr          ; -- Begin function mlx4_ib_rereg_user_mr
	.p2align	2
_mlx4_ib_rereg_user_mr:                 ; @mlx4_ib_rereg_user_mr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x28, x6
	mov	x21, x5
	mov	x24, x4
	mov	x23, x3
	mov	x26, x2
	mov	x22, x1
	mov	x20, x0
	ldr	w0, [x0]
	bl	_to_mdev
	mov	x19, x0
	mov	x0, x20
	bl	_to_mmr
	mov	x20, x0
	add	x8, sp, #24
	str	x8, [sp, #16]
	ldr	w0, [x19]
	add	x2, sp, #16
	mov	x1, x20
	bl	_mlx4_mr_hw_get_mpt
	mov	x27, x0
	cbnz	w0, LBB0_21
; %bb.1:
	str	x25, [sp, #8]                   ; 8-byte Folded Spill
Lloh0:
	adrp	x8, _IB_MR_REREG_PD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IB_MR_REREG_PD@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_3
; %bb.2:
	ldr	w27, [x19]
	ldr	x8, [sp, #16]
	mov	x25, x21
	mov	x21, x23
	mov	x23, x24
	ldr	x24, [x8]
	mov	x0, x28
	bl	_to_mpd
	ldr	w2, [x0]
	mov	x0, x27
	mov	x1, x24
	mov	x24, x23
	mov	x23, x21
	mov	x21, x25
	bl	_mlx4_mr_hw_change_pd
	mov	x27, x0
	cbnz	w0, LBB0_20
LBB0_3:
Lloh3:
	adrp	x25, _IB_MR_REREG_ACCESS@GOTPAGE
Lloh4:
	ldr	x25, [x25, _IB_MR_REREG_ACCESS@GOTPAGEOFF]
	ldr	w8, [x25]
	tst	w8, w22
	b.eq	LBB0_7
; %bb.4:
	mov	x0, x21
	bl	_ib_access_writable
	cbz	x0, LBB0_6
; %bb.5:
	ldr	x8, [x20, #24]
	ldr	w8, [x8]
	cbz	w8, LBB0_10
LBB0_6:
	mov	x28, x23
	mov	x23, x24
	ldr	w24, [x19]
	ldr	x8, [sp, #16]
	ldr	x27, [x8]
	mov	x0, x21
	bl	_convert_access
	mov	x2, x0
	mov	x0, x24
	mov	x24, x23
	mov	x23, x28
	mov	x1, x27
	bl	_mlx4_mr_hw_change_access
	mov	x27, x0
	cbnz	w0, LBB0_20
LBB0_7:
Lloh5:
	adrp	x8, _IB_MR_REREG_TRANS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _IB_MR_REREG_TRANS@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_16
; %bb.8:
	ldr	w0, [x19]
	mov	x1, x20
	bl	_mlx4_mr_rereg_mem_cleanup
	ldr	x0, [x20, #24]
	bl	_ib_umem_release
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	mov	x1, x26
	mov	x2, x23
	mov	x3, x21
	bl	_mlx4_get_umem_mr
	str	x0, [x20, #24]
	bl	_IS_ERR
	mov	x8, x0
	ldr	x0, [x20, #24]
	cbz	x8, LBB0_11
; %bb.9:
	bl	_PTR_ERR
	mov	x27, x0
	str	xzr, [x20, #24]
	b	LBB0_20
LBB0_10:
Lloh8:
	adrp	x8, _EPERM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w27, w8
	b	LBB0_20
LBB0_11:
	bl	_ib_umem_page_count
	mov	x4, x0
Lloh11:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh13:
	ldr	w5, [x8]
	ldr	w0, [x19]
	ldr	x8, [sp, #16]
	ldr	x6, [x8]
	mov	x1, x20
	mov	x2, x24
	mov	x3, x23
	bl	_mlx4_mr_rereg_mem_write
	cbz	w0, LBB0_13
; %bb.12:
	mov	x27, x0
	b	LBB0_15
LBB0_13:
	stp	x23, x24, [x20, #8]
	add	x1, x20, #4
	ldr	x2, [x20, #24]
	mov	x0, x19
	bl	_mlx4_ib_umem_write_mtt
	cbz	w0, LBB0_16
; %bb.14:
	mov	x27, x0
	ldr	w0, [x19]
	mov	x1, x20
	bl	_mlx4_mr_rereg_mem_cleanup
LBB0_15:
	ldr	x0, [x20, #24]
	bl	_ib_umem_release
	b	LBB0_20
LBB0_16:
	ldr	w0, [x19]
	ldr	x2, [sp, #16]
	mov	x1, x20
	bl	_mlx4_mr_hw_write_mpt
	mov	x27, x0
	cbnz	w0, LBB0_20
; %bb.17:
	ldr	w8, [x25]
	tst	w8, w22
	b.eq	LBB0_19
; %bb.18:
	mov	w27, #0
	str	w21, [x20]
	b	LBB0_20
LBB0_19:
	mov	w27, #0
LBB0_20:
	ldr	w0, [x19]
	ldr	x1, [sp, #16]
	bl	_mlx4_mr_hw_put_mpt
LBB0_21:
	mov	x0, x27
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_IB_MR_REREG_PD,4,2             ; @IB_MR_REREG_PD
	.comm	_IB_MR_REREG_ACCESS,4,2         ; @IB_MR_REREG_ACCESS
	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_IB_MR_REREG_TRANS,4,2          ; @IB_MR_REREG_TRANS
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
.subsections_via_symbols
