	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function netcp_free_navigator_resources
_netcp_free_navigator_resources:        ## @netcp_free_navigator_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	40(%rdi), %rdi
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	callq	_knav_dma_close_channel
	movq	$0, 40(%r15)
LBB0_2:
	movq	32(%r15), %rdi
	callq	_IS_ERR_OR_NULL
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movq	%r15, %rdi
	callq	_netcp_rxpool_free
LBB0_4:
	movq	24(%r15), %rdi
	callq	_IS_ERR_OR_NULL
	testl	%eax, %eax
	jne	LBB0_6
## %bb.5:
	movq	24(%r15), %rdi
	callq	_knav_queue_close
	movq	$0, 24(%r15)
LBB0_6:
	movq	_KNAV_DMA_FDQ_PER_CHAN@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	jle	LBB0_10
## %bb.7:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r15), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_IS_ERR_OR_NULL
	testl	%eax, %eax
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	16(%r15), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_knav_queue_close
	movq	16(%r15), %rax
	movq	$0, (%rax,%rbx,8)
	incq	%rbx
	movslq	(%r14), %rax
	cmpq	%rax, %rbx
	jl	LBB0_8
LBB0_10:
	movq	8(%r15), %rdi
	callq	_IS_ERR_OR_NULL
	testl	%eax, %eax
	jne	LBB0_12
## %bb.11:
	movq	8(%r15), %rdi
	callq	_knav_queue_close
	movq	$0, 8(%r15)
LBB0_12:
	movq	(%r15), %rdi
	callq	_IS_ERR_OR_NULL
	testl	%eax, %eax
	jne	LBB0_14
## %bb.13:
	movq	(%r15), %rdi
	callq	_knav_pool_destroy
	movq	$0, (%r15)
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KNAV_DMA_FDQ_PER_CHAN,4,2      ## @KNAV_DMA_FDQ_PER_CHAN
	.no_dead_strip	_netcp_free_navigator_resources
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function netcp_free_navigator_resources
_netcp_free_navigator_resources:        ; @netcp_free_navigator_resources
	.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
	ldr	x0, [x0, #40]
	cbz	x0, LBB0_2
; %bb.1:
	bl	_knav_dma_close_channel
	str	xzr, [x19, #40]
LBB0_2:
	ldr	x0, [x19, #32]
	bl	_IS_ERR_OR_NULL
	cbnz	w0, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_netcp_rxpool_free
LBB0_4:
	ldr	x0, [x19, #24]
	bl	_IS_ERR_OR_NULL
	cbnz	w0, LBB0_6
; %bb.5:
	ldr	x0, [x19, #24]
	bl	_knav_queue_close
	str	xzr, [x19, #24]
LBB0_6:
Lloh0:
	adrp	x20, _KNAV_DMA_FDQ_PER_CHAN@GOTPAGE
Lloh1:
	ldr	x20, [x20, _KNAV_DMA_FDQ_PER_CHAN@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.7:
	mov	x21, #0
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	x0, [x8, x21, lsl #3]
	bl	_IS_ERR_OR_NULL
	cbnz	w0, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [x19, #16]
	lsl	x22, x21, #3
	ldr	x0, [x8, x22]
	bl	_knav_queue_close
	ldr	x8, [x19, #16]
	str	xzr, [x8, x22]
	add	x21, x21, #1
	ldrsw	x8, [x20]
	cmp	x21, x8
	b.lt	LBB0_8
LBB0_10:
	ldr	x0, [x19, #8]
	bl	_IS_ERR_OR_NULL
	cbnz	w0, LBB0_12
; %bb.11:
	ldr	x0, [x19, #8]
	bl	_knav_queue_close
	str	xzr, [x19, #8]
LBB0_12:
	ldr	x0, [x19]
	bl	_IS_ERR_OR_NULL
	cbnz	w0, LBB0_14
; %bb.13:
	ldr	x0, [x19]
	bl	_knav_pool_destroy
	str	xzr, [x19]
LBB0_14:
	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 AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_KNAV_DMA_FDQ_PER_CHAN,4,2      ; @KNAV_DMA_FDQ_PER_CHAN
	.no_dead_strip	_netcp_free_navigator_resources
.subsections_via_symbols
