	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cx18_stream_configure_mdls
_cx18_stream_configure_mdls:            ## @cx18_stream_configure_mdls
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	callq	_cx18_unload_queues
	movl	(%rbx), %eax
	cmpl	$129, %eax
	je	LBB0_7
## %bb.1:
	cmpl	$128, %eax
	jne	LBB0_10
## %bb.2:
	movl	24(%rbx), %ecx
	movq	_V4L2_PIX_FMT_HM12@GOTPCREL(%rip), %rdx
	movq	16(%rbx), %rax
	movl	4(%rax), %eax
	cmpl	(%rdx), %ecx
	jne	LBB0_4
## %bb.3:
	imull	$2160, %eax, %eax               ## imm = 0x870
	sarl	%eax
	jmp	LBB0_5
LBB0_7:
	movl	$1, 8(%rbx)
	movq	16(%rbx), %rdi
	callq	_cx18_raw_vbi
	movq	16(%rbx), %rcx
	movl	(%rcx), %ecx
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	testl	%ecx, %ecx
	movl	$36, %eax
	movl	$24, %ecx
	cmovel	%eax, %ecx
	movq	_VBI_ACTIVE_SAMPLES@GOTPCREL(%rip), %rax
	imull	(%rax), %ecx
	movl	%ecx, 4(%rbx)
	jmp	LBB0_12
LBB0_10:
	movl	$1, 8(%rbx)
	movl	12(%rbx), %eax
	jmp	LBB0_11
LBB0_4:
	imull	$1440, %eax, %eax               ## imm = 0x5A0
LBB0_5:
	movl	%eax, 4(%rbx)
	cltd
	idivl	12(%rbx)
	movl	%eax, 8(%rbx)
	testl	%edx, %edx
	je	LBB0_12
## %bb.6:
	incl	%eax
	movl	%eax, 8(%rbx)
	jmp	LBB0_12
LBB0_9:
	movq	_VBI_HBLANK_SAMPLES_60HZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shll	$2, %eax
	movq	_VBI_HBLANK_SAMPLES_50HZ@GOTPCREL(%rip), %rdx
	imull	$44, (%rdx), %edx
	testl	%ecx, %ecx
	leal	(%rax,%rax,8), %eax
	cmovel	%edx, %eax
LBB0_11:
	movl	%eax, 4(%rbx)
LBB0_12:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_cx18_load_queues               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_PIX_FMT_HM12,4,2          ## @V4L2_PIX_FMT_HM12
	.comm	_VBI_ACTIVE_SAMPLES,4,2         ## @VBI_ACTIVE_SAMPLES
	.comm	_VBI_HBLANK_SAMPLES_60HZ,4,2    ## @VBI_HBLANK_SAMPLES_60HZ
	.comm	_VBI_HBLANK_SAMPLES_50HZ,4,2    ## @VBI_HBLANK_SAMPLES_50HZ
	.no_dead_strip	_cx18_stream_configure_mdls
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cx18_stream_configure_mdls
_cx18_stream_configure_mdls:            ; @cx18_stream_configure_mdls
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	bl	_cx18_unload_queues
	ldr	w8, [x19]
	cmp	w8, #129
	b.eq	LBB0_4
; %bb.1:
	cmp	w8, #128
	b.ne	LBB0_6
; %bb.2:
	ldr	w8, [x19, #24]
Lloh0:
	adrp	x9, _V4L2_PIX_FMT_HM12@GOTPAGE
Lloh1:
	ldr	x9, [x9, _V4L2_PIX_FMT_HM12@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	ldr	x10, [x19, #16]
	ldr	w10, [x10, #4]
	mov	w11, #1440
	mul	w11, w10, w11
	mov	w12, #2160
	mul	w10, w10, w12
	orr	w12, w10, #0x1
	cmp	w10, #0
	csel	w10, w12, w10, lt
	asr	w10, w10, #1
	cmp	w8, w9
	csel	w9, w11, w10, ne
	ldr	w10, [x19, #12]
	sdiv	w8, w9, w10
	stp	w9, w8, [x19, #4]
	msub	w9, w8, w10, w9
	cbz	w9, LBB0_9
; %bb.3:
	add	w8, w8, #1
	str	w8, [x19, #8]
	b	LBB0_9
LBB0_4:
	mov	w8, #1
	str	w8, [x19, #8]
	ldr	x0, [x19, #16]
	bl	_cx18_raw_vbi
	ldr	x8, [x19, #16]
	ldr	w8, [x8]
	cbz	w0, LBB0_7
; %bb.5:
	mov	w9, #24
	mov	w10, #36
	cmp	w8, #0
	csel	w8, w10, w9, eq
Lloh3:
	adrp	x9, _VBI_ACTIVE_SAMPLES@GOTPAGE
Lloh4:
	ldr	x9, [x9, _VBI_ACTIVE_SAMPLES@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	mul	w8, w8, w9
	b	LBB0_8
LBB0_6:
	mov	w8, #1
	ldr	w9, [x19, #12]
	stp	w9, w8, [x19, #4]
	b	LBB0_9
LBB0_7:
Lloh6:
	adrp	x9, _VBI_HBLANK_SAMPLES_60HZ@GOTPAGE
Lloh7:
	ldr	x9, [x9, _VBI_HBLANK_SAMPLES_60HZ@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	add	w9, w9, w9, lsl #3
	lsl	w9, w9, #2
Lloh9:
	adrp	x10, _VBI_HBLANK_SAMPLES_50HZ@GOTPAGE
Lloh10:
	ldr	x10, [x10, _VBI_HBLANK_SAMPLES_50HZ@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	mov	w11, #44
	mul	w10, w10, w11
	cmp	w8, #0
	csel	w8, w10, w9, eq
LBB0_8:
	str	w8, [x19, #4]
LBB0_9:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_cx18_load_queues
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_PIX_FMT_HM12,4,2          ; @V4L2_PIX_FMT_HM12
	.comm	_VBI_ACTIVE_SAMPLES,4,2         ; @VBI_ACTIVE_SAMPLES
	.comm	_VBI_HBLANK_SAMPLES_60HZ,4,2    ; @VBI_HBLANK_SAMPLES_60HZ
	.comm	_VBI_HBLANK_SAMPLES_50HZ,4,2    ; @VBI_HBLANK_SAMPLES_50HZ
	.no_dead_strip	_cx18_stream_configure_mdls
.subsections_via_symbols
