	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ivtv_s_std
_ivtv_s_std:                            ## @ivtv_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %rdi
	callq	_fh2id
	movq	_V4L2_STD_ALL@GOTPCREL(%rip), %rcx
	testq	%r14, (%rcx)
	je	LBB0_1
## %bb.3:
	movq	(%rax), %r15
	xorl	%ebx, %ebx
	cmpq	%r14, (%r15)
	je	LBB0_10
## %bb.4:
	movq	_IVTV_F_I_RADIO_USER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	20(%r15), %rsi
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_7
## %bb.5:
	leaq	16(%r15), %rdi
	callq	_atomic_read
	testq	%rax, %rax
	jg	LBB0_7
## %bb.6:
	leaq	12(%r15), %rdi
	callq	_atomic_read
	testq	%rax, %rax
	jle	LBB0_8
LBB0_7:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	(%r15), %rsi
	leaq	L_.str(%rip), %rdi
	callq	_IVTV_DEBUG_INFO
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_ivtv_s_std_enc
	movq	_V4L2_CAP_VIDEO_OUTPUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%r15)
	je	LBB0_10
## %bb.9:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_ivtv_s_std_dec
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_STD_ALL,8,3               ## @V4L2_STD_ALL
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IVTV_F_I_RADIO_USER,4,2        ## @IVTV_F_I_RADIO_USER
	.comm	_EBUSY,4,2                      ## @EBUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Switching standard to %llx.\n"

	.comm	_V4L2_CAP_VIDEO_OUTPUT,4,2      ## @V4L2_CAP_VIDEO_OUTPUT
	.no_dead_strip	_ivtv_s_std
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ivtv_s_std
_ivtv_s_std:                            ; @ivtv_s_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	x19, x2
	mov	x0, x1
	bl	_fh2id
Lloh0:
	adrp	x8, _V4L2_STD_ALL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _V4L2_STD_ALL@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	tst	x8, x19
	b.eq	LBB0_3
; %bb.1:
	ldr	x20, [x0]
	ldr	x8, [x20]
	cmp	x8, x19
	b.ne	LBB0_4
LBB0_2:
	mov	w0, #0
	b	LBB0_9
LBB0_3:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_8
LBB0_4:
Lloh5:
	adrp	x8, _IVTV_F_I_RADIO_USER@GOTPAGE
Lloh6:
	ldr	x8, [x8, _IVTV_F_I_RADIO_USER@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	add	x1, x20, #20
	bl	_test_bit
	cbnz	x0, LBB0_7
; %bb.5:
	add	x0, x20, #16
	bl	_atomic_read
	cmp	x0, #0
	b.gt	LBB0_7
; %bb.6:
	add	x0, x20, #12
	bl	_atomic_read
	cmp	x0, #1
	b.lt	LBB0_10
LBB0_7:
Lloh8:
	adrp	x8, _EBUSY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_10:
	ldr	x1, [x20]
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_IVTV_DEBUG_INFO
	mov	x0, x20
	mov	x1, x19
	bl	_ivtv_s_std_enc
	ldr	w8, [x20, #8]
Lloh12:
	adrp	x9, _V4L2_CAP_VIDEO_OUTPUT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _V4L2_CAP_VIDEO_OUTPUT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.11:
	mov	x0, x20
	mov	x1, x19
	bl	_ivtv_s_std_dec
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_STD_ALL,8,3               ; @V4L2_STD_ALL
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IVTV_F_I_RADIO_USER,4,2        ; @IVTV_F_I_RADIO_USER
	.comm	_EBUSY,4,2                      ; @EBUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Switching standard to %llx.\n"

	.comm	_V4L2_CAP_VIDEO_OUTPUT,4,2      ; @V4L2_CAP_VIDEO_OUTPUT
	.no_dead_strip	_ivtv_s_std
.subsections_via_symbols
