	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function teken_subr_do_scroll
_teken_subr_do_scroll:                  ## @teken_subr_do_scroll
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	40(%rdi), %rax
	xorl	%edi, %edi
	cmpq	8(%rbx), %rax
	setle	%dil
	callq	_teken_assert
	movq	24(%rbx), %rax
	xorl	%edi, %edi
	cmpq	8(%rbx), %rax
	setle	%dil
	callq	_teken_assert
	xorl	%edi, %edi
	testl	%r14d, %r14d
	setne	%dil
	callq	_teken_assert
	testl	%r14d, %r14d
	jle	LBB0_4
## %bb.1:
	movq	24(%rbx), %rax
	movq	32(%rbx), %rcx
	movl	%r14d, %r14d
	leaq	(%rcx,%r14), %rdx
	cmpq	%rax, %rdx
	jge	LBB0_3
## %bb.2:
	movq	%rdx, -32(%rbp)
	movq	$0, -24(%rbp)
	movq	%rax, -48(%rbp)
	movl	16(%rbx), %eax
	movl	%eax, -40(%rbp)
	movq	%rcx, -64(%rbp)
	movq	$0, -56(%rbp)
	leaq	-48(%rbp), %rsi
	leaq	-64(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_teken_funcs_copy
	movq	24(%rbx), %rax
	movq	%rax, %rcx
	subq	%r14, %rcx
LBB0_3:
	movq	%rcx, -32(%rbp)
	movq	$0, -24(%rbp)
	movq	%rax, -48(%rbp)
	jmp	LBB0_8
LBB0_4:
	negl	%r14d
	movq	24(%rbx), %rcx
	movq	32(%rbx), %rax
	leaq	(%rax,%r14), %rdx
	cmpq	%rcx, %rdx
	jge	LBB0_6
## %bb.5:
	movq	%rax, -32(%rbp)
	movq	$0, -24(%rbp)
	subq	%r14, %rcx
	movq	%rcx, -48(%rbp)
	movl	16(%rbx), %eax
	movl	%eax, -40(%rbp)
	movq	%rdx, -64(%rbp)
	movq	$0, -56(%rbp)
	leaq	-48(%rbp), %rsi
	leaq	-64(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_teken_funcs_copy
	movq	32(%rbx), %rax
	addq	%rax, %r14
	movq	%r14, -48(%rbp)
	jmp	LBB0_7
LBB0_6:
	movq	%rcx, -48(%rbp)
LBB0_7:
	movq	%rax, -32(%rbp)
	movq	$0, -24(%rbp)
LBB0_8:
	movl	16(%rbx), %eax
	movl	%eax, -40(%rbp)
	movq	_BLANK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdi
	movq	%rbx, %rcx
	callq	_teken_funcs_fill
	addq	$48, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BLANK,4,2                      ## @BLANK
	.no_dead_strip	_teken_subr_do_scroll
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function teken_subr_do_scroll
_teken_subr_do_scroll:                  ; @teken_subr_do_scroll
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x0, #40]
	ldr	x9, [x0, #8]
	cmp	x8, x9
	cset	w0, le
	bl	_teken_assert
	ldr	x8, [x19, #24]
	ldr	x9, [x19, #8]
	cmp	x8, x9
	cset	w0, le
	bl	_teken_assert
	cmp	w20, #0
	cset	w0, ne
	bl	_teken_assert
	cmp	w20, #1
	b.lt	LBB0_4
; %bb.1:
	mov	w20, w20
	ldp	x9, x8, [x19, #24]
	add	x10, x8, x20
	cmp	x10, x9
	b.ge	LBB0_3
; %bb.2:
	stp	x10, xzr, [sp, #32]
	stp	xzr, x9, [sp, #8]
	ldr	w9, [x19, #16]
	str	w9, [sp, #24]
	str	x8, [sp]
	add	x1, sp, #16
	mov	x2, sp
	mov	x0, x19
	bl	_teken_funcs_copy
	ldr	x9, [x19, #24]
	sub	x8, x9, x20
LBB0_3:
	stp	x8, xzr, [sp, #32]
	str	x9, [sp, #16]
	b	LBB0_8
LBB0_4:
	ldp	x10, x8, [x19, #24]
	neg	w20, w20
	add	x9, x8, x20
	cmp	x9, x10
	b.ge	LBB0_6
; %bb.5:
	stp	x8, xzr, [sp, #32]
	sub	x8, x10, x20
	stp	xzr, x8, [sp, #8]
	ldr	w8, [x19, #16]
	str	w8, [sp, #24]
	str	x9, [sp]
	add	x1, sp, #16
	mov	x2, sp
	mov	x0, x19
	bl	_teken_funcs_copy
	ldr	x8, [x19, #32]
	add	x9, x8, x20
	str	x9, [sp, #16]
	b	LBB0_7
LBB0_6:
	str	x10, [sp, #16]
LBB0_7:
	stp	x8, xzr, [sp, #32]
LBB0_8:
	ldr	w8, [x19, #16]
	str	w8, [sp, #24]
Lloh0:
	adrp	x8, _BLANK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BLANK@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	add	x1, sp, #16
	mov	x0, x19
	mov	x3, x19
	bl	_teken_funcs_fill
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_BLANK,4,2                      ; @BLANK
	.no_dead_strip	_teken_subr_do_scroll
.subsections_via_symbols
