	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function konicawc_compress_iso
_konicawc_compress_iso:                 ## @konicawc_compress_iso
	.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
	cmpl	$0, 8(%rsi)
	jle	LBB0_1
## %bb.2:
	movq	%rdx, %r15
	movq	%rsi, %rbx
	movq	(%rdx), %rax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	24(%rdi), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	$8, %r13d
	xorl	%r14d, %r14d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
	movl	$0, -56(%rbp)                   ## 4-byte Folded Spill
	movq	%rdx, -96(%rbp)                 ## 8-byte Spill
	movq	%rsi, -88(%rbp)                 ## 8-byte Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	$1, %edi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	movl	%r12d, %ecx
	xorl	%eax, %eax
	callq	_DEBUG
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	incl	20(%rax)
LBB0_24:                                ##   in Loop: Header=BB0_3 Depth=1
	incq	%r14
	movslq	8(%rbx), %rax
	addq	$12, %r13
	cmpq	%rax, %r14
	jge	LBB0_25
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%rbx), %rax
	movl	-8(%rax,%r13), %r12d
	movl	-4(%rax,%r13), %r8d
	testl	%r8d, %r8d
	js	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	testl	%r12d, %r12d
	jle	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %ecx
	movslq	(%rax,%r13), %rax
	addq	(%rbx), %rax
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	movq	16(%r15), %rax
	movslq	(%rax,%r13), %rax
	movq	-104(%rbp), %rdx                ## 8-byte Reload
	movzbl	(%rdx,%rax), %eax
	movl	%eax, %r15d
	shrl	$6, %r15d
	andl	$1, %r15d
	movl	%eax, %edx
	andb	$-65, %dl
	testb	%al, %al
	cmovsl	%ecx, %r15d
	movzbl	%dl, %ebx
	cmovsl	%eax, %ebx
	cmpl	%ecx, %r15d
	je	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	leaq	L_.str.3(%rip), %rdx
	testl	%r15d, %r15d
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=1
	leaq	L_.str.2(%rip), %rdx
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	$2, %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_DEBUG
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, (%rdi)
	callq	_konicawc_report_buttonstat
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	cmpb	$1, %bl
	jne	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_3 Depth=1
	incl	-56(%rbp)                       ## 4-byte Folded Spill
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	incl	16(%rax)
	jmp	LBB0_24
LBB0_14:                                ##   in Loop: Header=BB0_3 Depth=1
	testb	%bl, %bl
	jle	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rdi
	movzbl	%bl, %edx
	leaq	L_.str.4(%rip), %rsi
	callq	_dev_info
	incl	-52(%rbp)                       ## 4-byte Folded Spill
LBB0_13:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	-96(%rbp), %r15                 ## 8-byte Reload
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_24
LBB0_16:                                ##   in Loop: Header=BB0_3 Depth=1
	je	LBB0_17
## %bb.20:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	$65280, -76(%rbp)               ## imm = 0xFF00
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpl	$-2, 4(%rax)
	jne	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	$2, %edi
	leaq	L_.str.6(%rip), %rsi
	xorl	%eax, %eax
	callq	_DEBUG
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	$-1, 4(%rax)
LBB0_22:                                ##   in Loop: Header=BB0_3 Depth=1
	andb	$127, %bl
	movb	%bl, -73(%rbp)
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	leaq	-76(%rbp), %rsi
	movl	$4, %edx
	xorl	%eax, %eax
	callq	_RingQueue_Enqueue
	movq	%rbx, %rdi
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addl	$4, %eax
	movq	-96(%rbp), %r15                 ## 8-byte Reload
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_23
LBB0_17:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpl	$-2, 4(%rax)
	movq	-96(%rbp), %r15                 ## 8-byte Reload
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_18
## %bb.19:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	$2, %edi
	leaq	L_.str.5(%rip), %rsi
	xorl	%eax, %eax
	callq	_DEBUG
	jmp	LBB0_24
LBB0_18:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	-44(%rbp), %eax                 ## 4-byte Reload
LBB0_23:                                ##   in Loop: Header=BB0_3 Depth=1
	incl	-48(%rbp)                       ## 4-byte Folded Spill
	addl	%r12d, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	-112(%rbp), %rsi                ## 8-byte Reload
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_RingQueue_Enqueue
	jmp	LBB0_24
LBB0_1:
	movl	$0, -56(%rbp)                   ## 4-byte Folded Spill
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_25:
	leaq	L_.str.7(%rip), %rsi
	movl	$8, %edi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	-56(%rbp), %ecx                 ## 4-byte Reload
	movl	-52(%rbp), %r8d                 ## 4-byte Reload
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %r9d
	xorl	%eax, %eax
	callq	_DEBUG
	movl	%ebx, %eax
	addq	$72, %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	"Data error: packet=%d. len=%d. status=%d."

L_.str.1:                               ## @.str.1
	.asciz	"button: %sclicked"

L_.str.2:                               ## @.str.2
	.space	1

L_.str.3:                               ## @.str.3
	.asciz	"un"

L_.str.4:                               ## @.str.4
	.asciz	"unknown status %2.2x\n"

L_.str.5:                               ## @.str.5
	.asciz	"dropping frame looking for image start"

L_.str.6:                               ## @.str.6
	.asciz	"found initial image"

L_.str.7:                               ## @.str.7
	.asciz	"finished: keep = %d discard = %d bad = %d added %d bytes"

	.no_dead_strip	_konicawc_compress_iso
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function konicawc_compress_iso
_konicawc_compress_iso:                 ; @konicawc_compress_iso
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #192
	.cfi_def_cfa_offset 192
	stp	x28, x27, [sp, #96]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #112]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #128]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #144]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #160]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #176]            ; 16-byte Folded Spill
	add	x29, sp, #176
	.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
	ldr	w8, [x1, #8]
	cmp	w8, #1
	b.lt	LBB0_20
; %bb.1:
	mov	x27, x2
	mov	x21, x1
	mov	x22, x0
	mov	x28, #0
	mov	x26, #0
	mov	w23, #0
	stp	xzr, xzr, [sp, #40]             ; 16-byte Folded Spill
	ldr	x8, [x2]
	str	x8, [sp, #56]                   ; 8-byte Folded Spill
	ldr	x8, [x0, #24]
	stp	xzr, x8, [sp, #72]              ; 16-byte Folded Spill
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	stp	x25, x9, [sp, #8]
	str	x26, [sp]
	mov	w0, #1
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_DEBUG
	ldr	w8, [x22, #20]
	add	w8, w8, #1
	str	w8, [x22, #20]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x26, x26, #1
	ldrsw	x8, [x21, #8]
	add	x28, x28, #12
	cmp	x26, x8
	b.ge	LBB0_21
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #16]
	add	x8, x8, x28
	ldp	w25, w9, [x8]
	tbnz	w9, #31, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w25, #0
	b.le	LBB0_10
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x9, [sp, #80]                   ; 8-byte Folded Reload
	ldr	w9, [x9]
	ldr	x10, [x21]
	str	x10, [sp, #64]                  ; 8-byte Folded Spill
	ldrsw	x24, [x8, #8]
	mov	x19, x27
	ldr	x8, [x27, #16]
	add	x8, x8, x28
	ldrsw	x8, [x8, #8]
	ldr	x10, [sp, #56]                  ; 8-byte Folded Reload
	ldrsb	w8, [x10, x8]
	ubfx	w10, w8, #6, #1
	and	w11, w8, #0xffffffbf
	cmp	w8, #0
	csel	w20, w10, w9, ge
	csel	w27, w11, w8, ge
	cmp	w20, w9
	b.eq	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w20, #0
Lloh2:
	adrp	x8, l_.str.2@PAGE
Lloh3:
	add	x8, x8, l_.str.2@PAGEOFF
Lloh4:
	adrp	x9, l_.str.3@PAGE
Lloh5:
	add	x9, x9, l_.str.3@PAGEOFF
	csel	x8, x9, x8, eq
	str	x8, [sp]
	mov	w0, #2
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_DEBUG
	ldr	x0, [sp, #80]                   ; 8-byte Folded Reload
	str	w20, [x0]
	bl	_konicawc_report_buttonstat
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	and	w8, w27, #0xff
	cmp	w8, #1
	b.ne	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [sp, #72]                   ; 8-byte Folded Reload
	add	w8, w8, #1
	str	x8, [sp, #72]                   ; 8-byte Folded Spill
	mov	x27, x19
	b	LBB0_3
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x22, #16]
	add	w8, w8, #1
	str	w8, [x22, #16]
	b	LBB0_3
LBB0_11:                                ;   in Loop: Header=BB0_4 Depth=1
	sxtb	w8, w27
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [x22, #8]
	and	w2, w27, #0xff
Lloh8:
	adrp	x1, l_.str.4@PAGE
Lloh9:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_info
	ldr	x8, [sp, #48]                   ; 8-byte Folded Reload
	add	w8, w8, #1
	str	x8, [sp, #48]                   ; 8-byte Folded Spill
	mov	x27, x19
	b	LBB0_3
LBB0_13:                                ;   in Loop: Header=BB0_4 Depth=1
	tst	w27, #0xff
	b.eq	LBB0_17
; %bb.14:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	w8, #65280
	stur	w8, [x29, #-84]
	ldr	x8, [sp, #80]                   ; 8-byte Folded Reload
	ldr	w8, [x8, #4]
	cmn	w8, #2
	b.ne	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #2
Lloh10:
	adrp	x1, l_.str.6@PAGE
Lloh11:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_DEBUG
	ldr	x8, [sp, #80]                   ; 8-byte Folded Reload
	mov	w9, #-1
	str	w9, [x8, #4]
LBB0_16:                                ;   in Loop: Header=BB0_4 Depth=1
	and	w8, w27, #0x7f
	sturb	w8, [x29, #-81]
	mov	w9, #4
	sub	x8, x29, #84
	stp	x8, x9, [sp]
	mov	x0, x22
	bl	_RingQueue_Enqueue
	add	w23, w23, #4
	mov	x27, x19
	b	LBB0_19
LBB0_17:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [sp, #80]                   ; 8-byte Folded Reload
	ldr	w8, [x8, #4]
	cmn	w8, #2
	mov	x27, x19
	b.ne	LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #2
Lloh12:
	adrp	x1, l_.str.5@PAGE
Lloh13:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_DEBUG
	b	LBB0_3
LBB0_19:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [sp, #64]                   ; 8-byte Folded Reload
	add	x8, x8, x24
	ldr	x9, [sp, #40]                   ; 8-byte Folded Reload
	add	w9, w9, #1
	str	x9, [sp, #40]                   ; 8-byte Folded Spill
	add	w23, w23, w25
	stp	x8, x25, [sp]
	mov	x0, x22
	bl	_RingQueue_Enqueue
	b	LBB0_3
LBB0_20:
	str	xzr, [sp, #72]                  ; 8-byte Folded Spill
	stp	xzr, xzr, [sp, #40]             ; 16-byte Folded Spill
	mov	w23, #0
LBB0_21:
	ldr	x8, [sp, #48]                   ; 8-byte Folded Reload
	stp	x8, x23, [sp, #16]
	ldr	x9, [sp, #72]                   ; 8-byte Folded Reload
	ldr	x8, [sp, #40]                   ; 8-byte Folded Reload
	stp	x8, x9, [sp]
Lloh14:
	adrp	x1, l_.str.7@PAGE
Lloh15:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	w0, #8
	bl	_DEBUG
	mov	x0, x23
	ldp	x29, x30, [sp, #176]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #160]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #144]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #128]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #112]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #192
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Data error: packet=%d. len=%d. status=%d."

l_.str.1:                               ; @.str.1
	.asciz	"button: %sclicked"

l_.str.2:                               ; @.str.2
	.space	1

l_.str.3:                               ; @.str.3
	.asciz	"un"

l_.str.4:                               ; @.str.4
	.asciz	"unknown status %2.2x\n"

l_.str.5:                               ; @.str.5
	.asciz	"dropping frame looking for image start"

l_.str.6:                               ; @.str.6
	.asciz	"found initial image"

l_.str.7:                               ; @.str.7
	.asciz	"finished: keep = %d discard = %d bad = %d added %d bytes"

	.no_dead_strip	_konicawc_compress_iso
.subsections_via_symbols
