	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns_roce_mtr_find              ## -- Begin function hns_roce_mtr_find
	.p2align	4, 0x90
_hns_roce_mtr_find:                     ## @hns_roce_mtr_find
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $edx killed $edx def $rdx
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	testq	%rcx, %rcx
	movq	%r9, -64(%rbp)                  ## 8-byte Spill
	je	LBB0_6
## %bb.1:
	movl	%r8d, %r12d
	testl	%r8d, %r8d
	jle	LBB0_6
## %bb.2:
	movq	%rcx, %r13
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	$0, -44(%rbp)
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	leal	(%rbx,%rax), %edx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	leaq	-44(%rbp), %rcx
	xorl	%r8d, %r8d
	callq	_hns_roce_hem_list_find_mtt
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	-44(%rbp), %edi
	testl	%edi, %edi
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rax, %r14
	movl	%r12d, %esi
	callq	_min
	movl	%eax, %r15d
	movslq	%ebx, %rax
	leaq	(,%rax,4), %rdi
	addq	%r13, %rdi
	movq	_BA_BYTE_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	imull	%r15d, %edx
	movq	%r14, %rsi
	callq	_memcpy
	addl	%r15d, %ebx
	subl	%r15d, %r12d
	jg	LBB0_3
LBB0_6:
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	testq	%rcx, %rcx
	je	LBB0_8
## %bb.7:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	movl	%eax, (%rcx)
LBB0_8:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BA_BYTE_LEN,4,2                ## @BA_BYTE_LEN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns_roce_mtr_find              ; -- Begin function hns_roce_mtr_find
	.p2align	2
_hns_roce_mtr_find:                     ; @hns_roce_mtr_find
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x5
	mov	x20, x1
	mov	w21, #0
	cbz	x3, LBB0_6
; %bb.1:
	mov	x22, x4
	cmp	w4, #1
	b.lt	LBB0_6
; %bb.2:
	mov	x23, x3
	mov	x24, x2
	mov	x25, x0
	mov	w21, #0
Lloh0:
	adrp	x28, _BA_BYTE_LEN@GOTPAGE
Lloh1:
	ldr	x28, [x28, _BA_BYTE_LEN@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	str	wzr, [sp, #12]
	add	w2, w21, w24
	add	x3, sp, #12
	mov	x0, x25
	mov	x1, x20
	mov	x4, #0
	bl	_hns_roce_hem_list_find_mtt
	cbz	x0, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x26, x0
	ldr	w0, [sp, #12]
	cbz	w0, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x1, x22
	bl	_min
	mov	x27, x0
	add	x0, x23, w21, sxtw #2
	ldr	w8, [x28]
	mul	w2, w8, w27
	mov	x1, x26
	bl	_memcpy
	sub	w22, w22, w27
	add	w21, w27, w21
	cmp	w22, #0
	b.gt	LBB0_3
LBB0_6:
	cbz	x19, LBB0_8
; %bb.7:
	ldr	w8, [x20]
	str	w8, [x19]
LBB0_8:
	mov	x0, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_BA_BYTE_LEN,4,2                ; @BA_BYTE_LEN
.subsections_via_symbols
