	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ks0127_s_std
_ks0127_s_std:                          ## @ks0127_s_std
	.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
	movl	%esi, %r15d
	movq	%rdi, %r14
	callq	_to_ks0127
	movq	%rax, %rbx
	movq	_KS_DEMOD@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r14, %rdi
	movl	$240, %edx
	xorl	%ecx, %ecx
	callq	_ks0127_and_or
	movl	%r15d, (%rbx)
	movq	_V4L2_STD_NTSC@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_3
## %bb.1:
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rcx
LBB0_2:
	movl	$1, %edi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_v4l2_dbg
	movq	_KS_CHROMA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$159, %edx
	movl	$32, %ecx
	jmp	LBB0_6
LBB0_3:
	movq	_V4L2_STD_PAL_N@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_8
## %bb.4:
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rcx
LBB0_5:
	movl	$1, %edi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_v4l2_dbg
	movq	_KS_CHROMA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$159, %edx
	movl	$64, %ecx
LBB0_6:
	callq	_ks0127_and_or
LBB0_7:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_V4L2_STD_PAL@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_10
## %bb.9:
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rcx
	jmp	LBB0_2
LBB0_10:
	movq	_V4L2_STD_PAL_M@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_12
## %bb.11:
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rcx
	jmp	LBB0_5
LBB0_12:
	movq	_V4L2_STD_SECAM@GOTPCREL(%rip), %rax
	movq	_debug@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	testl	%r15d, (%rax)
	je	LBB0_15
## %bb.13:
	leaq	L_.str.4(%rip), %rcx
	movl	$1, %edi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_v4l2_dbg
	movq	_KS_CHROMA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$223, %edx
	movl	$32, %ecx
	callq	_ks0127_and_or
	movl	(%r12), %esi
	movq	%r14, %rdi
	movl	$240, %edx
	xorl	%ecx, %ecx
	callq	_ks0127_and_or
	movq	_HZ@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	imulq	$1717986919, %rax, %rax         ## imm = 0x66666667
	movq	%rax, %rcx
	sarq	$34, %rcx
	shrq	$63, %rax
	leal	(%rcx,%rax), %edi
	incl	%edi
	callq	_schedule_timeout_interruptible
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_ks0127_read
	testb	$64, %al
	jne	LBB0_7
## %bb.14:
	movl	(%r12), %esi
	movq	%r14, %rdi
	movl	$240, %edx
	movl	$15, %ecx
	jmp	LBB0_6
LBB0_15:
	movslq	%r15d, %r8
	leaq	L_.str.5(%rip), %rcx
	movl	$1, %edi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_v4l2_dbg
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_KS_DEMOD,4,2                   ## @KS_DEMOD
	.comm	_V4L2_STD_NTSC,4,2              ## @V4L2_STD_NTSC
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"s_std: NTSC_M\n"

	.comm	_KS_CHROMA,4,2                  ## @KS_CHROMA
	.comm	_V4L2_STD_PAL_N,4,2             ## @V4L2_STD_PAL_N
L_.str.1:                               ## @.str.1
	.asciz	"s_std: NTSC_N (fixme)\n"

	.comm	_V4L2_STD_PAL,4,2               ## @V4L2_STD_PAL
L_.str.2:                               ## @.str.2
	.asciz	"s_std: PAL_N\n"

	.comm	_V4L2_STD_PAL_M,4,2             ## @V4L2_STD_PAL_M
L_.str.3:                               ## @.str.3
	.asciz	"s_std: PAL_M (fixme)\n"

	.comm	_V4L2_STD_SECAM,4,2             ## @V4L2_STD_SECAM
L_.str.4:                               ## @.str.4
	.asciz	"s_std: SECAM\n"

	.comm	_HZ,4,2                         ## @HZ
L_.str.5:                               ## @.str.5
	.asciz	"s_std: Unknown norm %llx\n"

	.no_dead_strip	_ks0127_s_std
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ks0127_s_std
_ks0127_s_std:                          ; @ks0127_s_std
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x1
	mov	x19, x0
	bl	_to_ks0127
	mov	x21, x0
Lloh0:
	adrp	x22, _KS_DEMOD@GOTPAGE
Lloh1:
	ldr	x22, [x22, _KS_DEMOD@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #240
	mov	w3, #0
	bl	_ks0127_and_or
	str	w20, [x21]
Lloh2:
	adrp	x8, _V4L2_STD_NTSC@GOTPAGE
Lloh3:
	ldr	x8, [x8, _V4L2_STD_NTSC@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_3
; %bb.1:
Lloh5:
	adrp	x8, _debug@GOTPAGE
Lloh6:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x3, l_.str@PAGE
Lloh9:
	add	x3, x3, l_.str@PAGEOFF
LBB0_2:
	mov	w0, #1
	mov	x2, x19
	bl	_v4l2_dbg
Lloh10:
	adrp	x8, _KS_CHROMA@GOTPAGE
Lloh11:
	ldr	x8, [x8, _KS_CHROMA@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #159
	mov	w3, #32
	b	LBB0_6
LBB0_3:
Lloh13:
	adrp	x8, _V4L2_STD_PAL_N@GOTPAGE
Lloh14:
	ldr	x8, [x8, _V4L2_STD_PAL_N@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_8
; %bb.4:
Lloh16:
	adrp	x8, _debug@GOTPAGE
Lloh17:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
Lloh19:
	adrp	x3, l_.str.1@PAGE
Lloh20:
	add	x3, x3, l_.str.1@PAGEOFF
LBB0_5:
	mov	w0, #1
	mov	x2, x19
	bl	_v4l2_dbg
Lloh21:
	adrp	x8, _KS_CHROMA@GOTPAGE
Lloh22:
	ldr	x8, [x8, _KS_CHROMA@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #159
	mov	w3, #64
LBB0_6:
	bl	_ks0127_and_or
LBB0_7:
	mov	w0, #0
	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
	add	sp, sp, #64
	ret
LBB0_8:
Lloh24:
	adrp	x8, _V4L2_STD_PAL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _V4L2_STD_PAL@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_10
; %bb.9:
Lloh27:
	adrp	x8, _debug@GOTPAGE
Lloh28:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
Lloh30:
	adrp	x3, l_.str.2@PAGE
Lloh31:
	add	x3, x3, l_.str.2@PAGEOFF
	b	LBB0_2
LBB0_10:
Lloh32:
	adrp	x8, _V4L2_STD_PAL_M@GOTPAGE
Lloh33:
	ldr	x8, [x8, _V4L2_STD_PAL_M@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_12
; %bb.11:
Lloh35:
	adrp	x8, _debug@GOTPAGE
Lloh36:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh37:
	ldr	w1, [x8]
Lloh38:
	adrp	x3, l_.str.3@PAGE
Lloh39:
	add	x3, x3, l_.str.3@PAGEOFF
	b	LBB0_5
LBB0_12:
Lloh40:
	adrp	x8, _V4L2_STD_SECAM@GOTPAGE
Lloh41:
	ldr	x8, [x8, _V4L2_STD_SECAM@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
Lloh43:
	adrp	x9, _debug@GOTPAGE
Lloh44:
	ldr	x9, [x9, _debug@GOTPAGEOFF]
Lloh45:
	ldr	w1, [x9]
	tst	w8, w20
	b.eq	LBB0_15
; %bb.13:
Lloh46:
	adrp	x3, l_.str.4@PAGE
Lloh47:
	add	x3, x3, l_.str.4@PAGEOFF
	mov	w0, #1
	mov	x2, x19
	bl	_v4l2_dbg
Lloh48:
	adrp	x8, _KS_CHROMA@GOTPAGE
Lloh49:
	ldr	x8, [x8, _KS_CHROMA@GOTPAGEOFF]
Lloh50:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #223
	mov	w3, #32
	bl	_ks0127_and_or
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #240
	mov	w3, #0
	bl	_ks0127_and_or
Lloh51:
	adrp	x8, _HZ@GOTPAGE
Lloh52:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh53:
	ldrsw	x8, [x8]
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #34
	add	w8, w8, w9
	add	w0, w8, #1
	bl	_schedule_timeout_interruptible
	ldr	w1, [x22]
	mov	x0, x19
	bl	_ks0127_read
	tbnz	w0, #6, LBB0_7
; %bb.14:
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #240
	mov	w3, #15
	b	LBB0_6
LBB0_15:
	sxtw	x8, w20
	str	x8, [sp]
Lloh54:
	adrp	x3, l_.str.5@PAGE
Lloh55:
	add	x3, x3, l_.str.5@PAGEOFF
	mov	w0, #1
	mov	x2, x19
	bl	_v4l2_dbg
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpAdd	Lloh54, Lloh55
	.cfi_endproc
                                        ; -- End function
	.comm	_KS_DEMOD,4,2                   ; @KS_DEMOD
	.comm	_V4L2_STD_NTSC,4,2              ; @V4L2_STD_NTSC
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"s_std: NTSC_M\n"

	.comm	_KS_CHROMA,4,2                  ; @KS_CHROMA
	.comm	_V4L2_STD_PAL_N,4,2             ; @V4L2_STD_PAL_N
l_.str.1:                               ; @.str.1
	.asciz	"s_std: NTSC_N (fixme)\n"

	.comm	_V4L2_STD_PAL,4,2               ; @V4L2_STD_PAL
l_.str.2:                               ; @.str.2
	.asciz	"s_std: PAL_N\n"

	.comm	_V4L2_STD_PAL_M,4,2             ; @V4L2_STD_PAL_M
l_.str.3:                               ; @.str.3
	.asciz	"s_std: PAL_M (fixme)\n"

	.comm	_V4L2_STD_SECAM,4,2             ; @V4L2_STD_SECAM
l_.str.4:                               ; @.str.4
	.asciz	"s_std: SECAM\n"

	.comm	_HZ,4,2                         ; @HZ
l_.str.5:                               ; @.str.5
	.asciz	"s_std: Unknown norm %llx\n"

	.no_dead_strip	_ks0127_s_std
.subsections_via_symbols
