	.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, %r12
	leaq	L_.str(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_BNX2X_DEV_INFO
	leaq	-112(%rbp), %rdi
	xorl	%esi, %esi
	movl	$64, %edx
	callq	_memset
	movq	%r12, %rdi
	callq	_bnx2x_prev_is_path_marked
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%r12, %rdi
	callq	_bnx2x_prev_mcp_done
	jmp	LBB0_24
LBB0_2:
	movq	_MISC_REG_RESET_REG_1@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	callq	_REG_RD
	movl	%eax, %ebx
	movq	_MISC_REGISTERS_RESET_REG_1_RST_BRB1@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_15
## %bb.3:
	leaq	-112(%rbp), %rsi
	movq	%r12, %rdi
	callq	_bnx2x_prev_unload_close_mac
	xorl	%r15d, %r15d
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_bnx2x_set_rx_filter
	movq	_MISC_REGISTERS_RESET_REG_1_RST_DORQ@GOTPCREL(%rip), %rax
	movb	$1, %r14b
	testl	%ebx, (%rax)
	je	LBB0_6
## %bb.4:
	movq	_DORQ_REG_NORM_CID_OFST@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rsi
	movq	%r12, %rdi
	callq	_REG_RD
	cmpl	$7, %eax
	jne	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_BNX2X_DEV_INFO
	movq	(%rbx), %rsi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_REG_WR
	movq	_NIG_REG_NIG_INT_STS_CLR_0@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	callq	_REG_RD
	movl	$1, %r15d
LBB0_6:
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	%r12, %rdi
	callq	_CHIP_IS_E1x
	testl	%eax, %eax
	jne	LBB0_8
## %bb.7:
	movq	_PGLUE_B_REG_INTERNAL_PFID_ENABLE_MASTER@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_REG_WR
LBB0_8:
	movq	_BRB1_REG_NUM_OF_FULL_BLOCKS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	callq	_REG_RD
	movl	%eax, %r13d
	movl	$1000, %r15d                    ## imm = 0x3E8
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	$10, %edi
	callq	_udelay
	movl	%ebx, %r13d
	testl	%r15d, %r15d
	je	LBB0_13
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	_BRB1_REG_NUM_OF_FULL_BLOCKS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	callq	_REG_RD
	testl	%eax, %eax
	je	LBB0_14
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_BNX2X_DEV_INFO
	decl	%r15d
	cmpl	%ebx, %r13d
	movl	$1000, %eax                     ## imm = 0x3E8
	cmovgl	%eax, %r15d
	testb	%r14b, %r14b
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r12, %rdi
	callq	_BP_PORT
	movq	%r12, %rdi
	movl	%eax, %esi
	movl	$1, %edx
	callq	_bnx2x_prev_unload_undi_inc
	jmp	LBB0_12
LBB0_13:
	leaq	L_.str.3(%rip), %rdi
	callq	_BNX2X_ERR
LBB0_14:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
LBB0_15:
	movq	%r12, %rdi
	callq	_bnx2x_reset_common
	movq	-56(%rbp), %rsi
	testq	%rsi, %rsi
	je	LBB0_17
## %bb.16:
	movl	-64(%rbp), %edx
	movq	%r12, %rdi
	callq	_REG_WR
LBB0_17:
	movq	-72(%rbp), %rsi
	testq	%rsi, %rsi
	je	LBB0_19
## %bb.18:
	movl	-80(%rbp), %edx
	movq	%r12, %rdi
	callq	_REG_WR
LBB0_19:
	movq	-88(%rbp), %rsi
	testq	%rsi, %rsi
	je	LBB0_21
## %bb.20:
	movl	-96(%rbp), %edx
	movq	%r12, %rdi
	callq	_REG_WR
LBB0_21:
	movq	-104(%rbp), %rsi
	testq	%rsi, %rsi
	je	LBB0_23
## %bb.22:
	movq	-112(%rbp), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_REG_WR
	movq	-112(%rbp), %rax
	movq	-104(%rbp), %rsi
	addq	$4, %rsi
	movl	4(%rax), %edx
	movq	%r12, %rdi
	callq	_REG_WR
LBB0_23:
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_bnx2x_prev_mark_path
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_bnx2x_prev_mcp_done
	testl	%ebx, %ebx
	cmovnel	%ebx, %eax
LBB0_24:
	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,8,3       ## @MISC_REG_RESET_REG_1
	.comm	_MISC_REGISTERS_RESET_REG_1_RST_BRB1,4,2 ## @MISC_REGISTERS_RESET_REG_1_RST_BRB1
	.comm	_MISC_REGISTERS_RESET_REG_1_RST_DORQ,4,2 ## @MISC_REGISTERS_RESET_REG_1_RST_DORQ
	.comm	_DORQ_REG_NORM_CID_OFST,8,3     ## @DORQ_REG_NORM_CID_OFST
L_.str.1:                               ## @.str.1
	.asciz	"UNDI previously loaded\n"

	.comm	_NIG_REG_NIG_INT_STS_CLR_0,8,3  ## @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,8,3 ## @BRB1_REG_NUM_OF_FULL_BLOCKS
L_.str.2:                               ## @.str.2
	.asciz	"BRB still has 0x%08x\n"

L_.str.3:                               ## @.str.3
	.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_25
LBB0_2:
Lloh2:
	adrp	x8, _MISC_REG_RESET_REG_1@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MISC_REG_RESET_REG_1@GOTPAGEOFF]
Lloh4:
	ldr	x1, [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_14
; %bb.3:
	mov	x20, x0
	add	x1, sp, #16
	mov	x0, x19
	bl	_bnx2x_prev_unload_close_mac
	mov	x0, x19
	mov	w1, #0
	bl	_bnx2x_set_rx_filter
Lloh8:
	adrp	x8, _MISC_REGISTERS_RESET_REG_1_RST_DORQ@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MISC_REGISTERS_RESET_REG_1_RST_DORQ@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_6
; %bb.4:
Lloh11:
	adrp	x20, _DORQ_REG_NORM_CID_OFST@GOTPAGE
Lloh12:
	ldr	x20, [x20, _DORQ_REG_NORM_CID_OFST@GOTPAGEOFF]
	ldr	x1, [x20]
	mov	x0, x19
	bl	_REG_RD
	cmp	w0, #7
	b.ne	LBB0_6
; %bb.5:
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_BNX2X_DEV_INFO
	ldr	x1, [x20]
	mov	x0, x19
	mov	w2, #0
	bl	_REG_WR
Lloh15:
	adrp	x8, _NIG_REG_NIG_INT_STS_CLR_0@GOTPAGE
Lloh16:
	ldr	x8, [x8, _NIG_REG_NIG_INT_STS_CLR_0@GOTPAGEOFF]
Lloh17:
	ldr	x1, [x8]
	mov	x0, x19
	bl	_REG_RD
	mov	w24, #0
	mov	w20, #1
	b	LBB0_7
LBB0_6:
	mov	w20, #0
	mov	w24, #1
LBB0_7:
	mov	x0, x19
	bl	_CHIP_IS_E1x
	cbnz	w0, LBB0_9
; %bb.8:
Lloh18:
	adrp	x8, _PGLUE_B_REG_INTERNAL_PFID_ENABLE_MASTER@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PGLUE_B_REG_INTERNAL_PFID_ENABLE_MASTER@GOTPAGEOFF]
Lloh20:
	ldr	x1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_REG_WR
LBB0_9:
Lloh21:
	adrp	x25, _BRB1_REG_NUM_OF_FULL_BLOCKS@GOTPAGE
Lloh22:
	ldr	x25, [x25, _BRB1_REG_NUM_OF_FULL_BLOCKS@GOTPAGEOFF]
	ldr	x1, [x25]
	mov	x0, x19
	bl	_REG_RD
	mov	x23, x0
	mov	w26, #1000
	mov	w27, #1000
Lloh23:
	adrp	x21, l_.str.2@PAGE
Lloh24:
	add	x21, x21, l_.str.2@PAGEOFF
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	mov	w0, #10
	bl	_udelay
	mov	x23, x22
	cbz	w27, LBB0_15
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x1, [x25]
	mov	x0, x19
	bl	_REG_RD
	cbz	w0, LBB0_16
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x22, x0
	str	x22, [sp]
	mov	x0, x21
	bl	_BNX2X_DEV_INFO
	sub	w8, w27, #1
	cmp	w23, w22
	csel	w27, w26, w8, gt
	tbnz	w24, #0, LBB0_10
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x19
	bl	_BP_PORT
	mov	x1, x0
	mov	x0, x19
	mov	w2, #1
	bl	_bnx2x_prev_unload_undi_inc
	b	LBB0_10
LBB0_14:
	mov	w20, #0
	b	LBB0_16
LBB0_15:
Lloh25:
	adrp	x0, l_.str.3@PAGE
Lloh26:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_BNX2X_ERR
LBB0_16:
	mov	x0, x19
	bl	_bnx2x_reset_common
	ldr	x1, [sp, #72]
	cbz	x1, LBB0_18
; %bb.17:
	ldr	w2, [sp, #64]
	mov	x0, x19
	bl	_REG_WR
LBB0_18:
	ldr	x1, [sp, #56]
	cbz	x1, LBB0_20
; %bb.19:
	ldr	w2, [sp, #48]
	mov	x0, x19
	bl	_REG_WR
LBB0_20:
	ldr	x1, [sp, #40]
	cbz	x1, LBB0_22
; %bb.21:
	ldr	w2, [sp, #32]
	mov	x0, x19
	bl	_REG_WR
LBB0_22:
	ldr	x1, [sp, #24]
	cbz	x1, LBB0_24
; %bb.23:
	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_24:
	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_25:
	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	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Common unload Flow\n"

	.comm	_MISC_REG_RESET_REG_1,8,3       ; @MISC_REG_RESET_REG_1
	.comm	_MISC_REGISTERS_RESET_REG_1_RST_BRB1,4,2 ; @MISC_REGISTERS_RESET_REG_1_RST_BRB1
	.comm	_MISC_REGISTERS_RESET_REG_1_RST_DORQ,4,2 ; @MISC_REGISTERS_RESET_REG_1_RST_DORQ
	.comm	_DORQ_REG_NORM_CID_OFST,8,3     ; @DORQ_REG_NORM_CID_OFST
l_.str.1:                               ; @.str.1
	.asciz	"UNDI previously loaded\n"

	.comm	_NIG_REG_NIG_INT_STS_CLR_0,8,3  ; @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,8,3 ; @BRB1_REG_NUM_OF_FULL_BLOCKS
l_.str.2:                               ; @.str.2
	.asciz	"BRB still has 0x%08x\n"

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

	.no_dead_strip	_bnx2x_prev_unload_common
.subsections_via_symbols
