	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function devx_handle_mkey_create
_devx_handle_mkey_create:               ## @devx_handle_mkey_create
	.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, %r12d
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r15
	movq	_create_mkey_in@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movq	_memory_key_mkey_entry@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	callq	_MLX5_BYTE_OFF
	movl	%eax, %ebx
	movl	(%r13), %edi
	movl	(%r14), %esi
	callq	_MLX5_FLD_SZ_BYTES
	addl	%ebx, %eax
	cmpl	%r12d, %eax
	jle	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_7
LBB0_2:
	movl	(%r13), %edi
	movl	(%r14), %edx
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rsi
	callq	_MLX5_ADDR_OF
	movq	%rax, %rbx
	movq	_access_mode_1_0@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	callq	_MLX5_GET
	movl	%eax, %r12d
	movq	_access_mode_4_2@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	callq	_MLX5_GET
	shll	$2, %eax
	orl	%r12d, %eax
	movq	_MLX5_MKC_ACCESS_MODE_KLMS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_4
## %bb.3:
	movq	_MLX5_MKC_ACCESS_MODE_KSM@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_4
## %bb.6:
	movq	_create_mkey_in@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_mkey_umem_valid@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rsi
	movl	$1, %ecx
	callq	_MLX5_SET
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_4:
	movq	_CONFIG_INFINIBAND_ON_DEMAND_PAGING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_IS_ENABLED
	movq	%rax, %rcx
	xorl	%eax, %eax
	testq	%rcx, %rcx
	je	LBB0_7
## %bb.5:
	movq	_DEVX_OBJ_FLAGS_INDIRECT_MKEY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, (%r15)
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_create_mkey_in,4,2             ## @create_mkey_in
	.comm	_memory_key_mkey_entry,4,2      ## @memory_key_mkey_entry
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_access_mode_1_0,4,2            ## @access_mode_1_0
	.comm	_access_mode_4_2,4,2            ## @access_mode_4_2
	.comm	_MLX5_MKC_ACCESS_MODE_KLMS,4,2  ## @MLX5_MKC_ACCESS_MODE_KLMS
	.comm	_MLX5_MKC_ACCESS_MODE_KSM,4,2   ## @MLX5_MKC_ACCESS_MODE_KSM
	.comm	_CONFIG_INFINIBAND_ON_DEMAND_PAGING,4,2 ## @CONFIG_INFINIBAND_ON_DEMAND_PAGING
	.comm	_DEVX_OBJ_FLAGS_INDIRECT_MKEY,4,2 ## @DEVX_OBJ_FLAGS_INDIRECT_MKEY
	.comm	_mkey_umem_valid,4,2            ## @mkey_umem_valid
	.no_dead_strip	_devx_handle_mkey_create
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function devx_handle_mkey_create
_devx_handle_mkey_create:               ; @devx_handle_mkey_create
	.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, x3
	mov	x20, x2
	mov	x19, x1
Lloh0:
	adrp	x23, _create_mkey_in@GOTPAGE
Lloh1:
	ldr	x23, [x23, _create_mkey_in@GOTPAGEOFF]
	ldr	w0, [x23]
Lloh2:
	adrp	x24, _memory_key_mkey_entry@GOTPAGE
Lloh3:
	ldr	x24, [x24, _memory_key_mkey_entry@GOTPAGEOFF]
	ldr	w1, [x24]
	bl	_MLX5_BYTE_OFF
	mov	x22, x0
	ldr	w0, [x23]
	ldr	w1, [x24]
	bl	_MLX5_FLD_SZ_BYTES
	add	w8, w0, w22
	cmp	w8, w21
	b.le	LBB0_2
; %bb.1:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_2:
	ldr	w0, [x23]
	ldr	w2, [x24]
	mov	x1, x20
	bl	_MLX5_ADDR_OF
	mov	x21, x0
Lloh7:
	adrp	x8, _access_mode_1_0@GOTPAGE
Lloh8:
	ldr	x8, [x8, _access_mode_1_0@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	mov	x1, x0
	bl	_MLX5_GET
	mov	x22, x0
Lloh10:
	adrp	x8, _access_mode_4_2@GOTPAGE
Lloh11:
	ldr	x8, [x8, _access_mode_4_2@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	mov	x0, x21
	mov	x1, x21
	bl	_MLX5_GET
	orr	w8, w22, w0, lsl #2
Lloh13:
	adrp	x9, _MLX5_MKC_ACCESS_MODE_KLMS@GOTPAGE
Lloh14:
	ldr	x9, [x9, _MLX5_MKC_ACCESS_MODE_KLMS@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
Lloh16:
	adrp	x10, _MLX5_MKC_ACCESS_MODE_KSM@GOTPAGE
Lloh17:
	ldr	x10, [x10, _MLX5_MKC_ACCESS_MODE_KSM@GOTPAGEOFF]
Lloh18:
	ldr	w10, [x10]
	cmp	w8, w9
	ccmp	w8, w10, #4, ne
	b.ne	LBB0_5
; %bb.3:
Lloh19:
	adrp	x8, _CONFIG_INFINIBAND_ON_DEMAND_PAGING@GOTPAGE
Lloh20:
	ldr	x8, [x8, _CONFIG_INFINIBAND_ON_DEMAND_PAGING@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	bl	_IS_ENABLED
	cbz	x0, LBB0_6
; %bb.4:
	mov	w0, #0
Lloh22:
	adrp	x8, _DEVX_OBJ_FLAGS_INDIRECT_MKEY@GOTPAGE
Lloh23:
	ldr	x8, [x8, _DEVX_OBJ_FLAGS_INDIRECT_MKEY@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
	b	LBB0_6
LBB0_5:
	ldr	w0, [x23]
Lloh25:
	adrp	x8, _mkey_umem_valid@GOTPAGE
Lloh26:
	ldr	x8, [x8, _mkey_umem_valid@GOTPAGEOFF]
Lloh27:
	ldr	w2, [x8]
	mov	x1, x20
	mov	w3, #1
	bl	_MLX5_SET
	mov	w0, #0
LBB0_6:
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_create_mkey_in,4,2             ; @create_mkey_in
	.comm	_memory_key_mkey_entry,4,2      ; @memory_key_mkey_entry
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_access_mode_1_0,4,2            ; @access_mode_1_0
	.comm	_access_mode_4_2,4,2            ; @access_mode_4_2
	.comm	_MLX5_MKC_ACCESS_MODE_KLMS,4,2  ; @MLX5_MKC_ACCESS_MODE_KLMS
	.comm	_MLX5_MKC_ACCESS_MODE_KSM,4,2   ; @MLX5_MKC_ACCESS_MODE_KSM
	.comm	_CONFIG_INFINIBAND_ON_DEMAND_PAGING,4,2 ; @CONFIG_INFINIBAND_ON_DEMAND_PAGING
	.comm	_DEVX_OBJ_FLAGS_INDIRECT_MKEY,4,2 ; @DEVX_OBJ_FLAGS_INDIRECT_MKEY
	.comm	_mkey_umem_valid,4,2            ; @mkey_umem_valid
	.no_dead_strip	_devx_handle_mkey_create
.subsections_via_symbols
