	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_video_mode_Kiara
_set_video_mode_Kiara:                  ## @set_video_mode_Kiara
	.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
	subq	$136, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, -160(%rbp)
	movups	%xmm0, -96(%rbp)
	movups	%xmm0, -112(%rbp)
	movups	%xmm0, -128(%rbp)
	movups	%xmm0, -144(%rbp)
	movabsq	$3320009719814, %rax            ## imm = 0x30500000006
	movq	%rax, -168(%rbp)
	movl	$1272, -160(%rbp)               ## imm = 0x4F8
	movq	$173, -152(%rbp)
	cmpl	$3, %ecx
	ja	LBB0_3
## %bb.1:
	movl	%edx, %r12d
	leal	-31(%r12), %eax
	cmpl	$-26, %eax
	jb	LBB0_3
## %bb.2:
	movl	%esi, %r14d
	movq	_PSZ_MAX@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jle	LBB0_3
## %bb.5:
	movl	%r8d, %ebx
	movq	%rdi, %r13
	movq	_PSZ_VGA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	$16, %r12d
	jb	LBB0_7
## %bb.6:
	cmpl	%r14d, %eax
	jne	LBB0_7
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_28:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_30
## %bb.29:
	movl	%r13d, %eax
	addq	$136, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movslq	%r14d, %rsi
	testl	%ebx, %ebx
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	je	LBB0_12
## %bb.8:
	cmpl	$5, %r12d
	jne	LBB0_12
## %bb.9:
	cmpl	%r14d, %eax
	jne	LBB0_12
## %bb.10:
	movq	(%r13), %rax
	movq	_V4L2_PIX_FMT_YUV420@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	jne	LBB0_11
LBB0_12:
	movzbl	%r12b, %eax
	imull	$205, %eax, %eax
	shrq	$10, %rax
	movl	$4294967295, %edx               ## imm = 0xFFFFFFFF
	addq	%rax, %rdx
	movq	_Kiara_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%rsi,8), %rax
	movl	%edx, %edx
	movq	(%rax,%rdx,8), %rdx
	movl	%ecx, %eax
	imulq	$88, %rax, %rcx
	leaq	(%rcx,%rdx), %r15
	addq	$-88, %r15
	addq	$-3, %rax
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	cmpq	$0, 104(%r15)
	leaq	88(%r15), %r15
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	leaq	1(%rax), %rcx
	testq	%rax, %rax
	movq	%rcx, %rax
	jne	LBB0_13
	jmp	LBB0_15
LBB0_11:
	leaq	L_.str(%rip), %rdi
	callq	_PWC_DEBUG_SIZE
	leaq	-168(%rbp), %r15
LBB0_15:
	movq	16(%r15), %rsi
	testq	%rsi, %rsi
	je	LBB0_16
## %bb.17:
	leaq	L_.str.1(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	_PWC_TRACE
	movq	24(%r15), %rsi
	leaq	-60(%rbp), %rdi
	movl	$12, %edx
	callq	_memcpy
	testl	%ebx, %ebx
	je	LBB0_19
## %bb.18:
	orb	$-128, -60(%rbp)
LBB0_19:
	leaq	-60(%rbp), %rdx
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	movl	$4, %esi
	movl	$12, %ecx
	callq	_send_video_command
	testl	%eax, %eax
	js	LBB0_20
## %bb.21:
	cmpq	$0, 32(%r15)
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	jle	LBB0_24
## %bb.22:
	movq	(%r13), %rax
	movq	_V4L2_PIX_FMT_YUV420@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_24
## %bb.23:
	movl	68(%r13), %esi
	leaq	-60(%rbp), %rdx
	movq	%r13, %rdi
	callq	_pwc_dec23_init
LBB0_24:
	movl	$12, 8(%r13)
	movq	16(%r13), %rdi
	leaq	-60(%rbp), %rsi
	movl	$12, %edx
	callq	_memcpy
	movl	%r12d, 24(%r13)
	movl	%r14d, 28(%r13)
	movl	%ebx, 32(%r13)
	movq	16(%r15), %rax
	movq	%rax, 40(%r13)
	movq	_pwc_image_sizes@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rax,%rcx,8), %rax
	movq	%rax, 60(%r13)
	movq	32(%r15), %r9
	movq	%r9, 48(%r13)
	testq	%r9, %r9
	jle	LBB0_26
## %bb.25:
	cltq
	imulq	%r9, %rax
	leaq	3(%rax), %rsi
	testq	%rax, %rax
	cmovnsq	%rax, %rsi
	shrq	$2, %rsi
	jmp	LBB0_27
LBB0_16:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_20:
	movl	%eax, %r13d
	jmp	LBB0_28
LBB0_26:
	movq	%rax, %rcx
	shrq	$32, %rcx
	imull	%eax, %ecx
	shll	$2, %ecx
	leal	(%rcx,%rcx,2), %eax
	leal	(%rcx,%rcx,2), %esi
	addl	$7, %esi
	testl	%eax, %eax
	cmovnsl	%eax, %esi
	sarl	$3, %esi
LBB0_27:
	movl	%esi, 56(%r13)
	leaq	L_.str.2(%rip), %rdi
	xorl	%r13d, %r13d
                                        ## kill: def $esi killed $esi killed $rsi
	movl	%r12d, %edx
	movl	%r14d, %ecx
	movl	%ebx, %r8d
	xorl	%eax, %eax
	callq	_PWC_TRACE
	jmp	LBB0_28
LBB0_30:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PSZ_MAX,4,2                    ## @PSZ_MAX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PSZ_VGA,4,2                    ## @PSZ_VGA
	.comm	_V4L2_PIX_FMT_YUV420,8,3        ## @V4L2_PIX_FMT_YUV420
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Choosing VGA/5 BAYER mode.\n"

	.comm	_Kiara_table,8,3                ## @Kiara_table
	.comm	_ENOENT,4,2                     ## @ENOENT
L_.str.1:                               ## @.str.1
	.asciz	"Using alternate setting %d.\n"

	.comm	_pwc_image_sizes,8,3            ## @pwc_image_sizes
L_.str.2:                               ## @.str.2
	.asciz	"frame_size=%d, vframes=%d, vsize=%d, vsnapshot=%d, vbandlength=%d\n"

	.no_dead_strip	_set_video_mode_Kiara
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function set_video_mode_Kiara
lCPI0_0:
	.long	6                               ; 0x6
	.long	773                             ; 0x305
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_set_video_mode_Kiara:                  ; @set_video_mode_Kiara
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #208
	.cfi_def_cfa_offset 208
	stp	x24, x23, [sp, #144]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #160]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #176]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #192]            ; 16-byte Folded Spill
	add	x29, sp, #192
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	movi.2d	v0, #0000000000000000
	stur	q0, [sp, #40]
	stur	q0, [sp, #104]
	stur	q0, [sp, #88]
	stur	q0, [sp, #72]
	stur	q0, [sp, #56]
Lloh3:
	adrp	x8, lCPI0_0@PAGE
Lloh4:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [sp, #32]
	mov	w8, #1272
	str	w8, [sp, #40]
	mov	w8, #173
	str	x8, [sp, #48]
	cmp	w3, #3
	b.hi	LBB0_5
; %bb.1:
	mov	x19, x2
	sub	w8, w2, #31
	cmn	w8, #26
	b.lo	LBB0_5
; %bb.2:
	mov	x20, x1
Lloh5:
	adrp	x8, _PSZ_MAX@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PSZ_MAX@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w8, w1
	b.le	LBB0_5
; %bb.3:
	mov	x22, x4
	mov	x21, x0
Lloh8:
	adrp	x8, _PSZ_VGA@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PSZ_VGA@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w19, #16
	b.lo	LBB0_9
; %bb.4:
	cmp	w8, w20
	b.ne	LBB0_9
LBB0_5:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldur	x8, [x29, #-56]
Lloh13:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh14:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_26
; %bb.8:
	ldp	x29, x30, [sp, #192]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #176]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #160]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #144]            ; 16-byte Folded Reload
	add	sp, sp, #208
	ret
LBB0_9:
	cbz	w22, LBB0_13
; %bb.10:
	cmp	w19, #5
	b.ne	LBB0_13
; %bb.11:
	cmp	w8, w20
	b.ne	LBB0_13
; %bb.12:
	ldr	x8, [x21]
Lloh16:
	adrp	x9, _V4L2_PIX_FMT_YUV420@GOTPAGE
Lloh17:
	ldr	x9, [x9, _V4L2_PIX_FMT_YUV420@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_24
LBB0_13:
	and	w8, w19, #0xff
	mov	w9, #205
	mul	w8, w8, w9
	lsr	w8, w8, #10
	mov	w9, #-1
	add	x8, x8, x9
Lloh19:
	adrp	x9, _Kiara_table@GOTPAGE
Lloh20:
	ldr	x9, [x9, _Kiara_table@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	ldr	x9, [x9, w20, sxtw #3]
	ldr	x8, [x9, w8, uxtw #3]
	mov	w9, #88
	umull	x9, w3, w9
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	add	x10, x8, x9
	ldr	x11, [x10, #16]
	add	x10, x9, #88
	cbnz	x11, LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	cmp	x9, #264
	mov	x9, x10
	b.ne	LBB0_14
LBB0_16:
	mov	w22, #0
	add	x8, x8, x10
	sub	x23, x8, #88
	ldr	x1, [x23, #16]
	cbz	x1, LBB0_25
LBB0_17:
Lloh22:
	adrp	x0, l_.str.1@PAGE
Lloh23:
	add	x0, x0, l_.str.1@PAGEOFF
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_PWC_TRACE
	ldr	x1, [x23, #24]
	sub	x0, x29, #68
	mov	w2, #12
	bl	_memcpy
	cbz	w22, LBB0_19
; %bb.18:
	ldurb	w8, [x29, #-68]
	orr	w8, w8, #0x80
	sturb	w8, [x29, #-68]
LBB0_19:
	sub	x2, x29, #68
	mov	x0, x21
	mov	w1, #4
	mov	w3, #12
	bl	_send_video_command
	tbnz	w0, #31, LBB0_7
; %bb.20:
	ldr	x8, [x23, #32]
	cmp	x8, #1
	b.lt	LBB0_23
; %bb.21:
	ldr	x8, [x21]
Lloh24:
	adrp	x9, _V4L2_PIX_FMT_YUV420@GOTPAGE
Lloh25:
	ldr	x9, [x9, _V4L2_PIX_FMT_YUV420@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_23
; %bb.22:
	ldr	w1, [x21, #68]
	sub	x2, x29, #68
	mov	x0, x21
	bl	_pwc_dec23_init
LBB0_23:
	mov	w8, #12
	str	w8, [x21, #8]
	ldr	x0, [x21, #16]
	sub	x1, x29, #68
	mov	w2, #12
	bl	_memcpy
	stp	w19, w20, [x21, #24]
	str	w22, [x21, #32]
	ldr	x8, [x23, #16]
Lloh27:
	adrp	x9, _pwc_image_sizes@GOTPAGE
Lloh28:
	ldr	x9, [x9, _pwc_image_sizes@GOTPAGEOFF]
	str	x8, [x21, #40]
Lloh29:
	ldr	x8, [x9]
	ldr	x8, [x8, w20, sxtw #3]
	stur	x8, [x21, #60]
	ldr	x9, [x23, #32]
	str	x9, [x21, #48]
	lsr	x10, x8, #32
	mul	w10, w10, w8
	add	w10, w10, w10, lsl #1
	lsl	w10, w10, #2
	add	w11, w10, #7
	cmp	w10, #0
	csel	w10, w11, w10, lt
	asr	w10, w10, #3
	sxtw	x8, w8
	mul	x8, x9, x8
	add	x11, x8, #3
	cmp	x8, #0
	csel	x8, x11, x8, lt
	lsr	x8, x8, #2
	cmp	x9, #1
	csel	w1, w10, w8, lt
	str	w1, [x21, #56]
	stp	x22, x9, [sp, #16]
	stp	x19, x20, [sp]
Lloh30:
	adrp	x0, l_.str.2@PAGE
Lloh31:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_PWC_TRACE
	mov	w0, #0
	b	LBB0_7
LBB0_24:
Lloh32:
	adrp	x0, l_.str@PAGE
Lloh33:
	add	x0, x0, l_.str@PAGEOFF
	bl	_PWC_DEBUG_SIZE
	add	x23, sp, #32
	ldr	x1, [x23, #16]
	cbnz	x1, LBB0_17
LBB0_25:
Lloh34:
	adrp	x8, _ENOENT@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_6
LBB0_26:
	bl	___stack_chk_fail
	.loh AdrpLdr	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_PSZ_MAX,4,2                    ; @PSZ_MAX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PSZ_VGA,4,2                    ; @PSZ_VGA
	.comm	_V4L2_PIX_FMT_YUV420,8,3        ; @V4L2_PIX_FMT_YUV420
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Choosing VGA/5 BAYER mode.\n"

	.comm	_Kiara_table,8,3                ; @Kiara_table
	.comm	_ENOENT,4,2                     ; @ENOENT
l_.str.1:                               ; @.str.1
	.asciz	"Using alternate setting %d.\n"

	.comm	_pwc_image_sizes,8,3            ; @pwc_image_sizes
l_.str.2:                               ; @.str.2
	.asciz	"frame_size=%d, vframes=%d, vsize=%d, vsnapshot=%d, vbandlength=%d\n"

	.no_dead_strip	_set_video_mode_Kiara
.subsections_via_symbols
