	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function saa6752hs_set_fmt
LCPI0_0:
	.long	4294966576                      ## 0xfffffd30
	.long	4294966816                      ## 0xfffffe20
	.space	4
	.space	4
LCPI0_1:
	.long	720                             ## 0x2d0
	.long	480                             ## 0x1e0
	.space	4
	.space	4
LCPI0_2:
	.long	4294966720                      ## 0xfffffdc0
	.long	4294967008                      ## 0xfffffee0
	.space	4
	.space	4
LCPI0_3:
	.long	576                             ## 0x240
	.long	288                             ## 0x120
	.space	4
	.space	4
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_saa6752hs_set_fmt:                     ## @saa6752hs_set_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdx, %rbx
	movq	%rsi, %r14
	callq	_to_state
	cmpq	$0, 8(%rbx)
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_20
LBB0_2:
	movq	_MEDIA_BUS_FMT_FIXED@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, 16(%rbx)
	movl	24(%rbx), %ecx
	movd	%ecx, %xmm0
	pshufd	$80, %xmm0, %xmm1               ## xmm1 = xmm0[0,0,1,1]
	movdqa	LCPI0_0(%rip), %xmm2            ## xmm2 = <4294966576,4294966816,u,u>
	paddd	%xmm1, %xmm2
	movdqa	LCPI0_1(%rip), %xmm3            ## xmm3 = <720,480,u,u>
	movdqa	%xmm3, %xmm0
	pcmpgtd	%xmm1, %xmm0
	psubd	%xmm1, %xmm3
	blendvps	%xmm0, %xmm3, %xmm2
	movd	%xmm2, %esi
	pextrd	$1, %xmm2, %edx
	cmpl	%edx, %esi
	jge	LBB0_4
## %bb.3:
	movabsq	$2473901163216, %rcx            ## imm = 0x240000002D0
	movq	%rcx, 24(%rbx)
	movl	$720, %edx                      ## imm = 0x2D0
	movb	$1, %cl
	jmp	LBB0_9
LBB0_4:
	leal	-352(%rcx), %esi
	leal	-352(%rcx), %edi
	negl	%edi
	cmpl	$352, %ecx                      ## imm = 0x160
	cmovgel	%esi, %edi
	cmpl	%edi, %edx
	jge	LBB0_6
## %bb.5:
	movabsq	$2473901162976, %rcx            ## imm = 0x240000001E0
	movq	%rcx, 24(%rbx)
	movl	$480, %edx                      ## imm = 0x1E0
	movb	$1, %cl
	jmp	LBB0_9
LBB0_6:
	movl	$352, 24(%rbx)                  ## imm = 0x160
	movd	28(%rbx), %xmm0                 ## xmm0 = mem[0],zero,zero,zero
	pshufd	$80, %xmm0, %xmm1               ## xmm1 = xmm0[0,0,1,1]
	movdqa	LCPI0_2(%rip), %xmm2            ## xmm2 = <4294966720,4294967008,u,u>
	paddd	%xmm1, %xmm2
	movdqa	LCPI0_3(%rip), %xmm3            ## xmm3 = <576,288,u,u>
	movdqa	%xmm3, %xmm0
	pcmpgtd	%xmm1, %xmm0
	psubd	%xmm1, %xmm3
	blendvps	%xmm0, %xmm3, %xmm2
	pshufd	$85, %xmm2, %xmm0               ## xmm0 = xmm2[1,1,1,1]
	pcmpgtd	%xmm2, %xmm0
	movd	%xmm0, %ecx
	testb	$1, %cl
	je	LBB0_8
## %bb.7:
	movl	$576, 28(%rbx)                  ## imm = 0x240
	movl	$352, %edx                      ## imm = 0x160
	movb	$1, %cl
	jmp	LBB0_9
LBB0_8:
	movl	$288, 28(%rbx)                  ## imm = 0x120
	movl	$352, %edx                      ## imm = 0x160
	xorl	%ecx, %ecx
LBB0_9:
	movq	_V4L2_FIELD_INTERLACED@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	movl	%esi, 36(%rbx)
	movq	_V4L2_COLORSPACE_SMPTE170M@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	movl	%esi, 32(%rbx)
	movq	(%rbx), %rsi
	movq	_V4L2_SUBDEV_FORMAT_TRY@GOTPCREL(%rip), %rdi
	cmpq	(%rdi), %rsi
	jne	LBB0_11
## %bb.10:
	addq	$16, %rbx
	movq	16(%rbx), %rax
	movq	%rax, 16(%r14)
	movdqu	(%rbx), %xmm0
	movdqu	%xmm0, (%r14)
	jmp	LBB0_19
LBB0_11:
	cmpl	$480, %edx                      ## imm = 0x1E0
	je	LBB0_14
## %bb.12:
	cmpl	$720, %edx                      ## imm = 0x2D0
	jne	LBB0_15
## %bb.13:
	movq	_SAA6752HS_VF_D1@GOTPCREL(%rip), %rcx
	jmp	LBB0_18
LBB0_14:
	movq	_SAA6752HS_VF_2_3_D1@GOTPCREL(%rip), %rcx
	jmp	LBB0_18
LBB0_15:
	testb	%cl, %cl
	je	LBB0_17
## %bb.16:
	movq	_SAA6752HS_VF_1_2_D1@GOTPCREL(%rip), %rcx
	jmp	LBB0_18
LBB0_17:
	movq	_SAA6752HS_VF_SIF@GOTPCREL(%rip), %rcx
LBB0_18:
	movl	(%rcx), %ecx
	movl	%ecx, (%rax)
LBB0_19:
	xorl	%eax, %eax
LBB0_20:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MEDIA_BUS_FMT_FIXED,8,3        ## @MEDIA_BUS_FMT_FIXED
	.comm	_V4L2_FIELD_INTERLACED,4,2      ## @V4L2_FIELD_INTERLACED
	.comm	_V4L2_COLORSPACE_SMPTE170M,4,2  ## @V4L2_COLORSPACE_SMPTE170M
	.comm	_V4L2_SUBDEV_FORMAT_TRY,8,3     ## @V4L2_SUBDEV_FORMAT_TRY
	.comm	_SAA6752HS_VF_D1,4,2            ## @SAA6752HS_VF_D1
	.comm	_SAA6752HS_VF_2_3_D1,4,2        ## @SAA6752HS_VF_2_3_D1
	.comm	_SAA6752HS_VF_1_2_D1,4,2        ## @SAA6752HS_VF_1_2_D1
	.comm	_SAA6752HS_VF_SIF,4,2           ## @SAA6752HS_VF_SIF
	.no_dead_strip	_saa6752hs_set_fmt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function saa6752hs_set_fmt
lCPI0_0:
	.long	480                             ; 0x1e0
	.long	576                             ; 0x240
lCPI0_1:
	.long	720                             ; 0x2d0
	.long	576                             ; 0x240
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_saa6752hs_set_fmt:                     ; @saa6752hs_set_fmt
	.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	x20, x2
	mov	x19, x1
	bl	_to_state
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w8, w8
	b	LBB0_19
LBB0_2:
Lloh3:
	adrp	x8, _MEDIA_BUS_FMT_FIXED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MEDIA_BUS_FMT_FIXED@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	str	x8, [x20, #16]
	ldr	w8, [x20, #24]
	mov	w9, #480
	sub	w9, w9, w8
	subs	w10, w8, #480
	csel	w9, w9, w10, lt
	mov	w10, #720
	sub	w10, w10, w8
	subs	w11, w8, #720
	csel	w10, w10, w11, lt
	cmp	w10, w9
	b.ge	LBB0_4
; %bb.3:
Lloh6:
	adrp	x8, lCPI0_1@PAGE
Lloh7:
	ldr	d0, [x8, lCPI0_1@PAGEOFF]
	str	d0, [x20, #24]
	mov	w8, #720
	mov	w9, #1
	b	LBB0_9
LBB0_4:
	mov	w10, #352
	sub	w11, w10, w8
	subs	w8, w8, #352
	csel	w8, w11, w8, lt
	cmp	w9, w8
	b.ge	LBB0_6
; %bb.5:
Lloh8:
	adrp	x8, lCPI0_0@PAGE
Lloh9:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x20, #24]
	mov	w8, #480
	mov	w9, #1
	b	LBB0_9
LBB0_6:
	str	w10, [x20, #24]
	ldr	w9, [x20, #28]
	mov	w8, #576
	sub	w10, w8, w9
	subs	w11, w9, #576
	csel	w11, w10, w11, lt
	mov	w10, #288
	sub	w12, w10, w9
	subs	w9, w9, #288
	csel	w9, w12, w9, lt
	cmp	w11, w9
	b.ge	LBB0_8
; %bb.7:
	str	w8, [x20, #28]
	mov	w8, #352
	mov	w9, #1
	b	LBB0_9
LBB0_8:
	mov	w9, #0
	str	w10, [x20, #28]
	mov	w8, #352
LBB0_9:
Lloh10:
	adrp	x10, _V4L2_FIELD_INTERLACED@GOTPAGE
Lloh11:
	ldr	x10, [x10, _V4L2_FIELD_INTERLACED@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x10]
Lloh13:
	adrp	x11, _V4L2_COLORSPACE_SMPTE170M@GOTPAGE
Lloh14:
	ldr	x11, [x11, _V4L2_COLORSPACE_SMPTE170M@GOTPAGEOFF]
Lloh15:
	ldr	w11, [x11]
	stp	w11, w10, [x20, #32]
	ldr	x10, [x20]
Lloh16:
	adrp	x11, _V4L2_SUBDEV_FORMAT_TRY@GOTPAGE
Lloh17:
	ldr	x11, [x11, _V4L2_SUBDEV_FORMAT_TRY@GOTPAGEOFF]
Lloh18:
	ldr	x11, [x11]
	cmp	x10, x11
	b.ne	LBB0_11
; %bb.10:
	mov	w8, #0
	add	x9, x20, #16
	ldr	q0, [x9]
	ldr	x9, [x9, #16]
	str	x9, [x19, #16]
	str	q0, [x19]
	b	LBB0_19
LBB0_11:
	cmp	w8, #480
	b.eq	LBB0_14
; %bb.12:
	cmp	w8, #720
	b.ne	LBB0_15
; %bb.13:
	mov	w8, #0
Lloh19:
	adrp	x9, _SAA6752HS_VF_D1@GOTPAGE
Lloh20:
	ldr	x9, [x9, _SAA6752HS_VF_D1@GOTPAGEOFF]
	b	LBB0_18
LBB0_14:
	mov	w8, #0
Lloh21:
	adrp	x9, _SAA6752HS_VF_2_3_D1@GOTPAGE
Lloh22:
	ldr	x9, [x9, _SAA6752HS_VF_2_3_D1@GOTPAGEOFF]
	b	LBB0_18
LBB0_15:
	mov	w8, #0
	cbz	w9, LBB0_17
; %bb.16:
Lloh23:
	adrp	x9, _SAA6752HS_VF_1_2_D1@GOTPAGE
Lloh24:
	ldr	x9, [x9, _SAA6752HS_VF_1_2_D1@GOTPAGEOFF]
	b	LBB0_18
LBB0_17:
Lloh25:
	adrp	x9, _SAA6752HS_VF_SIF@GOTPAGE
Lloh26:
	ldr	x9, [x9, _SAA6752HS_VF_SIF@GOTPAGEOFF]
LBB0_18:
	ldr	w9, [x9]
	str	w9, [x0]
LBB0_19:
	mov	x0, x8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdr	Lloh6, Lloh7
	.loh AdrpLdr	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MEDIA_BUS_FMT_FIXED,8,3        ; @MEDIA_BUS_FMT_FIXED
	.comm	_V4L2_FIELD_INTERLACED,4,2      ; @V4L2_FIELD_INTERLACED
	.comm	_V4L2_COLORSPACE_SMPTE170M,4,2  ; @V4L2_COLORSPACE_SMPTE170M
	.comm	_V4L2_SUBDEV_FORMAT_TRY,8,3     ; @V4L2_SUBDEV_FORMAT_TRY
	.comm	_SAA6752HS_VF_D1,4,2            ; @SAA6752HS_VF_D1
	.comm	_SAA6752HS_VF_2_3_D1,4,2        ; @SAA6752HS_VF_2_3_D1
	.comm	_SAA6752HS_VF_1_2_D1,4,2        ; @SAA6752HS_VF_1_2_D1
	.comm	_SAA6752HS_VF_SIF,4,2           ; @SAA6752HS_VF_SIF
	.no_dead_strip	_saa6752hs_set_fmt
.subsections_via_symbols
