	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ibmcam_model2_320x240_parse_lines
_ibmcam_model2_320x240_parse_lines:     ## @ibmcam_model2_320x240_parse_lines
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	leal	-128(%rdi), %eax
	cmpl	$2, %eax
	ja	LBB0_3
## %bb.1:
	movq	%rsi, %r12
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_VIDEOSIZE_X
	movl	%eax, %r14d
	movl	(%rbx), %edi
	callq	_VIDEOSIZE_Y
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	movl	8(%rbx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	(%r12), %edi
	callq	_VIDEOSIZE_X
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	_V4L_BYTES_PER_PIXEL@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	leal	(%r14,%r14), %r13d
	xorl	%edi, %edi
	cmpl	$705, %r13d                     ## imm = 0x2C1
	setb	%dil
	callq	_assert
	leaq	4(%rbx), %r15
	movq	%r15, %rdi
	callq	_RingQueue_GetLength
	cmpl	%r13d, %eax
	jae	LBB0_4
## %bb.2:
	movq	_scan_Out@GOTPCREL(%rip), %rax
	jmp	LBB0_21
LBB0_3:
	leaq	L_.str(%rip), %rdi
	callq	_err
	movq	_scan_Out@GOTPCREL(%rip), %rax
	jmp	LBB0_21
LBB0_4:
	movq	%rbx, -104(%rbp)                ## 8-byte Spill
	leaq	_ibmcam_model2_320x240_parse_lines.lineBuffer(%rip), %rsi
	movq	%r15, %rdi
	movl	%r13d, %edx
	callq	_RingQueue_Dequeue
	movl	(%r12), %edi
	movl	4(%r12), %ebx
	addl	$2, %ebx
	callq	_VIDEOSIZE_Y
	cmpl	%eax, %ebx
	jge	LBB0_20
## %bb.5:
	movslq	-56(%rbp), %rax                 ## 4-byte Folded Reload
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	imulq	%rax, %r15
	movslq	4(%r12), %rax
	movslq	%r15d, %rcx
	imulq	%rax, %rcx
	addq	8(%r12), %rcx
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movl	(%r12), %edi
	callq	_VIDEOSIZE_X
	testl	%eax, %eax
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	jle	LBB0_18
## %bb.6:
	sarl	$8, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movslq	%r14d, %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_9 Depth=1
	movq	%rbx, %rdi
	callq	_IBMCAM_T
	cmpl	$1, (%rax)
	movl	$255, %r13d
	movl	$0, %r12d
	cmovel	%r13d, %r12d
	movl	$255, %r15d
	movl	$0, %eax
	cmovel	%eax, %r15d
	movq	%rbx, %rdi
	callq	_IBMCAM_T
	movl	$0, (%rax)
LBB0_8:                                 ##   in Loop: Header=BB0_9 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	4(%rdi), %edx
	movl	%r14d, %esi
	movl	%r12d, %ecx
	movl	%r13d, %r8d
	movq	%rdi, %r12
	movl	%r15d, %r9d
	callq	_RGB24_PUTPIXEL
	incq	%r14
	movl	(%r12), %edi
	callq	_VIDEOSIZE_X
	cltq
	cmpq	%rax, %r14
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	jge	LBB0_18
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	_FLAGS_DISPLAY_HINTS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_flags@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%rbx, %rdi
	callq	_IBMCAM_T
	cmpl	$0, (%rax)
	jne	LBB0_7
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	4(%r12), %eax
	addl	$2, %eax
	cmpl	-68(%rbp), %eax                 ## 4-byte Folded Reload
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	jge	LBB0_17
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	cmpq	%rbx, %r14
	jge	LBB0_17
## %bb.13:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	%r14d, %eax
	andl	$2147483646, %eax               ## imm = 0x7FFFFFFE
	leaq	_ibmcam_model2_320x240_parse_lines.lineBuffer(%rip), %rdi
	movzbl	(%r14,%rdi), %esi
	movl	%r14d, %ecx
	orl	$1, %ecx
	addq	%rbx, %rcx
	movzbl	(%rdi,%rcx), %edx
	addq	%rbx, %rax
	movzbl	(%rdi,%rax), %ecx
	leal	(%rdx,%rsi), %eax
	addl	%ecx, %eax
	imull	$43691, %eax, %eax              ## imm = 0xAAAB
	shrl	$17, %eax
	movq	_FLAGS_MONOCHROME@GOTPCREL(%rip), %rdi
	movl	(%rdi), %edi
	movl	%esi, %r12d
	movq	_flags@GOTPCREL(%rip), %rbx
	testl	%edi, (%rbx)
	cmovnel	%eax, %r12d
	movl	%edx, %r13d
	cmovnel	%eax, %r13d
	movl	%ecx, %r15d
	cmovnel	%eax, %r15d
	jne	LBB0_8
## %bb.14:                              ##   in Loop: Header=BB0_9 Depth=1
	cmpl	$128, -44(%rbp)                 ## 4-byte Folded Reload
	je	LBB0_8
## %bb.15:                              ##   in Loop: Header=BB0_9 Depth=1
	subl	%eax, %esi
	subl	%eax, %edx
	subl	%eax, %ecx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	imull	%edi, %esi
	leal	127(%rsi), %r12d
	testl	%esi, %esi
	cmovnsl	%esi, %r12d
	sarl	$7, %r12d
	imull	%edi, %edx
	leal	127(%rdx), %r13d
	testl	%edx, %edx
	cmovnsl	%edx, %r13d
	sarl	$7, %r13d
	imull	%edi, %ecx
	leal	127(%rcx), %r15d
	testl	%ecx, %ecx
	cmovnsl	%ecx, %r15d
	sarl	$7, %r15d
	addl	%eax, %r12d
	addl	%eax, %r13d
	addl	%eax, %r15d
	movl	%r12d, %edi
	xorl	%esi, %esi
	movl	$255, %edx
	callq	_RESTRICT_TO_RANGE
	movl	%r13d, %edi
	xorl	%esi, %esi
	movl	$255, %edx
	callq	_RESTRICT_TO_RANGE
	movl	%r15d, %edi
	xorl	%esi, %esi
	movl	$255, %edx
	callq	_RESTRICT_TO_RANGE
	jmp	LBB0_8
LBB0_17:
	movq	_V4L_BYTES_PER_PIXEL@GOTPCREL(%rip), %rax
	imull	(%rax), %r14d
	movl	%r15d, %edx
	subl	%r14d, %edx
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	xorl	%esi, %esi
	callq	_memset
LBB0_18:
	movl	4(%r12), %r14d
	addl	$2, %r14d
	movl	%r14d, 4(%r12)
	addq	%r15, %r15
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	addq	%r15, (%rax)
	movq	_Deinterlace_FillOddLines@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r12)
	movl	(%r12), %edi
	callq	_VIDEOSIZE_Y
	cmpl	%eax, %r14d
	jge	LBB0_20
## %bb.19:
	movq	_scan_Continue@GOTPCREL(%rip), %rax
	jmp	LBB0_21
LBB0_20:
	movq	_scan_NextFrame@GOTPCREL(%rip), %rax
LBB0_21:
	movl	(%rax), %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_ibmcam_model2_320x240_parse_lines.lineBuffer,704,4 ## @ibmcam_model2_320x240_parse_lines.lineBuffer
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ibmcam_model2_320x240_parse_lines: Wrong mode."

	.comm	_scan_Out,4,2                   ## @scan_Out
	.comm	_V4L_BYTES_PER_PIXEL,4,2        ## @V4L_BYTES_PER_PIXEL
	.comm	_scan_NextFrame,4,2             ## @scan_NextFrame
	.comm	_flags,4,2                      ## @flags
	.comm	_FLAGS_DISPLAY_HINTS,4,2        ## @FLAGS_DISPLAY_HINTS
	.comm	_FLAGS_MONOCHROME,4,2           ## @FLAGS_MONOCHROME
	.comm	_Deinterlace_FillOddLines,4,2   ## @Deinterlace_FillOddLines
	.comm	_scan_Continue,4,2              ## @scan_Continue
	.no_dead_strip	_ibmcam_model2_320x240_parse_lines
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ibmcam_model2_320x240_parse_lines
_ibmcam_model2_320x240_parse_lines:     ; @ibmcam_model2_320x240_parse_lines
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x0
	ldr	w0, [x0]
	sub	w8, w0, #128
	cmp	w8, #2
	b.hi	LBB0_13
; %bb.1:
	mov	x23, x2
	mov	x19, x1
	bl	_VIDEOSIZE_X
	mov	x25, x0
	ldr	w0, [x21]
	bl	_VIDEOSIZE_Y
	mov	x28, x0
	ldr	w20, [x21, #8]
	ldr	w0, [x19]
	bl	_VIDEOSIZE_X
	mov	x24, x0
Lloh0:
	adrp	x8, _V4L_BYTES_PER_PIXEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _V4L_BYTES_PER_PIXEL@GOTPAGEOFF]
Lloh2:
	ldrsw	x22, [x8]
	lsl	w26, w25, #1
	cmp	w26, #705
	cset	w0, lo
	bl	_assert
	add	x27, x21, #4
	mov	x0, x27
	bl	_RingQueue_GetLength
	cmp	w0, w26
	b.lo	LBB0_14
; %bb.2:
	str	w28, [sp, #44]                  ; 4-byte Folded Spill
	str	x23, [sp, #24]                  ; 8-byte Folded Spill
Lloh3:
	adrp	x1, _ibmcam_model2_320x240_parse_lines.lineBuffer@PAGE
Lloh4:
	add	x1, x1, _ibmcam_model2_320x240_parse_lines.lineBuffer@PAGEOFF
	mov	x0, x27
	mov	x2, x26
	bl	_RingQueue_Dequeue
	ldp	w0, w8, [x19]
	add	w26, w8, #2
	bl	_VIDEOSIZE_Y
Lloh5:
	adrp	x23, _scan_NextFrame@GOTPAGE
Lloh6:
	ldr	x23, [x23, _scan_NextFrame@GOTPAGEOFF]
	cmp	w26, w0
	b.ge	LBB0_15
; %bb.3:
	sxtw	x8, w24
	mul	x8, x22, x8
	str	x8, [sp, #16]                   ; 8-byte Folded Spill
	ldr	x26, [x19, #8]
	ldp	w0, w27, [x19]
                                        ; kill: def $w27 killed $w27 def $x27
	sxtw	x27, w27
	bl	_VIDEOSIZE_X
	cmp	w0, #1
	b.lt	LBB0_17
; %bb.4:
	mov	x24, #0
	asr	w20, w20, #8
	sxtw	x9, w25
Lloh7:
	adrp	x8, _ibmcam_model2_320x240_parse_lines.lineBuffer@PAGE
Lloh8:
	add	x8, x8, _ibmcam_model2_320x240_parse_lines.lineBuffer@PAGEOFF
	str	x9, [sp, #32]                   ; 8-byte Folded Spill
	add	x22, x8, x9
Lloh9:
	adrp	x25, _flags@GOTPAGE
Lloh10:
	ldr	x25, [x25, _flags@GOTPAGEOFF]
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	madd	x8, x27, x8, x26
	str	x8, [sp, #8]                    ; 8-byte Folded Spill
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x21
	bl	_IBMCAM_T
	ldr	w8, [x0]
	mov	w27, #255
	cmp	w8, #1
	csel	w26, w27, wzr, eq
	csel	w28, wzr, w27, eq
	mov	x0, x21
	bl	_IBMCAM_T
	str	wzr, [x0]
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	w2, [x19, #4]
	mov	x0, x19
	mov	x1, x24
	mov	x3, x26
	mov	x4, x27
	mov	x5, x28
	bl	_RGB24_PUTPIXEL
	add	x24, x24, #1
	ldr	w0, [x19]
	bl	_VIDEOSIZE_X
	cmp	x24, w0, sxtw
	b.ge	LBB0_17
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x25]
Lloh11:
	adrp	x9, _FLAGS_DISPLAY_HINTS@GOTPAGE
Lloh12:
	ldr	x9, [x9, _FLAGS_DISPLAY_HINTS@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x21
	bl	_IBMCAM_T
	ldr	w8, [x0]
	cbnz	w8, LBB0_5
LBB0_9:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [x19, #4]
	add	w8, w8, #2
	ldr	w9, [sp, #44]                   ; 4-byte Folded Reload
	cmp	w8, w9
	ldr	x8, [sp, #32]                   ; 8-byte Folded Reload
	ccmp	x24, x8, #0, lt
	b.ge	LBB0_16
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	and	x8, x24, #0x7ffffffe
Lloh14:
	adrp	x9, _ibmcam_model2_320x240_parse_lines.lineBuffer@PAGE
Lloh15:
	add	x9, x9, _ibmcam_model2_320x240_parse_lines.lineBuffer@PAGEOFF
	ldrb	w9, [x9, x24]
	and	x10, x24, #0xfffffffe
	add	x10, x22, x10
	ldrb	w10, [x10, #1]
	ldrb	w11, [x22, x8]
	add	w8, w10, w9
	add	w8, w8, w11
	mov	w12, #43691
	mul	w8, w8, w12
	lsr	w8, w8, #17
	ldr	w12, [x25]
Lloh16:
	adrp	x13, _FLAGS_MONOCHROME@GOTPAGE
Lloh17:
	ldr	x13, [x13, _FLAGS_MONOCHROME@GOTPAGEOFF]
Lloh18:
	ldr	w13, [x13]
	ands	w12, w13, w12
	csel	w26, w8, w9, ne
	csel	w27, w8, w10, ne
	csel	w28, w8, w11, ne
	cbnz	w12, LBB0_6
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=1
	cmp	w20, #128
	b.eq	LBB0_6
; %bb.12:                               ;   in Loop: Header=BB0_7 Depth=1
	sub	w9, w9, w8
	sub	w10, w10, w8
	sub	w11, w11, w8
	mul	w9, w9, w20
	add	w12, w9, #127
	cmp	w9, #0
	csel	w9, w12, w9, lt
	mul	w10, w10, w20
	add	w12, w10, #127
	cmp	w10, #0
	csel	w10, w12, w10, lt
	mul	w11, w11, w20
	add	w12, w11, #127
	add	w26, w8, w9, asr #7
	cmp	w11, #0
	csel	w9, w12, w11, lt
	add	w27, w8, w10, asr #7
	add	w28, w8, w9, asr #7
	mov	x0, x26
	mov	w1, #0
	mov	w2, #255
	bl	_RESTRICT_TO_RANGE
	mov	x0, x27
	mov	w1, #0
	mov	w2, #255
	bl	_RESTRICT_TO_RANGE
	mov	x0, x28
	mov	w1, #0
	mov	w2, #255
	bl	_RESTRICT_TO_RANGE
	b	LBB0_6
LBB0_13:
Lloh19:
	adrp	x0, l_.str@PAGE
Lloh20:
	add	x0, x0, l_.str@PAGEOFF
	bl	_err
LBB0_14:
Lloh21:
	adrp	x23, _scan_Out@GOTPAGE
Lloh22:
	ldr	x23, [x23, _scan_Out@GOTPAGEOFF]
LBB0_15:
	ldr	w0, [x23]
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_16:
Lloh23:
	adrp	x8, _V4L_BYTES_PER_PIXEL@GOTPAGE
Lloh24:
	ldr	x8, [x8, _V4L_BYTES_PER_PIXEL@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	mul	w8, w8, w24
	ldp	x0, x9, [sp, #8]                ; 16-byte Folded Reload
	sub	w2, w9, w8
	mov	w1, #0
	bl	_memset
LBB0_17:
	ldp	w0, w8, [x19]
	add	w20, w8, #2
	str	w20, [x19, #4]
	ldp	x8, x10, [sp, #16]              ; 16-byte Folded Reload
	lsl	w8, w8, #1
	ldr	x9, [x10]
	add	x8, x9, w8, sxtw
	str	x8, [x10]
Lloh26:
	adrp	x8, _Deinterlace_FillOddLines@GOTPAGE
Lloh27:
	ldr	x8, [x8, _Deinterlace_FillOddLines@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	str	w8, [x19, #16]
	bl	_VIDEOSIZE_Y
Lloh29:
	adrp	x8, _scan_Continue@GOTPAGE
Lloh30:
	ldr	x8, [x8, _scan_Continue@GOTPAGEOFF]
	cmp	w20, w0
	csel	x23, x8, x23, lt
	b	LBB0_15
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_ibmcam_model2_320x240_parse_lines.lineBuffer,704,0 ; @ibmcam_model2_320x240_parse_lines.lineBuffer
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ibmcam_model2_320x240_parse_lines: Wrong mode."

	.comm	_scan_Out,4,2                   ; @scan_Out
	.comm	_V4L_BYTES_PER_PIXEL,4,2        ; @V4L_BYTES_PER_PIXEL
	.comm	_scan_NextFrame,4,2             ; @scan_NextFrame
	.comm	_flags,4,2                      ; @flags
	.comm	_FLAGS_DISPLAY_HINTS,4,2        ; @FLAGS_DISPLAY_HINTS
	.comm	_FLAGS_MONOCHROME,4,2           ; @FLAGS_MONOCHROME
	.comm	_Deinterlace_FillOddLines,4,2   ; @Deinterlace_FillOddLines
	.comm	_scan_Continue,4,2              ; @scan_Continue
	.no_dead_strip	_ibmcam_model2_320x240_parse_lines
.subsections_via_symbols
