	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bnx2x_func_state_change        ## -- Begin function bnx2x_func_state_change
	.p2align	4, 0x90
_bnx2x_func_state_change:               ## @bnx2x_func_state_change
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	16(%rsi), %r12
	movl	(%rsi), %r15d
	leaq	36(%r12), %r13
	movq	%r13, %rdi
	callq	_mutex_lock
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	callq	*8(%r12)
	movl	%eax, %r14d
	movq	_EBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r14d, %eax
	jne	LBB0_8
## %bb.1:
	movq	_RAMROD_RETRY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	8(%rbx), %rsi
	callq	_test_bit
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	testq	%rax, %rax
	je	LBB0_8
## %bb.2:
	movl	(%rcx), %eax
	addl	%r14d, %eax
	jne	LBB0_10
## %bb.3:
	movl	%r15d, -56(%rbp)                ## 4-byte Spill
	movl	$300, %r15d                     ## imm = 0x12C
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	_mutex_unlock
	movl	$10, %edi
	callq	_msleep
	movq	%r13, %rdi
	callq	_mutex_lock
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movq	%rbx, %rdx
	callq	*8(%r12)
	movl	%eax, %r14d
	xorl	%eax, %eax
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
	cmpl	%eax, %r14d
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	leal	-1(%r15), %ecx
	cmpl	$2, %r15d
	movl	%ecx, %r15d
	ja	LBB0_4
LBB0_6:
	cmpl	%eax, %r14d
	movl	-56(%rbp), %r15d                ## 4-byte Reload
	jne	LBB0_10
## %bb.7:
	movq	%r13, %rdi
	callq	_mutex_unlock
	leaq	L_.str(%rip), %rdi
	callq	_BNX2X_ERR
	jmp	LBB0_16
LBB0_8:
	testl	%r14d, %r14d
	je	LBB0_10
## %bb.9:
	movq	%r13, %rdi
	callq	_mutex_unlock
	jmp	LBB0_16
LBB0_10:
	movl	%r15d, %edi
	movq	%r12, %rsi
	callq	_set_bit
	movq	_RAMROD_DRV_CLR_ONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	8(%rbx), %r14
	movq	%r14, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movl	%r15d, %edx
	callq	_bnx2x_func_state_change_comp
	movq	%r13, %rdi
	callq	_mutex_unlock
LBB0_15:
	movl	%r15d, %edi
	movq	%r12, %rsi
	callq	_test_bit
	xorl	%r14d, %r14d
	testq	%rax, %rax
	setne	%r14b
	jmp	LBB0_16
LBB0_12:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	*16(%r12)
	movl	%eax, %r14d
	movq	%r13, %rdi
	callq	_mutex_unlock
	testl	%r14d, %r14d
	je	LBB0_14
## %bb.13:
	movq	_BNX2X_F_STATE_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r12)
	movl	%r15d, %edi
	movq	%r12, %rsi
	callq	_clear_bit
	xorl	%eax, %eax
	callq	_smp_mb__after_atomic
LBB0_16:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	_RAMROD_COMP_WAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_15
## %bb.17:
	movq	24(%r12), %rax
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movl	%r15d, %edx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_RAMROD_RETRY,4,2               ## @RAMROD_RETRY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timeout waiting for previous ramrod completion\n"

	.comm	_RAMROD_DRV_CLR_ONLY,4,2        ## @RAMROD_DRV_CLR_ONLY
	.comm	_BNX2X_F_STATE_MAX,4,2          ## @BNX2X_F_STATE_MAX
	.comm	_RAMROD_COMP_WAIT,4,2           ## @RAMROD_COMP_WAIT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bnx2x_func_state_change        ; -- Begin function bnx2x_func_state_change
	.p2align	2
_bnx2x_func_state_change:               ; @bnx2x_func_state_change
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x1
	mov	x21, x0
	ldr	x19, [x1, #16]
	ldr	w20, [x1]
	add	x22, x19, #36
	mov	x0, x22
	bl	_mutex_lock
	ldr	x8, [x19, #8]
	mov	x0, x21
	mov	x1, x19
	mov	x2, x23
	blr	x8
	mov	x24, x0
Lloh0:
	adrp	x25, _EBUSY@GOTPAGE
Lloh1:
	ldr	x25, [x25, _EBUSY@GOTPAGEOFF]
	ldr	w8, [x25]
	cmn	w0, w8
	b.ne	LBB0_7
; %bb.1:
Lloh2:
	adrp	x8, _RAMROD_RETRY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _RAMROD_RETRY@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	add	x1, x23, #8
	bl	_test_bit
	cbz	x0, LBB0_7
; %bb.2:
	ldr	w8, [x25]
	cmn	w24, w8
	b.ne	LBB0_9
; %bb.3:
	mov	w26, #300
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	sub	w27, w26, #1
	mov	x0, x22
	bl	_mutex_unlock
	mov	w0, #10
	bl	_msleep
	mov	x0, x22
	bl	_mutex_lock
	ldr	x8, [x19, #8]
	mov	x0, x21
	mov	x1, x19
	mov	x2, x23
	blr	x8
	ldr	w8, [x25]
	cmn	w0, w8
	ccmp	w26, #2, #0, eq
	mov	x26, x27
	b.hi	LBB0_4
; %bb.5:
	mov	x24, x0
	neg	w8, w8
	cmp	w0, w8
	b.ne	LBB0_9
; %bb.6:
	mov	x0, x22
	bl	_mutex_unlock
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_BNX2X_ERR
	b	LBB0_14
LBB0_7:
	cbz	w24, LBB0_9
; %bb.8:
	mov	x0, x22
	bl	_mutex_unlock
	b	LBB0_14
LBB0_9:
	mov	x0, x20
	mov	x1, x19
	bl	_set_bit
Lloh7:
	adrp	x8, _RAMROD_DRV_CLR_ONLY@GOTPAGE
Lloh8:
	ldr	x8, [x8, _RAMROD_DRV_CLR_ONLY@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	add	x25, x23, #8
	mov	x1, x25
	bl	_test_bit
	cbz	x0, LBB0_12
; %bb.10:
	mov	x0, x21
	mov	x1, x19
	mov	x2, x20
	bl	_bnx2x_func_state_change_comp
	mov	x0, x22
	bl	_mutex_unlock
LBB0_11:
	mov	x0, x20
	mov	x1, x19
	bl	_test_bit
	cmp	x0, #0
	cset	w24, ne
	b	LBB0_14
LBB0_12:
	ldr	x8, [x19, #16]
	mov	x0, x21
	mov	x1, x23
	blr	x8
	mov	x24, x0
	mov	x0, x22
	bl	_mutex_unlock
	cbz	w24, LBB0_15
; %bb.13:
Lloh10:
	adrp	x8, _BNX2X_F_STATE_MAX@GOTPAGE
Lloh11:
	ldr	x8, [x8, _BNX2X_F_STATE_MAX@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	str	w8, [x19, #32]
	mov	x0, x20
	mov	x1, x19
	bl	_clear_bit
	bl	_smp_mb__after_atomic
LBB0_14:
	mov	x0, x24
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_15:
Lloh13:
	adrp	x8, _RAMROD_COMP_WAIT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _RAMROD_COMP_WAIT@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	mov	x1, x25
	bl	_test_bit
	cbz	x0, LBB0_11
; %bb.16:
	ldr	x3, [x19, #24]
	mov	x0, x21
	mov	x1, x19
	mov	x2, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	br	x3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_RAMROD_RETRY,4,2               ; @RAMROD_RETRY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timeout waiting for previous ramrod completion\n"

	.comm	_RAMROD_DRV_CLR_ONLY,4,2        ; @RAMROD_DRV_CLR_ONLY
	.comm	_BNX2X_F_STATE_MAX,4,2          ; @BNX2X_F_STATE_MAX
	.comm	_RAMROD_COMP_WAIT,4,2           ; @RAMROD_COMP_WAIT
.subsections_via_symbols
