	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns_roce_table_mhop_put
_hns_roce_table_mhop_put:               ## @hns_roce_table_mhop_put
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movq	%rdx, %rbx
	movq	%rsi, %r12
	movq	%rdi, %r13
	movq	8(%rdi), %r14
	movq	%rdx, -120(%rbp)
	leaq	-120(%rbp), %rdx
	leaq	-80(%rbp), %rcx
	callq	_hns_roce_calc_hem_mhop
	testl	%eax, %eax
	jne	LBB0_34
## %bb.1:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	movl	-80(%rbp), %eax
	movl	-76(%rbp), %r14d
	movq	_BA_BYTE_LEN@GOTPCREL(%rip), %rcx
	movl	%eax, -92(%rbp)                 ## 4-byte Spill
	cltd
	idivl	(%rcx)
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	(%r12), %rdi
	movl	%r14d, %esi
	callq	_hns_roce_get_bt_num
	cmpl	$1, %eax
	je	LBB0_6
## %bb.2:
	cmpl	$2, %eax
	je	LBB0_5
## %bb.3:
	cmpl	$3, %eax
	jne	LBB0_35
## %bb.4:
	movl	-72(%rbp), %eax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	imull	%ecx, %eax
	addl	-68(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, -104(%rbp)                ## 8-byte Spill
	imull	%ecx, %eax
	addl	-64(%rbp), %eax
	jmp	LBB0_8
LBB0_6:
	movl	-72(%rbp), %eax
	jmp	LBB0_7
LBB0_5:
	movl	-72(%rbp), %eax
	imull	-44(%rbp), %eax                 ## 4-byte Folded Reload
	addl	-68(%rbp), %eax
LBB0_7:
	xorl	%ecx, %ecx
	movq	%rcx, -104(%rbp)                ## 8-byte Spill
LBB0_8:
	movslq	%eax, %rbx
	leaq	8(%r12), %rdi
	movq	%rdi, -112(%rbp)                ## 8-byte Spill
	callq	_mutex_lock
	testl	%r15d, %r15d
	je	LBB0_10
## %bb.9:
	movq	56(%r12), %rax
	movq	(%rax,%rbx,8), %rax
	movq	(%rax), %rcx
	leaq	-1(%rcx), %rdx
	movq	%rdx, (%rax)
	cmpq	$2, %rcx
	jge	LBB0_33
LBB0_10:
	movq	(%r12), %rax
	movq	_HEM_TYPE_MTT@GOTPCREL(%rip), %r15
	movq	(%r15), %rcx
	cmpl	$1, %r14d
	jne	LBB0_13
## %bb.11:
	cmpq	%rcx, %rax
	jge	LBB0_13
## %bb.12:
	movq	(%r13), %rax
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	$1, %ecx
	jmp	LBB0_19
LBB0_13:
	cmpl	$2, %r14d
	jne	LBB0_16
## %bb.14:
	cmpq	%rcx, %rax
	jge	LBB0_16
## %bb.15:
	movq	(%r13), %rax
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	$2, %ecx
	jmp	LBB0_19
LBB0_35:
	movq	(%r12), %rdx
	leaq	L_.str(%rip), %rsi
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movl	%r14d, %ecx
	callq	_dev_err
	jmp	LBB0_34
LBB0_16:
	cmpq	%rcx, %rax
	jge	LBB0_21
## %bb.17:
	movq	_HNS_ROCE_HOP_NUM_0@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jne	LBB0_21
## %bb.18:
	movq	(%r13), %rax
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	xorl	%ecx, %ecx
LBB0_19:
	callq	*(%rax)
	testq	%rax, %rax
	je	LBB0_21
## %bb.20:
	leaq	L_.str.1(%rip), %rsi
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_warn
LBB0_21:
	movq	56(%r12), %rax
	movq	(%rax,%rbx,8), %rsi
	movq	%r13, %rdi
	callq	_hns_roce_free_hem
	movq	56(%r12), %rax
	movq	$0, (%rax,%rbx,8)
	movq	(%r12), %rdi
	movl	%r14d, %esi
	callq	_check_whether_bt_num_2
	testq	%rax, %rax
	je	LBB0_25
## %bb.22:
	movl	-72(%rbp), %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	imull	%edx, %esi
	movq	56(%r12), %rdi
	movl	48(%r12), %ecx
	callq	_hns_roce_check_hem_null
	testq	%rax, %rax
	je	LBB0_33
## %bb.23:
	movq	(%r12), %rax
	cmpq	(%r15), %rax
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	jge	LBB0_32
## %bb.24:
	movq	(%r13), %rax
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	xorl	%ecx, %ecx
	callq	*(%rax)
	testq	%rax, %rax
	je	LBB0_32
LBB0_31:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_warn
LBB0_32:
	movslq	-72(%rbp), %rax
	leaq	(,%rax,8), %rcx
	addq	16(%r12), %rcx
	movq	(%rcx), %rdx
	movq	24(%r12), %rcx
	movl	(%rcx,%rax,4), %ecx
	movq	%r14, %rdi
	movl	-92(%rbp), %esi                 ## 4-byte Reload
	callq	_dma_free_coherent
	movq	16(%r12), %rax
	movslq	-72(%rbp), %rcx
	movq	$0, (%rax,%rcx,8)
	jmp	LBB0_33
LBB0_25:
	movq	(%r12), %rdi
	movl	%r14d, %esi
	callq	_check_whether_bt_num_3
	testq	%rax, %rax
	je	LBB0_33
## %bb.26:
	movl	-72(%rbp), %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	imull	%edx, %esi
	addl	-68(%rbp), %esi
	imull	%edx, %esi
	movq	56(%r12), %rdi
	movl	48(%r12), %ecx
	callq	_hns_roce_check_hem_null
	testq	%rax, %rax
	je	LBB0_33
## %bb.27:
	movq	(%r13), %rax
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	$1, %ecx
	callq	*(%rax)
	testq	%rax, %rax
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	je	LBB0_29
## %bb.28:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_warn
LBB0_29:
	movq	32(%r12), %rax
	movq	40(%r12), %rcx
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	movq	(%rax,%rbx,8), %rdx
	movl	(%rcx,%rbx,4), %ecx
	movq	%r14, %rdi
	movl	-92(%rbp), %esi                 ## 4-byte Reload
	callq	_dma_free_coherent
	movq	32(%r12), %rax
	movq	$0, (%rax,%rbx,8)
	movl	-72(%rbp), %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	imull	%edx, %esi
	movq	32(%r12), %rdi
	callq	_hns_roce_check_bt_null
	testq	%rax, %rax
	je	LBB0_33
## %bb.30:
	movq	(%r13), %rax
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	xorl	%ecx, %ecx
	callq	*(%rax)
	testq	%rax, %rax
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	jne	LBB0_31
	jmp	LBB0_32
LBB0_33:
	movq	-112(%rbp), %rdi                ## 8-byte Reload
	callq	_mutex_unlock
LBB0_34:
	addq	$88, %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
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Table %d not support hop_num = %d!\n"

	.comm	_HEM_TYPE_MTT,8,3               ## @HEM_TYPE_MTT
L_.str.1:                               ## @.str.1
	.asciz	"Clear HEM base address failed.\n"

	.comm	_HNS_ROCE_HOP_NUM_0,4,2         ## @HNS_ROCE_HOP_NUM_0
	.no_dead_strip	_hns_roce_table_mhop_put
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hns_roce_table_mhop_put
_hns_roce_table_mhop_put:               ; @hns_roce_table_mhop_put
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x27, x3
	mov	x22, x2
	mov	x19, x1
	mov	x23, x0
	ldr	x20, [x0, #8]
	str	x2, [sp, #16]
	add	x2, sp, #16
	add	x3, sp, #24
	bl	_hns_roce_calc_hem_mhop
	cbnz	w0, LBB0_31
; %bb.1:
	ldp	w21, w26, [sp, #24]
Lloh0:
	adrp	x8, _BA_BYTE_LEN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BA_BYTE_LEN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	sdiv	w25, w21, w8
	ldr	x0, [x19]
	mov	x1, x26
	bl	_hns_roce_get_bt_num
	cmp	w0, #1
	b.eq	LBB0_5
; %bb.2:
	cmp	w0, #2
	b.eq	LBB0_6
; %bb.3:
	cmp	w0, #3
	b.ne	LBB0_15
; %bb.4:
	ldp	w8, w9, [sp, #32]
	madd	w9, w8, w25, w9
	ldr	w8, [sp, #40]
	madd	w8, w9, w25, w8
	sxtw	x9, w9
	str	x9, [sp, #8]                    ; 8-byte Folded Spill
	b	LBB0_7
LBB0_5:
	str	xzr, [sp, #8]                   ; 8-byte Folded Spill
	ldr	w8, [sp, #32]
	b	LBB0_7
LBB0_6:
	str	xzr, [sp, #8]                   ; 8-byte Folded Spill
	ldp	w8, w9, [sp, #32]
	madd	w8, w8, w25, w9
LBB0_7:
	sxtw	x28, w8
	add	x24, x19, #8
	mov	x0, x24
	bl	_mutex_lock
	cbz	w27, LBB0_9
; %bb.8:
	ldr	x8, [x19, #56]
	ldr	x8, [x8, x28, lsl #3]
	ldr	x9, [x8]
	sub	x10, x9, #1
	str	x10, [x8]
	cmp	x9, #2
	b.ge	LBB0_30
LBB0_9:
	ldr	x8, [x19]
Lloh3:
	adrp	x27, _HEM_TYPE_MTT@GOTPAGE
Lloh4:
	ldr	x27, [x27, _HEM_TYPE_MTT@GOTPAGEOFF]
	ldr	x9, [x27]
	cmp	w26, #1
	b.ne	LBB0_12
; %bb.10:
	cmp	x8, x9
	b.ge	LBB0_12
; %bb.11:
	ldr	x8, [x23]
	ldr	x8, [x8]
	mov	x0, x23
	mov	x1, x19
	mov	x2, x22
	mov	w3, #1
	blr	x8
	cbnz	x0, LBB0_18
	b	LBB0_19
LBB0_12:
	cmp	w26, #2
	b.ne	LBB0_16
; %bb.13:
	cmp	x8, x9
	b.ge	LBB0_16
; %bb.14:
	ldr	x8, [x23]
	ldr	x8, [x8]
	mov	x0, x23
	mov	x1, x19
	mov	x2, x22
	mov	w3, #2
	blr	x8
	cbnz	x0, LBB0_18
	b	LBB0_19
LBB0_15:
	ldr	x2, [x19]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x3, x26
	bl	_dev_err
	b	LBB0_31
LBB0_16:
Lloh7:
	adrp	x10, _HNS_ROCE_HOP_NUM_0@GOTPAGE
Lloh8:
	ldr	x10, [x10, _HNS_ROCE_HOP_NUM_0@GOTPAGEOFF]
Lloh9:
	ldr	w10, [x10]
	cmp	x8, x9
	ccmp	w26, w10, #0, lt
	b.ne	LBB0_19
; %bb.17:
	ldr	x8, [x23]
	ldr	x8, [x8]
	mov	x0, x23
	mov	x1, x19
	mov	x2, x22
	mov	w3, #0
	blr	x8
	cbz	x0, LBB0_19
LBB0_18:
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_warn
LBB0_19:
	ldr	x8, [x19, #56]
	lsl	x28, x28, #3
	ldr	x1, [x8, x28]
	mov	x0, x23
	bl	_hns_roce_free_hem
	ldr	x8, [x19, #56]
	str	xzr, [x8, x28]
	ldr	x0, [x19]
	mov	x1, x26
	bl	_check_whether_bt_num_2
	cbz	x0, LBB0_22
; %bb.20:
	ldr	w8, [sp, #32]
	mul	w1, w8, w25
	ldr	x0, [x19, #56]
	ldr	w3, [x19, #48]
	mov	x2, x25
	bl	_hns_roce_check_hem_null
	cbz	x0, LBB0_30
; %bb.21:
	ldr	x8, [x19]
	ldr	x9, [x27]
	cmp	x8, x9
	b.lt	LBB0_27
	b	LBB0_29
LBB0_22:
	ldr	x0, [x19]
	mov	x1, x26
	bl	_check_whether_bt_num_3
	cbz	x0, LBB0_30
; %bb.23:
	ldp	w8, w9, [sp, #32]
	madd	w8, w8, w25, w9
	mul	w1, w8, w25
	ldr	x0, [x19, #56]
	ldr	w3, [x19, #48]
	mov	x2, x25
	bl	_hns_roce_check_hem_null
	cbz	x0, LBB0_30
; %bb.24:
	ldr	x8, [x23]
	ldr	x8, [x8]
	mov	x0, x23
	mov	x1, x19
	mov	x2, x22
	mov	w3, #1
	blr	x8
	cbz	x0, LBB0_26
; %bb.25:
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_warn
LBB0_26:
	ldr	x10, [sp, #8]                   ; 8-byte Folded Reload
	lsl	x26, x10, #3
	ldp	x8, x9, [x19, #32]
	ldr	x2, [x8, x26]
	ldr	w3, [x9, x10, lsl #2]
	mov	x0, x20
	mov	x1, x21
	bl	_dma_free_coherent
	ldr	x8, [x19, #32]
	str	xzr, [x8, x26]
	ldr	w8, [sp, #32]
	mul	w1, w8, w25
	ldr	x0, [x19, #32]
	mov	x2, x25
	bl	_hns_roce_check_bt_null
	cbz	x0, LBB0_30
LBB0_27:
	ldr	x8, [x23]
	ldr	x8, [x8]
	mov	x0, x23
	mov	x1, x19
	mov	x2, x22
	mov	w3, #0
	blr	x8
	cbz	x0, LBB0_29
; %bb.28:
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_warn
LBB0_29:
	ldr	x9, [x19, #16]
	ldrsw	x8, [sp, #32]
	add	x9, x9, x8, lsl #3
	ldr	x2, [x9]
	ldr	x9, [x19, #24]
	ldr	w3, [x9, x8, lsl #2]
	mov	x0, x20
	mov	x1, x21
	bl	_dma_free_coherent
	ldr	x8, [x19, #16]
	ldrsw	x9, [sp, #32]
	str	xzr, [x8, x9, lsl #3]
LBB0_30:
	mov	x0, x24
	bl	_mutex_unlock
LBB0_31:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_BA_BYTE_LEN,4,2                ; @BA_BYTE_LEN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Table %d not support hop_num = %d!\n"

	.comm	_HEM_TYPE_MTT,8,3               ; @HEM_TYPE_MTT
l_.str.1:                               ; @.str.1
	.asciz	"Clear HEM base address failed.\n"

	.comm	_HNS_ROCE_HOP_NUM_0,4,2         ; @HNS_ROCE_HOP_NUM_0
	.no_dead_strip	_hns_roce_table_mhop_put
.subsections_via_symbols
