	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tw9910_select_norm
_tw9910_select_norm:                    ## @tw9910_select_norm
	.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, %r15
	movq	_V4L2_STD_NTSC@GOTPCREL(%rip), %rax
	testl	%edi, (%rax)
	je	LBB0_2
## %bb.1:
	movq	_tw9910_ntsc_scales@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_2:
	movq	_V4L2_STD_PAL@GOTPCREL(%rip), %rax
	testl	%edi, (%rax)
	je	LBB0_8
## %bb.3:
	movq	_tw9910_pal_scales@GOTPCREL(%rip), %rax
LBB0_4:
	movq	(%rax), %rbx
	movq	%rbx, %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_8
## %bb.5:
	movl	%eax, %r8d
	movl	$4294967295, %edx               ## imm = 0xFFFFFFFF
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rsi
	subq	8(%rbx), %rsi
	movq	%rsi, %rdi
	negq	%rdi
	cmovsq	%rsi, %rdi
	movq	%r14, %rcx
	subq	(%rbx), %rcx
	movq	%rcx, %rsi
	negq	%rsi
	cmovsq	%rcx, %rsi
	addq	%rdi, %rsi
	cmpq	%rdx, %rsi
	cmovlq	%rbx, %rax
	cmovlq	%rsi, %rdx
	addq	$16, %rbx
	decq	%r8
	jne	LBB0_6
	jmp	LBB0_9
LBB0_8:
	xorl	%eax, %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_STD_NTSC,4,2              ## @V4L2_STD_NTSC
	.comm	_tw9910_ntsc_scales,8,3         ## @tw9910_ntsc_scales
	.comm	_V4L2_STD_PAL,4,2               ## @V4L2_STD_PAL
	.comm	_tw9910_pal_scales,8,3          ## @tw9910_pal_scales
	.no_dead_strip	_tw9910_select_norm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tw9910_select_norm
_tw9910_select_norm:                    ; @tw9910_select_norm
	.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
	mov	x21, x2
	mov	x20, x1
Lloh0:
	adrp	x8, _V4L2_STD_NTSC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _V4L2_STD_NTSC@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _tw9910_ntsc_scales@GOTPAGE
Lloh4:
	ldr	x8, [x8, _tw9910_ntsc_scales@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:
Lloh5:
	adrp	x8, _V4L2_STD_PAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _V4L2_STD_PAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_7
; %bb.3:
Lloh8:
	adrp	x8, _tw9910_pal_scales@GOTPAGE
Lloh9:
	ldr	x8, [x8, _tw9910_pal_scales@GOTPAGEOFF]
LBB0_4:
	ldr	x19, [x8]
	mov	x0, x19
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_7
; %bb.5:
	mov	x8, x0
	mov	x0, #0
	mov	w8, w8
	fmov	d0, x21
	mov.d	v0[1], x20
	mov	w9, #-1
	mov	x10, x19
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	q1, [x10], #16
	sub.2d	v1, v0, v1
	abs.2d	v1, v1
	addp.2d	d1, v1
	fmov	x11, d1
	cmp	x11, x9
	csel	x0, x19, x0, lt
	csel	x9, x11, x9, lt
	mov	x19, x10
	subs	x8, x8, #1
	b.ne	LBB0_6
	b	LBB0_8
LBB0_7:
	mov	x0, #0
LBB0_8:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_STD_NTSC,4,2              ; @V4L2_STD_NTSC
	.comm	_tw9910_ntsc_scales,8,3         ; @tw9910_ntsc_scales
	.comm	_V4L2_STD_PAL,4,2               ; @V4L2_STD_PAL
	.comm	_tw9910_pal_scales,8,3          ; @tw9910_pal_scales
	.no_dead_strip	_tw9910_select_norm
.subsections_via_symbols
