	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_tvnorm
_set_tvnorm:                            ## @set_tvnorm
	.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
	movl	%esi, %r14d
	movq	%rdi, %r12
	movq	_BTTV_TVNORMS@GOTPCREL(%rip), %rbx
	xorl	%edi, %edi
	cmpl	%esi, (%rbx)
	setbe	%dil
	callq	_BUG_ON
	movl	(%r12), %eax
	xorl	%edi, %edi
	cmpl	(%rbx), %eax
	setae	%dil
	callq	_BUG_ON
	movq	_bttv_tvnorms@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	%r14d, %eax
	movl	(%r12), %ecx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	24(%rbx,%rcx,8), %rdi
	leaq	(%rax,%rax,4), %r13
	leaq	(%rbx,%r13,8), %r15
	addq	$24, %r15
	movq	%r15, %rsi
	movl	$16, %edx
	callq	_memcmp
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	24(%r12), %rdi
	movl	%r14d, %esi
	callq	_bttv_crop_reset
	movq	24(%r12), %rax
	movl	(%rax), %ecx
	movl	%ecx, 4(%rax)
	movq	_VIDEO_RESOURCES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r12)
	jne	LBB0_3
## %bb.2:
	movq	(%r15), %rax
	addq	32(%rbx,%r13,8), %rax
	movq	%rax, 16(%r12)
LBB0_3:
	movl	%r14d, (%r12)
	movl	(%rbx,%r13,8), %edi
	movq	_BT848_ADELAY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_btwrite
	movl	4(%rbx,%r13,8), %edi
	movq	_BT848_BDELAY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_btwrite
	movq	_BT848_IFORM_NORM@GOTPCREL(%rip), %rax
	movq	_BT848_IFORM_XTBOTH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movl	16(%rbx,%r13,8), %edi
	notl	%esi
	movq	_BT848_IFORM@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_btaor
	movl	8(%rbx,%r13,8), %edi
	movq	_BT848_VBI_PACK_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_btwrite
	movq	_BT848_VBI_PACK_DEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edi
	callq	_btwrite
	movq	%r12, %rdi
	callq	_bt848A_set_timing
	movl	8(%r12), %eax
	andl	$-2, %eax
	cmpl	$128, %eax
	jne	LBB0_5
## %bb.4:
	xorl	%eax, %eax
	callq	_gpio_read
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_bttv_tda9880_setnorm
LBB0_5:
	movl	12(%rbx,%r13,8), %ecx
	movq	_video@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_s_std@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_bttv_call_all
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BTTV_TVNORMS,4,2               ## @BTTV_TVNORMS
	.comm	_bttv_tvnorms,8,3               ## @bttv_tvnorms
	.comm	_VIDEO_RESOURCES,4,2            ## @VIDEO_RESOURCES
	.comm	_BT848_ADELAY,4,2               ## @BT848_ADELAY
	.comm	_BT848_BDELAY,4,2               ## @BT848_BDELAY
	.comm	_BT848_IFORM_NORM,4,2           ## @BT848_IFORM_NORM
	.comm	_BT848_IFORM_XTBOTH,4,2         ## @BT848_IFORM_XTBOTH
	.comm	_BT848_IFORM,4,2                ## @BT848_IFORM
	.comm	_BT848_VBI_PACK_SIZE,4,2        ## @BT848_VBI_PACK_SIZE
	.comm	_BT848_VBI_PACK_DEL,4,2         ## @BT848_VBI_PACK_DEL
	.comm	_video,4,2                      ## @video
	.comm	_s_std,4,2                      ## @s_std
	.no_dead_strip	_set_tvnorm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_tvnorm
_set_tvnorm:                            ; @set_tvnorm
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x21, _BTTV_TVNORMS@GOTPAGE
Lloh1:
	ldr	x21, [x21, _BTTV_TVNORMS@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w8, w1
	cset	w0, ls
	bl	_BUG_ON
	ldr	w8, [x19]
	ldr	w9, [x21]
	cmp	w8, w9
	cset	w0, hs
	bl	_BUG_ON
Lloh2:
	adrp	x8, _bttv_tvnorms@GOTPAGE
Lloh3:
	ldr	x8, [x8, _bttv_tvnorms@GOTPAGEOFF]
Lloh4:
	ldr	x22, [x8]
	mov	w23, w20
	ldr	w8, [x19]
	mov	w9, #40
	madd	x8, x8, x9, x22
	add	x0, x8, #24
	umaddl	x8, w20, w9, x22
	add	x21, x8, #24
	mov	x1, x21
	mov	w2, #16
	bl	_memcmp
	cbz	x0, LBB0_3
; %bb.1:
	ldr	x0, [x19, #24]
	mov	x1, x20
	bl	_bttv_crop_reset
	ldr	x8, [x19, #24]
	ldr	w9, [x8]
	str	w9, [x8, #4]
	ldr	w8, [x19, #4]
Lloh5:
	adrp	x9, _VIDEO_RESOURCES@GOTPAGE
Lloh6:
	ldr	x9, [x9, _VIDEO_RESOURCES@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_3
; %bb.2:
	mov	w8, #40
	madd	x8, x23, x8, x22
	ldr	x8, [x8, #32]
	ldr	x9, [x21]
	add	x8, x9, x8
	str	x8, [x19, #16]
LBB0_3:
	str	w20, [x19]
	mov	w8, #40
	madd	x20, x23, x8, x22
	ldr	w0, [x20]
Lloh8:
	adrp	x8, _BT848_ADELAY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BT848_ADELAY@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	bl	_btwrite
	ldr	w0, [x20, #4]
Lloh11:
	adrp	x8, _BT848_BDELAY@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BT848_BDELAY@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	bl	_btwrite
	ldr	w0, [x20, #16]
Lloh14:
	adrp	x8, _BT848_IFORM_NORM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _BT848_IFORM_NORM@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	adrp	x9, _BT848_IFORM_XTBOTH@GOTPAGE
Lloh18:
	ldr	x9, [x9, _BT848_IFORM_XTBOTH@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	orr	w8, w9, w8
	mvn	w1, w8
Lloh20:
	adrp	x8, _BT848_IFORM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _BT848_IFORM@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	bl	_btaor
	ldr	w0, [x20, #8]
Lloh23:
	adrp	x8, _BT848_VBI_PACK_SIZE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _BT848_VBI_PACK_SIZE@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	bl	_btwrite
Lloh26:
	adrp	x8, _BT848_VBI_PACK_DEL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _BT848_VBI_PACK_DEL@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	mov	w0, #1
	bl	_btwrite
	mov	x0, x19
	bl	_bt848A_set_timing
	ldr	w8, [x19, #8]
	and	w8, w8, #0xfffffffe
	cmp	w8, #128
	b.ne	LBB0_5
; %bb.4:
	bl	_gpio_read
	mov	x1, x0
	mov	x0, x19
	bl	_bttv_tda9880_setnorm
LBB0_5:
	mov	w8, #40
	madd	x8, x23, x8, x22
	ldr	w3, [x8, #12]
Lloh29:
	adrp	x8, _video@GOTPAGE
Lloh30:
	ldr	x8, [x8, _video@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
Lloh32:
	adrp	x8, _s_std@GOTPAGE
Lloh33:
	ldr	x8, [x8, _s_std@GOTPAGEOFF]
Lloh34:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_bttv_call_all
	mov	w0, #0
	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
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_BTTV_TVNORMS,4,2               ; @BTTV_TVNORMS
	.comm	_bttv_tvnorms,8,3               ; @bttv_tvnorms
	.comm	_VIDEO_RESOURCES,4,2            ; @VIDEO_RESOURCES
	.comm	_BT848_ADELAY,4,2               ; @BT848_ADELAY
	.comm	_BT848_BDELAY,4,2               ; @BT848_BDELAY
	.comm	_BT848_IFORM_NORM,4,2           ; @BT848_IFORM_NORM
	.comm	_BT848_IFORM_XTBOTH,4,2         ; @BT848_IFORM_XTBOTH
	.comm	_BT848_IFORM,4,2                ; @BT848_IFORM
	.comm	_BT848_VBI_PACK_SIZE,4,2        ; @BT848_VBI_PACK_SIZE
	.comm	_BT848_VBI_PACK_DEL,4,2         ; @BT848_VBI_PACK_DEL
	.comm	_video,4,2                      ; @video
	.comm	_s_std,4,2                      ; @s_std
	.no_dead_strip	_set_tvnorm
.subsections_via_symbols
