	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ivtv_s_input                   ## -- Begin function ivtv_s_input
	.p2align	4, 0x90
_ivtv_s_input:                          ## @ivtv_s_input
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%edx, %ebx
	movq	%rsi, %rdi
	callq	_fh2id
	movq	(%rax), %r14
	cmpl	%ebx, (%r14)
	jbe	LBB0_1
## %bb.3:
	cmpl	%ebx, 4(%r14)
	jne	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_IVTV_DEBUG_INFO
	jmp	LBB0_14
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_5:
	leaq	36(%r14), %rdi
	callq	_atomic_read
	testq	%rax, %rax
	jle	LBB0_7
## %bb.6:
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_7:
	movl	4(%r14), %esi
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_IVTV_DEBUG_INFO
	movl	%ebx, 4(%r14)
	movq	24(%r14), %rax
	movq	(%rax), %rax
	movl	%ebx, %ecx
	shlq	$4, %rcx
	movl	8(%rax,%rcx), %edx
	movl	%edx, 32(%r14)
	movq	(%rax,%rcx), %rax
	movq	_IVTV_CARD_INPUT_VID_TUNER@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_8
## %bb.9:
	movq	_V4L2_STD_ALL@GOTPCREL(%rip), %rcx
	jmp	LBB0_10
LBB0_8:
	leaq	16(%r14), %rcx
LBB0_10:
	movq	_IVTV_ENC_STREAM_TYPE_VBI@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	js	LBB0_13
## %bb.11:
	movl	(%rcx), %ecx
	movq	8(%r14), %rdx
	movq	$-1, %rsi
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movl	%ecx, 4(%rdx,%rsi,4)
	movslq	(%rax), %rdi
	incq	%rsi
	cmpq	%rdi, %rsi
	jl	LBB0_12
LBB0_13:
	movq	%r14, %rdi
	callq	_ivtv_mute
	movq	%r14, %rdi
	callq	_ivtv_video_set_io
	movq	%r14, %rdi
	callq	_ivtv_audio_set_io
	movq	%r14, %rdi
	callq	_ivtv_unmute
	xorl	%ebx, %ebx
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Input unchanged\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
L_.str.1:                               ## @.str.1
	.asciz	"Changing input from %d to %d\n"

	.comm	_IVTV_CARD_INPUT_VID_TUNER,8,3  ## @IVTV_CARD_INPUT_VID_TUNER
	.comm	_V4L2_STD_ALL,4,2               ## @V4L2_STD_ALL
	.comm	_IVTV_ENC_STREAM_TYPE_VBI,4,2   ## @IVTV_ENC_STREAM_TYPE_VBI
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ivtv_s_input                   ; -- Begin function ivtv_s_input
	.p2align	2
_ivtv_s_input:                          ; @ivtv_s_input
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x2
	mov	x0, x1
	bl	_fh2id
	ldr	x19, [x0]
	ldr	w8, [x19]
	cmp	w8, w20
	b.ls	LBB0_3
; %bb.1:
	ldr	w8, [x19, #4]
	cmp	w8, w20
	b.ne	LBB0_4
; %bb.2:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_IVTV_DEBUG_INFO
	b	LBB0_11
LBB0_3:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
	add	x0, x19, #36
	bl	_atomic_read
	cmp	x0, #1
	b.lt	LBB0_7
; %bb.5:
Lloh4:
	adrp	x8, _EBUSY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_7:
	ldr	w8, [x19, #4]
	stp	x8, x20, [sp]
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_IVTV_DEBUG_INFO
	str	w20, [x19, #4]
	ldr	x8, [x19, #24]
	ldr	x8, [x8]
	add	x8, x8, w20, uxtw #4
	ldr	w9, [x8, #8]
	str	w9, [x19, #32]
	ldr	x8, [x8]
Lloh8:
	adrp	x9, _IVTV_CARD_INPUT_VID_TUNER@GOTPAGE
Lloh9:
	ldr	x9, [x9, _IVTV_CARD_INPUT_VID_TUNER@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
Lloh11:
	adrp	x10, _V4L2_STD_ALL@GOTPAGE
Lloh12:
	ldr	x10, [x10, _V4L2_STD_ALL@GOTPAGEOFF]
	add	x11, x19, #16
	cmp	x8, x9
	csel	x9, x11, x10, eq
Lloh13:
	adrp	x8, _IVTV_ENC_STREAM_TYPE_VBI@GOTPAGE
Lloh14:
	ldr	x8, [x8, _IVTV_ENC_STREAM_TYPE_VBI@GOTPAGEOFF]
	ldr	w10, [x8]
	tbnz	w10, #31, LBB0_10
; %bb.8:
	mov	x10, #0
	ldr	w9, [x9]
	ldr	x11, [x19, #8]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	str	w9, [x11, x10, lsl #2]
	add	x12, x10, #1
	ldrsw	x13, [x8]
	cmp	x10, x13
	mov	x10, x12
	b.lt	LBB0_9
LBB0_10:
	mov	x0, x19
	bl	_ivtv_mute
	mov	x0, x19
	bl	_ivtv_video_set_io
	mov	x0, x19
	bl	_ivtv_audio_set_io
	mov	x0, x19
	bl	_ivtv_unmute
LBB0_11:
	mov	w0, #0
LBB0_12:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Input unchanged\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
l_.str.1:                               ; @.str.1
	.asciz	"Changing input from %d to %d\n"

	.comm	_IVTV_CARD_INPUT_VID_TUNER,8,3  ; @IVTV_CARD_INPUT_VID_TUNER
	.comm	_V4L2_STD_ALL,4,2               ; @V4L2_STD_ALL
	.comm	_IVTV_ENC_STREAM_TYPE_VBI,4,2   ; @IVTV_ENC_STREAM_TYPE_VBI
.subsections_via_symbols
