	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_saa7134_s_std_internal         ## -- Begin function saa7134_s_std_internal
	.p2align	4, 0x90
_saa7134_s_std_internal:                ## @saa7134_s_std_internal
	.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	%rsi, %rbx
	movq	%rdi, %r14
	testq	%rsi, %rsi
	je	LBB0_6
## %bb.1:
	leaq	8(%r14), %rdi
	movl	(%rbx), %esi
	callq	_v4l2_prio_check
	testl	%eax, %eax
	jne	LBB0_39
	jmp	LBB0_2
LBB0_6:
	movq	_RESOURCE_OVERLAY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_res_locked
	testq	%rax, %rax
	je	LBB0_2
## %bb.7:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	jmp	LBB0_8
LBB0_2:
	movq	_TVNORMS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ecx, %ecx
	movl	$0, %edx
	testq	%rax, %rax
	je	LBB0_9
## %bb.3:
	movl	(%r15), %esi
	movq	_tvnorms@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdi
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	(%rdi,%rdx,4), %esi
	je	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	incq	%rdx
	cmpq	%rdx, %rax
	jne	LBB0_4
	jmp	LBB0_11
LBB0_9:
	cmpl	%eax, %edx
	cmovnel	%edx, %ecx
	jne	LBB0_14
## %bb.10:
	testl	%eax, %eax
	je	LBB0_14
LBB0_11:
	movl	(%r15), %edx
	movq	_tvnorms@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	testl	%edx, (%rsi,%rcx,4)
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	incq	%rcx
	cmpq	%rcx, %rax
	jne	LBB0_12
	jmp	LBB0_15
LBB0_14:
	cmpl	%eax, %ecx
	jne	LBB0_16
LBB0_15:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_8:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_39:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	_V4L2_STD_SECAM@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, (%r15)
	je	LBB0_31
## %bb.17:
	movq	_secam@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rdi
	movb	(%rdi), %sil
	cmpb	$75, %sil
	jle	LBB0_18
## %bb.21:
	cmpb	$108, %sil
	je	LBB0_24
## %bb.22:
	cmpb	$100, %sil
	je	LBB0_20
## %bb.23:
	cmpb	$76, %sil
	jne	LBB0_28
LBB0_24:
	movb	1(%rdi), %cl
	orb	$32, %cl
	cmpb	$99, %cl
	jne	LBB0_26
## %bb.25:
	movq	_V4L2_STD_SECAM_LC@GOTPCREL(%rip), %rcx
	jmp	LBB0_27
LBB0_18:
	cmpb	$45, %sil
	je	LBB0_31
## %bb.19:
	cmpb	$68, %sil
	jne	LBB0_28
LBB0_20:
	movq	_V4L2_STD_SECAM_DK@GOTPCREL(%rip), %rcx
	jmp	LBB0_27
LBB0_26:
	movq	_V4L2_STD_SECAM_L@GOTPCREL(%rip), %rcx
LBB0_27:
	movl	(%rcx), %edx
LBB0_28:
	testq	%rax, %rax
	je	LBB0_29
## %bb.34:
	movq	_tvnorms@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_35:                                ## =>This Inner Loop Header: Depth=1
	movl	%ecx, %edi
	cmpl	(%rsi,%rdi,4), %edx
	je	LBB0_30
## %bb.36:                              ##   in Loop: Header=BB0_35 Depth=1
	incl	%ecx
	cmpl	%ecx, %eax
	jne	LBB0_35
	jmp	LBB0_15
LBB0_29:
	xorl	%ecx, %ecx
LBB0_30:
	cmpl	%eax, %ecx
	je	LBB0_15
LBB0_31:
	movq	_tvnorms@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	movl	%ecx, %r12d
	movl	(%rax,%r12,4), %eax
	movl	%eax, (%r15)
	movq	%r14, %rdi
	callq	_mutex_lock
	testq	%rbx, %rbx
	je	LBB0_37
## %bb.32:
	movq	_RESOURCE_OVERLAY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_res_check
	testq	%rax, %rax
	je	LBB0_37
## %bb.33:
	leaq	4(%r14), %r15
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_stop_preview
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	shlq	$2, %r12
	addq	(%r13), %r12
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_set_tvnorm
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_start_preview
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	jmp	LBB0_38
LBB0_37:
	shlq	$2, %r12
	addq	(%r13), %r12
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_set_tvnorm
LBB0_38:
	movq	%r14, %rdi
	callq	_saa7134_tvaudio_do_scan
	movq	%r14, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
	jmp	LBB0_39
	.cfi_endproc
                                        ## -- End function
	.comm	_RESOURCE_OVERLAY,4,2           ## @RESOURCE_OVERLAY
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_TVNORMS,4,2                    ## @TVNORMS
	.comm	_tvnorms,8,3                    ## @tvnorms
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_V4L2_STD_SECAM,4,2             ## @V4L2_STD_SECAM
	.comm	_secam,8,3                      ## @secam
	.comm	_V4L2_STD_SECAM_LC,4,2          ## @V4L2_STD_SECAM_LC
	.comm	_V4L2_STD_SECAM_L,4,2           ## @V4L2_STD_SECAM_L
	.comm	_V4L2_STD_SECAM_DK,4,2          ## @V4L2_STD_SECAM_DK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_saa7134_s_std_internal         ; -- Begin function saa7134_s_std_internal
	.p2align	2
_saa7134_s_std_internal:                ; @saa7134_s_std_internal
	.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	x21, x2
	mov	x20, x1
	mov	x19, x0
	cbz	x1, LBB0_2
; %bb.1:
	add	x0, x19, #8
	ldr	w1, [x20]
	bl	_v4l2_prio_check
	cbnz	w0, LBB0_17
	b	LBB0_4
LBB0_2:
Lloh0:
	adrp	x8, _RESOURCE_OVERLAY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RESOURCE_OVERLAY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_res_locked
	cbz	x0, LBB0_4
; %bb.3:
Lloh3:
	adrp	x8, _EBUSY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_16
LBB0_4:
Lloh5:
	adrp	x8, _TVNORMS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _TVNORMS@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x22, _tvnorms@GOTPAGE
Lloh9:
	ldr	x22, [x22, _tvnorms@GOTPAGEOFF]
	cbz	w8, LBB0_8
; %bb.5:
	mov	x9, #0
	ldr	w10, [x21]
	ldr	x11, [x22]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x11, x9, lsl #2]
	cmp	w10, w12
	b.eq	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x9, x9, #1
	cmp	x8, x9
	b.ne	LBB0_6
	b	LBB0_11
LBB0_8:
	mov	w9, #0
LBB0_9:
	cmp	w9, w8
	csel	w9, w9, wzr, ne
	b.ne	LBB0_14
; %bb.10:
	cbz	w8, LBB0_14
LBB0_11:
	mov	x9, #0
	ldr	w10, [x21]
	ldr	x11, [x22]
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x11, x9, lsl #2]
	tst	w12, w10
	b.ne	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	add	x9, x9, #1
	cmp	x8, x9
	b.ne	LBB0_12
	b	LBB0_15
LBB0_14:
	cmp	w9, w8
	b.ne	LBB0_18
LBB0_15:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_16:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_17:
	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_18:
	ldr	w11, [x21]
Lloh12:
	adrp	x10, _V4L2_STD_SECAM@GOTPAGE
Lloh13:
	ldr	x10, [x10, _V4L2_STD_SECAM@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	tst	w10, w11
	b.eq	LBB0_35
; %bb.19:
Lloh15:
	adrp	x11, _secam@GOTPAGE
Lloh16:
	ldr	x11, [x11, _secam@GOTPAGEOFF]
Lloh17:
	ldr	x11, [x11]
	ldrb	w12, [x11]
	cmp	w12, #75
	b.le	LBB0_25
; %bb.20:
	cmp	w12, #108
	b.eq	LBB0_23
; %bb.21:
	cmp	w12, #100
	b.eq	LBB0_27
; %bb.22:
	cmp	w12, #76
	b.ne	LBB0_30
LBB0_23:
	ldrb	w9, [x11, #1]
	orr	w9, w9, #0x20
	cmp	w9, #99
	b.ne	LBB0_28
; %bb.24:
Lloh18:
	adrp	x9, _V4L2_STD_SECAM_LC@GOTPAGE
Lloh19:
	ldr	x9, [x9, _V4L2_STD_SECAM_LC@GOTPAGEOFF]
	b	LBB0_29
LBB0_25:
	cmp	w12, #45
	b.eq	LBB0_35
; %bb.26:
	cmp	w12, #68
	b.ne	LBB0_30
LBB0_27:
Lloh20:
	adrp	x9, _V4L2_STD_SECAM_DK@GOTPAGE
Lloh21:
	ldr	x9, [x9, _V4L2_STD_SECAM_DK@GOTPAGEOFF]
	b	LBB0_29
LBB0_28:
Lloh22:
	adrp	x9, _V4L2_STD_SECAM_L@GOTPAGE
Lloh23:
	ldr	x9, [x9, _V4L2_STD_SECAM_L@GOTPAGEOFF]
LBB0_29:
	ldr	w10, [x9]
LBB0_30:
	mov	w9, #0
	cbz	w8, LBB0_34
; %bb.31:
	ldr	x11, [x22]
LBB0_32:                                ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x11, w9, uxtw #2]
	cmp	w10, w12
	b.eq	LBB0_34
; %bb.33:                               ;   in Loop: Header=BB0_32 Depth=1
	add	w9, w9, #1
	cmp	w8, w9
	b.ne	LBB0_32
	b	LBB0_15
LBB0_34:
	cmp	w9, w8
	b.eq	LBB0_15
LBB0_35:
	ldr	x8, [x22]
	mov	w23, w9
	ldr	w8, [x8, w9, uxtw #2]
	str	w8, [x21]
	mov	x0, x19
	bl	_mutex_lock
	cbz	x20, LBB0_38
; %bb.36:
Lloh24:
	adrp	x8, _RESOURCE_OVERLAY@GOTPAGE
Lloh25:
	ldr	x8, [x8, _RESOURCE_OVERLAY@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_res_check
	cbz	x0, LBB0_38
; %bb.37:
	add	x21, x19, #4
	mov	x0, x21
	bl	_spin_lock_irqsave
	mov	x0, x19
	mov	x1, x20
	bl	_stop_preview
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	ldr	x8, [x22]
	add	x1, x8, x23, lsl #2
	mov	x0, x19
	bl	_set_tvnorm
	mov	x0, x21
	bl	_spin_lock_irqsave
	mov	x0, x19
	mov	x1, x20
	bl	_start_preview
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	b	LBB0_39
LBB0_38:
	ldr	x8, [x22]
	add	x1, x8, x23, lsl #2
	mov	x0, x19
	bl	_set_tvnorm
LBB0_39:
	mov	x0, x19
	bl	_saa7134_tvaudio_do_scan
	mov	x0, x19
	bl	_mutex_unlock
	mov	w0, #0
	b	LBB0_17
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_RESOURCE_OVERLAY,4,2           ; @RESOURCE_OVERLAY
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_TVNORMS,4,2                    ; @TVNORMS
	.comm	_tvnorms,8,3                    ; @tvnorms
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_V4L2_STD_SECAM,4,2             ; @V4L2_STD_SECAM
	.comm	_secam,8,3                      ; @secam
	.comm	_V4L2_STD_SECAM_LC,4,2          ; @V4L2_STD_SECAM_LC
	.comm	_V4L2_STD_SECAM_L,4,2           ; @V4L2_STD_SECAM_L
	.comm	_V4L2_STD_SECAM_DK,4,2          ; @V4L2_STD_SECAM_DK
.subsections_via_symbols
