	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function konicawc_set_video_mode
_konicawc_set_video_mode:               ## @konicawc_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	24(%rdi), %r15
	movl	(%r15), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	(%rsi), %ebx
	movl	4(%rsi), %r14d
	movl	8(%rsi), %r12d
	testl	%ebx, %ebx
	jle	LBB0_7
## %bb.1:
	testl	%r14d, %r14d
	jle	LBB0_7
## %bb.2:
	leaq	L_.str(%rip), %rsi
	xorl	%r13d, %r13d
	movl	$2, %edi
	movl	%ebx, %edx
	movl	%r14d, %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), %r13
	xorl	%ecx, %ecx
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%rcx
	cmpq	%rcx, %r13
	je	LBB0_9
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%ebx, (%rdx,%rcx,8)
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	%r14d, 4(%rdx,%rcx,8)
	jne	LBB0_6
## %bb.8:
	movl	%ecx, %r13d
LBB0_9:
	cmpl	%eax, %r13d
	jle	LBB0_11
LBB0_10:
	leaq	L_.str.1(%rip), %rsi
	xorl	%r15d, %r15d
	movl	$1, %edi
	movl	%ebx, %edx
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_DEBUG
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_23
LBB0_7:
	movl	4(%r15), %r13d
	movq	_MAX_FRAME_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %r13d
	jg	LBB0_10
LBB0_11:
	testl	%r12d, %r12d
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	jle	LBB0_13
## %bb.12:
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_DEBUG
	movl	%r13d, %edi
	movl	%r12d, %esi
	callq	_konicawc_find_fps
	movl	%eax, %ebx
	movq	_spd_to_fps@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%r13d, %rcx
	movq	(%rax,%rcx,8), %rax
	movslq	%ebx, %rdx
	movl	(%rax,%rdx,4), %ecx
	leaq	L_.str.3(%rip), %rsi
	movl	$1, %edi
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_DEBUG
LBB0_13:
	movq	_MAX_SPEED@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jle	LBB0_15
## %bb.14:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_23
LBB0_15:
	leaq	L_.str.4(%rip), %rsi
	movl	$1, %edi
	movl	%r13d, %edx
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_DEBUG
	cmpl	4(%r15), %r13d
	jne	LBB0_18
## %bb.16:
	cmpl	(%r15), %ebx
	jne	LBB0_18
## %bb.17:
	leaq	L_.str.5(%rip), %rsi
	xorl	%r15d, %r15d
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_DEBUG
	jmp	LBB0_23
LBB0_18:
	movq	_camera_sizes@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%r13d, %rsi
	movl	(%rax,%rsi,8), %edx
	movl	4(%rax,%rsi,8), %ecx
	movq	_spd_to_fps@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%rsi,8), %rax
	movslq	%ebx, %r14
	movslq	(%rax,%r14,4), %rax
	imulq	$1431655766, %rax, %r8          ## imm = 0x55555556
	movq	%r8, %rax
	shrq	$63, %rax
	shrq	$32, %r8
	addl	%eax, %r8d
	leaq	L_.str.6(%rip), %rsi
	xorl	%edi, %edi
                                        ## kill: def $r8d killed $r8d killed $r8
	xorl	%eax, %eax
	callq	_DEBUG
	movl	%ebx, %r12d
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_konicawc_stop_data
	movq	_spd_to_iface@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%r14,4), %edx
	movl	%edx, (%rbx)
	leaq	L_.str.7(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_DEBUG
	movl	%r12d, (%r15)
	cmpl	%r13d, 4(%r15)
	je	LBB0_20
## %bb.19:
	movl	%r13d, 4(%r15)
	movq	%rbx, %rdi
	callq	_konicawc_set_camera_size
LBB0_20:
	leaq	16(%rbx), %rdi
	callq	_RingQueue_Flush
	movl	$-2, 8(%r15)
	movslq	4(%rbx), %rax
	cmpq	$-1, %rax
	je	LBB0_22
## %bb.21:
	movq	8(%rbx), %rcx
	leaq	(%rax,%rax,2), %rax
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rcx,%rax,8)
	movq	$0, 16(%rcx,%rax,8)
LBB0_22:
	movq	%rbx, %rdi
	callq	_konicawc_start_data
	xorl	%r15d, %r15d
LBB0_23:
	movl	%r15d, %eax
	addq	$24, %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	"trying to set fps to %d"

L_.str.3:                               ## @.str.3
	.asciz	"find_fps returned %d (%d)"

	.comm	_spd_to_fps,8,3                 ## @spd_to_fps
	.comm	_MAX_SPEED,4,2                  ## @MAX_SPEED
L_.str.4:                               ## @.str.4
	.asciz	"setting size to %d speed to %d"

L_.str.5:                               ## @.str.5
	.asciz	"Nothing to do"

L_.str.6:                               ## @.str.6
	.asciz	"setting to  %dx%d @ %d fps"

	.comm	_spd_to_iface,8,3               ## @spd_to_iface
L_.str.7:                               ## @.str.7
	.asciz	"new interface = %d"

	.no_dead_strip	_konicawc_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 konicawc_set_video_mode
_konicawc_set_video_mode:               ; @konicawc_set_video_mode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x19, x0
	ldr	x22, [x0, #24]
	ldr	w23, [x22]
	ldp	w24, w25, [x1]
	ldr	w21, [x1, #8]
	cmp	w24, #1
	ccmp	w25, #1, #8, ge
	b.ge	LBB0_2
; %bb.1:
	ldr	w20, [x22, #4]
Lloh0:
	adrp	x8, _MAX_FRAME_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_FRAME_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w20, w8
	b.gt	LBB0_9
	b	LBB0_11
LBB0_2:
	stp	x24, x25, [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	x20, 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	x20, x9
	b.eq	LBB0_8
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldur	w11, [x10, #-4]
	cmp	w11, w24
	b.ne	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w11, [x10]
	cmp	w11, w25
	b.ne	LBB0_4
; %bb.7:
	mov	x20, x9
LBB0_8:
	cmp	w20, w8
	b.le	LBB0_11
LBB0_9:
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
                                        ; kill: def $w24 killed $w24 killed $x24 def $x24
	stp	x24, x25, [sp]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_DEBUG
	b	LBB0_14
LBB0_10:
	mov	w20, #0
	cmp	w20, w8
	b.gt	LBB0_9
LBB0_11:
	cmp	w21, #1
	b.lt	LBB0_13
; %bb.12:
	str	x21, [sp]
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	bl	_DEBUG
	mov	x0, x20
	mov	x1, x21
	bl	_konicawc_find_fps
	mov	x21, x0
Lloh15:
	adrp	x8, _spd_to_fps@GOTPAGE
Lloh16:
	ldr	x8, [x8, _spd_to_fps@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	ldr	x8, [x8, w20, sxtw #3]
	ldr	w8, [x8, w0, sxtw #2]
	stp	x21, x8, [sp]
Lloh18:
	adrp	x1, l_.str.3@PAGE
Lloh19:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #1
	bl	_DEBUG
	mov	x23, x21
LBB0_13:
Lloh20:
	adrp	x8, _MAX_SPEED@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MAX_SPEED@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	cmp	w23, w8
	b.le	LBB0_15
LBB0_14:
Lloh23:
	adrp	x8, _EINVAL@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_24
LBB0_15:
	mov	x8, x23
	mov	x9, x20
	stp	x9, x8, [sp]
Lloh26:
	adrp	x1, l_.str.4@PAGE
Lloh27:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #1
	bl	_DEBUG
	ldr	w8, [x22, #4]
	cmp	w20, w8
	b.ne	LBB0_18
; %bb.16:
	ldr	w8, [x22]
	cmp	w23, w8
	b.ne	LBB0_18
; %bb.17:
Lloh28:
	adrp	x1, l_.str.5@PAGE
Lloh29:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	w0, #1
	bl	_DEBUG
	b	LBB0_23
LBB0_18:
Lloh30:
	adrp	x8, _camera_sizes@GOTPAGE
Lloh31:
	ldr	x8, [x8, _camera_sizes@GOTPAGEOFF]
Lloh32:
	ldr	x8, [x8]
	mov	x9, x20
	sbfiz	x9, x9, #3, #32
	add	x8, x8, x9
Lloh33:
	adrp	x10, _spd_to_fps@GOTPAGE
Lloh34:
	ldr	x10, [x10, _spd_to_fps@GOTPAGEOFF]
Lloh35:
	ldr	x10, [x10]
	ldr	x9, [x10, x9]
	sbfiz	x21, x23, #2, #32
	ldrsw	x9, [x9, x21]
	mov	w10, #21846
	movk	w10, #21845, lsl #16
	mul	x9, x9, x10
	lsr	x10, x9, #63
	lsr	x9, x9, #32
	add	w9, w9, w10
	ldp	w10, w8, [x8]
	stp	x10, x8, [sp]
	str	x9, [sp, #16]
Lloh36:
	adrp	x1, l_.str.6@PAGE
Lloh37:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w0, #0
	bl	_DEBUG
	mov	x0, x19
	bl	_konicawc_stop_data
Lloh38:
	adrp	x8, _spd_to_iface@GOTPAGE
Lloh39:
	ldr	x8, [x8, _spd_to_iface@GOTPAGEOFF]
Lloh40:
	ldr	x8, [x8]
	ldr	w8, [x8, x21]
	str	w8, [x19]
	str	x8, [sp]
Lloh41:
	adrp	x1, l_.str.7@PAGE
Lloh42:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	w0, #1
	bl	_DEBUG
	str	w23, [x22]
	ldr	w8, [x22, #4]
	cmp	w8, w20
	b.eq	LBB0_20
; %bb.19:
	str	w20, [x22, #4]
	mov	x0, x19
	bl	_konicawc_set_camera_size
LBB0_20:
	add	x0, x19, #16
	bl	_RingQueue_Flush
	mov	w8, #-2
	str	w8, [x22, #8]
	ldrsw	x8, [x19, #4]
	cmn	w8, #1
	b.eq	LBB0_22
; %bb.21:
	ldr	x9, [x19, #8]
	mov	w10, #24
	madd	x8, x8, x10, x9
	stp	xzr, xzr, [x8]
	str	xzr, [x8, #16]
LBB0_22:
	mov	x0, x19
	bl	_konicawc_start_data
LBB0_23:
	mov	w0, #0
LBB0_24:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.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	"trying to set fps to %d"

l_.str.3:                               ; @.str.3
	.asciz	"find_fps returned %d (%d)"

	.comm	_spd_to_fps,8,3                 ; @spd_to_fps
	.comm	_MAX_SPEED,4,2                  ; @MAX_SPEED
l_.str.4:                               ; @.str.4
	.asciz	"setting size to %d speed to %d"

l_.str.5:                               ; @.str.5
	.asciz	"Nothing to do"

l_.str.6:                               ; @.str.6
	.asciz	"setting to  %dx%d @ %d fps"

	.comm	_spd_to_iface,8,3               ; @spd_to_iface
l_.str.7:                               ; @.str.7
	.asciz	"new interface = %d"

	.no_dead_strip	_konicawc_set_video_mode
.subsections_via_symbols
