	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlx4_comm_cmd_wait
_mlx4_comm_cmd_wait:                    ## @mlx4_comm_cmd_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
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r14
	callq	_mlx4_priv
	movq	%rax, %r12
	leaq	8(%rax), %rdi
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	callq	_down
	leaq	12(%r12), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	xorl	%edi, %edi
	callq	_BUG_ON
	movq	(%r12), %r15
	movq	16(%r12), %r13
	shlq	$5, %r15
	movl	24(%r12), %eax
	movl	28(%r13,%r15), %ecx
	addl	%ecx, %eax
	incl	%eax
	movl	%eax, 28(%r13,%r15)
	movq	(%r13,%r15), %rax
	movq	%rax, (%r12)
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_spin_unlock
	leaq	(%r15,%r13), %rbx
	addq	$24, %rbx
	movq	%rbx, %rdi
	callq	_init_completion
	movq	%r14, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	callq	_mlx4_comm_cmd_post
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_msecs_to_jiffies
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	8(%r13,%r15), %ebx
	testl	%ebx, %ebx
	je	LBB0_6
## %bb.3:
	movq	16(%r13,%r15), %rcx
	movq	_CMD_STAT_MULTI_FUNC_REQ@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rcx
	je	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_mlx4_err
LBB0_5:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_6
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	callq	_mlx4_warn
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
LBB0_6:
	addq	%r15, %r13
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_msecs_to_jiffies
	movq	%rax, %rbx
	movq	_jiffies@GOTPCREL(%rip), %r15
	addq	(%r15), %rbx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_comm_pending
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	(%r15), %rdi
	movq	%rbx, %rsi
	callq	_time_before
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	xorl	%eax, %eax
	callq	_cond_resched
	jmp	LBB0_7
LBB0_10:
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_spin_lock
	movq	(%r12), %rax
	movq	%rax, (%r13)
	subq	16(%r12), %r13
	sarq	$5, %r13
	movq	%r13, (%r12)
	movq	%rbx, %rdi
	callq	_spin_unlock
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_up
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"communication channel command 0x%x timed out\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_CMD_STAT_MULTI_FUNC_REQ,8,3    ## @CMD_STAT_MULTI_FUNC_REQ
L_.str.1:                               ## @.str.1
	.asciz	"command 0x%x failed: fw status = 0x%x\n"

	.comm	_jiffies,8,3                    ## @jiffies
	.no_dead_strip	_mlx4_comm_cmd_wait
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlx4_comm_cmd_wait
_mlx4_comm_cmd_wait:                    ; @mlx4_comm_cmd_wait
	.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	x23, x3
	mov	x24, x2
	mov	x25, x1
	mov	x22, x0
	bl	_mlx4_priv
	mov	x20, x0
	add	x0, x0, #8
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
	bl	_down
	add	x21, x20, #12
	mov	x0, x21
	bl	_spin_lock
	mov	w0, #0
	bl	_BUG_ON
	ldr	x28, [x20, #16]
	ldr	x19, [x20]
	add	x27, x28, x19, lsl #5
	ldr	w8, [x20, #24]
	ldr	w9, [x27, #28]
	add	w8, w8, w9
	add	w8, w8, #1
	str	w8, [x27, #28]
	ldr	x8, [x27]
	str	x8, [x20]
	mov	x0, x21
	bl	_spin_unlock
	add	x26, x27, #24
	mov	x0, x26
	bl	_init_completion
	mov	x0, x22
	mov	x1, x25
	mov	x2, x24
	bl	_mlx4_comm_cmd_post
	mov	x0, x23
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x26
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_4
; %bb.1:
	ldr	w24, [x27, #8]
	cbz	w24, LBB0_5
; %bb.2:
	add	x8, x28, x19, lsl #5
	ldr	x3, [x8, #16]
Lloh0:
	adrp	x8, _CMD_STAT_MULTI_FUNC_REQ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CMD_STAT_MULTI_FUNC_REQ@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x3, x8
	b.eq	LBB0_5
; %bb.3:
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	mov	x2, x25
	bl	_mlx4_err
	b	LBB0_5
LBB0_4:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	mov	x2, x25
	bl	_mlx4_warn
Lloh7:
	adrp	x8, _EBUSY@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_5:
	mov	x0, x23
	bl	_msecs_to_jiffies
	mov	x23, x0
Lloh10:
	adrp	x19, _jiffies@GOTPAGE
Lloh11:
	ldr	x19, [x19, _jiffies@GOTPAGEOFF]
	ldr	x25, [x19]
	mov	x0, x22
	bl	_comm_pending
	cbz	x0, LBB0_9
; %bb.6:
	add	x23, x25, x23
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x19]
	mov	x1, x23
	bl	_time_before
	cbz	x0, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	bl	_cond_resched
	mov	x0, x22
	bl	_comm_pending
	cbnz	x0, LBB0_7
LBB0_9:
	mov	x0, x21
	bl	_spin_lock
	ldr	x8, [x20]
	str	x8, [x27]
	ldr	x8, [x20, #16]
	sub	x8, x27, x8
	asr	x8, x8, #5
	str	x8, [x20]
	mov	x0, x21
	bl	_spin_unlock
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	bl	_up
	mov	x0, x24
	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	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"communication channel command 0x%x timed out\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_CMD_STAT_MULTI_FUNC_REQ,8,3    ; @CMD_STAT_MULTI_FUNC_REQ
l_.str.1:                               ; @.str.1
	.asciz	"command 0x%x failed: fw status = 0x%x\n"

	.comm	_jiffies,8,3                    ; @jiffies
	.no_dead_strip	_mlx4_comm_cmd_wait
.subsections_via_symbols
