	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function handle_alloc_dm_memic
_handle_alloc_dm_memic:                 ## @handle_alloc_dm_memic
	.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	%rcx, %r12
	movq	%rdx, %rbx
	movq	%rsi, %r13
	movq	%rdi, %r14
	movl	(%rdi), %edi
	callq	_to_mdev
	movq	%rax, %r15
	movl	4(%rbx), %edi
	movq	_MLX5_MEMIC_BASE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_roundup
	movl	%eax, 4(%r13)
	movl	(%rbx), %ecx
	movq	%r15, %rdi
	movq	%r13, %rsi
	movl	%eax, %edx
	callq	_mlx5_cmd_alloc_memic
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_5
## %bb.1:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movl	(%r13), %r12d
	movq	(%r15), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_pci_resource_start
	movl	%eax, %ebx
	movq	(%r15), %rdi
	movq	_memic_bar_start_addr@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_MLX5_CAP64_DEV_MEM
	addl	%ebx, %eax
	subl	%eax, %r12d
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %r12d
	movl	%r12d, -44(%rbp)
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	_MLX5_IB_ATTR_ALLOC_DM_RESP_PAGE_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	movq	%r12, %rdi
	movl	$4, %ecx
	callq	_uverbs_copy_to
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_4
## %bb.2:
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	(%r13), %eax
	movl	%eax, -48(%rbp)
	movq	_MLX5_IB_ATTR_ALLOC_DM_RESP_START_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	movq	%r12, %rdi
	movl	$4, %ecx
	callq	_uverbs_copy_to
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_3
LBB0_4:
	movl	(%r13), %esi
	movl	4(%r13), %edx
	movq	%r15, %rdi
	callq	_mlx5_cmd_dealloc_memic
LBB0_5:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%r14, %rdi
	callq	_to_mucontext
	movl	(%rax), %ebx
	movl	-44(%rbp), %r14d
	movl	4(%r13), %edi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_DIV_ROUND_UP
	movl	%ebx, %edi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_bitmap_set
	xorl	%ebx, %ebx
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_MLX5_MEMIC_BASE_SIZE,4,2       ## @MLX5_MEMIC_BASE_SIZE
	.comm	_memic_bar_start_addr,4,2       ## @memic_bar_start_addr
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_MLX5_IB_ATTR_ALLOC_DM_RESP_PAGE_INDEX,4,2 ## @MLX5_IB_ATTR_ALLOC_DM_RESP_PAGE_INDEX
	.comm	_PAGE_MASK,4,2                  ## @PAGE_MASK
	.comm	_MLX5_IB_ATTR_ALLOC_DM_RESP_START_OFFSET,4,2 ## @MLX5_IB_ATTR_ALLOC_DM_RESP_START_OFFSET
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.no_dead_strip	_handle_alloc_dm_memic
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function handle_alloc_dm_memic
_handle_alloc_dm_memic:                 ; @handle_alloc_dm_memic
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x22, x3
	mov	x23, x2
	mov	x19, x1
	mov	x20, x0
	ldr	w0, [x0]
	bl	_to_mdev
	mov	x21, x0
	ldr	w0, [x23, #4]
Lloh0:
	adrp	x8, _MLX5_MEMIC_BASE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MLX5_MEMIC_BASE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_roundup
	mov	x2, x0
	str	w0, [x19, #4]
	ldr	w3, [x23]
	mov	x0, x21
	mov	x1, x19
	bl	_mlx5_cmd_alloc_memic
	mov	x23, x0
	cbnz	w0, LBB0_4
; %bb.1:
	ldr	w24, [x19]
	ldr	x8, [x21]
	ldr	w0, [x8]
	mov	w1, #0
	bl	_pci_resource_start
	mov	x23, x0
	ldr	x0, [x21]
Lloh3:
	adrp	x8, _memic_bar_start_addr@GOTPAGE
Lloh4:
	ldr	x8, [x8, _memic_bar_start_addr@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_MLX5_CAP64_DEV_MEM
	add	w8, w23, w0
	sub	w8, w24, w8
Lloh6:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	asr	w8, w8, w9
	str	w8, [sp, #8]
Lloh9:
	adrp	x8, _MLX5_IB_ATTR_ALLOC_DM_RESP_PAGE_INDEX@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MLX5_IB_ATTR_ALLOC_DM_RESP_PAGE_INDEX@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x22
	mov	w3, #4
	bl	_uverbs_copy_to
	mov	x23, x0
	cbnz	w0, LBB0_3
; %bb.2:
	ldr	w8, [x19]
Lloh12:
	adrp	x9, _PAGE_MASK@GOTPAGE
Lloh13:
	ldr	x9, [x9, _PAGE_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	bic	w8, w8, w9
	str	w8, [sp, #12]
Lloh15:
	adrp	x8, _MLX5_IB_ATTR_ALLOC_DM_RESP_START_OFFSET@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MLX5_IB_ATTR_ALLOC_DM_RESP_START_OFFSET@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x22
	mov	w3, #4
	bl	_uverbs_copy_to
	mov	x23, x0
	cbz	w0, LBB0_5
LBB0_3:
	ldp	w1, w2, [x19]
	mov	x0, x21
	bl	_mlx5_cmd_dealloc_memic
LBB0_4:
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_5:
	mov	x0, x20
	bl	_to_mucontext
	ldr	w20, [x0]
	ldr	w21, [sp, #8]
	ldr	w0, [x19, #4]
Lloh18:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	bl	_DIV_ROUND_UP
	mov	x2, x0
	mov	x0, x20
	mov	x1, x21
	bl	_bitmap_set
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_MLX5_MEMIC_BASE_SIZE,4,2       ; @MLX5_MEMIC_BASE_SIZE
	.comm	_memic_bar_start_addr,4,2       ; @memic_bar_start_addr
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_MLX5_IB_ATTR_ALLOC_DM_RESP_PAGE_INDEX,4,2 ; @MLX5_IB_ATTR_ALLOC_DM_RESP_PAGE_INDEX
	.comm	_PAGE_MASK,4,2                  ; @PAGE_MASK
	.comm	_MLX5_IB_ATTR_ALLOC_DM_RESP_START_OFFSET,4,2 ; @MLX5_IB_ATTR_ALLOC_DM_RESP_START_OFFSET
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.no_dead_strip	_handle_alloc_dm_memic
.subsections_via_symbols
