	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_video_mode_Nala
_set_video_mode_Nala:                   ## @set_video_mode_Nala
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $edx killed $edx def $rdx
	testl	%esi, %esi
	js	LBB0_3
## %bb.1:
	leal	-26(%rdx), %eax
	cmpl	$-22, %eax
	jb	LBB0_3
## %bb.2:
	movl	%esi, %r15d
	movq	_PSZ_CIF@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jl	LBB0_3
## %bb.4:
	movl	%edx, %eax
	leaq	l___const.set_video_mode_Nala.frames2frames(%rip), %rcx
	movslq	(%rcx,%rax,4), %rsi
	leaq	l___const.set_video_mode_Nala.frames2table(%rip), %rax
	movslq	(%rax,%rsi,4), %rax
	movq	_Nala_table@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%r15d, %edx
	movq	(%rcx,%rdx,8), %r12
	leaq	(%rax,%rax,2), %r13
	cmpq	$0, (%r12,%r13,8)
	je	LBB0_3
## %bb.5:
	movq	%rdi, %r14
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	8(%r12,%r13,8), %rsi
	leaq	-43(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$3, %edx
	callq	_memcpy
	movl	64(%r14), %esi
	movq	%r14, %rdi
	movq	%rbx, %rdx
	movl	$3, %ecx
	callq	_send_video_command
	testl	%eax, %eax
	js	LBB0_6
## %bb.7:
	leaq	(%r12,%r13,8), %rbx
	cmpq	$0, 16(%r12,%r13,8)
	je	LBB0_10
## %bb.8:
	movq	(%r14), %rax
	movq	_V4L2_PIX_FMT_YUV420@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.9:
	movl	60(%r14), %edi
	movl	8(%r14), %esi
	movl	56(%r14), %ecx
	leaq	-43(%rbp), %rdx
	callq	_pwc_dec1_init
LBB0_10:
	movl	$3, 12(%r14)
	movq	16(%r14), %rdi
	leaq	-43(%rbp), %rsi
	movl	$3, %edx
	callq	_memcpy
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, 24(%r14)
	movl	%r15d, 28(%r14)
	movq	(%rbx), %rax
	movq	%rax, 32(%r14)
	movq	_pwc_image_sizes@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rax,%rcx,8), %rcx
	movq	%rcx, 48(%r14)
	movq	%rcx, %rax
	shrq	$32, %rax
	imull	%ecx, %eax
	leal	(%rax,%rax,2), %ecx
	movl	%ecx, %edx
	shrl	$31, %edx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, 40(%r14)
	cmpq	$0, 16(%rbx)
	je	LBB0_14
## %bb.11:
	cmpl	$4, 8(%r14)
	jg	LBB0_13
## %bb.12:
	leal	7(%rcx), %eax
	testl	%ecx, %ecx
	cmovnsl	%ecx, %eax
	movl	$528, 44(%r14)                  ## imm = 0x210
	sarl	$3, %eax
	movl	%eax, 40(%r14)
	jmp	LBB0_15
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_16:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_PWC_DEBUG_MODULE
	jmp	LBB0_16
LBB0_14:
	movl	$0, 44(%r14)
	jmp	LBB0_15
LBB0_13:
	movl	$704, 44(%r14)                  ## imm = 0x2C0
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	movl	%ecx, 40(%r14)
LBB0_15:
	xorl	%ebx, %ebx
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @__const.set_video_mode_Nala.frames2frames
l___const.set_video_mode_Nala.frames2frames:
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	4                               ## 0x4
	.long	5                               ## 0x5
	.long	5                               ## 0x5
	.long	7                               ## 0x7
	.long	7                               ## 0x7
	.long	10                              ## 0xa
	.long	10                              ## 0xa
	.long	10                              ## 0xa
	.long	12                              ## 0xc
	.long	12                              ## 0xc
	.long	15                              ## 0xf
	.long	15                              ## 0xf
	.long	15                              ## 0xf
	.long	15                              ## 0xf
	.long	20                              ## 0x14
	.long	20                              ## 0x14
	.long	20                              ## 0x14
	.long	20                              ## 0x14
	.long	20                              ## 0x14
	.long	24                              ## 0x18
	.long	24                              ## 0x18
	.long	24                              ## 0x18
	.long	24                              ## 0x18
	.long	24                              ## 0x18
	.long	24                              ## 0x18
	.long	24                              ## 0x18
	.long	24                              ## 0x18

	.p2align	4                               ## @__const.set_video_mode_Nala.frames2table
l___const.set_video_mode_Nala.frames2table:
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	2                               ## 0x2
	.long	2                               ## 0x2
	.long	3                               ## 0x3
	.long	3                               ## 0x3
	.long	4                               ## 0x4
	.long	4                               ## 0x4
	.long	4                               ## 0x4
	.long	5                               ## 0x5
	.long	5                               ## 0x5
	.long	5                               ## 0x5
	.long	5                               ## 0x5
	.long	5                               ## 0x5
	.long	6                               ## 0x6
	.long	6                               ## 0x6
	.long	6                               ## 0x6
	.long	6                               ## 0x6
	.long	7                               ## 0x7
	.long	7                               ## 0x7
	.long	7                               ## 0x7
	.long	7                               ## 0x7
	.long	7                               ## 0x7
	.long	7                               ## 0x7
	.long	7                               ## 0x7

	.comm	_PSZ_CIF,4,2                    ## @PSZ_CIF
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_Nala_table,8,3                 ## @Nala_table
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to send video command... %d\n"

	.comm	_V4L2_PIX_FMT_YUV420,8,3        ## @V4L2_PIX_FMT_YUV420
	.comm	_pwc_image_sizes,8,3            ## @pwc_image_sizes
	.no_dead_strip	_set_video_mode_Nala
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_video_mode_Nala
_set_video_mode_Nala:                   ; @set_video_mode_Nala
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	tbnz	w1, #31, LBB0_11
; %bb.1:
	sub	w8, w2, #26
	cmn	w8, #22
	b.lo	LBB0_11
; %bb.2:
	mov	x20, x1
Lloh0:
	adrp	x8, _PSZ_CIF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PSZ_CIF@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.lt	LBB0_11
; %bb.3:
Lloh3:
	adrp	x8, l___const.set_video_mode_Nala.frames2frames@PAGE
Lloh4:
	add	x8, x8, l___const.set_video_mode_Nala.frames2frames@PAGEOFF
	ldrsw	x22, [x8, w2, uxtw #2]
Lloh5:
	adrp	x8, l___const.set_video_mode_Nala.frames2table@PAGE
Lloh6:
	add	x8, x8, l___const.set_video_mode_Nala.frames2table@PAGEOFF
	ldrsw	x25, [x8, x22, lsl #2]
Lloh7:
	adrp	x8, _Nala_table@GOTPAGE
Lloh8:
	ldr	x8, [x8, _Nala_table@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	ldr	x26, [x8, w20, uxtw #3]
	mov	w8, #24
	madd	x23, x25, x8, x26
	ldr	x8, [x23]
	cbz	x8, LBB0_11
; %bb.4:
	mov	x19, x0
	mov	w8, #24
	madd	x8, x25, x8, x26
	ldr	x1, [x8, #8]
	add	x0, sp, #13
	mov	w2, #3
	bl	_memcpy
	ldr	w1, [x19, #64]
	add	x2, sp, #13
	mov	x0, x19
	mov	w3, #3
	bl	_send_video_command
	tbnz	w0, #31, LBB0_13
; %bb.5:
	mov	w24, w20
	mov	w8, #24
	madd	x21, x25, x8, x26
	ldr	x8, [x21, #16]!
	cbz	x8, LBB0_8
; %bb.6:
	ldr	x8, [x19]
Lloh10:
	adrp	x9, _V4L2_PIX_FMT_YUV420@GOTPAGE
Lloh11:
	ldr	x9, [x9, _V4L2_PIX_FMT_YUV420@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.7:
	ldr	w1, [x19, #8]
	ldp	w3, w0, [x19, #56]
	add	x2, sp, #13
	bl	_pwc_dec1_init
LBB0_8:
	mov	w8, #3
	str	w8, [x19, #12]
	ldr	x0, [x19, #16]
	add	x1, sp, #13
	mov	w2, #3
	bl	_memcpy
	stp	w22, w20, [x19, #24]
	ldr	x8, [x23]
	str	x8, [x19, #32]
Lloh13:
	adrp	x8, _pwc_image_sizes@GOTPAGE
Lloh14:
	ldr	x8, [x8, _pwc_image_sizes@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	ldr	x8, [x8, x24, lsl #3]
	str	x8, [x19, #48]
	lsr	x9, x8, #32
	mul	w8, w9, w8
	add	w9, w8, w8, lsl #1
	cmp	w9, #0
	cinc	w10, w9, lt
	asr	w10, w10, #1
	str	w10, [x19, #40]
	ldr	x10, [x21]
	cbz	x10, LBB0_14
; %bb.9:
	ldr	w10, [x19, #8]
	cmp	w10, #4
	b.gt	LBB0_15
; %bb.10:
	mov	w21, #0
	mov	w8, #528
	add	w10, w9, #7
	cmp	w9, #0
	csel	w9, w10, w9, lt
	asr	w9, w9, #3
	stp	w9, w8, [x19, #40]
	b	LBB0_12
LBB0_11:
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_12:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_13:
	mov	x21, x0
Lloh19:
	adrp	x0, l_.str@PAGE
Lloh20:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_PWC_DEBUG_MODULE
	b	LBB0_12
LBB0_14:
	mov	w21, #0
	str	wzr, [x19, #44]
	b	LBB0_12
LBB0_15:
	mov	w21, #0
	mov	w9, #704
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
	stp	w8, w9, [x19, #40]
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @__const.set_video_mode_Nala.frames2frames
l___const.set_video_mode_Nala.frames2frames:
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	4                               ; 0x4
	.long	5                               ; 0x5
	.long	5                               ; 0x5
	.long	7                               ; 0x7
	.long	7                               ; 0x7
	.long	10                              ; 0xa
	.long	10                              ; 0xa
	.long	10                              ; 0xa
	.long	12                              ; 0xc
	.long	12                              ; 0xc
	.long	15                              ; 0xf
	.long	15                              ; 0xf
	.long	15                              ; 0xf
	.long	15                              ; 0xf
	.long	20                              ; 0x14
	.long	20                              ; 0x14
	.long	20                              ; 0x14
	.long	20                              ; 0x14
	.long	20                              ; 0x14
	.long	24                              ; 0x18
	.long	24                              ; 0x18
	.long	24                              ; 0x18
	.long	24                              ; 0x18
	.long	24                              ; 0x18
	.long	24                              ; 0x18
	.long	24                              ; 0x18
	.long	24                              ; 0x18

	.p2align	2                               ; @__const.set_video_mode_Nala.frames2table
l___const.set_video_mode_Nala.frames2table:
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.long	1                               ; 0x1
	.long	1                               ; 0x1
	.long	2                               ; 0x2
	.long	2                               ; 0x2
	.long	3                               ; 0x3
	.long	3                               ; 0x3
	.long	4                               ; 0x4
	.long	4                               ; 0x4
	.long	4                               ; 0x4
	.long	5                               ; 0x5
	.long	5                               ; 0x5
	.long	5                               ; 0x5
	.long	5                               ; 0x5
	.long	5                               ; 0x5
	.long	6                               ; 0x6
	.long	6                               ; 0x6
	.long	6                               ; 0x6
	.long	6                               ; 0x6
	.long	7                               ; 0x7
	.long	7                               ; 0x7
	.long	7                               ; 0x7
	.long	7                               ; 0x7
	.long	7                               ; 0x7
	.long	7                               ; 0x7
	.long	7                               ; 0x7

	.comm	_PSZ_CIF,4,2                    ; @PSZ_CIF
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_Nala_table,8,3                 ; @Nala_table
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to send video command... %d\n"

	.comm	_V4L2_PIX_FMT_YUV420,8,3        ; @V4L2_PIX_FMT_YUV420
	.comm	_pwc_image_sizes,8,3            ; @pwc_image_sizes
	.no_dead_strip	_set_video_mode_Nala
.subsections_via_symbols
