	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function saa711x_set_v4lstd
_saa711x_set_v4lstd:                    ## @saa711x_set_v4lstd
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	callq	_to_state
	cmpq	%r14, (%rax)
	jne	LBB0_1
## %bb.25:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rax, %rbx
	movq	%r14, (%rax)
	movq	_V4L2_STD_525_60@GOTPCREL(%rip), %rax
	movq	_debug@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	testq	%r14, (%rax)
	je	LBB0_5
## %bb.2:
	leaq	L_.str(%rip), %rcx
	movl	$1, %edi
	movq	%r15, %rdx
	callq	_v4l2_dbg
	movq	8(%rbx), %rax
	movq	_GM7113C@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	movq	_R_08_SYNC_CNTL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_saa711x_read
	movq	_SAA7113_R_08_FSEL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_SAA7113_R_08_AUFD@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	%ecx, %edx
	notl	%edx
	andl	%eax, %edx
	orl	%ecx, %edx
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_saa711x_write
	movl	$480, %edx                      ## imm = 0x1E0
	jmp	LBB0_9
LBB0_5:
	leaq	L_.str.1(%rip), %rcx
	movl	$1, %edi
	movq	%r15, %rdx
	callq	_v4l2_dbg
	movq	8(%rbx), %rax
	movq	_GM7113C@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.6:
	movq	_R_08_SYNC_CNTL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_saa711x_read
	movq	_SAA7113_R_08_FSEL@GOTPCREL(%rip), %rcx
	movq	_SAA7113_R_08_AUFD@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_saa711x_write
	jmp	LBB0_8
LBB0_4:
	movq	_saa7115_cfg_60hz_video@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_saa711x_writeregs
	movl	$480, %edx                      ## imm = 0x1E0
	jmp	LBB0_9
LBB0_7:
	movq	_saa7115_cfg_50hz_video@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_saa711x_writeregs
LBB0_8:
	movl	$576, %edx                      ## imm = 0x240
LBB0_9:
	movq	%r15, %rdi
	movl	$720, %esi                      ## imm = 0x2D0
	callq	_saa711x_set_size
	movq	8(%rbx), %rax
	movq	_SAA7113@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jle	LBB0_11
## %bb.10:
	movq	_GM7113C@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_11
## %bb.21:
	movq	_R_80_GLOBAL_CNTL_1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_saa711x_read
	testb	$16, %al
	je	LBB0_24
## %bb.22:
	movq	8(%rbx), %rax
	movq	_SAA7114@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_24
## %bb.23:
	movq	_saa7115_cfg_vbi_on@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_saa711x_writeregs
LBB0_24:
	movl	16(%rbx), %esi
	movq	%r15, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_saa711x_s_clock_freq           ## TAILCALL
LBB0_11:
	movq	_R_0E_CHROMA_CNTL_1@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_saa711x_read
	andl	$143, %eax
	movq	_V4L2_STD_PAL_M@GOTPCREL(%rip), %rcx
	cmpq	%r14, (%rcx)
	jne	LBB0_13
## %bb.12:
	orl	$48, %eax
	jmp	LBB0_20
LBB0_13:
	movq	_V4L2_STD_PAL_Nc@GOTPCREL(%rip), %rcx
	cmpq	%r14, (%rcx)
	jne	LBB0_15
## %bb.14:
	orl	$32, %eax
	jmp	LBB0_20
LBB0_15:
	movq	_V4L2_STD_PAL_60@GOTPCREL(%rip), %rcx
	cmpq	%r14, (%rcx)
	jne	LBB0_17
## %bb.16:
	orl	$16, %eax
	jmp	LBB0_20
LBB0_17:
	movq	_V4L2_STD_NTSC_M_JP@GOTPCREL(%rip), %rcx
	cmpq	%r14, (%rcx)
	jne	LBB0_19
## %bb.18:
	orl	$64, %eax
	jmp	LBB0_20
LBB0_19:
	movq	_V4L2_STD_SECAM@GOTPCREL(%rip), %rcx
	movl	%eax, %edx
	orl	$80, %edx
	testq	%r14, (%rcx)
	cmovnel	%edx, %eax
LBB0_20:
	movl	(%rbx), %esi
	movq	%r15, %rdi
	movl	%eax, %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_saa711x_write                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_STD_525_60,8,3            ## @V4L2_STD_525_60
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"decoder set standard 60 Hz\n"

	.comm	_GM7113C,8,3                    ## @GM7113C
	.comm	_R_08_SYNC_CNTL,4,2             ## @R_08_SYNC_CNTL
	.comm	_SAA7113_R_08_FSEL,4,2          ## @SAA7113_R_08_FSEL
	.comm	_SAA7113_R_08_AUFD,4,2          ## @SAA7113_R_08_AUFD
	.comm	_saa7115_cfg_60hz_video,4,2     ## @saa7115_cfg_60hz_video
L_.str.1:                               ## @.str.1
	.asciz	"decoder set standard 50 Hz\n"

	.comm	_saa7115_cfg_50hz_video,4,2     ## @saa7115_cfg_50hz_video
	.comm	_SAA7113,8,3                    ## @SAA7113
	.comm	_R_0E_CHROMA_CNTL_1,4,2         ## @R_0E_CHROMA_CNTL_1
	.comm	_V4L2_STD_PAL_M,8,3             ## @V4L2_STD_PAL_M
	.comm	_V4L2_STD_PAL_Nc,8,3            ## @V4L2_STD_PAL_Nc
	.comm	_V4L2_STD_PAL_60,8,3            ## @V4L2_STD_PAL_60
	.comm	_V4L2_STD_NTSC_M_JP,8,3         ## @V4L2_STD_NTSC_M_JP
	.comm	_V4L2_STD_SECAM,8,3             ## @V4L2_STD_SECAM
	.comm	_R_80_GLOBAL_CNTL_1,4,2         ## @R_80_GLOBAL_CNTL_1
	.comm	_SAA7114,8,3                    ## @SAA7114
	.comm	_saa7115_cfg_vbi_on,4,2         ## @saa7115_cfg_vbi_on
	.no_dead_strip	_saa711x_set_v4lstd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function saa711x_set_v4lstd
_saa711x_set_v4lstd:                    ; @saa711x_set_v4lstd
	.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, x1
	mov	x19, x0
	bl	_to_state
	ldr	x8, [x0]
	cmp	x8, x20
	b.ne	LBB0_2
; %bb.1:
	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_2:
	mov	x21, x0
	str	x20, [x0]
Lloh0:
	adrp	x8, _V4L2_STD_525_60@GOTPAGE
Lloh1:
	ldr	x8, [x8, _V4L2_STD_525_60@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _debug@GOTPAGE
Lloh4:
	ldr	x9, [x9, _debug@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x9]
Lloh6:
	adrp	x22, _GM7113C@GOTPAGE
Lloh7:
	ldr	x22, [x22, _GM7113C@GOTPAGEOFF]
	tst	x8, x20
	b.eq	LBB0_5
; %bb.3:
Lloh8:
	adrp	x3, l_.str@PAGE
Lloh9:
	add	x3, x3, l_.str@PAGEOFF
	mov	w0, #1
	mov	x2, x19
	bl	_v4l2_dbg
	ldr	x8, [x21, #8]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.4:
Lloh10:
	adrp	x23, _R_08_SYNC_CNTL@GOTPAGE
Lloh11:
	ldr	x23, [x23, _R_08_SYNC_CNTL@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_saa711x_read
Lloh12:
	adrp	x8, _SAA7113_R_08_FSEL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SAA7113_R_08_FSEL@GOTPAGEOFF]
Lloh14:
	adrp	x9, _SAA7113_R_08_AUFD@GOTPAGE
Lloh15:
	ldr	x9, [x9, _SAA7113_R_08_AUFD@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	ldr	w9, [x9]
	orr	w9, w9, w8
	bic	w9, w0, w9
	orr	w2, w9, w8
	ldr	w1, [x23]
	mov	x0, x19
	bl	_saa711x_write
	mov	w2, #480
	b	LBB0_10
LBB0_5:
Lloh18:
	adrp	x3, l_.str.1@PAGE
Lloh19:
	add	x3, x3, l_.str.1@PAGEOFF
	mov	w0, #1
	mov	x2, x19
	bl	_v4l2_dbg
	ldr	x8, [x21, #8]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.6:
Lloh20:
	adrp	x23, _R_08_SYNC_CNTL@GOTPAGE
Lloh21:
	ldr	x23, [x23, _R_08_SYNC_CNTL@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_saa711x_read
Lloh22:
	adrp	x8, _SAA7113_R_08_FSEL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SAA7113_R_08_FSEL@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
Lloh25:
	adrp	x9, _SAA7113_R_08_AUFD@GOTPAGE
Lloh26:
	ldr	x9, [x9, _SAA7113_R_08_AUFD@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bic	w2, w0, w8
	ldr	w1, [x23]
	mov	x0, x19
	bl	_saa711x_write
	b	LBB0_9
LBB0_7:
Lloh28:
	adrp	x8, _saa7115_cfg_60hz_video@GOTPAGE
Lloh29:
	ldr	x8, [x8, _saa7115_cfg_60hz_video@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_saa711x_writeregs
	mov	w2, #480
	b	LBB0_10
LBB0_8:
Lloh31:
	adrp	x8, _saa7115_cfg_50hz_video@GOTPAGE
Lloh32:
	ldr	x8, [x8, _saa7115_cfg_50hz_video@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_saa711x_writeregs
LBB0_9:
	mov	w2, #576
LBB0_10:
	mov	x0, x19
	mov	w1, #720
	bl	_saa711x_set_size
	ldr	x8, [x21, #8]
Lloh34:
	adrp	x9, _SAA7113@GOTPAGE
Lloh35:
	ldr	x9, [x9, _SAA7113@GOTPAGEOFF]
Lloh36:
	ldr	x9, [x9]
	ldr	x10, [x22]
	cmp	x8, x9
	ccmp	x8, x10, #4, gt
	b.ne	LBB0_13
; %bb.11:
Lloh37:
	adrp	x21, _R_0E_CHROMA_CNTL_1@GOTPAGE
Lloh38:
	ldr	x21, [x21, _R_0E_CHROMA_CNTL_1@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_saa711x_read
	mov	w8, #143
	and	w8, w0, w8
Lloh39:
	adrp	x9, _V4L2_STD_PAL_M@GOTPAGE
Lloh40:
	ldr	x9, [x9, _V4L2_STD_PAL_M@GOTPAGEOFF]
Lloh41:
	ldr	x9, [x9]
	cmp	x9, x20
	b.ne	LBB0_17
; %bb.12:
	orr	w2, w8, #0x30
	b	LBB0_24
LBB0_13:
Lloh42:
	adrp	x8, _R_80_GLOBAL_CNTL_1@GOTPAGE
Lloh43:
	ldr	x8, [x8, _R_80_GLOBAL_CNTL_1@GOTPAGEOFF]
Lloh44:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_saa711x_read
	tbz	w0, #4, LBB0_16
; %bb.14:
	ldr	x8, [x21, #8]
Lloh45:
	adrp	x9, _SAA7114@GOTPAGE
Lloh46:
	ldr	x9, [x9, _SAA7114@GOTPAGEOFF]
Lloh47:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_16
; %bb.15:
Lloh48:
	adrp	x8, _saa7115_cfg_vbi_on@GOTPAGE
Lloh49:
	ldr	x8, [x8, _saa7115_cfg_vbi_on@GOTPAGEOFF]
Lloh50:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_saa711x_writeregs
LBB0_16:
	ldr	w1, [x21, #16]
	mov	x0, x19
	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
	b	_saa711x_s_clock_freq
LBB0_17:
Lloh51:
	adrp	x9, _V4L2_STD_PAL_Nc@GOTPAGE
Lloh52:
	ldr	x9, [x9, _V4L2_STD_PAL_Nc@GOTPAGEOFF]
Lloh53:
	ldr	x9, [x9]
	cmp	x9, x20
	b.ne	LBB0_19
; %bb.18:
	orr	w2, w8, #0x20
	b	LBB0_24
LBB0_19:
Lloh54:
	adrp	x9, _V4L2_STD_PAL_60@GOTPAGE
Lloh55:
	ldr	x9, [x9, _V4L2_STD_PAL_60@GOTPAGEOFF]
Lloh56:
	ldr	x9, [x9]
	cmp	x9, x20
	b.ne	LBB0_21
; %bb.20:
	orr	w2, w8, #0x10
	b	LBB0_24
LBB0_21:
Lloh57:
	adrp	x9, _V4L2_STD_NTSC_M_JP@GOTPAGE
Lloh58:
	ldr	x9, [x9, _V4L2_STD_NTSC_M_JP@GOTPAGEOFF]
Lloh59:
	ldr	x9, [x9]
	cmp	x9, x20
	b.ne	LBB0_23
; %bb.22:
	orr	w2, w8, #0x40
	b	LBB0_24
LBB0_23:
Lloh60:
	adrp	x9, _V4L2_STD_SECAM@GOTPAGE
Lloh61:
	ldr	x9, [x9, _V4L2_STD_SECAM@GOTPAGEOFF]
Lloh62:
	ldr	x9, [x9]
	mov	w10, #80
	orr	w10, w8, w10
	tst	x9, x20
	csel	w2, w8, w10, eq
LBB0_24:
	ldr	w1, [x21]
	mov	x0, x19
	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
	b	_saa711x_write
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh16
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGotLdr	Lloh57, Lloh58, Lloh59
	.loh AdrpLdrGotLdr	Lloh60, Lloh61, Lloh62
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_STD_525_60,8,3            ; @V4L2_STD_525_60
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"decoder set standard 60 Hz\n"

	.comm	_GM7113C,8,3                    ; @GM7113C
	.comm	_R_08_SYNC_CNTL,4,2             ; @R_08_SYNC_CNTL
	.comm	_SAA7113_R_08_FSEL,4,2          ; @SAA7113_R_08_FSEL
	.comm	_SAA7113_R_08_AUFD,4,2          ; @SAA7113_R_08_AUFD
	.comm	_saa7115_cfg_60hz_video,4,2     ; @saa7115_cfg_60hz_video
l_.str.1:                               ; @.str.1
	.asciz	"decoder set standard 50 Hz\n"

	.comm	_saa7115_cfg_50hz_video,4,2     ; @saa7115_cfg_50hz_video
	.comm	_SAA7113,8,3                    ; @SAA7113
	.comm	_R_0E_CHROMA_CNTL_1,4,2         ; @R_0E_CHROMA_CNTL_1
	.comm	_V4L2_STD_PAL_M,8,3             ; @V4L2_STD_PAL_M
	.comm	_V4L2_STD_PAL_Nc,8,3            ; @V4L2_STD_PAL_Nc
	.comm	_V4L2_STD_PAL_60,8,3            ; @V4L2_STD_PAL_60
	.comm	_V4L2_STD_NTSC_M_JP,8,3         ; @V4L2_STD_NTSC_M_JP
	.comm	_V4L2_STD_SECAM,8,3             ; @V4L2_STD_SECAM
	.comm	_R_80_GLOBAL_CNTL_1,4,2         ; @R_80_GLOBAL_CNTL_1
	.comm	_SAA7114,8,3                    ; @SAA7114
	.comm	_saa7115_cfg_vbi_on,4,2         ; @saa7115_cfg_vbi_on
	.no_dead_strip	_saa711x_set_v4lstd
.subsections_via_symbols
