	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __hns_roce_cmd_mbox_wait
___hns_roce_cmd_mbox_wait:              ## @__hns_roce_cmd_mbox_wait
	.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	%r9d, -44(%rbp)                 ## 4-byte Spill
	movl	%r8d, -56(%rbp)                 ## 4-byte Spill
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	leaq	16(%rdi), %r12
	movq	%r12, %rdi
	callq	_spin_lock
	xorl	%edi, %edi
	callq	_WARN_ON
	movq	8(%rbx), %rax
	movq	24(%rbx), %r14
	leaq	(%rax,%rax,2), %r15
	leaq	(%r14,%r15,8), %r13
	movl	32(%rbx), %eax
	movl	16(%r14,%r15,8), %ecx
	leal	1(%rax,%rcx), %eax
	movl	%eax, 16(%r14,%r15,8)
	movq	(%r14,%r15,8), %rax
	movq	%rax, 8(%rbx)
	movq	%r12, %rdi
	callq	_spin_unlock
	leaq	(%r14,%r15,8), %rdi
	addq	$12, %rdi
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	callq	_init_completion
	movl	16(%r14,%r15,8), %eax
	movq	%rbx, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movl	-56(%rbp), %r8d                 ## 4-byte Reload
	movl	-44(%rbp), %r9d                 ## 4-byte Reload
	pushq	$1
	pushq	%rax
	callq	_hns_roce_cmd_mbox_post_hw
	addq	$16, %rsp
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	je	LBB0_1
LBB0_6:
	movq	%r12, %rdi
	callq	_spin_lock
	movq	8(%rbx), %rax
	movq	%rax, (%r13)
	subq	24(%rbx), %r13
	sarq	$3, %r13
	movabsq	$-6148914691236517205, %rax     ## imm = 0xAAAAAAAAAAAAAAAB
	imulq	%r13, %rax
	movq	%rax, 8(%rbx)
	movq	%r12, %rdi
	callq	_spin_unlock
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	16(%rbp), %rdi
	callq	_msecs_to_jiffies
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	movl	8(%r14,%r15,8), %edx
	testl	%edx, %edx
	je	LBB0_4
## %bb.5:
	leaq	L_.str.1(%rip), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_6
LBB0_2:
	leaq	L_.str(%rip), %rsi
	xorl	%r14d, %r14d
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EBUSY@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	jmp	LBB0_6
LBB0_4:
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[cmd]wait_for_completion_timeout timeout\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
L_.str.1:                               ## @.str.1
	.asciz	"[cmd]event mod cmd process error!err=%d\n"

	.no_dead_strip	___hns_roce_cmd_mbox_wait
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __hns_roce_cmd_mbox_wait
___hns_roce_cmd_mbox_wait:              ; @__hns_roce_cmd_mbox_wait
	.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
	str	w5, [sp, #28]                   ; 4-byte Folded Spill
	mov	x23, x4
	mov	x26, x3
	mov	x27, x2
	mov	x28, x1
	mov	x20, x0
	ldr	x8, [x0]
	stp	x8, x6, [sp, #8]                ; 16-byte Folded Spill
	add	x19, x0, #16
	mov	x0, x19
	bl	_spin_lock
	mov	w0, #0
	bl	_WARN_ON
	ldr	x22, [x20, #24]
	ldr	x25, [x20, #8]
	mov	w8, #24
	madd	x21, x25, x8, x22
	ldr	w8, [x20, #32]
	ldr	w9, [x21, #16]
	add	w8, w8, w9
	add	w8, w8, #1
	str	w8, [x21, #16]
	ldr	x8, [x21]
	str	x8, [x20, #8]
	mov	x0, x19
	bl	_spin_unlock
	add	x24, x21, #12
	mov	x0, x24
	bl	_init_completion
	ldr	w6, [x21, #16]
	mov	x0, x20
	mov	x1, x28
	mov	x2, x27
	mov	x3, x26
	mov	x4, x23
	ldr	w5, [sp, #28]                   ; 4-byte Folded Reload
	mov	w7, #1
	bl	_hns_roce_cmd_mbox_post_hw
	mov	x23, x0
	cbz	w0, LBB0_2
LBB0_1:
	mov	x0, x19
	bl	_spin_lock
	ldr	x8, [x20, #8]
	str	x8, [x21]
	ldr	x8, [x20, #24]
	sub	x8, x21, x8
	asr	x8, x8, #3
	mov	x9, #-6148914691236517206
	movk	x9, #43691
	mul	x8, x8, x9
	str	x8, [x20, #8]
	mov	x0, x19
	bl	_spin_unlock
	mov	x0, x23
	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
LBB0_2:
	mov	x23, x25
	ldp	x25, x0, [sp, #8]               ; 16-byte Folded Reload
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x24
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_5
; %bb.3:
	mov	w8, #24
	madd	x8, x23, x8, x22
	ldr	w23, [x8, #8]
	cbz	w23, LBB0_1
; %bb.4:
	str	x23, [sp]
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x25
	bl	_dev_err
	b	LBB0_1
LBB0_5:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x25
	bl	_dev_err
Lloh4:
	adrp	x8, _EBUSY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_1
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[cmd]wait_for_completion_timeout timeout\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
l_.str.1:                               ; @.str.1
	.asciz	"[cmd]event mod cmd process error!err=%d\n"

	.no_dead_strip	___hns_roce_cmd_mbox_wait
.subsections_via_symbols
