	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bnx2x_prev_unload_common
_bnx2x_prev_unload_common:              ## @bnx2x_prev_unload_common
	.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
	movq	%rdi, %r13
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_BNX2X_DEV_INFO
	leaq	-112(%rbp), %rdi
	xorl	%esi, %esi
	movl	$64, %edx
	callq	_memset
	movq	%r13, %rdi
	callq	_bnx2x_prev_is_path_marked
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%r13, %rdi
	callq	_bnx2x_prev_mcp_done
	jmp	LBB0_25
LBB0_2:
	movq	_MISC_REG_RESET_REG_1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_REG_RD
	movq	_MISC_REGISTERS_RESET_REG_1_RST_BRB1@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_14
## %bb.3:
	leaq	-112(%rbp), %rsi
	movq	%r13, %rdi
	callq	_bnx2x_prev_unload_close_mac
	xorl	%ebx, %ebx
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_bnx2x_set_rx_filter
	xorb	$1, (%r13)
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_bnx2x_set_rx_filter
	xorb	$1, (%r13)
	movq	%r13, %rdi
	callq	_bnx2x_prev_is_after_undi
	movq	%rax, %r15
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_DORQ_REG_NORM_CID_OFST@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_REG_WR
	movq	_NIG_REG_NIG_INT_STS_CLR_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_REG_RD
	movl	$1, %ebx
LBB0_5:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	%r13, %rdi
	callq	_CHIP_IS_E1x
	testl	%eax, %eax
	jne	LBB0_7
## %bb.6:
	movq	_PGLUE_B_REG_INTERNAL_PFID_ENABLE_MASTER@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_REG_WR
LBB0_7:
	movq	_BRB1_REG_NUM_OF_FULL_BLOCKS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_REG_RD
	movl	%eax, %r14d
	movl	$1000, %r12d                    ## imm = 0x3E8
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	$10, %edi
	callq	_udelay
	movl	%ebx, %r14d
	testl	%r12d, %r12d
	je	LBB0_12
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	_BRB1_REG_NUM_OF_FULL_BLOCKS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_REG_RD
	testl	%eax, %eax
	je	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_BNX2X_DEV_INFO
	decl	%r12d
	cmpl	%ebx, %r14d
	movl	$1000, %eax                     ## imm = 0x3E8
	cmovgl	%eax, %r12d
	testq	%r15, %r15
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_bnx2x_prev_unload_undi_inc
	jmp	LBB0_11
LBB0_12:
	leaq	L_.str.2(%rip), %rdi
	callq	_BNX2X_ERR
LBB0_13:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
LBB0_14:
	movq	%r13, %rdi
	callq	_bnx2x_reset_common
	movq	-56(%rbp), %rsi
	testq	%rsi, %rsi
	je	LBB0_16
## %bb.15:
	movl	-64(%rbp), %edx
	movq	%r13, %rdi
	callq	_REG_WR
LBB0_16:
	movq	-72(%rbp), %rax
	movq	(%rax), %rsi
	testq	%rsi, %rsi
	je	LBB0_18
## %bb.17:
	movq	-80(%rbp), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_REG_WR
	movq	-72(%rbp), %rax
LBB0_18:
	movq	8(%rax), %rsi
	testq	%rsi, %rsi
	je	LBB0_20
## %bb.19:
	movq	-80(%rbp), %rax
	movl	4(%rax), %edx
	movq	%r13, %rdi
	callq	_REG_WR
LBB0_20:
	movq	-88(%rbp), %rsi
	testq	%rsi, %rsi
	je	LBB0_22
## %bb.21:
	movl	-96(%rbp), %edx
	movq	%r13, %rdi
	callq	_REG_WR
LBB0_22:
	movq	-104(%rbp), %rsi
	testq	%rsi, %rsi
	je	LBB0_24
## %bb.23:
	movq	-112(%rbp), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_REG_WR
	movq	-112(%rbp), %rax
	movq	-104(%rbp), %rsi
	addq	$4, %rsi
	movl	4(%rax), %edx
	movq	%r13, %rdi
	callq	_REG_WR
LBB0_24:
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_bnx2x_prev_mark_path
	movl	%eax, %ebx
	movq	%r13, %rdi
	callq	_bnx2x_prev_mcp_done
	testl	%ebx, %ebx
	cmovnel	%ebx, %eax
LBB0_25:
	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	"Common unload Flow\n"

	.comm	_MISC_REG_RESET_REG_1,4,2       ## @MISC_REG_RESET_REG_1
	.comm	_MISC_REGISTERS_RESET_REG_1_RST_BRB1,4,2 ## @MISC_REGISTERS_RESET_REG_1_RST_BRB1
	.comm	_DORQ_REG_NORM_CID_OFST,8,3     ## @DORQ_REG_NORM_CID_OFST
	.comm	_NIG_REG_NIG_INT_STS_CLR_0,4,2  ## @NIG_REG_NIG_INT_STS_CLR_0
	.comm	_PGLUE_B_REG_INTERNAL_PFID_ENABLE_MASTER,8,3 ## @PGLUE_B_REG_INTERNAL_PFID_ENABLE_MASTER
	.comm	_BRB1_REG_NUM_OF_FULL_BLOCKS,4,2 ## @BRB1_REG_NUM_OF_FULL_BLOCKS
L_.str.1:                               ## @.str.1
	.asciz	"BRB still has 0x%08x\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to empty BRB, hope for the best\n"

	.no_dead_strip	_bnx2x_prev_unload_common
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bnx2x_prev_unload_common
_bnx2x_prev_unload_common:              ; @bnx2x_prev_unload_common
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x28, x27, [sp, #80]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_BNX2X_DEV_INFO
	add	x0, sp, #16
	mov	w1, #0
	mov	w2, #64
	bl	_memset
	mov	x0, x19
	bl	_bnx2x_prev_is_path_marked
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_bnx2x_prev_mcp_done
	b	LBB0_26
LBB0_2:
Lloh2:
	adrp	x8, _MISC_REG_RESET_REG_1@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MISC_REG_RESET_REG_1@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_REG_RD
Lloh5:
	adrp	x8, _MISC_REGISTERS_RESET_REG_1_RST_BRB1@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MISC_REGISTERS_RESET_REG_1_RST_BRB1@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_5
; %bb.3:
	add	x1, sp, #16
	mov	x0, x19
	bl	_bnx2x_prev_unload_close_mac
	mov	x0, x19
	mov	w1, #0
	bl	_bnx2x_set_rx_filter
	ldr	w8, [x19]
	eor	w8, w8, #0x1
	str	w8, [x19]
	mov	x0, x19
	mov	w1, #0
	bl	_bnx2x_set_rx_filter
	ldr	w8, [x19]
	eor	w8, w8, #0x1
	str	w8, [x19]
	mov	x0, x19
	bl	_bnx2x_prev_is_after_undi
	mov	x21, x0
	cbz	x0, LBB0_6
; %bb.4:
Lloh8:
	adrp	x8, _DORQ_REG_NORM_CID_OFST@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DORQ_REG_NORM_CID_OFST@GOTPAGEOFF]
Lloh10:
	ldr	x1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_REG_WR
Lloh11:
	adrp	x8, _NIG_REG_NIG_INT_STS_CLR_0@GOTPAGE
Lloh12:
	ldr	x8, [x8, _NIG_REG_NIG_INT_STS_CLR_0@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_REG_RD
	mov	w20, #1
	b	LBB0_7
LBB0_5:
	mov	w20, #0
	b	LBB0_15
LBB0_6:
	mov	w20, #0
LBB0_7:
	mov	x0, x19
	bl	_CHIP_IS_E1x
	cbnz	w0, LBB0_9
; %bb.8:
Lloh14:
	adrp	x8, _PGLUE_B_REG_INTERNAL_PFID_ENABLE_MASTER@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PGLUE_B_REG_INTERNAL_PFID_ENABLE_MASTER@GOTPAGEOFF]
Lloh16:
	ldr	x1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_REG_WR
LBB0_9:
Lloh17:
	adrp	x25, _BRB1_REG_NUM_OF_FULL_BLOCKS@GOTPAGE
Lloh18:
	ldr	x25, [x25, _BRB1_REG_NUM_OF_FULL_BLOCKS@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x19
	bl	_REG_RD
	mov	x23, x0
	mov	w26, #1000
	mov	w27, #1000
Lloh19:
	adrp	x22, l_.str.1@PAGE
Lloh20:
	add	x22, x22, l_.str.1@PAGEOFF
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	mov	w0, #10
	bl	_udelay
	mov	x23, x24
	cbz	w27, LBB0_14
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x25]
	mov	x0, x19
	bl	_REG_RD
	cbz	w0, LBB0_15
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x24, x0
	str	x24, [sp]
	mov	x0, x22
	bl	_BNX2X_DEV_INFO
	sub	w8, w27, #1
	cmp	w23, w24
	csel	w27, w26, w8, gt
	cbz	x21, LBB0_10
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x19
	mov	w1, #1
	bl	_bnx2x_prev_unload_undi_inc
	b	LBB0_10
LBB0_14:
Lloh21:
	adrp	x0, l_.str.2@PAGE
Lloh22:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_BNX2X_ERR
LBB0_15:
	mov	x0, x19
	bl	_bnx2x_reset_common
	ldr	x1, [sp, #72]
	cbz	x1, LBB0_17
; %bb.16:
	ldr	w2, [sp, #64]
	mov	x0, x19
	bl	_REG_WR
LBB0_17:
	ldr	x8, [sp, #56]
	ldr	x1, [x8]
	cbz	x1, LBB0_19
; %bb.18:
	ldr	x8, [sp, #48]
	ldr	w2, [x8]
	mov	x0, x19
	bl	_REG_WR
	ldr	x8, [sp, #56]
LBB0_19:
	ldr	x1, [x8, #8]
	cbz	x1, LBB0_21
; %bb.20:
	ldr	x8, [sp, #48]
	ldr	w2, [x8, #4]
	mov	x0, x19
	bl	_REG_WR
LBB0_21:
	ldr	x1, [sp, #40]
	cbz	x1, LBB0_23
; %bb.22:
	ldr	w2, [sp, #32]
	mov	x0, x19
	bl	_REG_WR
LBB0_23:
	ldr	x1, [sp, #24]
	cbz	x1, LBB0_25
; %bb.24:
	ldr	x8, [sp, #16]
	ldr	w2, [x8]
	mov	x0, x19
	bl	_REG_WR
	ldp	x9, x8, [sp, #16]
	add	x1, x8, #4
	ldr	w2, [x9, #4]
	mov	x0, x19
	bl	_REG_WR
LBB0_25:
	mov	x0, x19
	mov	x1, x20
	bl	_bnx2x_prev_mark_path
	mov	x20, x0
	mov	x0, x19
	bl	_bnx2x_prev_mcp_done
	cmp	w20, #0
	csel	w0, w0, w20, eq
LBB0_26:
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Common unload Flow\n"

	.comm	_MISC_REG_RESET_REG_1,4,2       ; @MISC_REG_RESET_REG_1
	.comm	_MISC_REGISTERS_RESET_REG_1_RST_BRB1,4,2 ; @MISC_REGISTERS_RESET_REG_1_RST_BRB1
	.comm	_DORQ_REG_NORM_CID_OFST,8,3     ; @DORQ_REG_NORM_CID_OFST
	.comm	_NIG_REG_NIG_INT_STS_CLR_0,4,2  ; @NIG_REG_NIG_INT_STS_CLR_0
	.comm	_PGLUE_B_REG_INTERNAL_PFID_ENABLE_MASTER,8,3 ; @PGLUE_B_REG_INTERNAL_PFID_ENABLE_MASTER
	.comm	_BRB1_REG_NUM_OF_FULL_BLOCKS,4,2 ; @BRB1_REG_NUM_OF_FULL_BLOCKS
l_.str.1:                               ; @.str.1
	.asciz	"BRB still has 0x%08x\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to empty BRB, hope for the best\n"

	.no_dead_strip	_bnx2x_prev_unload_common
.subsections_via_symbols
