	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_netxen_free_hw_resources       ## -- Begin function netxen_free_hw_resources
	.p2align	4, 0x90
_netxen_free_hw_resources:              ## @netxen_free_hw_resources
	.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
	movq	%rdi, %r12
	movl	(%rdi), %r14d
	movl	60(%rdi), %edi
	callq	_NX_IS_REVISION_P2
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	movq	%r12, %rdi
	callq	_netxen_api_lock
	movl	%r14d, %edi
	callq	_CRB_CTX_SIGNATURE_REG
	movq	_NETXEN_CTX_D3_RESET@GOTPCREL(%rip), %rcx
	orl	(%rcx), %r14d
	movq	%r12, %rdi
	movl	%eax, %esi
	movl	%r14d, %edx
	callq	_NXWR32
	movq	%r12, %rdi
	callq	_netxen_api_unlock
	jmp	LBB0_4
LBB0_1:
	movq	___NX_FW_ATTACHED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	56(%r12), %rsi
	callq	_test_and_clear_bit
	testl	%eax, %eax
	je	LBB0_5
## %bb.2:
	movq	%r12, %rdi
	callq	_nx_fw_cmd_destroy_rx_ctx
	movq	%r12, %rdi
	callq	_nx_fw_cmd_destroy_tx_ctx
LBB0_4:
	movl	$20, %edi
	callq	_msleep
LBB0_5:
	movq	40(%r12), %rdx
	testq	%rdx, %rdx
	je	LBB0_7
## %bb.6:
	movl	12(%r12), %edi
	movl	48(%r12), %ecx
	movl	$8, %esi
	callq	_pci_free_consistent
	movq	$0, 40(%r12)
LBB0_7:
	movq	16(%r12), %r14
	cmpq	$0, (%r14)
	je	LBB0_9
## %bb.8:
	movl	12(%r12), %r15d
	movq	%r14, %rdi
	callq	_TX_DESC_RINGSIZE
	movq	(%r14), %rdx
	movl	8(%r14), %ecx
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_pci_free_consistent
	movq	$0, (%r14)
LBB0_9:
	movl	4(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_14
## %bb.10:
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_11 Depth=1
	incq	%r15
	movslq	%eax, %rcx
	addq	$16, %rbx
	cmpq	%rcx, %r15
	jge	LBB0_14
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	32(%r12), %r13
	cmpq	$0, (%r13,%rbx)
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	leaq	(%rbx,%r13), %rdi
	movl	12(%r12), %r14d
	callq	_RCV_DESC_RINGSIZE
	movq	(%r13,%rbx), %rdx
	movl	8(%r13,%rbx), %ecx
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_pci_free_consistent
	movq	$0, (%r13,%rbx)
	movl	4(%r12), %eax
	jmp	LBB0_13
LBB0_14:
	movl	8(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_19
## %bb.15:
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_16 Depth=1
	incq	%r15
	movslq	%eax, %rcx
	addq	$16, %rbx
	cmpq	%rcx, %r15
	jge	LBB0_19
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	24(%r12), %r13
	cmpq	$0, (%r13,%rbx)
	je	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	leaq	(%rbx,%r13), %rdi
	movl	12(%r12), %r14d
	callq	_STATUS_DESC_RINGSIZE
	movq	(%r13,%rbx), %rdx
	movl	8(%r13,%rbx), %ecx
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_pci_free_consistent
	movq	$0, (%r13,%rbx)
	movl	8(%r12), %eax
	jmp	LBB0_18
LBB0_19:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	___NX_FW_ATTACHED,4,2           ## @__NX_FW_ATTACHED
	.comm	_NETXEN_CTX_D3_RESET,4,2        ## @NETXEN_CTX_D3_RESET
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_netxen_free_hw_resources       ; -- Begin function netxen_free_hw_resources
	.p2align	2
_netxen_free_hw_resources:              ; @netxen_free_hw_resources
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	w20, [x0]
	ldr	w0, [x0, #60]
	bl	_NX_IS_REVISION_P2
	cbz	w0, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_netxen_api_lock
	mov	x0, x20
	bl	_CRB_CTX_SIGNATURE_REG
	mov	x1, x0
Lloh0:
	adrp	x8, _NETXEN_CTX_D3_RESET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NETXEN_CTX_D3_RESET@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	orr	w2, w8, w20
	mov	x0, x19
	bl	_NXWR32
	mov	x0, x19
	bl	_netxen_api_unlock
	b	LBB0_4
LBB0_2:
Lloh3:
	adrp	x8, ___NX_FW_ATTACHED@GOTPAGE
Lloh4:
	ldr	x8, [x8, ___NX_FW_ATTACHED@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	add	x1, x19, #56
	bl	_test_and_clear_bit
	cbz	w0, LBB0_5
; %bb.3:
	mov	x0, x19
	bl	_nx_fw_cmd_destroy_rx_ctx
	mov	x0, x19
	bl	_nx_fw_cmd_destroy_tx_ctx
LBB0_4:
	mov	w0, #20
	bl	_msleep
LBB0_5:
	ldr	x2, [x19, #40]
	cbz	x2, LBB0_7
; %bb.6:
	ldr	w0, [x19, #12]
	ldr	w3, [x19, #48]
	mov	w1, #8
	bl	_pci_free_consistent
	str	xzr, [x19, #40]
LBB0_7:
	ldr	x20, [x19, #16]
	ldr	x8, [x20]
	cbz	x8, LBB0_9
; %bb.8:
	ldr	w21, [x19, #12]
	mov	x0, x20
	bl	_TX_DESC_RINGSIZE
	mov	x1, x0
	ldr	x2, [x20]
	ldr	w3, [x20, #8]
	mov	x0, x21
	bl	_pci_free_consistent
	str	xzr, [x20]
LBB0_9:
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.10:
	mov	x22, #0
	mov	x23, #0
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	add	x23, x23, #1
	add	x22, x22, #16
	cmp	x23, w8, sxtw
	b.ge	LBB0_14
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #32]
	add	x20, x9, x22
	ldr	x9, [x20]
	cbz	x9, LBB0_11
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	w21, [x19, #12]
	mov	x0, x20
	bl	_RCV_DESC_RINGSIZE
	mov	x1, x0
	ldr	x2, [x20]
	ldr	w3, [x20, #8]
	mov	x0, x21
	bl	_pci_free_consistent
	str	xzr, [x20]
	ldr	w8, [x19, #4]
	b	LBB0_11
LBB0_14:
	ldr	w8, [x19, #8]
	cmp	w8, #1
	b.lt	LBB0_19
; %bb.15:
	mov	x22, #0
	mov	x23, #0
	b	LBB0_17
LBB0_16:                                ;   in Loop: Header=BB0_17 Depth=1
	add	x23, x23, #1
	add	x22, x22, #16
	cmp	x23, w8, sxtw
	b.ge	LBB0_19
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #24]
	add	x20, x9, x22
	ldr	x9, [x20]
	cbz	x9, LBB0_16
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	ldr	w21, [x19, #12]
	mov	x0, x20
	bl	_STATUS_DESC_RINGSIZE
	mov	x1, x0
	ldr	x2, [x20]
	ldr	w3, [x20, #8]
	mov	x0, x21
	bl	_pci_free_consistent
	str	xzr, [x20]
	ldr	w8, [x19, #8]
	b	LBB0_16
LBB0_19:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	___NX_FW_ATTACHED,4,2           ; @__NX_FW_ATTACHED
	.comm	_NETXEN_CTX_D3_RESET,4,2        ; @NETXEN_CTX_D3_RESET
.subsections_via_symbols
