	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bnxt_re_ib_unreg
_bnxt_re_ib_unreg:                      ## @bnxt_re_ib_unreg
	.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	%rdi, %rbx
	movq	_BNXT_RE_FLAG_IBDEV_REGISTERED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_test_and_clear_bit
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_bnxt_re_unregister_ib
LBB0_2:
	movq	_BNXT_RE_FLAG_QOS_WORK_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_test_and_clear_bit
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	24(%rbx), %rdi
	callq	_cancel_delayed_work_sync
LBB0_4:
	movq	_BNXT_RE_FLAG_RESOURCES_INITIALIZED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_test_and_clear_bit
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	callq	_bnxt_re_cleanup_res
LBB0_6:
	movq	_BNXT_RE_FLAG_RESOURCES_ALLOCATED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_test_and_clear_bit
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	%rbx, %rdi
	callq	_bnxt_re_free_res
LBB0_8:
	movq	_BNXT_RE_FLAG_RCFW_CHANNEL_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_test_and_clear_bit
	testq	%rax, %rax
	je	LBB0_12
## %bb.9:
	leaq	4(%rbx), %r14
	movq	%r14, %rdi
	callq	_bnxt_qplib_deinit_rcfw
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_rdev_to_dev
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	movl	%r15d, %edx
	callq	_dev_warn
LBB0_11:
	leaq	12(%rbx), %r15
	movl	12(%rbx), %esi
	movq	%rbx, %rdi
	callq	_bnxt_re_net_stats_ctx_free
	movq	16(%rbx), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_bnxt_qplib_free_ctx
	movq	%r14, %rdi
	callq	_bnxt_qplib_disable_rcfw_channel
	leaq	8(%rbx), %rdi
	callq	_bnxt_qplib_get_ring_type
	movl	4(%rbx), %esi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_bnxt_re_net_ring_free
	movq	%r14, %rdi
	callq	_bnxt_qplib_free_rcfw_channel
LBB0_12:
	movq	_BNXT_RE_FLAG_GOT_MSIX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_test_and_clear_bit
	testq	%rax, %rax
	je	LBB0_15
## %bb.13:
	movq	%rbx, %rdi
	callq	_bnxt_re_free_msix
	testl	%eax, %eax
	je	LBB0_15
## %bb.14:
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_rdev_to_dev
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edi
	movl	%r14d, %edx
	callq	_dev_warn
LBB0_15:
	movq	%rbx, %rdi
	callq	_bnxt_re_destroy_chip_ctx
	movq	_BNXT_RE_FLAG_NETDEV_REGISTERED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_test_and_clear_bit
	testq	%rax, %rax
	je	LBB0_17
## %bb.16:
	movq	%rbx, %rdi
	callq	_bnxt_re_unregister_netdev
	testl	%eax, %eax
	je	LBB0_17
## %bb.18:
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_rdev_to_dev
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edi
	movl	%r14d, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_warn                       ## TAILCALL
LBB0_17:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BNXT_RE_FLAG_IBDEV_REGISTERED,4,2 ## @BNXT_RE_FLAG_IBDEV_REGISTERED
	.comm	_BNXT_RE_FLAG_QOS_WORK_REG,4,2  ## @BNXT_RE_FLAG_QOS_WORK_REG
	.comm	_BNXT_RE_FLAG_RESOURCES_INITIALIZED,4,2 ## @BNXT_RE_FLAG_RESOURCES_INITIALIZED
	.comm	_BNXT_RE_FLAG_RESOURCES_ALLOCATED,4,2 ## @BNXT_RE_FLAG_RESOURCES_ALLOCATED
	.comm	_BNXT_RE_FLAG_RCFW_CHANNEL_EN,4,2 ## @BNXT_RE_FLAG_RCFW_CHANNEL_EN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to deinitialize RCFW: %#x"

	.comm	_BNXT_RE_FLAG_GOT_MSIX,4,2      ## @BNXT_RE_FLAG_GOT_MSIX
L_.str.1:                               ## @.str.1
	.asciz	"Failed to free MSI-X vectors: %#x"

	.comm	_BNXT_RE_FLAG_NETDEV_REGISTERED,4,2 ## @BNXT_RE_FLAG_NETDEV_REGISTERED
L_.str.2:                               ## @.str.2
	.asciz	"Failed to unregister with netdev: %#x"

	.no_dead_strip	_bnxt_re_ib_unreg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bnxt_re_ib_unreg
_bnxt_re_ib_unreg:                      ; @bnxt_re_ib_unreg
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _BNXT_RE_FLAG_IBDEV_REGISTERED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BNXT_RE_FLAG_IBDEV_REGISTERED@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_test_and_clear_bit
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_bnxt_re_unregister_ib
LBB0_2:
Lloh3:
	adrp	x8, _BNXT_RE_FLAG_QOS_WORK_REG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BNXT_RE_FLAG_QOS_WORK_REG@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_test_and_clear_bit
	cbz	x0, LBB0_4
; %bb.3:
	add	x0, x19, #24
	bl	_cancel_delayed_work_sync
LBB0_4:
Lloh6:
	adrp	x8, _BNXT_RE_FLAG_RESOURCES_INITIALIZED@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BNXT_RE_FLAG_RESOURCES_INITIALIZED@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_test_and_clear_bit
	cbz	x0, LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_bnxt_re_cleanup_res
LBB0_6:
Lloh9:
	adrp	x8, _BNXT_RE_FLAG_RESOURCES_ALLOCATED@GOTPAGE
Lloh10:
	ldr	x8, [x8, _BNXT_RE_FLAG_RESOURCES_ALLOCATED@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_test_and_clear_bit
	cbz	x0, LBB0_8
; %bb.7:
	mov	x0, x19
	bl	_bnxt_re_free_res
LBB0_8:
Lloh12:
	adrp	x8, _BNXT_RE_FLAG_RCFW_CHANNEL_EN@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BNXT_RE_FLAG_RCFW_CHANNEL_EN@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_test_and_clear_bit
	cbz	x0, LBB0_12
; %bb.9:
	add	x20, x19, #4
	mov	x0, x20
	bl	_bnxt_qplib_deinit_rcfw
	cbz	w0, LBB0_11
; %bb.10:
	mov	x21, x0
	mov	x0, x19
	bl	_rdev_to_dev
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dev_warn
LBB0_11:
	mov	x21, x19
	ldr	w1, [x21, #12]!
	mov	x0, x19
	bl	_bnxt_re_net_stats_ctx_free
	ldr	x8, [x19, #16]
	ldr	w0, [x8]
	mov	x1, x21
	bl	_bnxt_qplib_free_ctx
	mov	x0, x20
	bl	_bnxt_qplib_disable_rcfw_channel
	add	x0, x19, #8
	bl	_bnxt_qplib_get_ring_type
	mov	x2, x0
	ldr	w1, [x19, #4]
	mov	x0, x19
	bl	_bnxt_re_net_ring_free
	mov	x0, x20
	bl	_bnxt_qplib_free_rcfw_channel
LBB0_12:
Lloh17:
	adrp	x8, _BNXT_RE_FLAG_GOT_MSIX@GOTPAGE
Lloh18:
	ldr	x8, [x8, _BNXT_RE_FLAG_GOT_MSIX@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_test_and_clear_bit
	cbz	x0, LBB0_15
; %bb.13:
	mov	x0, x19
	bl	_bnxt_re_free_msix
	cbz	w0, LBB0_15
; %bb.14:
	mov	x20, x0
	mov	x0, x19
	bl	_rdev_to_dev
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
	bl	_dev_warn
LBB0_15:
	mov	x0, x19
	bl	_bnxt_re_destroy_chip_ctx
Lloh22:
	adrp	x8, _BNXT_RE_FLAG_NETDEV_REGISTERED@GOTPAGE
Lloh23:
	ldr	x8, [x8, _BNXT_RE_FLAG_NETDEV_REGISTERED@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_test_and_clear_bit
	cbz	x0, LBB0_18
; %bb.16:
	mov	x0, x19
	bl	_bnxt_re_unregister_netdev
	cbz	w0, LBB0_18
; %bb.17:
	mov	x20, x0
	mov	x0, x19
	bl	_rdev_to_dev
Lloh25:
	adrp	x1, l_.str.2@PAGE
Lloh26:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, 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	_dev_warn
LBB0_18:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_BNXT_RE_FLAG_IBDEV_REGISTERED,4,2 ; @BNXT_RE_FLAG_IBDEV_REGISTERED
	.comm	_BNXT_RE_FLAG_QOS_WORK_REG,4,2  ; @BNXT_RE_FLAG_QOS_WORK_REG
	.comm	_BNXT_RE_FLAG_RESOURCES_INITIALIZED,4,2 ; @BNXT_RE_FLAG_RESOURCES_INITIALIZED
	.comm	_BNXT_RE_FLAG_RESOURCES_ALLOCATED,4,2 ; @BNXT_RE_FLAG_RESOURCES_ALLOCATED
	.comm	_BNXT_RE_FLAG_RCFW_CHANNEL_EN,4,2 ; @BNXT_RE_FLAG_RCFW_CHANNEL_EN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to deinitialize RCFW: %#x"

	.comm	_BNXT_RE_FLAG_GOT_MSIX,4,2      ; @BNXT_RE_FLAG_GOT_MSIX
l_.str.1:                               ; @.str.1
	.asciz	"Failed to free MSI-X vectors: %#x"

	.comm	_BNXT_RE_FLAG_NETDEV_REGISTERED,4,2 ; @BNXT_RE_FLAG_NETDEV_REGISTERED
l_.str.2:                               ; @.str.2
	.asciz	"Failed to unregister with netdev: %#x"

	.no_dead_strip	_bnxt_re_ib_unreg
.subsections_via_symbols
