	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx18_streams_cleanup           ## -- Begin function cx18_streams_cleanup
	.p2align	4, 0x90
_cx18_streams_cleanup:                  ## @cx18_streams_cleanup
	.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
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	_CX18_MAX_STREAMS@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	jle	LBB0_16
## %bb.1:
	movq	%rdi, %r13
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	jmp	LBB0_2
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	addq	%rbx, %r15
	addq	$16, %r15
	addq	%rbx, %rdi
	callq	_cx18_stream_free
	movq	%r15, %rdi
	callq	_video_unregister_device
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%r14
	movslq	(%r12), %rax
	addq	$32, %rbx
	cmpq	%rax, %r14
	jge	LBB0_16
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_CX18_ENC_STREAM_TYPE_TS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpq	%rax, %r14
	jne	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r13), %rdi
	movq	24(%rdi,%rbx), %rax
	testq	%rax, %rax
	je	LBB0_15
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	addq	%rbx, %rdi
	callq	_cx18_dvb_unregister
	movq	8(%r13), %rax
	movq	24(%rax,%rbx), %rax
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %rdi
	callq	_kfree
	movq	8(%r13), %rdi
	movq	$0, 24(%rdi,%rbx)
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_CX18_ENC_STREAM_TYPE_IDX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpq	%rax, %r14
	jne	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r13), %rax
	cmpq	$0, (%rax,%r14,8)
	je	LBB0_15
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	$0, (%rax,%r14,8)
	movq	8(%r13), %rdi
	cmpq	$0, (%rdi,%rbx)
	je	LBB0_15
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	addq	%rbx, %rdi
	callq	_cx18_stream_free
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r13), %r15
	cmpq	$0, 16(%r15,%rbx)
	je	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_CX18_ENC_STREAM_TYPE_YUV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%r15, %rdi
	cmpq	%rax, %r14
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_2 Depth=1
	leaq	(%r15,%rbx), %rdi
	addq	$8, %rdi
	callq	_videobuf_mmap_free
	movq	8(%r13), %rdi
	jmp	LBB0_14
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CX18_MAX_STREAMS,4,2           ## @CX18_MAX_STREAMS
	.comm	_CX18_ENC_STREAM_TYPE_TS,4,2    ## @CX18_ENC_STREAM_TYPE_TS
	.comm	_CX18_ENC_STREAM_TYPE_IDX,4,2   ## @CX18_ENC_STREAM_TYPE_IDX
	.comm	_CX18_ENC_STREAM_TYPE_YUV,4,2   ## @CX18_ENC_STREAM_TYPE_YUV
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx18_streams_cleanup           ; -- Begin function cx18_streams_cleanup
	.p2align	2
_cx18_streams_cleanup:                  ; @cx18_streams_cleanup
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
Lloh0:
	adrp	x22, _CX18_MAX_STREAMS@GOTPAGE
Lloh1:
	ldr	x22, [x22, _CX18_MAX_STREAMS@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_16
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	mov	x23, #0
	mov	w24, #24
Lloh2:
	adrp	x25, _CX18_ENC_STREAM_TYPE_TS@GOTPAGE
Lloh3:
	ldr	x25, [x25, _CX18_ENC_STREAM_TYPE_TS@GOTPAGEOFF]
Lloh4:
	adrp	x26, _CX18_ENC_STREAM_TYPE_IDX@GOTPAGE
Lloh5:
	ldr	x26, [x26, _CX18_ENC_STREAM_TYPE_IDX@GOTPAGEOFF]
Lloh6:
	adrp	x27, _CX18_ENC_STREAM_TYPE_YUV@GOTPAGE
Lloh7:
	ldr	x27, [x27, _CX18_ENC_STREAM_TYPE_YUV@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x8, x8, x24
	sub	x0, x8, #24
	bl	_cx18_stream_free
	mov	x0, x21
	bl	_video_unregister_device
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x22]
	add	x24, x24, #32
	cmp	x23, x8
	b.ge	LBB0_16
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x25]
	cmp	x23, x8
	b.ne	LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x20, #8]
	add	x8, x8, x24
	ldr	x0, [x8], #-24
	cbz	x0, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	cbz	w19, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x8
	bl	_cx18_dvb_unregister
	ldr	x8, [x20, #8]
	ldr	x0, [x8, x24]
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	bl	_kfree
	ldr	x8, [x20, #8]
	add	x0, x8, x24
	str	xzr, [x0], #-24
	bl	_cx18_stream_free
	b	LBB0_3
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x26]
	cmp	x23, x8
	b.ne	LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x20]
	ldr	x9, [x8, x23, lsl #3]
	cbz	x9, LBB0_3
; %bb.11:                               ;   in Loop: Header=BB0_4 Depth=1
	str	xzr, [x8, x23, lsl #3]
	ldr	x8, [x20, #8]
	add	x0, x8, x24
	ldr	x8, [x0, #-24]!
	cbz	x8, LBB0_3
; %bb.12:                               ;   in Loop: Header=BB0_4 Depth=1
	bl	_cx18_stream_free
	b	LBB0_3
LBB0_13:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x20, #8]
	add	x21, x8, x24
	ldr	x9, [x21, #-8]!
	cbz	x9, LBB0_3
; %bb.14:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	w9, [x27]
	cmp	x23, x9
	b.ne	LBB0_2
; %bb.15:                               ;   in Loop: Header=BB0_4 Depth=1
	add	x8, x8, x24
	sub	x0, x8, #16
	bl	_videobuf_mmap_free
	ldr	x8, [x20, #8]
	b	LBB0_2
LBB0_16:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_CX18_MAX_STREAMS,4,2           ; @CX18_MAX_STREAMS
	.comm	_CX18_ENC_STREAM_TYPE_TS,4,2    ; @CX18_ENC_STREAM_TYPE_TS
	.comm	_CX18_ENC_STREAM_TYPE_IDX,4,2   ; @CX18_ENC_STREAM_TYPE_IDX
	.comm	_CX18_ENC_STREAM_TYPE_YUV,4,2   ; @CX18_ENC_STREAM_TYPE_YUV
.subsections_via_symbols
