	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wait_func
_wait_func:                             ## @wait_func
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	_MLX5_CMD_TIMEOUT_MSEC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movq	(%r14), %rcx
	movq	_CMD_MODE_POLLING@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	je	LBB0_2
## %bb.1:
	cmpq	$0, 32(%rbx)
	je	LBB0_3
LBB0_2:
	leaq	24(%rbx), %rdi
	callq	_wait_for_completion
LBB0_5:
	movl	(%rbx), %r15d
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r15d, %eax
	jne	LBB0_7
## %bb.6:
	movl	20(%rbx), %edi
	callq	_msg_to_opcode
	movl	%eax, %edi
	callq	_mlx5_command_str
	movl	%eax, %r12d
	movl	20(%rbx), %edi
	callq	_msg_to_opcode
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%r12d, %edx
	movl	%eax, %ecx
	callq	_mlx5_core_warn
LBB0_7:
	movl	16(%rbx), %edi
	callq	_deliv_status_to_str
	movl	16(%rbx), %r8d
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movl	%r15d, %edx
	movl	%eax, %ecx
	callq	_mlx5_core_dbg
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	leaq	24(%rbx), %rdi
	movq	%rax, %rsi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, (%rbx)
	movb	8(%rbx), %cl
	movl	$1, %esi
	shlq	%cl, %rsi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_mlx5_cmd_comp_handler
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_MLX5_CMD_TIMEOUT_MSEC,4,2      ## @MLX5_CMD_TIMEOUT_MSEC
	.comm	_CMD_MODE_POLLING,8,3           ## @CMD_MODE_POLLING
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s(0x%x) timeout. Will cause a leak of a command resource\n"

L_.str.1:                               ## @.str.1
	.asciz	"err %d, delivery status %s(%d)\n"

	.no_dead_strip	_wait_func
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wait_func
_wait_func:                             ; @wait_func
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _MLX5_CMD_TIMEOUT_MSEC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MLX5_CMD_TIMEOUT_MSEC@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_msecs_to_jiffies
	ldr	x8, [x19]
Lloh3:
	adrp	x9, _CMD_MODE_POLLING@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CMD_MODE_POLLING@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
Lloh6:
	adrp	x22, _ETIMEDOUT@GOTPAGE
Lloh7:
	ldr	x22, [x22, _ETIMEDOUT@GOTPAGEOFF]
	cmp	x8, x9
	b.eq	LBB0_2
; %bb.1:
	ldr	x8, [x20, #32]
	cbz	x8, LBB0_6
LBB0_2:
	add	x0, x20, #24
	bl	_wait_for_completion
LBB0_3:
	ldr	w21, [x20]
	ldr	w8, [x22]
	cmn	w21, w8
	b.ne	LBB0_5
; %bb.4:
	ldr	w0, [x20, #20]
	bl	_msg_to_opcode
	bl	_mlx5_command_str
	mov	x22, x0
	ldr	w0, [x20, #20]
	bl	_msg_to_opcode
	mov	x3, x0
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x22
	bl	_mlx5_core_warn
LBB0_5:
	ldr	w0, [x20, #16]
	bl	_deliv_status_to_str
	mov	x3, x0
	ldr	w4, [x20, #16]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_mlx5_core_dbg
	mov	x0, x21
	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_6:
	mov	x1, x0
	add	x0, x20, #24
	bl	_wait_for_completion_timeout
	cbnz	w0, LBB0_3
; %bb.7:
	ldr	w8, [x22]
	neg	w8, w8
	str	w8, [x20]
	ldr	x8, [x20, #8]
	mov	w9, #1
	lsl	x1, x9, x8
	mov	x0, x19
	mov	w2, #1
	bl	_mlx5_cmd_comp_handler
	b	LBB0_3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_MLX5_CMD_TIMEOUT_MSEC,4,2      ; @MLX5_CMD_TIMEOUT_MSEC
	.comm	_CMD_MODE_POLLING,8,3           ; @CMD_MODE_POLLING
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s(0x%x) timeout. Will cause a leak of a command resource\n"

l_.str.1:                               ; @.str.1
	.asciz	"err %d, delivery status %s(%d)\n"

	.no_dead_strip	_wait_func
.subsections_via_symbols
