	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function vivid_vid_adjust_sel
LCPI0_0:
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.space	4
	.space	4
LCPI0_1:
	.long	4294967294                      ## 0xfffffffe
	.long	4294967294                      ## 0xfffffffe
	.space	4
	.space	4
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_vivid_vid_adjust_sel
	.p2align	4, 0x90
_vivid_vid_adjust_sel:                  ## @vivid_vid_adjust_sel
	.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	(%rsi), %xmm0                   ## xmm0 = mem[0],zero
	pxor	%xmm1, %xmm1
	pblendw	$5, %xmm0, %xmm1                ## xmm1 = xmm0[0],xmm1[1],xmm0[2],xmm1[3,4,5,6,7]
	movq	_V4L2_SEL_FLAG_LE@GOTPCREL(%rip), %rax
	movl	(%rax), %r10d
	testl	%edi, %r10d
	jne	LBB0_2
## %bb.1:
	pmaxud	LCPI0_0(%rip), %xmm1
	pcmpeqd	%xmm2, %xmm2
	psubd	%xmm2, %xmm1
LBB0_2:
	movq	_V4L2_SEL_FLAG_GE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	testl	%edi, %ecx
	jne	LBB0_4
## %bb.3:
	movq	_MAX_WIDTH@GOTPCREL(%rip), %rax
	movq	_MAX_HEIGHT@GOTPCREL(%rip), %rdx
	movd	(%rax), %xmm2                   ## xmm2 = mem[0],zero,zero,zero
	pinsrd	$1, (%rdx), %xmm2
	pminud	%xmm2, %xmm1
LBB0_4:
	pand	LCPI0_1(%rip), %xmm1
	pxor	%xmm2, %xmm2
	pcmpeqd	%xmm1, %xmm2
	pmovsxdq	%xmm2, %xmm2
	movmskpd	%xmm2, %eax
	testl	%eax, %eax
	jne	LBB0_5
## %bb.6:
	movq	_MAX_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movd	%xmm1, %r9d
	movl	%r15d, %edx
	subl	%r9d, %edx
	jb	LBB0_5
## %bb.7:
	movq	_MAX_HEIGHT@GOTPCREL(%rip), %rbx
	movl	(%rbx), %r14d
	pextrd	$1, %xmm1, %r8d
	movl	%r14d, %r11d
	subl	%r8d, %r11d
	jb	LBB0_5
## %bb.8:
	movl	8(%rsi), %ebx
	movl	12(%rsi), %r12d
	xorl	%eax, %eax
	testl	%ebx, %ebx
	cmovlel	%eax, %ebx
	testl	%r12d, %r12d
	cmovgl	%r12d, %eax
	andl	$65534, %eax                    ## imm = 0xFFFE
	movl	%eax, 12(%rsi)
	andl	$65534, %ebx                    ## imm = 0xFFFE
	movl	%ebx, 8(%rsi)
	addl	%r9d, %eax
	cmpl	%r15d, %eax
	jbe	LBB0_10
## %bb.9:
	movl	%edx, 12(%rsi)
LBB0_10:
	addl	%r8d, %ebx
	cmpl	%r14d, %ebx
	jbe	LBB0_12
## %bb.11:
	movl	%r11d, 8(%rsi)
LBB0_12:
	orl	%r10d, %ecx
	notl	%edi
	testl	%edi, %ecx
	jne	LBB0_14
## %bb.13:
	pcmpeqd	%xmm1, %xmm0
	pmovsxdq	%xmm0, %xmm0
	movmskpd	%xmm0, %eax
	cmpb	$3, %al
	jne	LBB0_5
LBB0_14:
	movl	%r9d, (%rsi)
	movl	%r8d, 4(%rsi)
	xorl	%eax, %eax
	jmp	LBB0_15
LBB0_5:
	movq	_ERANGE@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_15:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_SEL_FLAG_LE,4,2           ## @V4L2_SEL_FLAG_LE
	.comm	_V4L2_SEL_FLAG_GE,4,2           ## @V4L2_SEL_FLAG_GE
	.comm	_MAX_WIDTH,4,2                  ## @MAX_WIDTH
	.comm	_MAX_HEIGHT,4,2                 ## @MAX_HEIGHT
	.comm	_ERANGE,4,2                     ## @ERANGE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vivid_vid_adjust_sel           ; -- Begin function vivid_vid_adjust_sel
	.p2align	2
_vivid_vid_adjust_sel:                  ; @vivid_vid_adjust_sel
	.cfi_startproc
; %bb.0:
	fmov	s1, wzr
	ldr	d0, [x1]
	movi	d2, #0x00ffff0000ffff
	and.8b	v2, v0, v2
Lloh0:
	adrp	x8, _V4L2_SEL_FLAG_LE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _V4L2_SEL_FLAG_LE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	and	w9, w8, w0
	fmov	s3, w9
	cmeq.2s	v1, v3, v1
	dup.2s	v1, v1[0]
	movi.2s	v3, #1
	umax.2s	v4, v2, v3
	add.2s	v3, v4, v3
	bsl.8b	v1, v3, v2
Lloh3:
	adrp	x9, _V4L2_SEL_FLAG_GE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _V4L2_SEL_FLAG_GE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w0
	b.ne	LBB0_2
; %bb.1:
Lloh6:
	adrp	x10, _MAX_WIDTH@GOTPAGE
Lloh7:
	ldr	x10, [x10, _MAX_WIDTH@GOTPAGEOFF]
Lloh8:
	adrp	x11, _MAX_HEIGHT@GOTPAGE
Lloh9:
	ldr	x11, [x11, _MAX_HEIGHT@GOTPAGEOFF]
Lloh10:
	ldr	s2, [x10]
	ld1.s	{ v2 }[1], [x11]
	umin.2s	v1, v1, v2
LBB0_2:
	bic.2s	v1, #1
	cmeq.2s	v2, v1, #0
	mov.s	w10, v2[1]
	fmov	w11, s2
	orr	w10, w11, w10
	tbnz	w10, #0, LBB0_10
; %bb.3:
Lloh11:
	adrp	x10, _MAX_WIDTH@GOTPAGE
Lloh12:
	ldr	x10, [x10, _MAX_WIDTH@GOTPAGEOFF]
Lloh13:
	ldr	w12, [x10]
Lloh14:
	adrp	x10, _MAX_HEIGHT@GOTPAGE
Lloh15:
	ldr	x10, [x10, _MAX_HEIGHT@GOTPAGEOFF]
	fmov	w13, s1
Lloh16:
	ldr	w10, [x10]
	mov.s	w11, v1[1]
	subs	w13, w12, w13
	ccmp	w10, w11, #0, hs
	b.lo	LBB0_10
; %bb.4:
	ldr	d2, [x1, #8]
	movi.2d	v3, #0000000000000000
	smax.2s	v2, v2, v3
	mov	w14, #65534
	dup.2s	v3, w14
	and.8b	v2, v2, v3
	str	d2, [x1, #8]
	dup.2s	v3, v2[1]
	add.2s	v3, v3, v1
	fmov	w14, s3
	cmp	w14, w12
	b.ls	LBB0_6
; %bb.5:
	str	w13, [x1, #12]
LBB0_6:
	fmov	w12, s2
	add	w12, w12, w11
	cmp	w12, w10
	b.ls	LBB0_8
; %bb.7:
	sub	w10, w10, w11
	str	w10, [x1, #8]
LBB0_8:
	orr	w8, w9, w8
	bics	wzr, w8, w0
	b.ne	LBB0_11
; %bb.9:
	cmeq.2s	v0, v0, v1
	mov.s	w8, v0[1]
	fmov	w9, s0
	and	w8, w9, w8
	tbnz	w8, #0, LBB0_11
LBB0_10:
Lloh17:
	adrp	x8, _ERANGE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w0, w8
	ret
LBB0_11:
	mov	w0, #0
	str	d1, [x1]
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_SEL_FLAG_LE,4,2           ; @V4L2_SEL_FLAG_LE
	.comm	_V4L2_SEL_FLAG_GE,4,2           ; @V4L2_SEL_FLAG_GE
	.comm	_MAX_WIDTH,4,2                  ; @MAX_WIDTH
	.comm	_MAX_HEIGHT,4,2                 ; @MAX_HEIGHT
	.comm	_ERANGE,4,2                     ; @ERANGE
.subsections_via_symbols
