	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns_roce_mtt_init              ## -- Begin function hns_roce_mtt_init
	.p2align	4, 0x90
_hns_roce_mtt_init:                     ## @hns_roce_mtt_init
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	testl	%esi, %esi
	je	LBB0_1
## %bb.2:
	movl	%edx, 4(%rcx)
	movl	$0, (%rcx)
	movq	_HNS_ROCE_MTT_ENTRY_PER_SEG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r14d, %r14d
	movl	$0, %eax
	cmpl	%esi, %edx
	jge	LBB0_6
## %bb.3:
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	incl	%eax
	addl	%edx, %edx
	cmpl	%esi, %edx
	jl	LBB0_4
## %bb.5:
	movl	%eax, (%rcx)
LBB0_6:
	movl	8(%rcx), %ebx
	addq	$12, %rcx
	movl	%eax, %esi
	movq	%rcx, %rdx
	movl	%ebx, %ecx
	callq	_hns_roce_alloc_mtt_range
	cmpl	$-1, %eax
	jne	LBB0_8
## %bb.7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_8
LBB0_1:
	movl	$-1, (%rcx)
	movq	_HNS_ROCE_HEM_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rcx)
	xorl	%r14d, %r14d
LBB0_8:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HNS_ROCE_HEM_PAGE_SHIFT,4,2    ## @HNS_ROCE_HEM_PAGE_SHIFT
	.comm	_HNS_ROCE_MTT_ENTRY_PER_SEG,4,2 ## @HNS_ROCE_MTT_ENTRY_PER_SEG
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns_roce_mtt_init              ; -- Begin function hns_roce_mtt_init
	.p2align	2
_hns_roce_mtt_init:                     ; @hns_roce_mtt_init
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	cbz	w1, LBB0_7
; %bb.1:
	mov	x8, x1
	mov	w1, #0
	stp	wzr, w2, [x3]
Lloh0:
	adrp	x9, _HNS_ROCE_MTT_ENTRY_PER_SEG@GOTPAGE
Lloh1:
	ldr	x9, [x9, _HNS_ROCE_MTT_ENTRY_PER_SEG@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w9, w8
	b.ge	LBB0_5
; %bb.2:
	mov	w1, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	add	w1, w1, #1
	lsl	w9, w9, #1
	cmp	w9, w8
	b.lt	LBB0_3
; %bb.4:
	str	w1, [x3]
LBB0_5:
	add	x2, x3, #12
	ldr	w3, [x3, #8]
	bl	_hns_roce_alloc_mtt_range
	cmn	w0, #1
	b.eq	LBB0_8
; %bb.6:
	mov	w0, #0
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_7:
	mov	w0, #0
	mov	w8, #-1
	str	w8, [x3]
Lloh3:
	adrp	x8, _HNS_ROCE_HEM_PAGE_SHIFT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HNS_ROCE_HEM_PAGE_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x3, #4]
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_8:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp], #16             ; 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	_HNS_ROCE_HEM_PAGE_SHIFT,4,2    ; @HNS_ROCE_HEM_PAGE_SHIFT
	.comm	_HNS_ROCE_MTT_ENTRY_PER_SEG,4,2 ; @HNS_ROCE_MTT_ENTRY_PER_SEG
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
