	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qcm_set_video_mode
_qcm_set_video_mode:                    ## @qcm_set_video_mode
	.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
	movq	%rdi, %r14
	movl	(%rsi), %r13d
	movl	4(%rsi), %r15d
	movq	24(%rdi), %r12
	testl	%r13d, %r13d
	jle	LBB0_7
## %bb.1:
	testl	%r15d, %r15d
	jle	LBB0_7
## %bb.2:
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movl	$2, %edi
	movl	%r13d, %edx
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_DEBUG
	movq	_MAX_FRAME_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	js	LBB0_9
## %bb.3:
	movq	_camera_sizes@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	leaq	1(%rax), %rbx
	xorl	%ecx, %ecx
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%rcx
	cmpq	%rcx, %rbx
	je	LBB0_9
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%r13d, (%rdx,%rcx,8)
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	%r15d, 4(%rdx,%rcx,8)
	jne	LBB0_6
## %bb.8:
	movl	%ecx, %ebx
LBB0_9:
	cmpl	%eax, %ebx
	jle	LBB0_11
LBB0_10:
	leaq	L_.str.1(%rip), %rsi
	xorl	%r12d, %r12d
	movl	$1, %edi
	movl	%r13d, %edx
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_DEBUG
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_19
LBB0_7:
	movl	(%r12), %ebx
	movq	_MAX_FRAME_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %ebx
	jg	LBB0_10
LBB0_11:
	cmpl	(%r12), %ebx
	jne	LBB0_13
## %bb.12:
	leaq	L_.str.2(%rip), %rsi
	xorl	%r12d, %r12d
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_DEBUG
	jmp	LBB0_19
LBB0_13:
	movq	%r14, %rdi
	callq	_qcm_stop_data
	movl	(%r12), %r15d
	cmpl	%ebx, %r15d
	je	LBB0_16
## %bb.14:
	movq	%r12, %r13
	movl	%ebx, (%r12)
	movq	%r14, %rdi
	callq	_qcm_set_camera_size
	testl	%eax, %eax
	je	LBB0_16
## %bb.15:
	movl	%eax, %r12d
	leaq	L_.str.3(%rip), %rdi
	movl	%eax, %esi
	callq	_err
	movl	%r15d, (%r13)
	jmp	LBB0_19
LBB0_16:
	leaq	16(%r14), %rdi
	callq	_RingQueue_Flush
	movslq	(%r14), %rax
	cmpq	$-1, %rax
	je	LBB0_18
## %bb.17:
	movq	8(%r14), %rcx
	leaq	(%rax,%rax,2), %rax
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rcx,%rax,8)
	movq	$0, 16(%rcx,%rax,8)
LBB0_18:
	movq	%r14, %rdi
	callq	_qcm_start_data
	xorl	%r12d, %r12d
	xorl	%edi, %edi
	movl	%eax, %esi
	callq	_CHECK_RET
LBB0_19:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"trying to find size %d,%d"

	.comm	_MAX_FRAME_SIZE,4,2             ## @MAX_FRAME_SIZE
	.comm	_camera_sizes,8,3               ## @camera_sizes
L_.str.1:                               ## @.str.1
	.asciz	"couldn't find size %d,%d"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"Nothing to do"

L_.str.3:                               ## @.str.3
	.asciz	"Couldn't set camera size, err=%d"

	.no_dead_strip	_qcm_set_video_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qcm_set_video_mode
_qcm_set_video_mode:                    ; @qcm_set_video_mode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x0
	ldp	w20, w22, [x1]
	ldr	x21, [x0, #24]
	cmp	w20, #1
	ccmp	w22, #1, #8, ge
	b.ge	LBB0_2
; %bb.1:
	ldr	w23, [x21]
Lloh0:
	adrp	x8, _MAX_FRAME_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_FRAME_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w23, w8
	b.gt	LBB0_9
	b	LBB0_11
LBB0_2:
	stp	x20, x22, [sp]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #2
	bl	_DEBUG
Lloh5:
	adrp	x8, _MAX_FRAME_SIZE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MAX_FRAME_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	tbnz	w8, #31, LBB0_10
; %bb.3:
	mov	x9, #0
Lloh8:
	adrp	x10, _camera_sizes@GOTPAGE
Lloh9:
	ldr	x10, [x10, _camera_sizes@GOTPAGEOFF]
Lloh10:
	ldr	x10, [x10]
	add	x23, x8, #1
	add	x10, x10, #4
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x9, x9, #1
	add	x10, x10, #8
	cmp	x23, x9
	b.eq	LBB0_8
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldur	w11, [x10, #-4]
	cmp	w11, w20
	b.ne	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w11, [x10]
	cmp	w11, w22
	b.ne	LBB0_4
; %bb.7:
	mov	x23, x9
LBB0_8:
	cmp	w23, w8
	b.le	LBB0_11
LBB0_9:
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	stp	x20, x22, [sp]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_DEBUG
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_20
LBB0_10:
	mov	w23, #0
	cmp	w23, w8
	b.gt	LBB0_9
LBB0_11:
	ldr	w8, [x21]
	cmp	w23, w8
	b.ne	LBB0_13
; %bb.12:
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	bl	_DEBUG
	b	LBB0_19
LBB0_13:
	mov	x0, x19
	bl	_qcm_stop_data
	ldr	w22, [x21]
	cmp	w22, w23
	b.eq	LBB0_16
; %bb.14:
	str	w23, [x21]
	mov	x0, x19
	bl	_qcm_set_camera_size
	cbz	w0, LBB0_16
; %bb.15:
	mov	x20, x0
Lloh18:
	adrp	x0, l_.str.3@PAGE
Lloh19:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x20
	bl	_err
	str	w22, [x21]
	b	LBB0_20
LBB0_16:
	add	x0, x19, #16
	bl	_RingQueue_Flush
	ldrsw	x8, [x19]
	cmn	w8, #1
	b.eq	LBB0_18
; %bb.17:
	ldr	x9, [x19, #8]
	mov	w10, #24
	madd	x8, x8, x10, x9
	stp	xzr, xzr, [x8]
	str	xzr, [x8, #16]
LBB0_18:
	mov	x0, x19
	bl	_qcm_start_data
	mov	x1, x0
	mov	w0, #0
	bl	_CHECK_RET
LBB0_19:
	mov	w20, #0
LBB0_20:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"trying to find size %d,%d"

	.comm	_MAX_FRAME_SIZE,4,2             ; @MAX_FRAME_SIZE
	.comm	_camera_sizes,8,3               ; @camera_sizes
l_.str.1:                               ; @.str.1
	.asciz	"couldn't find size %d,%d"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"Nothing to do"

l_.str.3:                               ; @.str.3
	.asciz	"Couldn't set camera size, err=%d"

	.no_dead_strip	_qcm_set_video_mode
.subsections_via_symbols
