	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function video_mux
_video_mux:                             ## @video_mux
	.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
	movq	_bttv_tvcards@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movq	8(%rdi), %rcx
	shlq	$4, %rcx
	cmpl	%esi, (%rax,%rcx)
	jbe	LBB0_1
## %bb.2:
	movl	%esi, %r14d
	movq	%rdi, %r15
	movl	4(%rax,%rcx), %edi
	testl	%edi, %edi
	je	LBB0_4
## %bb.3:
	movl	%edi, %esi
	callq	_gpio_inout
LBB0_4:
	movq	_BT848_CONTROL_COMP@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	cmpl	%r14d, (%r15)
	jne	LBB0_6
## %bb.5:
	movq	_BT848_E_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_btor
	movl	(%rbx), %edi
	movq	_BT848_O_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_btor
	jmp	LBB0_7
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_6:
	notl	%edi
	movq	_BT848_E_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_btand
	movl	(%rbx), %edi
	notl	%edi
	movq	_BT848_O_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_btand
LBB0_7:
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_bttv_muxsel
	movl	%eax, %ebx
	movl	%eax, %edi
	shll	$5, %edi
	movq	_BT848_IFORM@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$-97, %esi
	callq	_btaor
	movl	16(%r15), %esi
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %edx
	movl	%ebx, %ecx
	callq	_dprintk
	movq	(%r12), %rax
	movq	8(%r15), %rcx
	shlq	$4, %rcx
	movq	8(%rax,%rcx), %rcx
	xorl	%ebx, %ebx
	testq	%rcx, %rcx
	je	LBB0_9
## %bb.8:
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	*%rcx
LBB0_9:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_bttv_tvcards,8,3               ## @bttv_tvcards
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_BT848_CONTROL_COMP,4,2         ## @BT848_CONTROL_COMP
	.comm	_BT848_E_CONTROL,4,2            ## @BT848_E_CONTROL
	.comm	_BT848_O_CONTROL,4,2            ## @BT848_O_CONTROL
	.comm	_BT848_IFORM,4,2                ## @BT848_IFORM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%d: video mux: input=%d mux=%d\n"

	.no_dead_strip	_video_mux
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function video_mux
_video_mux:                             ; @video_mux
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
Lloh0:
	adrp	x22, _bttv_tvcards@GOTPAGE
Lloh1:
	ldr	x22, [x22, _bttv_tvcards@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	x9, [x0, #8]
	lsl	x10, x9, #4
	ldr	w10, [x8, x10]
	cmp	w10, w1
	b.ls	LBB0_5
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	add	x8, x8, x9, lsl #4
	ldr	w0, [x8, #4]
	cbz	w0, LBB0_3
; %bb.2:
	mov	x1, x0
	bl	_gpio_inout
LBB0_3:
	ldr	w8, [x20]
Lloh2:
	adrp	x21, _BT848_CONTROL_COMP@GOTPAGE
Lloh3:
	ldr	x21, [x21, _BT848_CONTROL_COMP@GOTPAGEOFF]
	ldr	w0, [x21]
	cmp	w8, w19
	b.ne	LBB0_6
; %bb.4:
Lloh4:
	adrp	x8, _BT848_E_CONTROL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _BT848_E_CONTROL@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	bl	_btor
	ldr	w0, [x21]
Lloh7:
	adrp	x8, _BT848_O_CONTROL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _BT848_O_CONTROL@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	bl	_btor
	b	LBB0_7
LBB0_5:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_6:
	mvn	w0, w0
Lloh13:
	adrp	x8, _BT848_E_CONTROL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _BT848_E_CONTROL@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	bl	_btand
	ldr	w8, [x21]
	mvn	w0, w8
Lloh16:
	adrp	x8, _BT848_O_CONTROL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _BT848_O_CONTROL@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	bl	_btand
LBB0_7:
	mov	x0, x20
	mov	x1, x19
	bl	_bttv_muxsel
	mov	x21, x0
	lsl	w0, w0, #5
Lloh19:
	adrp	x8, _BT848_IFORM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _BT848_IFORM@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x8]
	mov	w1, #-97
	bl	_btaor
	ldr	w1, [x20, #16]
Lloh22:
	adrp	x0, l_.str@PAGE
Lloh23:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x19
	mov	x3, x21
	bl	_dprintk
	ldr	x8, [x22]
	ldr	x9, [x20, #8]
	add	x8, x8, x9, lsl #4
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_9
; %bb.8:
	mov	x0, x20
	mov	x1, x19
	blr	x8
LBB0_9:
	mov	w0, #0
LBB0_10:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_bttv_tvcards,8,3               ; @bttv_tvcards
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_BT848_CONTROL_COMP,4,2         ; @BT848_CONTROL_COMP
	.comm	_BT848_E_CONTROL,4,2            ; @BT848_E_CONTROL
	.comm	_BT848_O_CONTROL,4,2            ; @BT848_O_CONTROL
	.comm	_BT848_IFORM,4,2                ; @BT848_IFORM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%d: video mux: input=%d mux=%d\n"

	.no_dead_strip	_video_mux
.subsections_via_symbols
