	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns_roce_write_mtt_chunk
_hns_roce_write_mtt_chunk:              ## @hns_roce_write_mtt_chunk
	.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	%r8, -48(%rbp)                  ## 8-byte Spill
	movl	(%rsi), %eax
	addl	$-128, %eax
	cmpl	$3, %eax
	ja	LBB0_5
## %bb.1:
	movl	%ecx, %r15d
	movl	%edx, %r9d
	movq	%rdi, %r12
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_7:
	leaq	32(%r12), %r8
	movq	%r12, %rax
	jmp	LBB0_8
LBB0_3:
	leaq	24(%r12), %r8
	leaq	8(%r12), %rax
	jmp	LBB0_8
LBB0_4:
	leaq	20(%r12), %r8
	leaq	12(%r12), %rax
	jmp	LBB0_8
LBB0_2:
	leaq	28(%r12), %r8
	leaq	4(%r12), %rax
LBB0_8:
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	addl	(%rax), %ecx
	movl	$1, %edx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %edx
	movslq	%r9d, %rax
	movslq	%edx, %rdi
	shrq	$2, %rdi
	movq	%rax, %rcx
	orq	%rdi, %rcx
	shrq	$32, %rcx
	je	LBB0_9
## %bb.10:
	xorl	%edx, %edx
	divq	%rdi
	movq	%rax, %rcx
	jmp	LBB0_11
LBB0_9:
	movl	%r9d, %eax
	xorl	%edx, %edx
	divl	%edi
	movl	%eax, %ecx
LBB0_11:
	leal	(%r9,%r15), %eax
	decl	%eax
	movslq	%eax, %rbx
	movq	%rbx, %rdx
	orq	%rdi, %rdx
	shrq	$32, %rdx
	je	LBB0_12
## %bb.13:
	movq	%rbx, %rax
	xorl	%edx, %edx
	divq	%rdi
	cmpq	%rax, %rcx
	je	LBB0_15
	jmp	LBB0_5
LBB0_12:
	xorl	%edx, %edx
	divl	%edi
                                        ## kill: def $eax killed $eax def $rax
	cmpq	%rax, %rcx
	jne	LBB0_5
LBB0_15:
	movq	_HNS_ROCE_MTT_ENTRY_PER_SEG@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leal	-1(%rcx), %eax
	testl	%r9d, %eax
	je	LBB0_16
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_6:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_24:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movl	%r9d, %eax
	cltd
	idivl	%ecx
	movslq	%eax, %rdx
	addq	8(%rsi), %rdx
	leaq	-52(%rbp), %rcx
	movq	%r12, %rdi
	movq	%r8, %rsi
	callq	_hns_roce_table_find
	testq	%rax, %rax
	je	LBB0_19
## %bb.17:
	testl	%r15d, %r15d
	jle	LBB0_18
## %bb.20:
	movq	%rax, %r13
	movl	%r15d, %r15d
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	jmp	LBB0_21
	.p2align	4, 0x90
LBB0_23:                                ##   in Loop: Header=BB0_21 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax,%r14,4), %edi
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %edi
	callq	_cpu_to_le64
	movl	%eax, (%r13,%r14,4)
	incq	%r14
	cmpq	%r14, %r15
	je	LBB0_24
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	cmpl	$0, 16(%r12)
	movl	$0, %ecx
	jne	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_21 Depth=1
	movq	_PAGE_ADDR_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	jmp	LBB0_23
LBB0_19:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_18:
	xorl	%ebx, %ebx
	jmp	LBB0_24
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_7, LBB0_7-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_7
	.long	L0_0_set_3
	.long	L0_0_set_4
	.long	L0_0_set_2
	.end_data_region
                                        ## -- End function
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_HNS_ROCE_MTT_ENTRY_PER_SEG,4,2 ## @HNS_ROCE_MTT_ENTRY_PER_SEG
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PAGE_ADDR_SHIFT,4,2            ## @PAGE_ADDR_SHIFT
	.no_dead_strip	_hns_roce_write_mtt_chunk
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hns_roce_write_mtt_chunk
_hns_roce_write_mtt_chunk:              ; @hns_roce_write_mtt_chunk
	.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
                                        ; kill: def $w2 killed $w2 def $x2
	ldr	w8, [x1]
	sub	w8, w8, #128
	cmp	w8, #3
	b.hi	LBB0_8
; %bb.1:
	mov	x19, x4
	mov	x21, x3
	mov	x20, x0
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	x8, x20, #32
	mov	x9, x20
	b	LBB0_6
LBB0_3:
	add	x8, x20, #24
	add	x9, x20, #8
	b	LBB0_6
LBB0_4:
	add	x8, x20, #20
	add	x9, x20, #12
	b	LBB0_6
LBB0_5:
	add	x8, x20, #28
	add	x9, x20, #4
LBB0_6:
	ldr	w9, [x9]
Lloh2:
	adrp	x10, _PAGE_SHIFT@GOTPAGE
Lloh3:
	ldr	x10, [x10, _PAGE_SHIFT@GOTPAGEOFF]
Lloh4:
	ldr	w10, [x10]
	add	w9, w10, w9
	mov	w10, #1
	lsl	w9, w10, w9
	sxtw	x10, w2
	sxtw	x9, w9
	lsr	x9, x9, #2
	udiv	x10, x10, x9
	add	w11, w2, w21
	sub	w11, w11, #1
	sxtw	x11, w11
	udiv	x9, x11, x9
	cmp	x10, x9
	b.ne	LBB0_8
; %bb.7:
Lloh5:
	adrp	x9, _HNS_ROCE_MTT_ENTRY_PER_SEG@GOTPAGE
Lloh6:
	ldr	x9, [x9, _HNS_ROCE_MTT_ENTRY_PER_SEG@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	sub	w10, w9, #1
	tst	w10, w2
	b.eq	LBB0_11
LBB0_8:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	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_11:
	ldr	x10, [x1, #8]
	sdiv	w9, w2, w9
	add	x2, x10, w9, sxtw
	add	x3, sp, #12
	mov	x0, x20
	mov	x1, x8
	bl	_hns_roce_table_find
	cbz	x0, LBB0_16
; %bb.12:
	cmp	w21, #1
	b.lt	LBB0_15
; %bb.13:
	mov	x22, x0
	mov	w21, w21
Lloh10:
	adrp	x23, _PAGE_ADDR_SHIFT@GOTPAGE
Lloh11:
	ldr	x23, [x23, _PAGE_ADDR_SHIFT@GOTPAGEOFF]
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x20, #16]
	ldr	w9, [x19], #4
	ldr	w10, [x23]
	cmp	w8, #0
	csel	w8, w10, wzr, eq
	asr	w0, w9, w8
	bl	_cpu_to_le64
	str	w0, [x22], #4
	subs	x21, x21, #1
	b.ne	LBB0_14
LBB0_15:
	mov	w0, #0
	b	LBB0_10
LBB0_16:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_9
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_3-LBB0_2)>>2
	.byte	(LBB0_4-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
                                        ; -- End function
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_HNS_ROCE_MTT_ENTRY_PER_SEG,4,2 ; @HNS_ROCE_MTT_ENTRY_PER_SEG
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PAGE_ADDR_SHIFT,4,2            ; @PAGE_ADDR_SHIFT
	.no_dead_strip	_hns_roce_write_mtt_chunk
.subsections_via_symbols
