	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bnx2_fw_sync
_bnx2_fw_sync:                          ## @bnx2_fw_sync
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movl	%edx, %r13d
	movq	%rdi, %r14
	movl	(%rdi), %ebx
	incl	%ebx
	movl	%ebx, (%rdi)
	orl	%esi, %ebx
	movl	%ebx, 4(%rdi)
	movq	_BNX2_DRV_MB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edx
	callq	_bnx2_shmem_wr
	xorl	%eax, %eax
	testl	%r13d, %r13d
	je	LBB0_14
## %bb.1:
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	_BNX2_FW_ACK_TIME_OUT_MS@GOTPCREL(%rip), %r13
	cmpl	$10, (%r13)
                                        ## implicit-def: $eax
	jl	LBB0_5
## %bb.2:
	xorl	%r15d, %r15d
	movq	_BNX2_DRV_MSG_SEQ@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	$10, %edi
	callq	_msleep
	movq	_BNX2_FW_MB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_bnx2_shmem_rd
	movl	%eax, %ecx
	movq	_BNX2_FW_MSG_ACK@GOTPCREL(%rip), %rdx
	andl	(%rdx), %ecx
	movl	(%r12), %edx
	andl	%ebx, %edx
	cmpl	%edx, %ecx
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_4 Depth=1
	incl	%r15d
	movslq	(%r13), %rcx
	imulq	$1717986919, %rcx, %rcx         ## imm = 0x66666667
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$34, %rcx
	addl	%edx, %ecx
	cmpl	%ecx, %r15d
	jl	LBB0_4
LBB0_5:
	movq	_BNX2_DRV_MSG_DATA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%ebx, %ecx
	movq	_BNX2_DRV_MSG_DATA_WAIT0@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_7
## %bb.6:
	xorl	%eax, %eax
	jmp	LBB0_14
LBB0_7:
	movq	_BNX2_FW_MSG_ACK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	movq	_BNX2_DRV_MSG_SEQ@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	andl	%ebx, %edx
	cmpl	%edx, %ecx
	jne	LBB0_8
## %bb.11:
	movq	_BNX2_FW_MSG_STATUS_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_BNX2_FW_MSG_STATUS_OK@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	movl	$0, %eax
	je	LBB0_14
## %bb.12:
	movq	_EIO@GOTPCREL(%rip), %rcx
	jmp	LBB0_13
LBB0_8:
	movq	_BNX2_DRV_MSG_CODE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, %ebx
	movq	_BNX2_DRV_MSG_CODE_FW_TIMEOUT@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_BNX2_DRV_MB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_bnx2_shmem_wr
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_10
## %bb.9:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_pr_err
	movq	%r14, %rdi
	callq	_bnx2_dump_mcp_state
LBB0_10:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
LBB0_13:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BNX2_DRV_MB,4,2                ## @BNX2_DRV_MB
	.comm	_BNX2_FW_ACK_TIME_OUT_MS,4,2    ## @BNX2_FW_ACK_TIME_OUT_MS
	.comm	_BNX2_FW_MB,4,2                 ## @BNX2_FW_MB
	.comm	_BNX2_FW_MSG_ACK,4,2            ## @BNX2_FW_MSG_ACK
	.comm	_BNX2_DRV_MSG_SEQ,4,2           ## @BNX2_DRV_MSG_SEQ
	.comm	_BNX2_DRV_MSG_DATA,4,2          ## @BNX2_DRV_MSG_DATA
	.comm	_BNX2_DRV_MSG_DATA_WAIT0,4,2    ## @BNX2_DRV_MSG_DATA_WAIT0
	.comm	_BNX2_DRV_MSG_CODE,4,2          ## @BNX2_DRV_MSG_CODE
	.comm	_BNX2_DRV_MSG_CODE_FW_TIMEOUT,4,2 ## @BNX2_DRV_MSG_CODE_FW_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fw sync timeout, reset code = %x\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_BNX2_FW_MSG_STATUS_MASK,4,2    ## @BNX2_FW_MSG_STATUS_MASK
	.comm	_BNX2_FW_MSG_STATUS_OK,4,2      ## @BNX2_FW_MSG_STATUS_OK
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_bnx2_fw_sync
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bnx2_fw_sync
_bnx2_fw_sync:                          ; @bnx2_fw_sync
	.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	x20, x3
	mov	x22, x2
	mov	x19, x0
	ldr	w8, [x0]
	add	w8, w8, #1
	orr	w21, w8, w1
	stp	w8, w21, [x0]
Lloh0:
	adrp	x23, _BNX2_DRV_MB@GOTPAGE
Lloh1:
	ldr	x23, [x23, _BNX2_DRV_MB@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x2, x21
	bl	_bnx2_shmem_wr
	cbz	w22, LBB0_6
; %bb.1:
Lloh2:
	adrp	x22, _BNX2_FW_ACK_TIME_OUT_MS@GOTPAGE
Lloh3:
	ldr	x22, [x22, _BNX2_FW_ACK_TIME_OUT_MS@GOTPAGEOFF]
	ldr	w8, [x22]
                                        ; implicit-def: $w0
	cmp	w8, #10
	b.lt	LBB0_5
; %bb.2:
	mov	w24, #0
Lloh4:
	adrp	x25, _BNX2_FW_MB@GOTPAGE
Lloh5:
	ldr	x25, [x25, _BNX2_FW_MB@GOTPAGEOFF]
Lloh6:
	adrp	x26, _BNX2_FW_MSG_ACK@GOTPAGE
Lloh7:
	ldr	x26, [x26, _BNX2_FW_MSG_ACK@GOTPAGEOFF]
	mov	w27, #26215
	movk	w27, #26214, lsl #16
Lloh8:
	adrp	x28, _BNX2_DRV_MSG_SEQ@GOTPAGE
Lloh9:
	ldr	x28, [x28, _BNX2_DRV_MSG_SEQ@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #10
	bl	_msleep
	ldr	w1, [x25]
	mov	x0, x19
	bl	_bnx2_shmem_rd
	ldr	w8, [x26]
	and	w8, w8, w0
	ldr	w9, [x28]
	and	w9, w9, w21
	cmp	w8, w9
	b.eq	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w24, w24, #1
	ldrsw	x8, [x22]
	mul	x8, x8, x27
	lsr	x9, x8, #63
	asr	x8, x8, #34
	add	w8, w8, w9
	cmp	w24, w8
	b.lt	LBB0_3
LBB0_5:
Lloh10:
	adrp	x8, _BNX2_DRV_MSG_DATA@GOTPAGE
Lloh11:
	ldr	x8, [x8, _BNX2_DRV_MSG_DATA@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	and	w8, w8, w21
Lloh13:
	adrp	x9, _BNX2_DRV_MSG_DATA_WAIT0@GOTPAGE
Lloh14:
	ldr	x9, [x9, _BNX2_DRV_MSG_DATA_WAIT0@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_7
LBB0_6:
	mov	w0, #0
	b	LBB0_14
LBB0_7:
Lloh16:
	adrp	x8, _BNX2_FW_MSG_ACK@GOTPAGE
Lloh17:
	ldr	x8, [x8, _BNX2_FW_MSG_ACK@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh19:
	adrp	x9, _BNX2_DRV_MSG_SEQ@GOTPAGE
Lloh20:
	ldr	x9, [x9, _BNX2_DRV_MSG_SEQ@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	and	w9, w9, w21
	cmp	w8, w9
	b.ne	LBB0_10
; %bb.8:
Lloh22:
	adrp	x8, _BNX2_FW_MSG_STATUS_MASK@GOTPAGE
Lloh23:
	ldr	x8, [x8, _BNX2_FW_MSG_STATUS_MASK@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh25:
	adrp	x9, _BNX2_FW_MSG_STATUS_OK@GOTPAGE
Lloh26:
	ldr	x9, [x9, _BNX2_FW_MSG_STATUS_OK@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_6
; %bb.9:
Lloh28:
	adrp	x8, _EIO@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_13
LBB0_10:
Lloh30:
	adrp	x8, _BNX2_DRV_MSG_CODE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _BNX2_DRV_MSG_CODE@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	bic	w8, w21, w8
Lloh33:
	adrp	x9, _BNX2_DRV_MSG_CODE_FW_TIMEOUT@GOTPAGE
Lloh34:
	ldr	x9, [x9, _BNX2_DRV_MSG_CODE_FW_TIMEOUT@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	orr	w21, w8, w9
	ldr	w1, [x23]
	mov	x0, x19
	mov	x2, x21
	bl	_bnx2_shmem_wr
	cbnz	w20, LBB0_12
; %bb.11:
Lloh36:
	adrp	x0, l_.str@PAGE
Lloh37:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_pr_err
	mov	x0, x19
	bl	_bnx2_dump_mcp_state
LBB0_12:
Lloh38:
	adrp	x8, _EBUSY@GOTPAGE
Lloh39:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_13:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_14:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_BNX2_DRV_MB,4,2                ; @BNX2_DRV_MB
	.comm	_BNX2_FW_ACK_TIME_OUT_MS,4,2    ; @BNX2_FW_ACK_TIME_OUT_MS
	.comm	_BNX2_FW_MB,4,2                 ; @BNX2_FW_MB
	.comm	_BNX2_FW_MSG_ACK,4,2            ; @BNX2_FW_MSG_ACK
	.comm	_BNX2_DRV_MSG_SEQ,4,2           ; @BNX2_DRV_MSG_SEQ
	.comm	_BNX2_DRV_MSG_DATA,4,2          ; @BNX2_DRV_MSG_DATA
	.comm	_BNX2_DRV_MSG_DATA_WAIT0,4,2    ; @BNX2_DRV_MSG_DATA_WAIT0
	.comm	_BNX2_DRV_MSG_CODE,4,2          ; @BNX2_DRV_MSG_CODE
	.comm	_BNX2_DRV_MSG_CODE_FW_TIMEOUT,4,2 ; @BNX2_DRV_MSG_CODE_FW_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fw sync timeout, reset code = %x\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_BNX2_FW_MSG_STATUS_MASK,4,2    ; @BNX2_FW_MSG_STATUS_MASK
	.comm	_BNX2_FW_MSG_STATUS_OK,4,2      ; @BNX2_FW_MSG_STATUS_OK
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_bnx2_fw_sync
.subsections_via_symbols
