	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns_roce_calc_hem_mhop         ## -- Begin function hns_roce_calc_hem_mhop
	.p2align	4, 0x90
_hns_roce_calc_hem_mhop:                ## @hns_roce_calc_hem_mhop
	.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
	movq	%rcx, %r14
	movq	%rdx, %r13
	movq	%rsi, %rbx
	movq	(%rdi), %r15
	movq	(%rsi), %rdx
	movq	%rcx, %rsi
	callq	_get_hem_table_config
	testq	%rax, %rax
	je	LBB0_2
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_30:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	xorl	%r12d, %r12d
	testq	%r13, %r13
	je	LBB0_30
## %bb.3:
	movq	(%rbx), %rdi
	movl	48(%r14), %esi
	callq	_hns_roce_get_bt_num
	movq	%rax, %rsi
	movq	(%r14), %rdi
	movq	_BA_BYTE_LEN@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%rdi, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_4
## %bb.5:
	movq	%rdi, %rax
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %r8
	jmp	LBB0_6
LBB0_4:
	movl	%edi, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %r8d
LBB0_6:
	movq	(%rbx), %r9
	movq	_HEM_TYPE_MTT@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r9
	jge	LBB0_8
## %bb.7:
	movq	8(%r14), %rdi
LBB0_8:
	movslq	8(%rbx), %rcx
	decq	%rcx
	movq	16(%rbx), %rbx
	movq	%rdi, %rax
	orq	%rbx, %rax
	andq	(%r13), %rcx
	shrq	$32, %rax
	je	LBB0_9
## %bb.10:
	movq	%rdi, %rax
	xorl	%edx, %edx
	divq	%rbx
	movq	%rax, %rdi
	jmp	LBB0_11
LBB0_9:
	movl	%edi, %eax
	xorl	%edx, %edx
	divl	%ebx
	movl	%eax, %edi
LBB0_11:
	movq	%rcx, %rax
	orq	%rdi, %rax
	shrq	$32, %rax
	je	LBB0_12
## %bb.13:
	movq	%rcx, %rax
	xorl	%edx, %edx
	divq	%rdi
	cmpq	$1, %rsi
	jne	LBB0_15
	jmp	LBB0_25
LBB0_12:
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	%edi
                                        ## kill: def $eax killed $eax def $rax
	cmpq	$1, %rsi
	je	LBB0_25
LBB0_15:
	cmpq	$2, %rsi
	je	LBB0_19
## %bb.16:
	cmpq	$3, %rsi
	jne	LBB0_20
## %bb.17:
	leaq	-1(%r8), %rcx
	movq	%rax, %rdx
	andq	%rcx, %rdx
	movq	%rdx, 16(%r14)
	movq	%rax, %rdx
	orq	%r8, %rdx
	shrq	$32, %rdx
	je	LBB0_18
## %bb.21:
	xorl	%edx, %edx
	divq	%r8
	jmp	LBB0_22
LBB0_19:
	leaq	-1(%r8), %rcx
	jmp	LBB0_22
LBB0_20:
	movl	48(%r14), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movq	%r9, %rdx
	callq	_dev_err
	jmp	LBB0_1
LBB0_18:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%r8d
                                        ## kill: def $eax killed $eax def $rax
LBB0_22:
	andq	%rax, %rcx
	movq	%rcx, 24(%r14)
	movq	%rax, %rcx
	orq	%r8, %rcx
	shrq	$32, %rcx
	je	LBB0_23
## %bb.24:
	xorl	%edx, %edx
	divq	%r8
	jmp	LBB0_25
LBB0_23:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%r8d
                                        ## kill: def $eax killed $eax def $rax
LBB0_25:
	movq	%rax, 32(%r14)
	movq	40(%r14), %rcx
	cmpq	%rcx, %rax
	jb	LBB0_30
## %bb.26:
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_27
## %bb.28:
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_29
LBB0_27:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
LBB0_29:
	movq	%rdx, 32(%r14)
	jmp	LBB0_30
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_BA_BYTE_LEN,8,3                ## @BA_BYTE_LEN
	.comm	_HEM_TYPE_MTT,8,3               ## @HEM_TYPE_MTT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Table %d not support hop_num = %d!\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns_roce_calc_hem_mhop         ; -- Begin function hns_roce_calc_hem_mhop
	.p2align	2
_hns_roce_calc_hem_mhop:                ; @hns_roce_calc_hem_mhop
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x3
	mov	x22, x2
	mov	x21, x1
	ldr	x20, [x0]
	ldr	x2, [x1]
	mov	x1, x3
	bl	_get_hem_table_config
	cbz	x0, LBB0_2
LBB0_1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_14
LBB0_2:
	cbz	x22, LBB0_12
; %bb.3:
	ldr	x0, [x21]
	ldr	w1, [x19, #48]
	bl	_hns_roce_get_bt_num
	ldr	x9, [x19]
	ldr	x2, [x21]
Lloh3:
	adrp	x8, _HEM_TYPE_MTT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HEM_TYPE_MTT@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x8]
	mov	x8, x9
	cmp	x2, x10
	b.ge	LBB0_5
; %bb.4:
	ldr	x8, [x19, #8]
LBB0_5:
	ldr	x10, [x22]
	ldrsw	x11, [x21, #8]
	sub	x11, x11, #1
	and	x10, x10, x11
	ldr	x11, [x21, #16]
	udiv	x8, x8, x11
	udiv	x8, x10, x8
	cmp	x0, #1
	b.eq	LBB0_11
; %bb.6:
Lloh6:
	adrp	x10, _BA_BYTE_LEN@GOTPAGE
Lloh7:
	ldr	x10, [x10, _BA_BYTE_LEN@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	udiv	x9, x9, x10
	cmp	x0, #2
	b.eq	LBB0_9
; %bb.7:
	cmp	x0, #3
	b.ne	LBB0_15
; %bb.8:
	sub	x10, x9, #1
	and	x11, x8, x10
	str	x11, [x19, #16]
	udiv	x8, x8, x9
	b	LBB0_10
LBB0_9:
	sub	x10, x9, #1
LBB0_10:
	and	x10, x8, x10
	str	x10, [x19, #24]
	udiv	x8, x8, x9
LBB0_11:
	str	x8, [x19, #32]
	ldr	x9, [x19, #40]
	cmp	x8, x9
	b.hs	LBB0_13
LBB0_12:
	mov	w0, #0
	b	LBB0_14
LBB0_13:
	mov	w0, #0
	udiv	x10, x8, x9
	msub	x8, x10, x9, x8
	str	x8, [x19, #32]
LBB0_14:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_15:
	ldr	w3, [x19, #48]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_BA_BYTE_LEN,8,3                ; @BA_BYTE_LEN
	.comm	_HEM_TYPE_MTT,8,3               ; @HEM_TYPE_MTT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Table %d not support hop_num = %d!\n"

.subsections_via_symbols
