	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tvp5150_set_std
_tvp5150_set_std:                       ## @tvp5150_set_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r14
	callq	_to_tvp5150
	movl	%r15d, (%rax)
	movq	_V4L2_STD_ALL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	cmpl	%r15d, (%rax)
	je	LBB0_7
## %bb.1:
	movq	_V4L2_STD_NTSC_443@GOTPCREL(%rip), %rax
	movl	$10, %ebx
	testl	%r15d, (%rax)
	jne	LBB0_7
## %bb.2:
	movq	_V4L2_STD_PAL_M@GOTPCREL(%rip), %rax
	movl	$6, %ebx
	testl	%r15d, (%rax)
	jne	LBB0_7
## %bb.3:
	movq	_V4L2_STD_PAL_N@GOTPCREL(%rip), %rax
	movq	_V4L2_STD_PAL_Nc@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	$8, %ebx
	testl	%r15d, %ecx
	jne	LBB0_7
## %bb.4:
	movq	_V4L2_STD_NTSC@GOTPCREL(%rip), %rax
	movl	$2, %ebx
	testl	%r15d, (%rax)
	jne	LBB0_7
## %bb.5:
	movq	_V4L2_STD_PAL@GOTPCREL(%rip), %rax
	movl	$4, %ebx
	testl	%r15d, (%rax)
	jne	LBB0_7
## %bb.6:
	movq	_V4L2_STD_SECAM@GOTPCREL(%rip), %rax
	andl	(%rax), %r15d
	movl	$12, %ebx
	cmovel	%r15d, %ebx
LBB0_7:
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rcx
	movl	$1, %edi
	movq	%r14, %rdx
	movl	%ebx, %r8d
	callq	_v4l2_dbg
	movq	_TVP5150_VIDEO_STD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_tvp5150_write
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_STD_ALL,4,2               ## @V4L2_STD_ALL
	.comm	_V4L2_STD_NTSC_443,4,2          ## @V4L2_STD_NTSC_443
	.comm	_V4L2_STD_PAL_M,4,2             ## @V4L2_STD_PAL_M
	.comm	_V4L2_STD_PAL_N,4,2             ## @V4L2_STD_PAL_N
	.comm	_V4L2_STD_PAL_Nc,4,2            ## @V4L2_STD_PAL_Nc
	.comm	_V4L2_STD_NTSC,4,2              ## @V4L2_STD_NTSC
	.comm	_V4L2_STD_PAL,4,2               ## @V4L2_STD_PAL
	.comm	_V4L2_STD_SECAM,4,2             ## @V4L2_STD_SECAM
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Set video std register to %d.\n"

	.comm	_TVP5150_VIDEO_STD,4,2          ## @TVP5150_VIDEO_STD
	.no_dead_strip	_tvp5150_set_std
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tvp5150_set_std
_tvp5150_set_std:                       ; @tvp5150_set_std
	.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, x1
	mov	x19, x0
	bl	_to_tvp5150
	str	w20, [x0]
Lloh0:
	adrp	x8, _V4L2_STD_ALL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _V4L2_STD_ALL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ne	LBB0_2
; %bb.1:
	mov	w20, #0
	b	LBB0_13
LBB0_2:
Lloh3:
	adrp	x8, _V4L2_STD_NTSC_443@GOTPAGE
Lloh4:
	ldr	x8, [x8, _V4L2_STD_NTSC_443@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_4
; %bb.3:
	mov	w20, #10
	b	LBB0_13
LBB0_4:
Lloh6:
	adrp	x8, _V4L2_STD_PAL_M@GOTPAGE
Lloh7:
	ldr	x8, [x8, _V4L2_STD_PAL_M@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_6
; %bb.5:
	mov	w20, #6
	b	LBB0_13
LBB0_6:
Lloh9:
	adrp	x8, _V4L2_STD_PAL_N@GOTPAGE
Lloh10:
	ldr	x8, [x8, _V4L2_STD_PAL_N@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _V4L2_STD_PAL_Nc@GOTPAGE
Lloh13:
	ldr	x9, [x9, _V4L2_STD_PAL_Nc@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w9, w8
	tst	w8, w20
	b.eq	LBB0_8
; %bb.7:
	mov	w20, #8
	b	LBB0_13
LBB0_8:
Lloh15:
	adrp	x8, _V4L2_STD_NTSC@GOTPAGE
Lloh16:
	ldr	x8, [x8, _V4L2_STD_NTSC@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_10
; %bb.9:
	mov	w20, #2
	b	LBB0_13
LBB0_10:
Lloh18:
	adrp	x8, _V4L2_STD_PAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _V4L2_STD_PAL@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_12
; %bb.11:
	mov	w20, #4
	b	LBB0_13
LBB0_12:
Lloh21:
	adrp	x8, _V4L2_STD_SECAM@GOTPAGE
Lloh22:
	ldr	x8, [x8, _V4L2_STD_SECAM@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	tst	w8, w20
	mov	w8, #12
	csel	w20, wzr, w8, eq
LBB0_13:
Lloh24:
	adrp	x8, _debug@GOTPAGE
Lloh25:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
Lloh27:
	adrp	x3, l_.str@PAGE
Lloh28:
	add	x3, x3, l_.str@PAGEOFF
	mov	w0, #1
	mov	x2, x19
	mov	x4, x20
	bl	_v4l2_dbg
Lloh29:
	adrp	x8, _TVP5150_VIDEO_STD@GOTPAGE
Lloh30:
	ldr	x8, [x8, _TVP5150_VIDEO_STD@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_tvp5150_write
	mov	w0, #0
	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 AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_STD_ALL,4,2               ; @V4L2_STD_ALL
	.comm	_V4L2_STD_NTSC_443,4,2          ; @V4L2_STD_NTSC_443
	.comm	_V4L2_STD_PAL_M,4,2             ; @V4L2_STD_PAL_M
	.comm	_V4L2_STD_PAL_N,4,2             ; @V4L2_STD_PAL_N
	.comm	_V4L2_STD_PAL_Nc,4,2            ; @V4L2_STD_PAL_Nc
	.comm	_V4L2_STD_NTSC,4,2              ; @V4L2_STD_NTSC
	.comm	_V4L2_STD_PAL,4,2               ; @V4L2_STD_PAL
	.comm	_V4L2_STD_SECAM,4,2             ; @V4L2_STD_SECAM
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Set video std register to %d.\n"

	.comm	_TVP5150_VIDEO_STD,4,2          ; @TVP5150_VIDEO_STD
	.no_dead_strip	_tvp5150_set_std
.subsections_via_symbols
