	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cx25840_s_mbus_fmt
_cx25840_s_mbus_fmt:                    ## @cx25840_s_mbus_fmt
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %rbx
	callq	_to_state
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_v4l2_get_subdevdata
	movq	(%r15), %rdx
	movq	_V4L2_MBUS_FMT_FIXED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	jne	LBB0_1
## %bb.3:
	movq	_V4L2_STD_525_60@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	(%r12), %ecx
	setne	-44(%rbp)                       ## 1-byte Folded Spill
	movq	_V4L2_FIELD_INTERLACED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 20(%r15)
	movq	_V4L2_COLORSPACE_SMPTE170M@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 16(%r15)
	movq	%rax, %r13
	movq	%rax, %rdi
	movl	$1142, %esi                     ## imm = 0x476
	callq	_cx25840_read
	movl	%eax, %r12d
	movq	%r13, %rdi
	movl	$1141, %esi                     ## imm = 0x475
	callq	_cx25840_read
	movl	%eax, %r14d
	movq	%r13, %rdi
	movl	$1138, %esi                     ## imm = 0x472
	callq	_cx25840_read
	movl	%eax, %ebx
	andl	$63, %ebx
	shll	$4, %ebx
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	movl	$1137, %esi                     ## imm = 0x471
	callq	_cx25840_read
	shrl	$4, %eax
	andl	$15, %eax
	orl	%ebx, %eax
	movl	8(%r15), %r9d
	movl	12(%r15), %r8d
	movl	%r8d, %ecx
	shll	$4, %ecx
	cmpl	%eax, %ecx
	jl	LBB0_7
## %bb.4:
	cmpl	%r8d, %eax
	jl	LBB0_7
## %bb.5:
	andl	$63, %r12d
	shll	$4, %r12d
	shrl	$4, %r14d
	andl	$15, %r14d
	orl	%r12d, %r14d
	xorl	%ecx, %ecx
	movb	-44(%rbp), %dl                  ## 1-byte Reload
	movb	%dl, %cl
	leal	(%rcx,%rcx,2), %ecx
	leal	(%rcx,%r9), %edx
	leal	32(,%rdx,8), %edx
	cmpl	%r14d, %edx
	jl	LBB0_7
## %bb.6:
	addl	%r9d, %ecx
	addl	$4, %ecx
	cmpl	%ecx, %r14d
	jl	LBB0_7
## %bb.8:
	shll	$20, %eax
	xorl	%r13d, %r13d
	xorl	%edx, %edx
	idivl	%r8d
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	%eax, %ebx
	addl	$-1048576, %ebx                 ## imm = 0xFFF00000
	shll	$9, %r14d
	movl	%r14d, %eax
	xorl	%edx, %edx
	idivl	%ecx
	movl	$512, %r15d                     ## imm = 0x200
	subl	%eax, %r15d
	movl	%r15d, %r12d
	andl	$8191, %r12d                    ## imm = 0x1FFF
	movl	$8, %eax
	cmpl	$384, %r8d                      ## imm = 0x180
	jg	LBB0_11
## %bb.9:
	movl	$9, %eax
	cmpl	$192, %r8d
	jg	LBB0_11
## %bb.10:
	xorl	%eax, %eax
	cmpl	$97, %r8d
	setge	%al
	xorl	$11, %eax
LBB0_11:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_cx25840_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rcx
	movl	$1, %edi
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdx
                                        ## kill: def $r9d killed $r9d killed $r9
	pushq	%r12
	pushq	%rbx
	callq	_v4l_dbg
	addq	$16, %rsp
	movzbl	-48(%rbp), %edx                 ## 1-byte Folded Reload
	movq	%r14, %rdi
	movl	$1048, %esi                     ## imm = 0x418
	callq	_cx25840_write
	movzbl	%bh, %edx
	movq	%r14, %rdi
	movl	$1049, %esi                     ## imm = 0x419
	callq	_cx25840_write
	sarl	$16, %ebx
	movq	%r14, %rdi
	movl	$1050, %esi                     ## imm = 0x41A
	movl	%ebx, %edx
	callq	_cx25840_write
	movzbl	%r15b, %edx
	movq	%r14, %rdi
	movl	$1052, %esi                     ## imm = 0x41C
	callq	_cx25840_write
	shrl	$8, %r12d
	movq	%r14, %rdi
	movl	$1053, %esi                     ## imm = 0x41D
	movl	%r12d, %edx
	callq	_cx25840_write
	movq	%r14, %rdi
	movl	$1054, %esi                     ## imm = 0x41E
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_cx25840_write
	jmp	LBB0_12
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_7:
	leaq	L_.str(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r8d, %edx
	movl	%r9d, %ecx
	callq	_v4l_err
	movq	_ERANGE@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_12:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_STD_525_60,4,2            ## @V4L2_STD_525_60
	.comm	_V4L2_MBUS_FMT_FIXED,8,3        ## @V4L2_MBUS_FMT_FIXED
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_V4L2_FIELD_INTERLACED,4,2      ## @V4L2_FIELD_INTERLACED
	.comm	_V4L2_COLORSPACE_SMPTE170M,4,2  ## @V4L2_COLORSPACE_SMPTE170M
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%dx%d is not a valid size!\n"

	.comm	_ERANGE,4,2                     ## @ERANGE
	.comm	_cx25840_debug,4,2              ## @cx25840_debug
L_.str.1:                               ## @.str.1
	.asciz	"decoder set size %dx%d -> scale  %ux%u\n"

	.no_dead_strip	_cx25840_s_mbus_fmt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cx25840_s_mbus_fmt
_cx25840_s_mbus_fmt:                    ; @cx25840_s_mbus_fmt
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x1
	mov	x19, x0
	bl	_to_state
	mov	x21, x0
	mov	x0, x19
	bl	_v4l2_get_subdevdata
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _V4L2_MBUS_FMT_FIXED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _V4L2_MBUS_FMT_FIXED@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.1:
	mov	x19, x0
	ldr	w24, [x21]
Lloh3:
	adrp	x8, _V4L2_STD_525_60@GOTPAGE
Lloh4:
	ldr	x8, [x8, _V4L2_STD_525_60@GOTPAGEOFF]
Lloh5:
	ldr	w25, [x8]
Lloh6:
	adrp	x8, _V4L2_FIELD_INTERLACED@GOTPAGE
Lloh7:
	ldr	x8, [x8, _V4L2_FIELD_INTERLACED@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _V4L2_COLORSPACE_SMPTE170M@GOTPAGE
Lloh10:
	ldr	x9, [x9, _V4L2_COLORSPACE_SMPTE170M@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #16]
	mov	w1, #1142
	bl	_cx25840_read
	mov	x21, x0
	mov	x0, x19
	mov	w1, #1141
	bl	_cx25840_read
	mov	x22, x0
	mov	x0, x19
	mov	w1, #1138
	bl	_cx25840_read
	ubfiz	w23, w0, #4, #6
	mov	x0, x19
	mov	w1, #1137
	bl	_cx25840_read
	bfxil	w23, w0, #4, #4
	tst	w25, w24
	mov	w8, #7
	mov	w9, #4
	csel	w9, w9, w8, eq
	ldp	w5, w4, [x20, #8]
	cmp	w23, w4, lsl #4
	b.gt	LBB0_7
; %bb.2:
	cmp	w23, w4
	b.lt	LBB0_7
; %bb.3:
	ubfiz	w8, w21, #4, #6
	bfxil	w8, w22, #4, #4
	add	w9, w5, w9
	lsl	w10, w9, #3
	cmp	w10, w8
	ccmp	w8, w9, #8, ge
	b.lt	LBB0_7
; %bb.4:
	lsl	w10, w23, #20
	sdiv	w24, w10, w4
	sub	w22, w24, #256, lsl #12         ; =1048576
	lsl	w8, w8, #9
	mov	w10, #512
	sdiv	w8, w8, w9
	sub	w23, w10, w8
	and	w20, w23, #0x1fff
	cmp	w4, #384
	b.le	LBB0_9
; %bb.5:
	mov	w21, #8
	b	LBB0_12
LBB0_6:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x4
	mov	x3, x5
	bl	_v4l_err
Lloh16:
	adrp	x8, _ERANGE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_13
LBB0_9:
	cmp	w4, #192
	b.le	LBB0_11
; %bb.10:
	mov	w21, #9
	b	LBB0_12
LBB0_11:
	cmp	w4, #96
	mov	w8, #10
	cinc	w21, w8, le
LBB0_12:
Lloh18:
	adrp	x8, _cx25840_debug@GOTPAGE
Lloh19:
	ldr	x8, [x8, _cx25840_debug@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
Lloh21:
	adrp	x3, l_.str.1@PAGE
Lloh22:
	add	x3, x3, l_.str.1@PAGEOFF
	mov	w0, #1
	mov	x2, x19
	mov	x6, x22
	mov	x7, x20
	bl	_v4l_dbg
	and	w2, w24, #0xff
	mov	x0, x19
	mov	w1, #1048
	bl	_cx25840_write
	ubfx	w2, w22, #8, #8
	mov	x0, x19
	mov	w1, #1049
	bl	_cx25840_write
	asr	w2, w22, #16
	mov	x0, x19
	mov	w1, #1050
	bl	_cx25840_write
	and	w2, w23, #0xff
	mov	x0, x19
	mov	w1, #1052
	bl	_cx25840_write
	lsr	w2, w20, #8
	mov	x0, x19
	mov	w1, #1053
	bl	_cx25840_write
	mov	x0, x19
	mov	w1, #1054
	mov	x2, x21
	bl	_cx25840_write
	mov	w0, #0
LBB0_13:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_STD_525_60,4,2            ; @V4L2_STD_525_60
	.comm	_V4L2_MBUS_FMT_FIXED,8,3        ; @V4L2_MBUS_FMT_FIXED
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_V4L2_FIELD_INTERLACED,4,2      ; @V4L2_FIELD_INTERLACED
	.comm	_V4L2_COLORSPACE_SMPTE170M,4,2  ; @V4L2_COLORSPACE_SMPTE170M
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%dx%d is not a valid size!\n"

	.comm	_ERANGE,4,2                     ; @ERANGE
	.comm	_cx25840_debug,4,2              ; @cx25840_debug
l_.str.1:                               ; @.str.1
	.asciz	"decoder set size %dx%d -> scale  %ux%u\n"

	.no_dead_strip	_cx25840_s_mbus_fmt
.subsections_via_symbols
