	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlx5_fw_tracer_create_mkey
_mlx5_fw_tracer_create_mkey:            ## @mlx5_fw_tracer_create_mkey
	.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
	movq	%rdi, %r13
	movq	24(%rdi), %r14
	movq	_create_mkey_in@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_MLX5_ST_SZ_BYTES
	movl	%eax, %ebx
	movq	_TRACER_BUFFER_PAGE_NUM@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movl	$2, %esi
	callq	_round_up
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rbx,%rax,4), %r15d
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	callq	_kvzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	_create_mkey_in@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	_translations_octword_actual_size@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	(%r12), %edi
	movl	$2, %esi
	callq	_DIV_ROUND_UP
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	%r14d, %edx
	movl	%eax, %ecx
	callq	_MLX5_SET
	movq	_create_mkey_in@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_klm_pas_mtt@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rsi
	callq	_MLX5_ADDR_OF
	cmpl	$0, (%r12)
	jle	LBB0_5
## %bb.3:
	movq	%rax, %r14
	xorl	%ebx, %ebx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movslq	(%r15), %rax
	movslq	%ebx, %rdi
	imulq	%rax, %rdi
	addq	16(%r13), %rdi
	callq	_cpu_to_be64
	movl	%eax, (%r14,%rbx,4)
	incq	%rbx
	movslq	(%r12), %rax
	cmpq	%rax, %rbx
	jl	LBB0_4
LBB0_5:
	movq	_create_mkey_in@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_memory_key_mkey_entry@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rsi
	callq	_MLX5_ADDR_OF
	movq	%rax, %rbx
	movq	_access_mode_1_0@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_MLX5_MKC_ACCESS_MODE_MTT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	callq	_MLX5_SET
	movq	_lr@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	_MLX5_SET
	movq	_lw@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	_MLX5_SET
	movq	_pd@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	(%r13), %ecx
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	callq	_MLX5_SET
	movq	_bsf_octword_size@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	xorl	%ecx, %ecx
	callq	_MLX5_SET
	movq	_qpn@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	movl	$16777215, %ecx                 ## imm = 0xFFFFFF
	callq	_MLX5_SET
	movq	_log_page_size@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	callq	_MLX5_SET
	movq	_translations_octword_size@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	(%r12), %edi
	movl	$2, %esi
	callq	_DIV_ROUND_UP
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	movl	%r14d, %edx
	movl	%eax, %ecx
	callq	_MLX5_SET
	movq	_start_addr@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	16(%r13), %rcx
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	callq	_MLX5_SET64
	movq	_len@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	8(%r13), %rcx
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	callq	_MLX5_SET64
	addq	$4, %r13
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movq	%r13, %rsi
	movq	%r15, %rdx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	callq	_mlx5_core_create_mkey
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_mlx5_core_warn
LBB0_7:
	movq	%r15, %rdi
	callq	_kvfree
	jmp	LBB0_8
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_create_mkey_in,8,3             ## @create_mkey_in
	.comm	_TRACER_BUFFER_PAGE_NUM,4,2     ## @TRACER_BUFFER_PAGE_NUM
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_translations_octword_actual_size,4,2 ## @translations_octword_actual_size
	.comm	_klm_pas_mtt,4,2                ## @klm_pas_mtt
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_memory_key_mkey_entry,4,2      ## @memory_key_mkey_entry
	.comm	_access_mode_1_0,4,2            ## @access_mode_1_0
	.comm	_MLX5_MKC_ACCESS_MODE_MTT,4,2   ## @MLX5_MKC_ACCESS_MODE_MTT
	.comm	_lr,4,2                         ## @lr
	.comm	_lw,4,2                         ## @lw
	.comm	_pd,4,2                         ## @pd
	.comm	_bsf_octword_size,4,2           ## @bsf_octword_size
	.comm	_qpn,4,2                        ## @qpn
	.comm	_log_page_size,4,2              ## @log_page_size
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_translations_octword_size,4,2  ## @translations_octword_size
	.comm	_start_addr,4,2                 ## @start_addr
	.comm	_len,4,2                        ## @len
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"FWTracer: Failed to create mkey, %d\n"

	.no_dead_strip	_mlx5_fw_tracer_create_mkey
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlx5_fw_tracer_create_mkey
_mlx5_fw_tracer_create_mkey:            ; @mlx5_fw_tracer_create_mkey
	.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, x0
	ldr	x19, [x0, #24]
Lloh0:
	adrp	x26, _create_mkey_in@GOTPAGE
Lloh1:
	ldr	x26, [x26, _create_mkey_in@GOTPAGEOFF]
	ldr	x0, [x26]
	bl	_MLX5_ST_SZ_BYTES
	mov	x21, x0
Lloh2:
	adrp	x25, _TRACER_BUFFER_PAGE_NUM@GOTPAGE
Lloh3:
	ldr	x25, [x25, _TRACER_BUFFER_PAGE_NUM@GOTPAGEOFF]
	ldr	w0, [x25]
	mov	w1, #2
	bl	_round_up
	add	w22, w21, w0, lsl #2
Lloh4:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_kvzalloc
	cbz	x0, LBB0_7
; %bb.1:
	mov	x21, x0
	ldr	x23, [x26]
Lloh7:
	adrp	x8, _translations_octword_actual_size@GOTPAGE
Lloh8:
	ldr	x8, [x8, _translations_octword_actual_size@GOTPAGEOFF]
Lloh9:
	ldr	w24, [x8]
	ldr	w0, [x25]
	mov	w1, #2
	bl	_DIV_ROUND_UP
	mov	x3, x0
	mov	x0, x23
	mov	x1, x21
	mov	x2, x24
	bl	_MLX5_SET
	ldr	x0, [x26]
Lloh10:
	adrp	x8, _klm_pas_mtt@GOTPAGE
Lloh11:
	ldr	x8, [x8, _klm_pas_mtt@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	mov	x1, x21
	bl	_MLX5_ADDR_OF
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.2:
	mov	x23, x0
	mov	x24, #0
Lloh13:
	adrp	x27, _PAGE_SIZE@GOTPAGE
Lloh14:
	ldr	x27, [x27, _PAGE_SIZE@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #16]
	ldrsw	x9, [x27]
	sxtw	x10, w24
	madd	x0, x9, x10, x8
	bl	_cpu_to_be64
	str	w0, [x23, x24, lsl #2]
	add	x24, x24, #1
	ldrsw	x8, [x25]
	cmp	x24, x8
	b.lt	LBB0_3
LBB0_4:
	ldr	x0, [x26]
Lloh15:
	adrp	x8, _memory_key_mkey_entry@GOTPAGE
Lloh16:
	ldr	x8, [x8, _memory_key_mkey_entry@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	mov	x1, x21
	bl	_MLX5_ADDR_OF
	mov	x23, x0
Lloh18:
	adrp	x8, _access_mode_1_0@GOTPAGE
Lloh19:
	ldr	x8, [x8, _access_mode_1_0@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
Lloh21:
	adrp	x8, _MLX5_MKC_ACCESS_MODE_MTT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MLX5_MKC_ACCESS_MODE_MTT@GOTPAGEOFF]
Lloh23:
	ldr	w3, [x8]
	mov	x1, x0
	bl	_MLX5_SET
Lloh24:
	adrp	x8, _lr@GOTPAGE
Lloh25:
	ldr	x8, [x8, _lr@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	mov	x0, x23
	mov	x1, x23
	mov	w3, #1
	bl	_MLX5_SET
Lloh27:
	adrp	x8, _lw@GOTPAGE
Lloh28:
	ldr	x8, [x8, _lw@GOTPAGEOFF]
Lloh29:
	ldr	w2, [x8]
	mov	x0, x23
	mov	x1, x23
	mov	w3, #1
	bl	_MLX5_SET
Lloh30:
	adrp	x8, _pd@GOTPAGE
Lloh31:
	ldr	x8, [x8, _pd@GOTPAGEOFF]
Lloh32:
	ldr	w2, [x8]
	ldr	w3, [x20]
	mov	x0, x23
	mov	x1, x23
	bl	_MLX5_SET
Lloh33:
	adrp	x8, _bsf_octword_size@GOTPAGE
Lloh34:
	ldr	x8, [x8, _bsf_octword_size@GOTPAGEOFF]
Lloh35:
	ldr	w2, [x8]
	mov	x0, x23
	mov	x1, x23
	mov	w3, #0
	bl	_MLX5_SET
Lloh36:
	adrp	x8, _qpn@GOTPAGE
Lloh37:
	ldr	x8, [x8, _qpn@GOTPAGEOFF]
Lloh38:
	ldr	w2, [x8]
	mov	x0, x23
	mov	x1, x23
	mov	w3, #16777215
	bl	_MLX5_SET
Lloh39:
	adrp	x8, _log_page_size@GOTPAGE
Lloh40:
	ldr	x8, [x8, _log_page_size@GOTPAGEOFF]
Lloh41:
	ldr	w2, [x8]
Lloh42:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh43:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh44:
	ldr	w3, [x8]
	mov	x0, x23
	mov	x1, x23
	bl	_MLX5_SET
Lloh45:
	adrp	x8, _translations_octword_size@GOTPAGE
Lloh46:
	ldr	x8, [x8, _translations_octword_size@GOTPAGEOFF]
Lloh47:
	ldr	w24, [x8]
	ldr	w0, [x25]
	mov	w1, #2
	bl	_DIV_ROUND_UP
	mov	x3, x0
	mov	x0, x23
	mov	x1, x23
	mov	x2, x24
	bl	_MLX5_SET
Lloh48:
	adrp	x8, _start_addr@GOTPAGE
Lloh49:
	ldr	x8, [x8, _start_addr@GOTPAGEOFF]
Lloh50:
	ldr	w2, [x8]
	ldr	x3, [x20, #16]
	mov	x0, x23
	mov	x1, x23
	bl	_MLX5_SET64
Lloh51:
	adrp	x8, _len@GOTPAGE
Lloh52:
	ldr	x8, [x8, _len@GOTPAGEOFF]
Lloh53:
	ldr	w2, [x8]
	ldr	x3, [x20, #8]
	mov	x0, x23
	mov	x1, x23
	bl	_MLX5_SET64
	add	x1, x20, #4
	mov	x0, x19
	mov	x2, x21
	mov	x3, x22
	bl	_mlx5_core_create_mkey
	mov	x20, x0
	cbz	w0, LBB0_6
; %bb.5:
Lloh54:
	adrp	x1, l_.str@PAGE
Lloh55:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_mlx5_core_warn
LBB0_6:
	mov	x0, x21
	bl	_kvfree
	b	LBB0_8
LBB0_7:
Lloh56:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh57:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh58:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_8:
	mov	x0, x20
	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 AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh56, Lloh57, Lloh58
	.cfi_endproc
                                        ; -- End function
	.comm	_create_mkey_in,8,3             ; @create_mkey_in
	.comm	_TRACER_BUFFER_PAGE_NUM,4,2     ; @TRACER_BUFFER_PAGE_NUM
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_translations_octword_actual_size,4,2 ; @translations_octword_actual_size
	.comm	_klm_pas_mtt,4,2                ; @klm_pas_mtt
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_memory_key_mkey_entry,4,2      ; @memory_key_mkey_entry
	.comm	_access_mode_1_0,4,2            ; @access_mode_1_0
	.comm	_MLX5_MKC_ACCESS_MODE_MTT,4,2   ; @MLX5_MKC_ACCESS_MODE_MTT
	.comm	_lr,4,2                         ; @lr
	.comm	_lw,4,2                         ; @lw
	.comm	_pd,4,2                         ; @pd
	.comm	_bsf_octword_size,4,2           ; @bsf_octword_size
	.comm	_qpn,4,2                        ; @qpn
	.comm	_log_page_size,4,2              ; @log_page_size
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_translations_octword_size,4,2  ; @translations_octword_size
	.comm	_start_addr,4,2                 ; @start_addr
	.comm	_len,4,2                        ; @len
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"FWTracer: Failed to create mkey, %d\n"

	.no_dead_strip	_mlx5_fw_tracer_create_mkey
.subsections_via_symbols
