	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlx4_cmd_wait
_mlx4_cmd_wait:                         ## @mlx4_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	$72, %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, -84(%rbp)                 ## 4-byte Spill
	movl	%ecx, -76(%rbp)                 ## 4-byte Spill
	movq	%rdx, %r12
	movl	%esi, -80(%rbp)                 ## 4-byte Spill
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	callq	_mlx4_priv
	movq	%rax, %r14
	leaq	8(%rax), %rdi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_down
	leaq	12(%r14), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock
	xorl	%edi, %edi
	callq	_BUG_ON
	movq	(%r14), %r15
	movq	16(%r14), %r13
	shlq	$5, %r15
	movl	24(%r14), %eax
	leaq	(%r15,%r13), %rcx
	addq	$24, %rcx
	movq	%rcx, -104(%rbp)                ## 8-byte Spill
	movl	24(%r13,%r15), %ecx
	leal	1(%rax,%rcx), %eax
	movl	%eax, 24(%r13,%r15)
	movq	(%r13,%r15), %rax
	movq	%rax, (%r14)
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_spin_unlock
	leaq	(%r15,%r13), %rdi
	addq	$20, %rdi
	movq	%rdi, -112(%rbp)                ## 8-byte Spill
	callq	_init_completion
	xorl	%edx, %edx
	testq	%r12, %r12
	je	LBB0_2
## %bb.1:
	movl	(%r12), %edx
LBB0_2:
	movq	%r12, -96(%rbp)                 ## 8-byte Spill
	leaq	(%r15,%r13), %r12
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movl	(%rax), %eax
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	-80(%rbp), %esi                 ## 4-byte Reload
	movl	-84(%rbp), %ecx                 ## 4-byte Reload
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movl	16(%rbp), %ebx
	movl	%ebx, %r9d
	pushq	$1
	pushq	%rax
	callq	_mlx4_cmd_post
	addq	$16, %rsp
	movq	24(%rbp), %rdi
	callq	_msecs_to_jiffies
	movq	-112(%rbp), %rdi                ## 8-byte Reload
	movl	%eax, %esi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movl	8(%r13,%r15), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	16(%r13,%r15), %ecx
	leaq	L_.str.1(%rip), %rsi
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	16(%rbp), %edx
	callq	_mlx4_err
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	jmp	LBB0_9
LBB0_3:
	leaq	L_.str(%rip), %rsi
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %edx
	callq	_mlx4_warn
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_9
LBB0_6:
	cmpl	$0, -76(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_8
## %bb.7:
	movl	12(%r13,%r15), %eax
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
LBB0_8:
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	xorl	%r13d, %r13d
LBB0_9:
	movq	%rbx, %rdi
	callq	_spin_lock
	movq	(%r14), %rax
	movq	%rax, (%r12)
	subq	16(%r14), %r12
	sarq	$5, %r12
	movq	%r12, (%r14)
	movq	%rbx, %rdi
	callq	_spin_unlock
	movq	%r15, %rdi
	callq	_up
	movl	%r13d, %eax
	addq	$72, %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	"command 0x%x timed out (go bit not cleared)\n"

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

	.no_dead_strip	_mlx4_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_cmd_wait
_mlx4_cmd_wait:                         ; @mlx4_cmd_wait
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x7, [sp, #32]                   ; 8-byte Folded Spill
	str	w6, [sp, #44]                   ; 4-byte Folded Spill
	stp	w4, w5, [sp, #16]               ; 8-byte Folded Spill
	str	w3, [sp, #12]                   ; 4-byte Folded Spill
	mov	x25, x2
	mov	x24, x1
	mov	x23, x0
	bl	_mlx4_priv
	mov	x20, x0
	add	x0, x0, #8
	str	x0, [sp, #24]                   ; 8-byte Folded Spill
	bl	_down
	add	x21, x20, #12
	mov	x0, x21
	bl	_spin_lock
	mov	w0, #0
	bl	_BUG_ON
	ldr	x22, [x20, #16]
	ldr	x27, [x20]
	add	x28, x22, x27, lsl #5
	ldr	w8, [x20, #24]
	mov	x26, x28
	ldr	w9, [x26, #24]!
	add	w8, w8, w9
	add	w8, w8, #1
	str	w8, [x26]
	mov	x19, x28
	ldr	x8, [x19], #20
	str	x8, [x20]
	mov	x0, x21
	bl	_spin_unlock
	mov	x0, x19
	bl	_init_completion
	str	x25, [sp]                       ; 8-byte Folded Spill
	cbz	x25, LBB0_2
; %bb.1:
	ldr	w2, [x25]
	b	LBB0_3
LBB0_2:
	mov	w2, #0
LBB0_3:
	ldp	w3, w4, [sp, #16]               ; 8-byte Folded Reload
	mov	x1, x24
	ldr	w6, [x26]
	mov	x0, x23
	ldr	w26, [sp, #44]                  ; 4-byte Folded Reload
	mov	x5, x26
	mov	w7, #1
	bl	_mlx4_cmd_post
	ldr	x0, [sp, #32]                   ; 8-byte Folded Reload
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x19
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_6
; %bb.4:
	add	x8, x22, x27, lsl #5
	ldr	w25, [x8, #8]
	cbz	w25, LBB0_7
; %bb.5:
	ldr	w3, [x8, #16]
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x23
	mov	x2, x26
	bl	_mlx4_err
	ldr	x19, [sp, #24]                  ; 8-byte Folded Reload
	b	LBB0_10
LBB0_6:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x23
	mov	x2, x26
	bl	_mlx4_warn
Lloh4:
	adrp	x8, _EBUSY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w25, w8
	ldr	x19, [sp, #24]                  ; 8-byte Folded Reload
	b	LBB0_10
LBB0_7:
	ldr	x19, [sp, #24]                  ; 8-byte Folded Reload
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	cbz	w8, LBB0_9
; %bb.8:
	mov	w25, #0
	add	x8, x22, x27, lsl #5
	ldr	w8, [x8, #12]
	ldr	x9, [sp]                        ; 8-byte Folded Reload
	str	w8, [x9]
	b	LBB0_10
LBB0_9:
	mov	w25, #0
LBB0_10:
	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, x25
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.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	"command 0x%x timed out (go bit not cleared)\n"

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

	.no_dead_strip	_mlx4_cmd_wait
.subsections_via_symbols
