	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cx18_g_enc_index
_cx18_g_enc_index:                      ## @cx18_g_enc_index
	.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	%rdx, %r14
	movq	%rsi, %rdi
	callq	_fh2id
	movq	(%rax), %rax
	movq	(%rax), %r12
	movq	_CX18_ENC_STREAM_TYPE_IDX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	(%rax,%rax,4), %rbx
	leaq	(%r12,%rbx,4), %r13
	movq	%r13, %rdi
	callq	_cx18_stream_enabled
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	_CX18_ENC_STREAM_TYPE_IDX_FW_MDL_MIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	4(%r12,%rbx,4), %eax
	movl	(%r13), %ecx
	subl	%eax, %ecx
	cmpl	$2, %ecx
	movl	$1, %eax
	cmovgel	%ecx, %eax
	imull	8(%r12,%rbx,4), %eax
	sarl	$2, %eax
	movq	$0, (%r14)
	movl	%eax, 8(%r14)
	movl	12(%r14), %edi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	leaq	(%r12,%rbx,4), %r15
	addq	$16, %r15
	leaq	(%r12,%rbx,4), %r12
	addq	$12, %r12
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_cx18_dequeue
	testq	%rax, %rax
	je	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rax, %rbx
	movq	%r13, %rdi
	movq	%rax, %rsi
	movq	%r14, %rdx
	callq	_cx18_process_idx_data
	movq	(%rbx), %rax
	cmpq	8(%rbx), %rax
	jl	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movq	%r12, %rdx
	callq	_cx18_enqueue
	movq	(%r14), %rax
	movq	_V4L2_ENC_IDX_ENTRIES@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_3
	jmp	LBB0_7
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_8
LBB0_5:
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	callq	_cx18_push
LBB0_7:
	movq	%r13, %rdi
	callq	_cx18_stream_load_fw_queue
	xorl	%eax, %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CX18_ENC_STREAM_TYPE_IDX,8,3   ## @CX18_ENC_STREAM_TYPE_IDX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CX18_ENC_STREAM_TYPE_IDX_FW_MDL_MIN,4,2 ## @CX18_ENC_STREAM_TYPE_IDX_FW_MDL_MIN
	.comm	_V4L2_ENC_IDX_ENTRIES,8,3       ## @V4L2_ENC_IDX_ENTRIES
	.no_dead_strip	_cx18_g_enc_index
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cx18_g_enc_index
_cx18_g_enc_index:                      ; @cx18_g_enc_index
	.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, x2
	mov	x0, x1
	bl	_fh2id
	ldr	x8, [x0]
	ldr	x21, [x8]
Lloh0:
	adrp	x8, _CX18_ENC_STREAM_TYPE_IDX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CX18_ENC_STREAM_TYPE_IDX@GOTPAGEOFF]
Lloh2:
	ldr	x22, [x8]
	mov	w8, #20
	madd	x20, x22, x8, x21
	mov	x0, x20
	bl	_cx18_stream_enabled
	cbz	w0, LBB0_5
; %bb.1:
	ldr	w8, [x20]
	mov	w9, #20
Lloh3:
	adrp	x10, _CX18_ENC_STREAM_TYPE_IDX_FW_MDL_MIN@GOTPAGE
Lloh4:
	ldr	x10, [x10, _CX18_ENC_STREAM_TYPE_IDX_FW_MDL_MIN@GOTPAGEOFF]
	madd	x22, x22, x9, x21
Lloh5:
	ldr	w9, [x10]
	ldp	w10, w11, [x22, #4]
	msub	w8, w9, w10, w8
	cmp	w8, #1
	csinc	w8, w8, wzr, gt
	mul	w8, w8, w11
	asr	w8, w8, #2
	str	xzr, [x19]
	str	w8, [x19, #8]
	ldr	w0, [x19, #12]
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	add	x21, x22, #16
	add	x22, x22, #12
Lloh6:
	adrp	x24, _V4L2_ENC_IDX_ENTRIES@GOTPAGE
Lloh7:
	ldr	x24, [x24, _V4L2_ENC_IDX_ENTRIES@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_cx18_dequeue
	cbz	x0, LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x23, x0
	mov	x0, x20
	mov	x1, x23
	mov	x2, x19
	bl	_cx18_process_idx_data
	ldp	x8, x9, [x23]
	mov	x0, x20
	mov	x1, x23
	cmp	x8, x9
	b.lt	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x2, x22
	bl	_cx18_enqueue
	ldr	x8, [x19]
	ldr	x9, [x24]
	cmp	x8, x9
	b.lt	LBB0_2
	b	LBB0_7
LBB0_5:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_6:
	mov	x2, x21
	bl	_cx18_push
LBB0_7:
	mov	x0, x20
	bl	_cx18_stream_load_fw_queue
	mov	w0, #0
LBB0_8:
	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 AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_CX18_ENC_STREAM_TYPE_IDX,8,3   ; @CX18_ENC_STREAM_TYPE_IDX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CX18_ENC_STREAM_TYPE_IDX_FW_MDL_MIN,4,2 ; @CX18_ENC_STREAM_TYPE_IDX_FW_MDL_MIN
	.comm	_V4L2_ENC_IDX_ENTRIES,8,3       ; @V4L2_ENC_IDX_ENTRIES
	.no_dead_strip	_cx18_g_enc_index
.subsections_via_symbols
