	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function saa717x_set_fmt
_saa717x_set_fmt:                       ## @saa717x_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	%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, %r15
	movq	%rdi, %r14
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rcx
	movl	$1, %edi
	movq	%r14, %rdx
	callq	_v4l2_dbg
	cmpq	$0, 8(%r15)
	jne	LBB0_2
## %bb.1:
	movq	16(%r15), %rax
	movq	_MEDIA_BUS_FMT_FIXED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.3:
	movl	24(%r15), %edi
	leal	-1441(%rdi), %eax
	cmpl	$-1441, %eax                    ## imm = 0xFA5F
	jbe	LBB0_2
## %bb.4:
	movl	28(%r15), %esi
	leal	-961(%rsi), %eax
	cmpl	$-961, %eax                     ## imm = 0xFC3F
	ja	LBB0_5
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_V4L2_FIELD_INTERLACED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%r15)
	movq	_V4L2_COLORSPACE_SMPTE170M@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r15)
	movq	(%r15), %rax
	movq	_V4L2_SUBDEV_FORMAT_TRY@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.6:
	movq	_SAA717X_NTSC_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, %eax
	cltd
	idivl	%edi
	movl	%eax, %r13d
	testl	%eax, %eax
	movl	$1, %eax
	cmovel	%eax, %r13d
	shll	$10, %ecx
	movl	%ecx, %eax
	cltd
	idivl	%r13d
	cltd
	idivl	%edi
	movl	%eax, %r12d
	movq	_SAA717X_NTSC_HEIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shll	$10, %eax
	cltd
	idivl	%esi
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	%r13d, %edx
	callq	_set_h_prescale
	movq	%r14, %rdi
	movl	$1, %esi
	movl	%r13d, %edx
	callq	_set_h_prescale
	movzbl	%r12b, %r13d
	movq	%r14, %rdi
	movl	$108, %esi
	movl	%r13d, %edx
	callq	_saa717x_write
	movl	%r12d, %eax
	movzbl	%ah, %edx
	movq	%r14, %rdi
	movl	$109, %esi
	movl	%edx, %r12d
	callq	_saa717x_write
	movq	%r14, %rdi
	movl	$172, %esi
	movl	%r13d, %edx
	callq	_saa717x_write
	movq	%r14, %rdi
	movl	$173, %esi
	movl	%r12d, %edx
	callq	_saa717x_write
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %edx
	callq	_set_v_scale
	movq	%r14, %rdi
	movl	$1, %esi
	movl	%r12d, %edx
	callq	_set_v_scale
	movzbl	24(%r15), %edx
	movq	%r14, %rdi
	movl	$92, %esi
	callq	_saa717x_write
	movzbl	25(%r15), %edx
	movq	%r14, %rdi
	movl	$93, %esi
	callq	_saa717x_write
	movzbl	24(%r15), %edx
	movq	%r14, %rdi
	movl	$156, %esi
	callq	_saa717x_write
	movzbl	25(%r15), %edx
	movq	%r14, %rdi
	movl	$157, %esi
	callq	_saa717x_write
	movzbl	28(%r15), %edx
	movq	%r14, %rdi
	movl	$94, %esi
	callq	_saa717x_write
	movzbl	29(%r15), %edx
	movq	%r14, %rdi
	movl	$95, %esi
	callq	_saa717x_write
	movzbl	28(%r15), %edx
	movq	%r14, %rdi
	movl	$158, %esi
	callq	_saa717x_write
	movzbl	29(%r15), %edx
	movq	%r14, %rdi
	movl	$159, %esi
	callq	_saa717x_write
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"decoder set size\n"

	.comm	_MEDIA_BUS_FMT_FIXED,8,3        ## @MEDIA_BUS_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
	.comm	_V4L2_SUBDEV_FORMAT_TRY,8,3     ## @V4L2_SUBDEV_FORMAT_TRY
	.comm	_SAA717X_NTSC_WIDTH,4,2         ## @SAA717X_NTSC_WIDTH
	.comm	_SAA717X_NTSC_HEIGHT,4,2        ## @SAA717X_NTSC_HEIGHT
	.no_dead_strip	_saa717x_set_fmt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function saa717x_set_fmt
_saa717x_set_fmt:                       ; @saa717x_set_fmt
	.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	x20, x2
	mov	x19, x0
Lloh0:
	adrp	x8, _debug@GOTPAGE
Lloh1:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x3, l_.str@PAGE
Lloh4:
	add	x3, x3, l_.str@PAGEOFF
	mov	w0, #1
	mov	x2, x19
	bl	_v4l2_dbg
	ldr	x8, [x20, #8]
	cbnz	x8, LBB0_4
; %bb.1:
	ldr	x8, [x20, #16]
Lloh5:
	adrp	x9, _MEDIA_BUS_FMT_FIXED@GOTPAGE
Lloh6:
	ldr	x9, [x9, _MEDIA_BUS_FMT_FIXED@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
	ldr	w8, [x20, #24]
	sub	w9, w8, #1441
	cmn	w9, #1441
	b.ls	LBB0_4
; %bb.3:
	ldr	w9, [x20, #28]
	sub	w10, w9, #961
	cmn	w10, #961
	b.hi	LBB0_6
LBB0_4:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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
LBB0_6:
Lloh11:
	adrp	x10, _V4L2_FIELD_INTERLACED@GOTPAGE
Lloh12:
	ldr	x10, [x10, _V4L2_FIELD_INTERLACED@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
Lloh14:
	adrp	x11, _V4L2_COLORSPACE_SMPTE170M@GOTPAGE
Lloh15:
	ldr	x11, [x11, _V4L2_COLORSPACE_SMPTE170M@GOTPAGEOFF]
Lloh16:
	ldr	w11, [x11]
	stp	w11, w10, [x20, #32]
	ldr	x10, [x20]
Lloh17:
	adrp	x11, _V4L2_SUBDEV_FORMAT_TRY@GOTPAGE
Lloh18:
	ldr	x11, [x11, _V4L2_SUBDEV_FORMAT_TRY@GOTPAGEOFF]
Lloh19:
	ldr	x11, [x11]
	cmp	x10, x11
	b.eq	LBB0_8
; %bb.7:
Lloh20:
	adrp	x10, _SAA717X_NTSC_WIDTH@GOTPAGE
Lloh21:
	ldr	x10, [x10, _SAA717X_NTSC_WIDTH@GOTPAGEOFF]
Lloh22:
	ldr	w10, [x10]
	sdiv	w11, w10, w8
	cmp	w11, #0
	csinc	w21, w11, wzr, ne
	lsl	w10, w10, #10
	sdiv	w10, w10, w21
	sdiv	w23, w10, w8
Lloh23:
	adrp	x8, _SAA717X_NTSC_HEIGHT@GOTPAGE
Lloh24:
	ldr	x8, [x8, _SAA717X_NTSC_HEIGHT@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	lsl	w8, w8, #10
	sdiv	w22, w8, w9
	mov	x0, x19
	mov	w1, #0
	mov	x2, x21
	bl	_set_h_prescale
	mov	x0, x19
	mov	w1, #1
	mov	x2, x21
	bl	_set_h_prescale
	and	w21, w23, #0xff
	mov	x0, x19
	mov	w1, #108
	mov	x2, x21
	bl	_saa717x_write
	ubfx	w23, w23, #8, #8
	mov	x0, x19
	mov	w1, #109
	mov	x2, x23
	bl	_saa717x_write
	mov	x0, x19
	mov	w1, #172
	mov	x2, x21
	bl	_saa717x_write
	mov	x0, x19
	mov	w1, #173
	mov	x2, x23
	bl	_saa717x_write
	mov	x0, x19
	mov	w1, #0
	mov	x2, x22
	bl	_set_v_scale
	mov	x0, x19
	mov	w1, #1
	mov	x2, x22
	bl	_set_v_scale
	ldrb	w2, [x20, #24]
	mov	x0, x19
	mov	w1, #92
	bl	_saa717x_write
	ldrb	w2, [x20, #25]
	mov	x0, x19
	mov	w1, #93
	bl	_saa717x_write
	ldrb	w2, [x20, #24]
	mov	x0, x19
	mov	w1, #156
	bl	_saa717x_write
	ldrb	w2, [x20, #25]
	mov	x0, x19
	mov	w1, #157
	bl	_saa717x_write
	ldrb	w2, [x20, #28]
	mov	x0, x19
	mov	w1, #94
	bl	_saa717x_write
	ldrb	w2, [x20, #29]
	mov	x0, x19
	mov	w1, #95
	bl	_saa717x_write
	ldrb	w2, [x20, #28]
	mov	x0, x19
	mov	w1, #158
	bl	_saa717x_write
	ldrb	w2, [x20, #29]
	mov	x0, x19
	mov	w1, #159
	bl	_saa717x_write
LBB0_8:
	mov	w0, #0
	b	LBB0_5
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"decoder set size\n"

	.comm	_MEDIA_BUS_FMT_FIXED,8,3        ; @MEDIA_BUS_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
	.comm	_V4L2_SUBDEV_FORMAT_TRY,8,3     ; @V4L2_SUBDEV_FORMAT_TRY
	.comm	_SAA717X_NTSC_WIDTH,4,2         ; @SAA717X_NTSC_WIDTH
	.comm	_SAA717X_NTSC_HEIGHT,4,2        ; @SAA717X_NTSC_HEIGHT
	.no_dead_strip	_saa717x_set_fmt
.subsections_via_symbols
