	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __hns_roce_cmq_send
___hns_roce_cmq_send:                   ## @__hns_roce_cmq_send
	.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
	movl	%edx, %r14d
	movq	%rsi, %r12
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %r15
	leaq	16(%r15), %r13
	leaq	24(%r15), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_bh
	movq	%r13, %rdi
	callq	_hns_roce_cmq_space
	cmpl	%r14d, %eax
	jge	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_spin_unlock_bh
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_19
LBB0_2:
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movl	(%r13), %r13d
	movl	%r14d, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	%r13d, %edx
	testl	%r14d, %r14d
	jle	LBB0_7
## %bb.3:
	xorl	%ebx, %ebx
	movl	%r13d, %edx
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	%edx, 16(%r15)
	incq	%rbx
	cmpq	%rbx, -64(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	32(%r15), %rax
	movslq	%edx, %rcx
	movq	(%r12,%rbx,8), %rdx
	movq	%rdx, (%rax,%rcx,8)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	movl	16(%r15), %eax
	incl	%eax
	movl	$0, %edx
	cmpl	20(%r15), %eax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%eax, %edx
	jmp	LBB0_6
LBB0_7:
	movq	_ROCEE_TX_CMQ_TAIL_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_roce_write
	movl	4(%r12), %edi
	callq	_le16_to_cpu
	movq	_HNS_ROCE_CMD_FLAG_NO_INTR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_11
## %bb.8:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_hns_roce_cmq_csq_done
	testq	%rax, %rax
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	$1, %edi
	callq	_udelay
	incq	%rbx
	cmpq	(%r15), %rbx
	jl	LBB0_9
LBB0_11:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_hns_roce_cmq_csq_done
	movl	$0, %esi
	testq	%rax, %rax
	je	LBB0_16
## %bb.12:
	movl	$0, %esi
	testl	%r14d, %r14d
	jle	LBB0_16
## %bb.13:
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	%r14d, -52(%rbp)                ## 4-byte Spill
	xorl	%r14d, %r14d
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	32(%r15), %rax
	movslq	%r13d, %r13
	movq	(%rax,%r13,8), %rax
	movq	%rax, (%r12,%r14,8)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_dbg
	movl	(%r12,%r14,8), %edi
	callq	_le16_to_cpu
	cltq
	movq	_CMD_EXEC_SUCCESS@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movq	_EIO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	%rax, 8(%r15)
	incl	%r13d
	incq	%r14
	cmpl	20(%r15), %r13d
	movl	$0, %esi
	cmovel	%esi, %r13d
	cmpq	%r14, %rbx
	jne	LBB0_14
## %bb.15:
	negl	%ecx
	xorl	%esi, %esi
	cmpq	%rax, %rdx
	cmovnel	%ecx, %esi
	movl	-52(%rbp), %r14d                ## 4-byte Reload
	movq	-72(%rbp), %rax                 ## 8-byte Reload
LBB0_16:
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	subl	(%rcx), %ebx
	testq	%rax, %rax
	cmovnel	%esi, %ebx
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	callq	_hns_roce_cmq_csq_clean
	cmpl	%r14d, %eax
	je	LBB0_18
## %bb.17:
	movl	(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edx
	movl	%r14d, %ecx
	callq	_dev_warn
LBB0_18:
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_bh
LBB0_19:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"set cmq desc:\n"

	.comm	_ROCEE_TX_CMQ_TAIL_REG,4,2      ## @ROCEE_TX_CMQ_TAIL_REG
	.comm	_HNS_ROCE_CMD_FLAG_NO_INTR,4,2  ## @HNS_ROCE_CMD_FLAG_NO_INTR
L_.str.1:                               ## @.str.1
	.asciz	"Get cmq desc:\n"

	.comm	_CMD_EXEC_SUCCESS,8,3           ## @CMD_EXEC_SUCCESS
	.comm	_EIO,4,2                        ## @EIO
	.comm	_EAGAIN,4,2                     ## @EAGAIN
L_.str.2:                               ## @.str.2
	.asciz	"Cleaned %d, need to clean %d\n"

	.no_dead_strip	___hns_roce_cmq_send
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __hns_roce_cmq_send
___hns_roce_cmq_send:                   ; @__hns_roce_cmq_send
	.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	x20, x2
	mov	x22, x1
	mov	x21, x0
	ldr	x25, [x0, #8]
	add	x23, x25, #16
	add	x28, x25, #24
	mov	x0, x28
	bl	_spin_lock_bh
	mov	x0, x23
	bl	_hns_roce_cmq_space
	cmp	w0, w20
	b.ge	LBB0_2
; %bb.1:
	mov	x0, x28
	bl	_spin_unlock_bh
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_17
LBB0_2:
	ldr	w26, [x23]
	mov	w27, w20
	mov	x2, x26
	cmp	w20, #1
	b.lt	LBB0_5
; %bb.3:
	mov	x19, x27
	mov	x24, x22
	mov	x2, x26
Lloh3:
	adrp	x23, l_.str@PAGE
Lloh4:
	add	x23, x23, l_.str@PAGEOFF
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x25, #32]
	ldr	x9, [x24], #8
	str	x9, [x8, w2, sxtw #3]
	ldr	w0, [x21]
	mov	x1, x23
	bl	_dev_dbg
	ldp	w8, w9, [x25, #16]
	add	w10, w8, #1
	cmp	w10, w9
	csinc	w2, wzr, w8, eq
	str	w2, [x25, #16]
	subs	x19, x19, #1
	b.ne	LBB0_4
LBB0_5:
Lloh5:
	adrp	x8, _ROCEE_TX_CMQ_TAIL_REG@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ROCEE_TX_CMQ_TAIL_REG@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_roce_write
	ldr	w0, [x22, #4]
	bl	_le16_to_cpu
Lloh8:
	adrp	x8, _HNS_ROCE_CMD_FLAG_NO_INTR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _HNS_ROCE_CMD_FLAG_NO_INTR@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_9
; %bb.6:
	mov	x19, #0
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_hns_roce_cmq_csq_done
	cbnz	x0, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	w0, #1
	bl	_udelay
	add	x19, x19, #1
	ldr	x8, [x25]
	cmp	x19, x8
	b.lt	LBB0_7
LBB0_9:
	mov	x0, x21
	bl	_hns_roce_cmq_csq_done
	mov	x23, x0
	mov	w8, #0
	cbz	x0, LBB0_14
; %bb.10:
	cmp	w20, #1
	b.lt	LBB0_14
; %bb.11:
	str	x28, [sp, #8]                   ; 8-byte Folded Spill
Lloh11:
	adrp	x24, l_.str.1@PAGE
Lloh12:
	add	x24, x24, l_.str.1@PAGEOFF
Lloh13:
	adrp	x28, _CMD_EXEC_SUCCESS@GOTPAGE
Lloh14:
	ldr	x28, [x28, _CMD_EXEC_SUCCESS@GOTPAGEOFF]
Lloh15:
	adrp	x19, _EIO@GOTPAGE
Lloh16:
	ldr	x19, [x19, _EIO@GOTPAGEOFF]
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x25, #32]
	ldr	x8, [x8, w26, sxtw #3]
	str	x8, [x22]
	ldr	w0, [x21]
	mov	x1, x24
	bl	_dev_dbg
	ldr	w0, [x22], #8
	bl	_le16_to_cpu
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	ldr	x10, [x28]
	ldr	w9, [x19]
	str	x8, [x25, #8]
	add	w11, w26, #1
	ldr	w12, [x25, #20]
	cmp	w11, w12
	csinc	w26, wzr, w26, eq
	subs	x27, x27, #1
	b.ne	LBB0_12
; %bb.13:
	cmp	x10, x8
	csneg	w8, wzr, w9, eq
	ldr	x28, [sp, #8]                   ; 8-byte Folded Reload
LBB0_14:
Lloh17:
	adrp	x9, _EAGAIN@GOTPAGE
Lloh18:
	ldr	x9, [x9, _EAGAIN@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	cmp	x23, #0
	csneg	w22, w8, w9, ne
	mov	x0, x21
	bl	_hns_roce_cmq_csq_clean
	cmp	w0, w20
	b.eq	LBB0_16
; %bb.15:
	mov	x2, x0
	ldr	w0, [x21]
Lloh20:
	adrp	x1, l_.str.2@PAGE
Lloh21:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x3, x20
	bl	_dev_warn
LBB0_16:
	mov	x0, x28
	bl	_spin_unlock_bh
LBB0_17:
	mov	x0, x22
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"set cmq desc:\n"

	.comm	_ROCEE_TX_CMQ_TAIL_REG,4,2      ; @ROCEE_TX_CMQ_TAIL_REG
	.comm	_HNS_ROCE_CMD_FLAG_NO_INTR,4,2  ; @HNS_ROCE_CMD_FLAG_NO_INTR
l_.str.1:                               ; @.str.1
	.asciz	"Get cmq desc:\n"

	.comm	_CMD_EXEC_SUCCESS,8,3           ; @CMD_EXEC_SUCCESS
	.comm	_EIO,4,2                        ; @EIO
	.comm	_EAGAIN,4,2                     ; @EAGAIN
l_.str.2:                               ; @.str.2
	.asciz	"Cleaned %d, need to clean %d\n"

	.no_dead_strip	___hns_roce_cmq_send
.subsections_via_symbols
