	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns_roce_v2_set_hem
_hns_roce_v2_set_hem:                   ## @hns_roce_v2_set_hem
	.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, %r13d
	movl	%edx, %ebx
	movq	%rsi, %r14
	movq	%rdi, %r15
	movslq	%edx, %rax
	movq	%rax, -120(%rbp)
	movq	(%rsi), %rsi
	callq	_hns_roce_check_whether_mhop
	xorl	%r12d, %r12d
	testl	%eax, %eax
	je	LBB0_24
## %bb.1:
	movl	%r13d, -52(%rbp)                ## 4-byte Spill
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	leaq	-120(%rbp), %rdx
	leaq	-104(%rbp), %rcx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_hns_roce_calc_hem_mhop
	movslq	-104(%rbp), %rdx
	movl	-100(%rbp), %eax
	movl	-92(%rbp), %ebx
	movl	-88(%rbp), %ecx
	leal	7(%rcx), %r13d
	testl	%ecx, %ecx
	cmovnsl	%ecx, %r13d
	sarl	$3, %r13d
	cmpl	$2, %ebx
	movq	%rdx, -112(%rbp)                ## 8-byte Spill
	jne	LBB0_3
## %bb.2:
	movl	%r13d, %ecx
	imull	%edx, %ecx
	addl	%eax, %ecx
	imull	%ecx, %r13d
	addl	-96(%rbp), %r13d
	movslq	%ecx, %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_6
LBB0_3:
	cmpl	$1, %ebx
	jne	LBB0_5
## %bb.4:
	imull	%edx, %r13d
	addl	%eax, %r13d
	xorl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_6
LBB0_5:
	movq	_HNS_ROCE_HOP_NUM_0@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	cmpl	(%rax), %ebx
	movl	$0, %r13d
	cmovel	%edx, %r13d
LBB0_6:
	movq	(%r14), %rsi
	movq	%r15, %rdi
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	callq	_get_op_for_set_hem
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	addl	%eax, %ecx
	je	LBB0_24
## %bb.7:
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	%r15, %rdi
	callq	_hns_roce_alloc_cmd_mailbox
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	%r12, %rdi
	callq	_PTR_ERR
	movl	%eax, %r12d
	jmp	LBB0_24
LBB0_9:
	movq	(%r14), %rax
	movq	_HEM_TYPE_SCCC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.10:
	movl	-104(%rbp), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
LBB0_11:
	movl	%ebx, %edi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_check_whether_last_step
	testq	%rax, %rax
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	je	LBB0_15
## %bb.12:
	movslq	%r13d, %rax
	movq	24(%r14), %rcx
	movq	(%rcx,%rax,8), %rdi
	leaq	-72(%rbp), %rbx
	movq	%rbx, %rsi
	callq	_hns_roce_hem_first
	movq	%rbx, %rdi
	callq	_hns_roce_hem_last
	xorl	%r12d, %r12d
	testl	%eax, %eax
	jne	LBB0_23
## %bb.13:
	leaq	-72(%rbp), %rbx
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movl	-48(%rbp), %r13d                ## 4-byte Reload
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_hns_roce_hem_addr
	movl	(%r14), %edx
	movq	_HNS_ROCE_CMD_TIMEOUT_MSECS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rsp)
	movq	%r15, %rdi
	movq	%rax, %rsi
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	xorl	%r8d, %r8d
	movl	%r13d, %r9d
	callq	_hns_roce_cmd_mbox
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_hns_roce_hem_next
	movq	%rbx, %rdi
	callq	_hns_roce_hem_last
	testl	%eax, %eax
	je	LBB0_14
	jmp	LBB0_23
LBB0_15:
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, %eax
	je	LBB0_16
## %bb.17:
	xorl	%esi, %esi
	cmpl	$1, %eax
	jne	LBB0_18
## %bb.19:
	cmpl	$2, %ebx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	-48(%rbp), %r9d                 ## 4-byte Reload
	jne	LBB0_22
## %bb.20:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	shlq	$3, %rax
	addq	16(%r14), %rax
	jmp	LBB0_21
LBB0_16:
	movq	-112(%rbp), %rax                ## 8-byte Reload
	shlq	$3, %rax
	addq	8(%r14), %rax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	-48(%rbp), %r9d                 ## 4-byte Reload
LBB0_21:
	movq	(%rax), %rsi
LBB0_22:
	movl	(%r12), %edx
	movq	_HNS_ROCE_CMD_TIMEOUT_MSECS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	movq	%r15, %rdi
	xorl	%r8d, %r8d
	callq	_hns_roce_cmd_mbox
	movl	%eax, %r12d
LBB0_23:
	movq	%r15, %rdi
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	callq	_hns_roce_free_cmd_mailbox
LBB0_24:
	movl	%r12d, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	-48(%rbp), %r9d                 ## 4-byte Reload
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_HNS_ROCE_HOP_NUM_0,4,2         ## @HNS_ROCE_HOP_NUM_0
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_HEM_TYPE_SCCC,8,3              ## @HEM_TYPE_SCCC
	.comm	_HNS_ROCE_CMD_TIMEOUT_MSECS,4,2 ## @HNS_ROCE_CMD_TIMEOUT_MSECS
	.no_dead_strip	_hns_roce_v2_set_hem
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hns_roce_v2_set_hem
_hns_roce_v2_set_hem:                   ; @hns_roce_v2_set_hem
	.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	x23, x3
	mov	x24, x2
	mov	x21, x1
	mov	x19, x0
	sxtw	x8, w24
	str	x8, [sp, #8]
	ldr	x1, [x1]
	bl	_hns_roce_check_whether_mhop
	cbz	w0, LBB0_7
; %bb.1:
	add	x2, sp, #8
	add	x3, sp, #16
	mov	x0, x19
	mov	x1, x21
	bl	_hns_roce_calc_hem_mhop
	ldp	w26, w8, [sp, #16]
                                        ; kill: def $w26 killed $w26 def $x26
	sxtw	x26, w26
	ldp	w25, w9, [sp, #28]
	add	w10, w9, #7
	cmp	w9, #0
	csel	w9, w10, w9, lt
	asr	w9, w9, #3
	cmp	w25, #2
	b.ne	LBB0_3
; %bb.2:
	ldr	w10, [sp, #24]
	madd	w8, w9, w26, w8
	madd	w28, w8, w9, w10
	sxtw	x27, w8
	b	LBB0_6
LBB0_3:
	cmp	w25, #1
	b.ne	LBB0_5
; %bb.4:
	mov	x27, #0
	madd	w28, w9, w26, w8
	b	LBB0_6
LBB0_5:
	mov	x27, #0
Lloh0:
	adrp	x8, _HNS_ROCE_HOP_NUM_0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HNS_ROCE_HOP_NUM_0@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w25, w8
	csel	w28, w26, wzr, eq
LBB0_6:
	ldr	x1, [x21]
	mov	x0, x19
	mov	x2, x23
	bl	_get_op_for_set_hem
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_8
LBB0_7:
	mov	w21, #0
	b	LBB0_23
LBB0_8:
	mov	x22, x0
	mov	x0, x19
	bl	_hns_roce_alloc_cmd_mailbox
	mov	x20, x0
	bl	_IS_ERR
	cbz	x0, LBB0_10
; %bb.9:
	mov	x0, x20
	bl	_PTR_ERR
	mov	x21, x0
	b	LBB0_23
LBB0_10:
	ldr	x8, [x21]
Lloh6:
	adrp	x9, _HEM_TYPE_SCCC@GOTPAGE
Lloh7:
	ldr	x9, [x9, _HEM_TYPE_SCCC@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	ldr	w10, [sp, #16]
	cmp	x8, x9
	csel	w24, w10, w24, eq
	mov	x0, x25
	mov	x1, x23
	bl	_check_whether_last_step
	cbz	x0, LBB0_13
; %bb.11:
	sxtw	x8, w28
	ldr	x9, [x21, #24]
	ldr	x0, [x9, x8, lsl #3]
	add	x1, sp, #40
	bl	_hns_roce_hem_first
	add	x0, sp, #40
	bl	_hns_roce_hem_last
	cbz	w0, LBB0_17
; %bb.12:
	mov	w21, #0
	b	LBB0_22
LBB0_13:
	cbz	w23, LBB0_19
; %bb.14:
	mov	x1, #0
	cmp	w23, #1
	b.ne	LBB0_21
; %bb.15:
	cmp	w25, #2
	b.ne	LBB0_21
; %bb.16:
	ldr	x8, [x21, #16]
	add	x8, x8, x27, lsl #3
	b	LBB0_20
LBB0_17:
Lloh9:
	adrp	x23, _HNS_ROCE_CMD_TIMEOUT_MSECS@GOTPAGE
Lloh10:
	ldr	x23, [x23, _HNS_ROCE_CMD_TIMEOUT_MSECS@GOTPAGEOFF]
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #40
	bl	_hns_roce_hem_addr
	mov	x1, x0
	ldr	w2, [x20]
	ldr	w6, [x23]
	mov	x0, x19
	mov	x3, x24
	mov	w4, #0
	mov	x5, x22
	bl	_hns_roce_cmd_mbox
	mov	x21, x0
	add	x0, sp, #40
	bl	_hns_roce_hem_next
	add	x0, sp, #40
	bl	_hns_roce_hem_last
	cbz	w0, LBB0_18
	b	LBB0_22
LBB0_19:
	ldr	x8, [x21, #8]
	add	x8, x8, x26, lsl #3
LBB0_20:
	ldr	x1, [x8]
LBB0_21:
	ldr	w2, [x20]
Lloh11:
	adrp	x8, _HNS_ROCE_CMD_TIMEOUT_MSECS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _HNS_ROCE_CMD_TIMEOUT_MSECS@GOTPAGEOFF]
Lloh13:
	ldr	w6, [x8]
	mov	x0, x19
	mov	x3, x24
	mov	w4, #0
	mov	x5, x22
	bl	_hns_roce_cmd_mbox
	mov	x21, x0
LBB0_22:
	mov	x0, x19
	mov	x1, x20
	bl	_hns_roce_free_cmd_mailbox
LBB0_23:
	mov	x0, x21
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_HNS_ROCE_HOP_NUM_0,4,2         ; @HNS_ROCE_HOP_NUM_0
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_HEM_TYPE_SCCC,8,3              ; @HEM_TYPE_SCCC
	.comm	_HNS_ROCE_CMD_TIMEOUT_MSECS,4,2 ; @HNS_ROCE_CMD_TIMEOUT_MSECS
	.no_dead_strip	_hns_roce_v2_set_hem
.subsections_via_symbols
