	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -96(%rbp)                  ## 8-byte Spill
	movl	%ecx, -84(%rbp)                 ## 4-byte Spill
	movl	%edx, -88(%rbp)                 ## 4-byte Spill
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r14
	callq	_mlx4_priv
	movq	%rax, %r15
	leaq	8(%rax), %rdi
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	callq	_down
	leaq	12(%r15), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock
	xorl	%edi, %edi
	callq	_BUG_ON
	movq	(%r15), %r12
	movq	16(%r15), %r13
	shlq	$5, %r12
	leaq	(%r12,%r13), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	24(%r15), %eax
	movl	28(%r13,%r12), %ecx
	leal	1(%rax,%rcx), %eax
	movl	%eax, 28(%r13,%r12)
	movq	(%r13,%r12), %rax
	movq	%rax, (%r15)
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movq	%r14, %rbx
	callq	_spin_unlock
	leaq	(%r12,%r13), %r14
	addq	$24, %r14
	movq	%r14, %rdi
	callq	_reinit_completion
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	-88(%rbp), %edx                 ## 4-byte Reload
	callq	_mlx4_comm_cmd_post
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_CMD_STAT_INTERNAL_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_mlx4_status_to_errno
	movl	%eax, %r14d
	jmp	LBB0_5
LBB0_2:
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	callq	_msecs_to_jiffies
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	je	LBB0_3
## %bb.6:
	movl	8(%r13,%r12), %r14d
	testl	%r14d, %r14d
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	je	LBB0_9
## %bb.7:
	movq	16(%r13,%r12), %rcx
	movq	_CMD_STAT_MULTI_FUNC_REQ@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rcx
	je	LBB0_9
## %bb.8:
	addq	%r13, %r12
	addq	$16, %r12
	leaq	L_.str.1(%rip), %rsi
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_mlx4_err
	movq	(%r12), %rsi
	movl	-84(%rbp), %edi                 ## 4-byte Reload
	callq	_mlx4_closing_cmd_fatal_error
	testq	%rax, %rax
	jne	LBB0_4
LBB0_9:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	_MLX4_DEVICE_STATE_INTERNAL_ERROR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	jne	LBB0_5
## %bb.10:
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	callq	_msecs_to_jiffies
	movq	%rax, %r12
	movq	_jiffies@GOTPCREL(%rip), %r13
	addq	(%r13), %r12
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_comm_pending
	testq	%rax, %rax
	je	LBB0_5
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	(%r13), %rdi
	movq	%r12, %rsi
	callq	_time_before
	testq	%rax, %rax
	je	LBB0_5
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	xorl	%eax, %eax
	callq	_cond_resched
	jmp	LBB0_11
LBB0_3:
	leaq	L_.str(%rip), %rsi
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	-84(%rbp), %ecx                 ## 4-byte Reload
	callq	_mlx4_warn
LBB0_4:
	movq	_CMD_STAT_INTERNAL_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_mlx4_status_to_errno
	movl	%eax, %r14d
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	callq	_mlx4_enter_error_state
LBB0_5:
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%r13, %rdi
	callq	_spin_lock
	movq	(%r15), %rax
	movq	%rax, (%rbx)
	subq	16(%r15), %rbx
	sarq	$5, %rbx
	movq	%rbx, (%r15)
	movq	%r13, %rdi
	callq	_spin_unlock
	movq	%r12, %rdi
	callq	_up
	movl	%r14d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CMD_STAT_INTERNAL_ERR,4,2      ## @CMD_STAT_INTERNAL_ERR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"communication channel command 0x%x (op=0x%x) timed out\n"

	.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	_MLX4_DEVICE_STATE_INTERNAL_ERROR,4,2 ## @MLX4_DEVICE_STATE_INTERNAL_ERROR
	.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	x19, x4
	str	w3, [sp, #4]                    ; 4-byte Folded Spill
	mov	x27, x2
	mov	x26, 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	x25, [x20, #16]
	ldr	x24, [x20]
	add	x28, x25, x24, lsl #5
	ldr	w8, [x20, #24]
	ldr	w9, [x28, #28]
	add	w8, w8, w9
	add	w8, w8, #1
	str	w8, [x28, #28]
	ldr	x8, [x28]
	str	x8, [x20]
	mov	x0, x21
	bl	_spin_unlock
	add	x23, x28, #24
	mov	x0, x23
	bl	_reinit_completion
	mov	x0, x22
	mov	x1, x26
	mov	x2, x27
	bl	_mlx4_comm_cmd_post
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _CMD_STAT_INTERNAL_ERR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CMD_STAT_INTERNAL_ERR@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_mlx4_status_to_errno
	mov	x23, x0
	b	LBB0_13
LBB0_2:
	ldr	w27, [sp, #4]                   ; 4-byte Folded Reload
	mov	x0, x19
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x23
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_11
; %bb.3:
	add	x24, x25, x24, lsl #5
	ldr	w23, [x24, #8]
	cbz	w23, LBB0_6
; %bb.4:
	ldr	x3, [x24, #16]!
Lloh3:
	adrp	x8, _CMD_STAT_MULTI_FUNC_REQ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CMD_STAT_MULTI_FUNC_REQ@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x3, x8
	b.eq	LBB0_6
; %bb.5:
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	mov	x2, x26
	bl	_mlx4_err
	ldr	x1, [x24]
	mov	x0, x27
	bl	_mlx4_closing_cmd_fatal_error
	cbnz	x0, LBB0_12
LBB0_6:
	ldr	x8, [x22]
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _MLX4_DEVICE_STATE_INTERNAL_ERROR@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MLX4_DEVICE_STATE_INTERNAL_ERROR@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_13
; %bb.7:
	mov	x0, x19
	bl	_msecs_to_jiffies
	mov	x24, x0
Lloh11:
	adrp	x25, _jiffies@GOTPAGE
Lloh12:
	ldr	x25, [x25, _jiffies@GOTPAGEOFF]
	ldr	x26, [x25]
	mov	x0, x22
	bl	_comm_pending
	cbz	x0, LBB0_13
; %bb.8:
	add	x24, x26, x24
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x25]
	mov	x1, x24
	bl	_time_before
	cbz	x0, LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	bl	_cond_resched
	mov	x0, x22
	bl	_comm_pending
	cbnz	x0, LBB0_9
	b	LBB0_13
LBB0_11:
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	mov	x2, x26
	mov	x3, x27
	bl	_mlx4_warn
LBB0_12:
Lloh15:
	adrp	x8, _CMD_STAT_INTERNAL_ERR@GOTPAGE
Lloh16:
	ldr	x8, [x8, _CMD_STAT_INTERNAL_ERR@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	bl	_mlx4_status_to_errno
	mov	x23, x0
	ldr	x0, [x22]
	bl	_mlx4_enter_error_state
LBB0_13:
	ldr	x19, [sp, #8]                   ; 8-byte Folded Reload
	mov	x0, x21
	bl	_spin_lock
	ldr	x8, [x20]
	str	x8, [x28]
	ldr	x8, [x20, #16]
	sub	x8, x28, x8
	asr	x8, x8, #5
	str	x8, [x20]
	mov	x0, x21
	bl	_spin_unlock
	mov	x0, x19
	bl	_up
	mov	x0, x23
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_CMD_STAT_INTERNAL_ERR,4,2      ; @CMD_STAT_INTERNAL_ERR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"communication channel command 0x%x (op=0x%x) timed out\n"

	.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	_MLX4_DEVICE_STATE_INTERNAL_ERROR,4,2 ; @MLX4_DEVICE_STATE_INTERNAL_ERROR
	.comm	_jiffies,8,3                    ; @jiffies
	.no_dead_strip	_mlx4_comm_cmd_wait
.subsections_via_symbols
