	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_reg_mkey_seg
_set_reg_mkey_seg:                      ## @set_reg_mkey_seg
	.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
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	%edx, %r12d
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movslq	24(%rsi), %rdi
	addq	16(%rsi), %rdi
	movl	$8, %esi
	callq	_ALIGN
	movl	%eax, %r15d
	movl	%eax, %r13d
	sarl	%r13d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$56, %edx
	callq	_memset
	movl	(%r14), %eax
	movq	_MLX5_MKC_ACCESS_MODE_MTT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_2
## %bb.1:
	movl	12(%r14), %edi
	callq	_ilog2
	movl	%eax, 48(%rbx)
	jmp	LBB0_3
LBB0_2:
	movq	_MLX5_MKC_ACCESS_MODE_KLMS@GOTPCREL(%rip), %rcx
	andl	$-2, %r15d
	cmpl	(%rcx), %eax
	cmovel	%r15d, %r13d
LBB0_3:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_get_umr_flags
	orl	(%r14), %eax
	movl	%eax, (%rbx)
	orl	$-256, %r12d
	movl	%r12d, %edi
	callq	_cpu_to_be32
	movq	%rax, 40(%rbx)
	movq	_MLX5_MKEY_REMOTE_INVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_be32
	movq	%rax, 32(%rbx)
	movl	8(%r14), %edi
	callq	_cpu_to_be64
	movq	%rax, 24(%rbx)
	movl	4(%r14), %edi
	callq	_cpu_to_be64
	movq	%rax, 16(%rbx)
	movl	%r13d, %edi
	callq	_cpu_to_be32
	movq	%rax, 8(%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MLX5_MKC_ACCESS_MODE_MTT,4,2   ## @MLX5_MKC_ACCESS_MODE_MTT
	.comm	_MLX5_MKC_ACCESS_MODE_KLMS,4,2  ## @MLX5_MKC_ACCESS_MODE_KLMS
	.comm	_MLX5_MKEY_REMOTE_INVAL,4,2     ## @MLX5_MKEY_REMOTE_INVAL
	.no_dead_strip	_set_reg_mkey_seg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_reg_mkey_seg
_set_reg_mkey_seg:                      ; @set_reg_mkey_seg
	.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	x23, x3
	mov	x22, x2
	mov	x20, x1
	mov	x19, x0
	ldrsw	x8, [x1, #24]
	ldr	x9, [x1, #16]
	add	x0, x9, x8
	mov	w1, #8
	bl	_ALIGN
	mov	x24, x0
	asr	w21, w0, #1
	mov	x0, x19
	mov	w1, #0
	mov	w2, #56
	bl	_memset
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _MLX5_MKC_ACCESS_MODE_MTT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MLX5_MKC_ACCESS_MODE_MTT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
	ldr	w0, [x20, #12]
	bl	_ilog2
	str	w0, [x19, #48]
	b	LBB0_3
LBB0_2:
Lloh3:
	adrp	x9, _MLX5_MKC_ACCESS_MODE_KLMS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MLX5_MKC_ACCESS_MODE_KLMS@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	and	w10, w24, #0xfffffffe
	cmp	w8, w9
	csel	w21, w10, w21, eq
LBB0_3:
	mov	x0, x23
	bl	_get_umr_flags
	ldr	w8, [x20]
	orr	w8, w8, w0
	str	w8, [x19]
	orr	w0, w22, #0xffffff00
	bl	_cpu_to_be32
	str	x0, [x19, #40]
Lloh6:
	adrp	x8, _MLX5_MKEY_REMOTE_INVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MLX5_MKEY_REMOTE_INVAL@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_cpu_to_be32
	str	x0, [x19, #32]
	ldr	w0, [x20, #8]
	bl	_cpu_to_be64
	str	x0, [x19, #24]
	ldr	w0, [x20, #4]
	bl	_cpu_to_be64
	str	x0, [x19, #16]
	mov	x0, x21
	bl	_cpu_to_be32
	str	x0, [x19, #8]
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_MLX5_MKC_ACCESS_MODE_MTT,4,2   ; @MLX5_MKC_ACCESS_MODE_MTT
	.comm	_MLX5_MKC_ACCESS_MODE_KLMS,4,2  ; @MLX5_MKC_ACCESS_MODE_KLMS
	.comm	_MLX5_MKEY_REMOTE_INVAL,4,2     ; @MLX5_MKEY_REMOTE_INVAL
	.no_dead_strip	_set_reg_mkey_seg
.subsections_via_symbols
