	.file	"extr_cx18-av-core.c_cx18_av_s_mbus_fmt.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%dx%d is not a valid size!\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"decoder set size %dx%d -> scale  %ux%u\n"
	.text
	.p2align 4
	.type	cx18_av_s_mbus_fmt, @function
cx18_av_s_mbus_fmt:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	call	to_cx18_av_state@PLT
	mov	rdi, rbp
	mov	rbx, rax
	call	v4l2_get_subdevdata@PLT
	mov	r15, rax
	mov	rax, QWORD PTR V4L2_MBUS_FMT_FIXED[rip]
	cmp	QWORD PTR 0[r13], rax
	je	.L2
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	eax, DWORD PTR V4L2_FIELD_INTERLACED[rip]
	mov	r14d, DWORD PTR [rbx]
	mov	esi, 1142
	mov	rdi, r15
	mov	ebx, DWORD PTR V4L2_STD_525_60[rip]
	mov	DWORD PTR 20[r13], eax
	mov	eax, DWORD PTR V4L2_COLORSPACE_SMPTE170M[rip]
	and	r14d, ebx
	mov	DWORD PTR 16[r13], eax
	call	cx18_av_read@PLT
	mov	esi, 1141
	mov	rdi, r15
	mov	DWORD PTR 8[rsp], eax
	call	cx18_av_read@PLT
	mov	esi, 1138
	mov	rdi, r15
	mov	DWORD PTR 12[rsp], eax
	call	cx18_av_read@PLT
	mov	esi, 1137
	mov	rdi, r15
	mov	r12d, eax
	call	cx18_av_read@PLT
	sal	r12d, 4
	mov	r11d, DWORD PTR 8[r13]
	sar	eax, 4
	and	r12d, 1008
	and	eax, 15
	or	r12d, eax
	cmp	r14d, 1
	mov	r14d, DWORD PTR 12[r13]
	sbb	esi, esi
	mov	ecx, r14d
	and	esi, 2
	sal	ecx, 4
	add	esi, 1
	cmp	ecx, r12d
	jl	.L5
	cmp	r14d, r12d
	jg	.L5
	mov	r13d, DWORD PTR 8[rsp]
	add	esi, r11d
	lea	eax, 0[0+rsi*8]
	sal	r13d, 4
	mov	ecx, r13d
	mov	r13d, DWORD PTR 12[rsp]
	and	ecx, 1008
	sar	r13d, 4
	and	r13d, 15
	or	r13d, ecx
	cmp	eax, r13d
	jl	.L5
	cmp	r13d, esi
	jl	.L5
	sal	r12d, 20
	sal	r13d, 9
	mov	eax, r12d
	mov	r12d, 8
	cdq
	idiv	r14d
	lea	ebx, -1048576[rax]
	mov	eax, r13d
	cdq
	idiv	esi
	mov	r13d, eax
	mov	eax, 66048
	sub	eax, r13d
	and	eax, 8191
	mov	r9d, eax
	cmp	r14d, 384
	jg	.L8
	mov	r12d, 9
	cmp	r14d, 192
	jg	.L8
	xor	r12d, r12d
	cmp	r14d, 97
	setl	r12b
	add	r12d, 10
.L8:
	mov	r8d, ebx
	mov	ecx, r11d
	mov	edx, r14d
	mov	rdi, rbp
	lea	rsi, .LC1[rip]
	mov	DWORD PTR 8[rsp], r9d
	neg	r13d
	call	CX18_DEBUG_INFO_DEV@PLT
	movzx	edx, bl
	mov	esi, 1048
	mov	rdi, r15
	call	cx18_av_write@PLT
	movzx	edx, bh
	mov	esi, 1049
	mov	rdi, r15
	call	cx18_av_write@PLT
	mov	edx, ebx
	mov	esi, 1050
	mov	rdi, r15
	sar	edx, 16
	call	cx18_av_write@PLT
	movzx	edx, r13b
	mov	esi, 1052
	mov	rdi, r15
	call	cx18_av_write@PLT
	mov	r9d, DWORD PTR 8[rsp]
	mov	esi, 1053
	mov	rdi, r15
	mov	edx, r9d
	sar	edx, 8
	call	cx18_av_write@PLT
	mov	edx, r12d
	mov	esi, 1054
	mov	rdi, r15
	call	cx18_av_write@PLT
	xor	eax, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L5:
	mov	edx, r14d
	mov	rdi, rbp
	lea	rsi, .LC0[rip]
	mov	ecx, r11d
	call	CX18_ERR_DEV@PLT
	mov	eax, DWORD PTR ERANGE[rip]
	add	rsp, 24
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	neg	eax
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	cx18_av_s_mbus_fmt, .-cx18_av_s_mbus_fmt
	.comm	V4L2_STD_525_60,4,4
	.comm	V4L2_MBUS_FMT_FIXED,8,8
	.comm	V4L2_FIELD_INTERLACED,4,4
	.comm	V4L2_COLORSPACE_SMPTE170M,4,4
	.comm	ERANGE,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_cx18-av-core.c_cx18_av_s_mbus_fmt.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"%dx%d is not a valid size!\012\000"
	.global	__aeabi_idiv
	.align	2
.LC1:
	.ascii	"decoder set size %dx%d -> scale  %ux%u\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	cx18_av_s_mbus_fmt, %function
cx18_av_s_mbus_fmt:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #20
	mov	r4, r1
	mov	r6, r0
	bl	to_cx18_av_state
	mov	r7, r0
	mov	r0, r6
	bl	v4l2_get_subdevdata
	ldr	r3, .L14
	ldr	r2, [r4]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L2
	ldr	r3, .L14+4
	ldr	r0, [r3]
	rsb	r0, r0, #0
.L1:
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	ldr	r2, .L14+8
	ldr	r3, .L14+12
	ldr	lr, [r2]
	ldr	ip, [r3]
	ldr	r2, .L14+16
	ldr	r3, [r7]
	ldr	r1, .L14+20
	str	lr, [r4, #16]
	str	ip, [r4, #12]
	ldr	fp, [r2]
	str	r3, [sp, #12]
	mov	r5, r0
	bl	cx18_av_read
	ldr	r1, .L14+24
	mov	r7, r0
	mov	r0, r5
	bl	cx18_av_read
	ldr	r1, .L14+28
	mov	r9, r0
	mov	r0, r5
	bl	cx18_av_read
	ldr	r1, .L14+32
	lsl	ip, r0, #4
	mov	r0, r5
	and	r10, ip, #1008
	bl	cx18_av_read
	ldr	r3, [sp, #12]
	ldr	r8, [r4, #8]
	lsl	ip, r0, #24
	tst	r3, fp
	orr	ip, r10, ip, lsr #28
	moveq	r2, #3
	movne	r2, #1
	cmp	ip, r8, lsl #4
	movgt	r3, #1
	movle	r3, #0
	cmp	r8, ip
	orrgt	r3, r3, #1
	cmp	r3, #0
	ldr	r10, [r4, #4]
	bne	.L5
	lsl	r4, r7, #4
	and	r4, r4, #1008
	add	r7, r10, r2
	lsl	r9, r9, #24
	orr	r4, r4, r9, lsr #28
	lsl	r3, r7, #3
	cmp	r3, r4
	cmpge	r4, r7
	blt	.L5
	mov	r1, r8
	lsl	r0, ip, #20
	bl	__aeabi_idiv
	mov	r1, r7
	mov	fp, r0
	lsl	r0, r4, #9
	bl	__aeabi_idiv
	rsb	r4, r0, #65536
	add	r4, r4, #512
	cmp	r8, #384
	lsl	r4, r4, #19
	mov	r7, r0
	movgt	r9, #8
	sub	fp, fp, #1048576
	lsr	r4, r4, #19
	bgt	.L7
	cmp	r8, #192
	movgt	r9, #9
	bgt	.L7
	cmp	r8, #96
	movgt	r9, #10
	movle	r9, #11
.L7:
	mov	r3, r10
	mov	r2, r8
	ldr	r1, .L14+36
	mov	r0, r6
	str	r4, [sp, #4]
	str	fp, [sp]
	bl	CX18_DEBUG_INFO_DEV
	ldr	r1, .L14+40
	and	r2, fp, #255
	mov	r0, r5
	bl	cx18_av_write
	asr	r2, fp, #8
	ldr	r1, .L14+44
	and	r2, r2, #255
	mov	r0, r5
	bl	cx18_av_write
	ldr	r1, .L14+48
	asr	r2, fp, #16
	mov	r0, r5
	bl	cx18_av_write
	rsb	r2, r7, #0
	ldr	r1, .L14+52
	and	r2, r2, #255
	mov	r0, r5
	bl	cx18_av_write
	ldr	r1, .L14+56
	lsr	r2, r4, #8
	mov	r0, r5
	bl	cx18_av_write
	mov	r2, r9
	mov	r0, r5
	ldr	r1, .L14+60
	bl	cx18_av_write
	mov	r0, #0
	b	.L1
.L5:
	mov	r3, r10
	mov	r2, r8
	mov	r0, r6
	ldr	r1, .L14+64
	bl	CX18_ERR_DEV
	ldr	r3, .L14+68
	ldr	r0, [r3]
	rsb	r0, r0, #0
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L15:
	.align	2
.L14:
	.word	V4L2_MBUS_FMT_FIXED
	.word	EINVAL
	.word	V4L2_FIELD_INTERLACED
	.word	V4L2_COLORSPACE_SMPTE170M
	.word	V4L2_STD_525_60
	.word	1142
	.word	1141
	.word	1138
	.word	1137
	.word	.LC1
	.word	1048
	.word	1049
	.word	1050
	.word	1052
	.word	1053
	.word	1054
	.word	.LC0
	.word	ERANGE
	.size	cx18_av_s_mbus_fmt, .-cx18_av_s_mbus_fmt
	.comm	V4L2_STD_525_60,4,4
	.comm	V4L2_MBUS_FMT_FIXED,4,4
	.comm	V4L2_FIELD_INTERLACED,4,4
	.comm	V4L2_COLORSPACE_SMPTE170M,4,4
	.comm	ERANGE,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
