	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_enter_error_state         ## -- Begin function mlx4_enter_error_state
	.p2align	4, 0x90
_mlx4_enter_error_state:                ## @mlx4_enter_error_state
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_mlx4_internal_err_reset@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_11
## %bb.1:
	movq	%rdi, %rbx
	leaq	4(%rdi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	_MLX4_DEVICE_STATE_INTERNAL_ERROR@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	testl	%eax, (%rbx)
	je	LBB0_2
## %bb.10:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	8(%rbx), %rbx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_mlx4_err
	movq	%rbx, %rdi
	callq	_mlx4_is_slave
	movq	%rbx, %rdi
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	callq	_mlx4_reset_slave
	testl	%eax, %eax
	je	LBB0_6
LBB0_7:
	movq	(%rbx), %rax
	movl	4(%rax), %edi
	callq	_pci_channel_offline
	testl	%eax, %eax
	jne	LBB0_9
## %bb.8:
	movl	$1, %edi
	callq	_BUG_ON
	jmp	LBB0_9
LBB0_4:
	callq	_mlx4_crdump_collect
	movq	%rbx, %rdi
	callq	_mlx4_reset_master
	testl	%eax, %eax
	jne	LBB0_7
LBB0_6:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_mlx4_err
LBB0_9:
	movl	(%r15), %eax
	movq	(%rbx), %rcx
	orl	%eax, (%rcx)
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	_MLX4_DEV_EVENT_CATASTROPHIC_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_mlx4_dispatch_event
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mlx4_cmd_wake_completions      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_mlx4_internal_err_reset,4,2    ## @mlx4_internal_err_reset
	.comm	_MLX4_DEVICE_STATE_INTERNAL_ERROR,4,2 ## @MLX4_DEVICE_STATE_INTERNAL_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"device is going to be reset\n"

L_.str.1:                               ## @.str.1
	.asciz	"device was reset successfully\n"

	.comm	_MLX4_DEV_EVENT_CATASTROPHIC_ERROR,4,2 ## @MLX4_DEV_EVENT_CATASTROPHIC_ERROR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_enter_error_state         ; -- Begin function mlx4_enter_error_state
	.p2align	2
_mlx4_enter_error_state:                ; @mlx4_enter_error_state
	.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
Lloh0:
	adrp	x8, _mlx4_internal_err_reset@GOTPAGE
Lloh1:
	ldr	x8, [x8, _mlx4_internal_err_reset@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbz	w8, LBB0_3
; %bb.1:
	mov	x20, x0
	add	x19, x0, #4
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x20]
Lloh3:
	adrp	x21, _MLX4_DEVICE_STATE_INTERNAL_ERROR@GOTPAGE
Lloh4:
	ldr	x21, [x21, _MLX4_DEVICE_STATE_INTERNAL_ERROR@GOTPAGEOFF]
	ldr	w9, [x21]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.2:
	mov	x0, x19
	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
	b	_mutex_unlock
LBB0_3:
	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_4:
	ldr	x20, [x20, #8]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_mlx4_err
	mov	x0, x20
	bl	_mlx4_is_slave
	cbz	x0, LBB0_8
; %bb.5:
	mov	x0, x20
	bl	_mlx4_reset_slave
	cbz	w0, LBB0_9
LBB0_6:
	ldr	x8, [x20]
	ldr	w0, [x8, #4]
	bl	_pci_channel_offline
	cbnz	w0, LBB0_10
; %bb.7:
	mov	w0, #1
	bl	_BUG_ON
	b	LBB0_10
LBB0_8:
	mov	x0, x20
	bl	_mlx4_crdump_collect
	mov	x0, x20
	bl	_mlx4_reset_master
	cbnz	w0, LBB0_6
LBB0_9:
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_mlx4_err
LBB0_10:
	ldr	w8, [x21]
	ldr	x9, [x20]
	ldr	w10, [x9]
	orr	w8, w10, w8
	str	w8, [x9]
	mov	x0, x19
	bl	_mutex_unlock
Lloh9:
	adrp	x8, _MLX4_DEV_EVENT_CATASTROPHIC_ERROR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MLX4_DEV_EVENT_CATASTROPHIC_ERROR@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_mlx4_dispatch_event
	mov	x0, x20
	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
	b	_mlx4_cmd_wake_completions
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_mlx4_internal_err_reset,4,2    ; @mlx4_internal_err_reset
	.comm	_MLX4_DEVICE_STATE_INTERNAL_ERROR,4,2 ; @MLX4_DEVICE_STATE_INTERNAL_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"device is going to be reset\n"

l_.str.1:                               ; @.str.1
	.asciz	"device was reset successfully\n"

	.comm	_MLX4_DEV_EVENT_CATASTROPHIC_ERROR,4,2 ; @MLX4_DEV_EVENT_CATASTROPHIC_ERROR
.subsections_via_symbols
