	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_ib_reg_user_mr            ## -- Begin function mlx4_ib_reg_user_mr
	.p2align	4, 0x90
_mlx4_ib_reg_user_mr:                   ## @mlx4_ib_reg_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r15
	movl	%r8d, %r14d
	movq	%rcx, -96(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r12
	movq	%rsi, %r13
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movl	(%rdi), %edi
	callq	_to_mdev
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$48, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_11
## %bb.1:
	movq	%rax, %rbx
	movq	%r15, %rdi
	movq	%r13, %rsi
	movq	%r12, %rdx
	movl	%r14d, %ecx
	callq	_mlx4_get_umem_mr
	movl	%eax, (%rbx)
	movl	%eax, %edi
	callq	_IS_ERR
	movl	(%rbx), %edi
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	callq	_PTR_ERR
	movl	%eax, %r13d
	jmp	LBB0_9
LBB0_11:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_3:
	callq	_ib_umem_page_count
	movl	%eax, -44(%rbp)
	movl	(%rbx), %edi
	leaq	-44(%rbp), %rdx
	movq	%r13, %rsi
	callq	_mlx4_ib_umem_calc_optimal_mtt_size
	movl	%eax, %r15d
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_to_mpd
	movl	(%rax), %r13d
	movl	%r14d, %edi
	callq	_convert_access
	movl	-44(%rbp), %r9d
	leaq	4(%rbx), %r10
	movl	-56(%rbp), %edi                 ## 4-byte Reload
	movl	%r13d, %esi
	movq	-96(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdx
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, %rcx
	movl	%eax, %r8d
	movq	%r10, -88(%rbp)                 ## 8-byte Spill
	pushq	%r10
	movq	%r15, %r12
	pushq	%r15
	callq	_mlx4_mr_alloc
	addq	$16, %rsp
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_8
## %bb.4:
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	leaq	8(%rbx), %rsi
	movl	(%rbx), %edx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_mlx4_ib_umem_write_mtt
	movl	%eax, %r13d
	testl	%eax, %eax
	movq	-88(%rbp), %r15                 ## 8-byte Reload
	jne	LBB0_7
## %bb.5:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_mlx4_mr_enable
	movl	%eax, %r13d
	testl	%eax, %eax
	je	LBB0_6
LBB0_7:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	callq	_to_mdev
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_mlx4_mr_free
LBB0_8:
	movl	(%rbx), %edi
	callq	_ib_umem_release
LBB0_9:
	movq	%rbx, %rdi
	callq	_kfree
	movl	%r13d, %edi
	callq	_ERR_PTR
LBB0_10:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	4(%rbx), %ecx
	movq	%rbx, %rax
	addq	$16, %rax
	movl	%ecx, 40(%rbx)
	movl	%ecx, 44(%rbx)
	movq	%r12, 32(%rbx)
	movq	%r14, 24(%rbx)
	movl	$1, %edx
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $cl killed $cl killed $rcx
	shll	%cl, %edx
	movl	%edx, 16(%rbx)
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_ib_reg_user_mr            ; -- Begin function mlx4_ib_reg_user_mr
	.p2align	2
_mlx4_ib_reg_user_mr:                   ; @mlx4_ib_reg_user_mr
	.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	x24, x5
	mov	x25, x4
	mov	x20, x3
	mov	x21, x2
	mov	x26, x1
	mov	x22, x0
	ldr	w0, [x0]
	bl	_to_mdev
	mov	x23, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #48
	bl	_kzalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	mov	x0, x24
	mov	x1, x26
	mov	x2, x21
	mov	x3, x25
	bl	_mlx4_get_umem_mr
	str	w0, [x19]
	bl	_IS_ERR
	mov	x8, x0
	ldr	w0, [x19]
	cbz	x8, LBB0_4
; %bb.2:
	bl	_PTR_ERR
	mov	x25, x0
	b	LBB0_9
LBB0_3:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	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
	b	_ERR_PTR
LBB0_4:
	bl	_ib_umem_page_count
	str	w0, [sp, #12]
	mov	x24, x19
	ldr	w0, [x24], #4
	add	x2, sp, #12
	mov	x1, x26
	bl	_mlx4_ib_umem_calc_optimal_mtt_size
	mov	x26, x0
	ldr	w27, [x23]
	mov	x0, x22
	bl	_to_mpd
	ldr	w28, [x0]
	mov	x0, x25
	bl	_convert_access
	mov	x4, x0
	ldr	w5, [sp, #12]
	mov	x0, x27
	mov	x1, x28
	mov	x2, x20
	mov	x3, x21
	mov	x6, x26
	mov	x7, x24
	bl	_mlx4_mr_alloc
	mov	x25, x0
	cbnz	w0, LBB0_8
; %bb.5:
	mov	x1, x19
	ldr	w2, [x1], #8
	mov	x0, x23
	bl	_mlx4_ib_umem_write_mtt
	mov	x25, x0
	cbnz	w0, LBB0_7
; %bb.6:
	ldr	w0, [x23]
	mov	x1, x24
	bl	_mlx4_mr_enable
	mov	x25, x0
	cbz	w0, LBB0_11
LBB0_7:
	ldr	w0, [x22]
	bl	_to_mdev
	ldr	w0, [x0]
	mov	x1, x24
	bl	_mlx4_mr_free
LBB0_8:
	ldr	w0, [x19]
	bl	_ib_umem_release
LBB0_9:
	mov	x0, x19
	bl	_kfree
	mov	x0, x25
	bl	_ERR_PTR
	mov	x19, x0
LBB0_10:
	mov	x0, x19
	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
LBB0_11:
	mov	w8, #1
	lsl	w8, w8, w26
	str	w8, [x19, #16]!
	ldur	w8, [x19, #-12]
	stp	w8, w8, [x19, #24]
	stp	x20, x21, [x19, #8]
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
