	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns_roce_init_hem_table        ## -- Begin function hns_roce_init_hem_table
	.p2align	4, 0x90
_hns_roce_init_hem_table:               ## @hns_roce_init_hem_table
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r12d
	movq	%r8, -48(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r14
	movq	%rdx, %r13
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	%rdx, %rsi
	callq	_hns_roce_check_whether_mhop
	testl	%eax, %eax
	je	LBB0_1
## %bb.9:
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -96(%rbp)
	movaps	%xmm0, -112(%rbp)
	leaq	-112(%rbp), %rsi
	movq	%rbx, %rdi
	movq	%r13, %rdx
	callq	_get_hem_table_config
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_36
LBB0_1:
	movq	(%rbx), %rax
	movq	%rax, (%r15)
	movq	%rax, %rcx
	orq	%r14, %rcx
	shrq	$32, %rcx
	je	LBB0_2
## %bb.3:
	xorl	%edx, %edx
	divq	%r14
	movq	%rax, %rcx
	jmp	LBB0_4
LBB0_11:
	movq	-112(%rbp), %rax
	movq	-104(%rbp), %rcx
	movq	-96(%rbp), %rdi
	movq	-88(%rbp), %rbx
	movq	%rax, %rdx
	orq	%r14, %rdx
	shrq	$32, %rdx
	je	LBB0_12
## %bb.13:
	xorl	%edx, %edx
	divq	%r14
	movq	%rax, %rsi
	jmp	LBB0_14
LBB0_2:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%r14d
	movl	%eax, %ecx
LBB0_4:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addq	%rcx, %rax
	decq	%rax
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	je	LBB0_5
## %bb.6:
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %r14
	jmp	LBB0_7
LBB0_5:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %r14d
LBB0_7:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	$4, %esi
	callq	_kcalloc
	movq	%rax, 40(%r15)
	testq	%rax, %rax
	je	LBB0_35
LBB0_8:
	movq	%r13, 80(%r15)
	movq	%r14, 8(%r15)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 16(%r15)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 24(%r15)
	movl	%r12d, 32(%r15)
	addq	$72, %r15
	movq	%r15, %rdi
	callq	_mutex_init
	xorl	%eax, %eax
	jmp	LBB0_37
LBB0_12:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%r14d
	movl	%eax, %esi
LBB0_14:
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addq	%rsi, %rax
	decq	%rax
	movq	%rax, %rdx
	orq	%rsi, %rdx
	shrq	$32, %rdx
	je	LBB0_15
## %bb.16:
	xorl	%edx, %edx
	divq	%rsi
	movq	%rax, %r14
	jmp	LBB0_17
LBB0_15:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%esi
	movl	%eax, %r14d
LBB0_17:
	movl	%r12d, -52(%rbp)                ## 4-byte Spill
	movq	_BA_BYTE_LEN@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%rcx, %rax
	orq	%rsi, %rax
	shrq	$32, %rax
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_18
## %bb.19:
	movq	%rcx, %rax
	xorl	%edx, %edx
	divq	%rsi
	movq	%rax, %r12
	jmp	LBB0_20
LBB0_18:
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	%esi
	movl	%eax, %r12d
LBB0_20:
	movq	_HEM_TYPE_MTT@GOTPCREL(%rip), %rax
	cmpq	%r13, (%rax)
	cmovleq	%r12, %rdi
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movq	%r14, %rdi
	movl	$4, %esi
	callq	_kcalloc
	movq	%rax, 40(%r15)
	testq	%rax, %rax
	je	LBB0_35
## %bb.21:
	movq	%r13, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_check_whether_bt_num_3
	testq	%rax, %rax
	je	LBB0_27
## %bb.22:
	leaq	(%r14,%r12), %rax
	decq	%rax
	movq	%rax, %rcx
	orq	%r12, %rcx
	shrq	$32, %rcx
	je	LBB0_23
## %bb.24:
	xorl	%edx, %edx
	divq	%r12
	movq	%rax, %r12
	jmp	LBB0_25
LBB0_23:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%r12d
	movl	%eax, %r12d
LBB0_25:
	movl	(%rbx), %edx
	movq	%r12, %rdi
	movl	$4, %esi
	callq	_kcalloc
	movq	%rax, 48(%r15)
	testq	%rax, %rax
	je	LBB0_34
## %bb.26:
	movl	(%rbx), %edx
	movq	%r12, %rdi
	movl	$4, %esi
	callq	_kcalloc
	movq	%rax, 56(%r15)
	testq	%rax, %rax
	je	LBB0_33
LBB0_27:
	movq	%r13, %rdi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_check_whether_bt_num_2
	testq	%rax, %rax
	movl	-52(%rbp), %r12d                ## 4-byte Reload
	jne	LBB0_29
## %bb.28:
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_check_whether_bt_num_3
	testq	%rax, %rax
	je	LBB0_8
LBB0_29:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	$4, %esi
	callq	_kcalloc
	movq	%rax, 64(%r15)
	testq	%rax, %rax
	je	LBB0_32
## %bb.30:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_kcalloc
	movq	%rax, 88(%r15)
	testq	%rax, %rax
	jne	LBB0_8
## %bb.31:
	movq	64(%r15), %rdi
	callq	_kfree
	movq	$0, 64(%r15)
LBB0_32:
	movq	56(%r15), %rdi
	callq	_kfree
	movq	$0, 56(%r15)
LBB0_33:
	movq	48(%r15), %rdi
	callq	_kfree
	movq	$0, 48(%r15)
LBB0_34:
	movq	40(%r15), %rdi
	callq	_kfree
	movq	$0, 40(%r15)
LBB0_35:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
LBB0_36:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_37:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_BA_BYTE_LEN,8,3                ## @BA_BYTE_LEN
	.comm	_HEM_TYPE_MTT,8,3               ## @HEM_TYPE_MTT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns_roce_init_hem_table        ; -- Begin function hns_roce_init_hem_table
	.p2align	2
_hns_roce_init_hem_table:               ; @hns_roce_init_hem_table
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x20, x5
	mov	x22, x4
	mov	x21, x3
	mov	x23, x2
	mov	x19, x1
	mov	x24, x0
	mov	x1, x2
	bl	_hns_roce_check_whether_mhop
	cbz	w0, LBB0_3
; %bb.1:
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp]
	mov	x1, sp
	mov	x0, x24
	mov	x2, x23
	bl	_get_hem_table_config
	cbz	x0, LBB0_5
; %bb.2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_18
LBB0_3:
	ldr	x8, [x24]
	str	x8, [x19]
	udiv	x8, x8, x21
	add	x9, x22, x8
	sub	x9, x9, #1
Lloh2:
	adrp	x10, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x10, [x10, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x10]
	udiv	x24, x9, x8
	mov	x0, x24
	mov	w1, #4
	bl	_kcalloc
	str	x0, [x19, #40]
	cbz	x0, LBB0_17
LBB0_4:
	str	x23, [x19, #80]
	stp	x24, x22, [x19, #8]
	str	x21, [x19, #24]
	add	x0, x19, #72
	str	w20, [x19, #32]
	bl	_mutex_init
	mov	w0, #0
	b	LBB0_19
LBB0_5:
	ldp	x8, x9, [sp]
	ldp	x10, x26, [sp, #16]
	udiv	x8, x8, x21
	add	x11, x22, x8
Lloh5:
	adrp	x12, _BA_BYTE_LEN@GOTPAGE
Lloh6:
	ldr	x12, [x12, _BA_BYTE_LEN@GOTPAGEOFF]
	sub	x11, x11, #1
Lloh7:
	ldr	x12, [x12]
	udiv	x27, x9, x12
Lloh8:
	adrp	x9, _HEM_TYPE_MTT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _HEM_TYPE_MTT@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x9, x23
	csel	x25, x10, x27, gt
Lloh11:
	adrp	x28, _GFP_KERNEL@GOTPAGE
Lloh12:
	ldr	x28, [x28, _GFP_KERNEL@GOTPAGEOFF]
	udiv	x24, x11, x8
	ldr	w2, [x28]
	mov	x0, x24
	mov	w1, #4
	bl	_kcalloc
	str	x0, [x19, #40]
	cbz	x0, LBB0_17
; %bb.6:
	mov	x0, x23
	mov	x1, x26
	bl	_check_whether_bt_num_3
	cbz	x0, LBB0_9
; %bb.7:
	add	x8, x24, x27
	sub	x8, x8, #1
	ldr	w2, [x28]
	udiv	x27, x8, x27
	mov	x0, x27
	mov	w1, #4
	bl	_kcalloc
	str	x0, [x19, #48]
	cbz	x0, LBB0_16
; %bb.8:
	ldr	w2, [x28]
	mov	x0, x27
	mov	w1, #4
	bl	_kcalloc
	str	x0, [x19, #56]
	cbz	x0, LBB0_15
LBB0_9:
	mov	x0, x23
	mov	x1, x26
	bl	_check_whether_bt_num_2
	cbnz	x0, LBB0_11
; %bb.10:
	mov	x0, x23
	mov	x1, x26
	bl	_check_whether_bt_num_3
	cbz	x0, LBB0_4
LBB0_11:
	ldr	w2, [x28]
	mov	x0, x25
	mov	w1, #4
	bl	_kcalloc
	str	x0, [x19, #64]
	cbz	x0, LBB0_14
; %bb.12:
	ldr	w2, [x28]
	mov	x0, x25
	mov	w1, #1
	bl	_kcalloc
	str	x0, [x19, #88]
	cbnz	x0, LBB0_4
; %bb.13:
	ldr	x0, [x19, #64]
	bl	_kfree
	str	xzr, [x19, #64]
LBB0_14:
	ldr	x0, [x19, #56]
	bl	_kfree
	str	xzr, [x19, #56]
LBB0_15:
	ldr	x0, [x19, #48]
	bl	_kfree
	str	xzr, [x19, #48]
LBB0_16:
	ldr	x0, [x19, #40]
	bl	_kfree
	str	xzr, [x19, #40]
LBB0_17:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_18:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_19:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_BA_BYTE_LEN,8,3                ; @BA_BYTE_LEN
	.comm	_HEM_TYPE_MTT,8,3               ; @HEM_TYPE_MTT
.subsections_via_symbols
