	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns_roce_alloc_mtt_range
_hns_roce_alloc_mtt_range:              ## @hns_roce_alloc_mtt_range
	.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
                                        ## kill: def $ecx killed $ecx def $rcx
	movq	%rdi, %rbx
	leal	-128(%rcx), %eax
	cmpl	$3, %eax
	ja	LBB0_5
## %bb.1:
	movq	%rdx, %r15
	movl	%esi, %r14d
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_6:
	leaq	32(%rbx), %r12
	leaq	28(%rbx), %rax
	jmp	LBB0_7
LBB0_5:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ecx, %edx
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_11
LBB0_3:
	leaq	16(%rbx), %r12
	leaq	12(%rbx), %rax
	jmp	LBB0_7
LBB0_4:
	leaq	8(%rbx), %r12
	leaq	4(%rbx), %rax
	jmp	LBB0_7
LBB0_2:
	leaq	24(%rbx), %r12
	leaq	20(%rbx), %rax
LBB0_7:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	movl	%r14d, %esi
	movq	%r15, %rdx
	callq	_hns_roce_buddy_alloc
	movl	$-1, %r13d
	cmpl	$-1, %eax
	je	LBB0_11
## %bb.8:
	movl	$1, %eax
	movl	%r14d, %ecx
	shll	%cl, %eax
	movq	(%r15), %rdx
	cltq
	leaq	(%rax,%rdx), %rcx
	decq	%rcx
	movq	%rbx, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_hns_roce_table_get_range
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	movq	(%r15), %rsi
	movq	%r12, %rdi
	movl	%r14d, %edx
	callq	_hns_roce_buddy_free
	jmp	LBB0_11
LBB0_9:
	xorl	%r13d, %r13d
LBB0_11:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_3, LBB0_3-LJTI0_0
.set L0_0_set_4, LBB0_4-LJTI0_0
.set L0_0_set_2, LBB0_2-LJTI0_0
LJTI0_0:
	.long	L0_0_set_6
	.long	L0_0_set_3
	.long	L0_0_set_4
	.long	L0_0_set_2
	.end_data_region
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unsupport MTT table type: %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_hns_roce_alloc_mtt_range
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hns_roce_alloc_mtt_range
_hns_roce_alloc_mtt_range:              ; @hns_roce_alloc_mtt_range
	.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, x0
	sub	w8, w3, #128
	cmp	w8, #3
	b.hi	LBB0_3
; %bb.1:
	mov	x20, x2
	mov	x19, x1
Lloh0:
	adrp	x9, lJTI0_0@PAGE
Lloh1:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
	add	x22, x21, #32
	add	x23, x21, #28
	b	LBB0_7
LBB0_3:
	ldr	w0, [x21]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x3
	bl	_dev_err
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_4:
	add	x22, x21, #16
	add	x23, x21, #12
	b	LBB0_7
LBB0_5:
	add	x22, x21, #8
	add	x23, x21, #4
	b	LBB0_7
LBB0_6:
	add	x22, x21, #24
	add	x23, x21, #20
LBB0_7:
	mov	x0, x22
	mov	x1, x19
	mov	x2, x20
	bl	_hns_roce_buddy_alloc
	cmn	w0, #1
	b.eq	LBB0_10
; %bb.8:
	ldr	x2, [x20]
	mov	w8, #1
	lsl	w8, w8, w19
	add	x8, x2, w8, sxtw
	sub	x3, x8, #1
	mov	x0, x21
	mov	x1, x23
	bl	_hns_roce_table_get_range
	cbz	x0, LBB0_10
; %bb.9:
	ldr	x1, [x20]
	mov	x0, x22
	mov	x2, x19
	bl	_hns_roce_buddy_free
	mov	w0, #-1
LBB0_10:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_4-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_6-LBB0_2)>>2
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unsupport MTT table type: %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_hns_roce_alloc_mtt_range
.subsections_via_symbols
