	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function roll_up
_roll_up:                               ## @roll_up
	.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, %r13
	callq	_get_current_visible_buffer
	movq	%rax, %r12
	movq	(%r13), %rax
	movl	(%rax), %eax
	movl	$132, %r14d
	subl	%eax, %r14d
	addl	$-128, %eax
	xorl	%ebx, %ebx
	cmpl	$3, %eax
	cmovael	%ebx, %r14d
	movq	8(%r12), %r8
	movl	$-1, %r15d
	xorl	%ecx, %ecx
	movl	$-1, %edi
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	xorl	%eax, %eax
	cmpq	$0, 8(%r8,%rbx,8)
	setne	%al
	cmovel	%edx, %edi
	cmovnel	%ecx, %r15d
	addl	%eax, %esi
	incq	%rcx
	movq	%rcx, %rbx
	movl	%esi, %ecx
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$-1, %edi
	movl	%edi, %edx
	cmovel	%ebx, %edx
	xorl	%esi, %esi
	cmpq	$0, (%r8,%rbx,8)
	cmovel	%edi, %edx
	cmovnel	%ebx, %r15d
	setne	%sil
	addl	%ecx, %esi
	leaq	1(%rbx), %rcx
	cmpq	$15, %rcx
	je	LBB0_5
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%ecx, %edi
	cmpl	$-1, %edx
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%edx, %edi
	jmp	LBB0_4
LBB0_5:
	movq	_debug_608@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_7
## %bb.6:
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_hb_log
LBB0_7:
	cmpl	$-1, %r15d
	je	LBB0_20
## %bb.8:
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movl	%r15d, %r13d
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	subl	%r14d, %r13d
	leal	1(%r13), %eax
	cmpl	%r15d, %eax
	jge	LBB0_13
## %bb.9:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leal	-1(%rax), %r14d
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	%ecx, %r13d
	decl	%r14d
	je	LBB0_13
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	leal	1(%r13), %ecx
	cmpl	$-1, %r13d
	jl	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	16(%r12), %rax
	movq	%r12, %rbx
	movl	%ecx, %r12d
	movq	(%rax,%r12,8), %rdi
	addl	$2, %r13d
	movq	(%rax,%r13,8), %rsi
	movq	_CC608_SCREEN_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	incl	%edx
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	callq	_memcpy
	movq	32(%rbx), %rax
	movq	(%rax,%r12,8), %rdi
	movq	(%rax,%r13,8), %rsi
	movq	_CC608_SCREEN_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	incl	%edx
	callq	_memcpy
	movq	24(%rbx), %rax
	movq	(%rax,%r12,8), %rdi
	movq	(%rax,%r13,8), %rsi
	movq	_CC608_SCREEN_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	incl	%edx
	callq	_memcpy
	movq	8(%rbx), %rax
	movq	(%rax,%r13,8), %rcx
	movq	%rcx, (%rax,%r12,8)
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	movq	%rbx, %r12
	jmp	LBB0_12
LBB0_13:
	movl	$1, %r13d
	subl	-48(%rbp), %r13d                ## 4-byte Folded Reload
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	4(%rax), %eax
	addl	%r13d, %eax
	testl	%eax, %eax
	jle	LBB0_14
## %bb.15:
	movq	16(%r12), %rax
	movq	_CC608_SCREEN_WIDTH@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rax,%rbx,8), %rdi
	movl	$32, %esi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memset
	movq	32(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	movq	_COL_WHITE@GOTPCREL(%rip), %rax
	movsbl	(%rax), %esi
	movl	(%r14), %edx
	callq	_memset
	movq	24(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	movq	_FONT_REGULAR@GOTPCREL(%rip), %rax
	movsbl	(%rax), %esi
	movl	(%r14), %edx
	callq	_memset
	movq	16(%r12), %rax
	movq	(%rax,%rbx,8), %rcx
	movslq	(%r14), %rdx
	movq	$0, (%rcx,%rdx,8)
	movq	8(%r12), %rcx
	movq	$0, (%rcx,%rbx,8)
	incq	%rbx
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	movl	4(%rcx), %ecx
	addl	%r13d, %ecx
	movslq	%ecx, %rcx
	cmpq	%rcx, %rbx
	jl	LBB0_16
	jmp	LBB0_17
LBB0_14:
	movq	16(%r12), %rax
	movq	_CC608_SCREEN_WIDTH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
LBB0_17:
	movslq	%r15d, %rbx
	movq	(%rax,%rbx,8), %rdi
	movl	$32, %esi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memset
	movq	32(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	movq	_COL_WHITE@GOTPCREL(%rip), %rax
	movsbl	(%rax), %esi
	movq	_CC608_SCREEN_WIDTH@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	callq	_memset
	movq	24(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	movq	_FONT_REGULAR@GOTPCREL(%rip), %rax
	movsbl	(%rax), %esi
	movl	(%r14), %edx
	callq	_memset
	movq	16(%r12), %rax
	movq	(%rax,%rbx,8), %rax
	movslq	(%r14), %rcx
	movq	$0, (%rax,%rcx,8)
	movq	8(%r12), %rax
	movq	$0, (%rax,%rbx,8)
	xorl	%edx, %edx
	cmpq	$0, (%rax)
	setne	%dl
	cmpq	$1, 8(%rax)
	sbbl	$-1, %edx
	cmpq	$1, 16(%rax)
	sbbl	$-1, %edx
	cmpq	$1, 24(%rax)
	sbbl	$-1, %edx
	cmpq	$1, 32(%rax)
	sbbl	$-1, %edx
	cmpq	$1, 40(%rax)
	sbbl	$-1, %edx
	cmpq	$1, 48(%rax)
	sbbl	$-1, %edx
	cmpq	$1, 56(%rax)
	sbbl	$-1, %edx
	cmpq	$1, 64(%rax)
	sbbl	$-1, %edx
	cmpq	$1, 72(%rax)
	sbbl	$-1, %edx
	cmpq	$1, 80(%rax)
	sbbl	$-1, %edx
	cmpq	$1, 88(%rax)
	sbbl	$-1, %edx
	cmpq	$1, 96(%rax)
	sbbl	$-1, %edx
	cmpq	$1, 104(%rax)
	sbbl	$-1, %edx
	cmpq	$1, 112(%rax)
	sbbl	$-1, %edx
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	cmpl	%esi, %edx
	jbe	LBB0_19
## %bb.18:
	leaq	L_.str.1(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	_hb_log
LBB0_19:
	movl	$1, (%r12)
LBB0_20:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_debug_608,8,3                  ## @debug_608
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\rIn roll-up: %d lines used, first: %d, last: %d\n"

	.comm	_CC608_SCREEN_WIDTH,4,2         ## @CC608_SCREEN_WIDTH
	.comm	_COL_WHITE,1,0                  ## @COL_WHITE
	.comm	_FONT_REGULAR,1,0               ## @FONT_REGULAR
L_.str.1:                               ## @.str.1
	.asciz	"Bug in roll_up, should have %d lines but I have %d.\n"

	.no_dead_strip	_roll_up
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function roll_up
_roll_up:                               ; @roll_up
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x0
	bl	_get_current_visible_buffer
	mov	x19, x0
	mov	x8, #0
	mov	w1, #0
	ldr	x9, [x21]
	ldr	w9, [x9]
	sub	w10, w9, #128
	mov	w11, #132
	sub	w9, w11, w9
	cmp	w10, #3
	csel	w20, w9, wzr, lo
	ldr	x9, [x0, #8]
	mov	w22, #-1
	mov	w2, #-1
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x9, x8, lsl #3]
	cmn	w2, #1
	csel	w11, w8, w2, eq
	cmp	x10, #0
	csel	w2, w2, w11, eq
	csel	w22, w22, w8, eq
	cinc	w1, w1, ne
	add	x8, x8, #1
	cmp	x8, #15
	b.ne	LBB0_1
; %bb.2:
Lloh0:
	adrp	x8, _debug_608@GOTPAGE
Lloh1:
	ldr	x8, [x8, _debug_608@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_4
; %bb.3:
	mov	x8, x22
	str	x8, [sp]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_hb_log
LBB0_4:
	cmn	w22, #1
	b.eq	LBB0_17
; %bb.5:
	sub	w8, w22, w20
	add	w8, w8, #1
Lloh5:
	adrp	x23, _CC608_SCREEN_WIDTH@GOTPAGE
Lloh6:
	ldr	x23, [x23, _CC608_SCREEN_WIDTH@GOTPAGEOFF]
	cmp	w8, w22
	b.ge	LBB0_10
; %bb.6:
	neg	w24, w20
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	w24, w24, #1
	cmn	w24, #1
	b.eq	LBB0_10
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	add	w8, w22, w24
	cmn	w8, #1
	b.lt	LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	add	w9, w8, #1
	ldr	x10, [x19, #16]
	lsl	x25, x9, #3
	ldr	x0, [x10, x25]
	add	w8, w8, #2
	lsl	x26, x8, #3
	ldr	x1, [x10, x26]
	ldr	w8, [x23]
	add	w2, w8, #1
	bl	_memcpy
	ldr	x8, [x19, #32]
	ldr	x0, [x8, x25]
	ldr	x1, [x8, x26]
	ldr	w8, [x23]
	add	w2, w8, #1
	bl	_memcpy
	ldr	x8, [x19, #24]
	ldr	x0, [x8, x25]
	ldr	x1, [x8, x26]
	ldr	w8, [x23]
	add	w2, w8, #1
	bl	_memcpy
	ldr	x8, [x19, #8]
	ldr	x9, [x8, x26]
	str	x9, [x8, x25]
	b	LBB0_7
LBB0_10:
	mov	w8, #1
	ldr	x9, [x21]
	ldr	w9, [x9, #4]
	sub	w26, w8, w20
	add	w8, w26, w9
Lloh7:
	adrp	x25, _COL_WHITE@GOTPAGE
Lloh8:
	ldr	x25, [x25, _COL_WHITE@GOTPAGEOFF]
Lloh9:
	adrp	x24, _FONT_REGULAR@GOTPAGE
Lloh10:
	ldr	x24, [x24, _FONT_REGULAR@GOTPAGEOFF]
	cmp	w8, #0
	b.le	LBB0_13
; %bb.11:
	mov	x27, #0
	ldr	x8, [x19, #16]
	ldr	w2, [x23]
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	lsl	x28, x27, #3
	ldr	x0, [x8, x28]
	mov	w1, #32
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_memset
	ldr	x8, [x19, #32]
	ldr	x0, [x8, x28]
	ldrsb	w1, [x25]
	ldr	w2, [x23]
	bl	_memset
	ldr	x8, [x19, #24]
	ldr	x0, [x8, x28]
	ldrsb	w1, [x24]
	ldr	w2, [x23]
	bl	_memset
	ldp	x9, x8, [x19, #8]
	ldr	x10, [x8, x28]
	ldrsw	x2, [x23]
	str	xzr, [x10, x2, lsl #3]
	str	xzr, [x9, x28]
	add	x27, x27, #1
	ldr	x9, [x21]
	ldr	w9, [x9, #4]
	add	w9, w26, w9
	cmp	x27, w9, sxtw
	b.lt	LBB0_12
	b	LBB0_14
LBB0_13:
	ldr	x8, [x19, #16]
	ldr	w2, [x23]
LBB0_14:
	sbfiz	x21, x22, #3, #32
	ldr	x0, [x8, x21]
	mov	w1, #32
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_memset
	ldr	x8, [x19, #32]
	ldr	x0, [x8, x21]
	ldrsb	w1, [x25]
	ldr	w2, [x23]
	bl	_memset
	ldr	x8, [x19, #24]
	ldr	x0, [x8, x21]
	ldrsb	w1, [x24]
	ldr	w2, [x23]
	bl	_memset
	ldp	x8, x9, [x19, #8]
	ldr	x9, [x9, x21]
	ldrsw	x10, [x23]
	str	xzr, [x9, x10, lsl #3]
	str	xzr, [x8, x21]
	ldp	q0, q1, [x8]
	ldp	q2, q3, [x8, #32]
	cmtst.2d	v3, v3, v3
	cmtst.2d	v2, v2, v2
	uzp1.4s	v2, v2, v3
	cmtst.2d	v1, v1, v1
	cmtst.2d	v0, v0, v0
	uzp1.4s	v0, v0, v1
	uzp1.8h	v0, v0, v2
	xtn.8b	v0, v0
	umov.b	w9, v0[1]
	umov.b	w10, v0[0]
	and	w9, w9, #0x1
	and	w10, w10, #0x1
	bfi	w10, w9, #1, #1
	umov.b	w9, v0[2]
	and	w9, w9, #0x1
	bfi	w10, w9, #2, #1
	umov.b	w9, v0[3]
	and	w9, w9, #0x1
	umov.b	w11, v0[4]
	bfi	w10, w9, #3, #1
	and	w9, w11, #0x1
	bfi	w10, w9, #4, #1
	umov.b	w9, v0[5]
	and	w9, w9, #0x1
	bfi	w10, w9, #5, #1
	umov.b	w9, v0[6]
	and	w9, w9, #0x1
	umov.b	w11, v0[7]
	orr	w9, w10, w9, lsl #6
	orr	w9, w9, w11, lsl #7
	ldp	q0, q1, [x8, #64]
	cmtst.2d	v1, v1, v1
	cmtst.2d	v0, v0, v0
	uzp1.4s	v0, v0, v1
	xtn.4h	v0, v0
	umov.h	w10, v0[0]
	umov.h	w11, v0[1]
	and	w9, w9, #0xff
	and	w11, w11, #0x1
	bfi	w10, w11, #1, #1
	umov.h	w11, v0[2]
	and	w11, w11, #0x1
	bfi	w10, w11, #2, #1
	umov.h	w11, v0[3]
	bfi	w10, w11, #3, #29
	and	w10, w10, #0xf
	ldp	x11, x12, [x8, #96]
	ldr	x8, [x8, #112]
	fmov	d0, x9
	cnt.8b	v0, v0
	uaddlv.8b	h0, v0
	fmov	w9, s0
	fmov	d0, x10
	cnt.8b	v0, v0
	uaddlv.8b	h0, v0
	fmov	w10, s0
	add	w9, w9, w10
	cmp	x11, #0
	cinc	w9, w9, ne
	cmp	x12, #0
	cinc	w9, w9, ne
	cmp	x8, #0
	cinc	w2, w9, ne
	cmp	w2, w20
	b.ls	LBB0_16
; %bb.15:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_hb_log
LBB0_16:
	mov	w8, #1
	str	w8, [x19]
LBB0_17:
	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
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_debug_608,8,3                  ; @debug_608
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\rIn roll-up: %d lines used, first: %d, last: %d\n"

	.comm	_CC608_SCREEN_WIDTH,4,2         ; @CC608_SCREEN_WIDTH
	.comm	_COL_WHITE,1,0                  ; @COL_WHITE
	.comm	_FONT_REGULAR,1,0               ; @FONT_REGULAR
l_.str.1:                               ; @.str.1
	.asciz	"Bug in roll_up, should have %d lines but I have %d.\n"

	.no_dead_strip	_roll_up
.subsections_via_symbols
