	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ui_draw_text                   ## -- Begin function ui_draw_text
	.p2align	4, 0x90
_ui_draw_text:                          ## @ui_draw_text
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	112(%rbp), %r12d
	movq	104(%rbp), %r14
	movl	88(%rbp), %r8d
	movl	72(%rbp), %r10d
	movl	56(%rbp), %r9d
	movl	48(%rbp), %edi
	movl	40(%rbp), %r15d
	movl	64(%rbp), %eax
	leal	(%rax,%rdi), %edx
	movq	_g_width@GOTPCREL(%rip), %rsi
	movl	(%rsi), %ebx
	movl	%ebx, %esi
	subl	%edi, %esi
	cmpl	%ebx, %edx
	movl	32(%rbp), %edx
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	movl	24(%rbp), %edx
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	cmovlel	%eax, %esi
	movl	16(%rbp), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	cmpl	$2, %esi
	movl	%r10d, -64(%rbp)                ## 4-byte Spill
	movl	%r9d, -56(%rbp)                 ## 4-byte Spill
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	movl	%esi, -68(%rbp)                 ## 4-byte Spill
	jl	LBB0_2
## %bb.1:
	movl	%esi, %edx
	movl	%r9d, %esi
                                        ## kill: def $edi killed $edi killed $rdi
	movl	%r10d, %ecx
	jmp	LBB0_4
LBB0_2:
	movq	_MIX_OPAQUE@GOTPCREL(%rip), %rax
	cmpl	%ecx, (%rax)
	jne	LBB0_5
## %bb.3:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	movl	%r15d, %ecx
LBB0_4:
	movl	$12, %r9d
	callq	_bs_rect
LBB0_5:
	movl	%r15d, -60(%rbp)                ## 4-byte Spill
	testl	%r12d, %r12d
	jle	LBB0_19
## %bb.6:
	xorl	%r15d, %r15d
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_DO_GLYPH
	incl	%r15d
LBB0_18:                                ##   in Loop: Header=BB0_7 Depth=1
	cmpl	%r12d, %r15d
	jge	LBB0_19
LBB0_7:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_15 Depth 2
	movslq	%r15d, %rbx
	movl	(%r14,%rbx,4), %eax
	cmpl	$254, %eax
	je	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	cmpl	$255, %eax
	jne	LBB0_17
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	leal	2(%r15), %eax
	cmpl	%r12d, %eax
	jge	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	4(%r14,%rbx,4), %edi
	cltq
	movl	(%r14,%rax,4), %edx
	movq	%r14, %rsi
	callq	_cache_put_text
	subl	%r15d, %r12d
	addl	$-3, %r12d
	leaq	(%r14,%rbx,4), %r14
	addq	$12, %r14
	xorl	%r15d, %r15d
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	%r12d, -72(%rbp)                ## 4-byte Spill
	movl	4(%r14,%rbx,4), %edi
	callq	_cache_get_text
	testq	%rax, %rax
	je	LBB0_16
## %bb.13:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%rax, %r12
	cmpl	$0, (%rax)
	jle	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_7 Depth=1
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_15:                                ##   Parent Loop BB0_7 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%r12), %rdi
	movl	%r13d, %esi
	callq	_DO_GLYPH
	incl	%r13d
	cmpl	(%r12), %r13d
	jl	LBB0_15
LBB0_16:                                ##   in Loop: Header=BB0_7 Depth=1
	leal	2(%r15), %eax
	addl	$3, %r15d
	movl	-72(%rbp), %r12d                ## 4-byte Reload
	cmpl	%r12d, %eax
	cmovgel	%eax, %r15d
	subl	%r15d, %r12d
	movslq	%r15d, %rax
	leaq	(%r14,%rax,4), %r14
	xorl	%r15d, %r15d
	jmp	LBB0_18
LBB0_19:
	movl	-68(%rbp), %edx                 ## 4-byte Reload
	cmpl	$2, %edx
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	jl	LBB0_22
## %bb.20:
                                        ## kill: def $edi killed $edi killed $rdi
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	movl	-64(%rbp), %ecx                 ## 4-byte Reload
	jmp	LBB0_21
LBB0_22:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	movl	-60(%rbp), %ecx                 ## 4-byte Reload
LBB0_21:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ui_invalidate                  ## TAILCALL
LBB0_11:
	leaq	L_.str(%rip), %rdi
	callq	_error
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_g_width,4,2                    ## @g_width
	.comm	_MIX_OPAQUE,4,2                 ## @MIX_OPAQUE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"this shouldn't be happening\n"

	.comm	_TEXT2_IMPLICIT_X,4,2           ## @TEXT2_IMPLICIT_X
	.comm	_TEXT2_VERTICAL,4,2             ## @TEXT2_VERTICAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ui_draw_text                   ; -- Begin function ui_draw_text
	.p2align	2
_ui_draw_text:                          ; @ui_draw_text
	.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	x26, x7
	mov	x19, x6
	ldr	w23, [x29, #64]
	ldr	x22, [x29, #56]
	ldr	w4, [x29, #48]
	ldp	w24, w21, [x29, #24]
	ldp	w28, w20, [x29, #16]
	ldp	w8, w25, [x29, #32]
Lloh0:
	adrp	x9, _g_width@GOTPAGE
Lloh1:
	ldr	x9, [x9, _g_width@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	sub	w10, w9, w24
	add	w11, w8, w24
	cmp	w11, w9
	csel	w27, w10, w8, gt
	cmp	w27, #2
	b.lt	LBB0_2
; %bb.1:
	mov	x0, x24
	mov	x1, x21
	mov	x2, x27
	mov	x3, x25
	b	LBB0_4
LBB0_2:
Lloh3:
	adrp	x8, _MIX_OPAQUE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MIX_OPAQUE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w3
	b.ne	LBB0_5
; %bb.3:
	mov	x0, x19
	mov	x1, x26
	mov	x2, x28
	mov	x3, x20
LBB0_4:
	mov	w5, #12
	bl	_bs_rect
LBB0_5:
	stp	w28, w20, [sp, #4]              ; 8-byte Folded Spill
	str	w19, [sp, #12]                  ; 4-byte Folded Spill
	cmp	w23, #1
	b.lt	LBB0_18
; %bb.6:
	mov	w8, #0
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x22
	mov	x1, x28
	bl	_DO_GLYPH
	add	w8, w28, #1
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	cmp	w8, w23
	b.ge	LBB0_18
LBB0_9:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_16 Depth 2
	sxtw	x28, w8
	ldr	w8, [x22, w8, sxtw #2]
	cmp	w8, #254
	b.eq	LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	cmp	w8, #255
	b.ne	LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x8, x28, #2
	cmp	w8, w23
	b.ge	LBB0_22
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x9, x22, x28, lsl #2
	ldr	w0, [x9, #4]
	ldr	w2, [x22, x8, lsl #2]
	mov	x1, x22
	bl	_cache_put_text
	mov	w8, #0
	add	x9, x28, #3
	sub	w23, w23, w9
	add	x22, x22, x9, lsl #2
	b	LBB0_8
LBB0_13:                                ;   in Loop: Header=BB0_9 Depth=1
	add	x8, x22, x28, lsl #2
	ldr	w0, [x8, #4]
	bl	_cache_get_text
	cbz	x0, LBB0_17
; %bb.14:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x19, x0
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_17
; %bb.15:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	w20, #0
LBB0_16:                                ;   Parent Loop BB0_9 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x0, [x19, #8]
	mov	x1, x20
	bl	_DO_GLYPH
	add	w20, w20, #1
	ldr	w8, [x19]
	cmp	w20, w8
	b.lt	LBB0_16
LBB0_17:                                ;   in Loop: Header=BB0_9 Depth=1
	mov	w8, #0
	add	w9, w28, #2
	add	w10, w28, #3
	cmp	w9, w23
	csel	w9, w10, w9, lt
	sub	w23, w23, w9
	add	x22, x22, w9, sxtw #2
	b	LBB0_8
LBB0_18:
	cmp	w27, #1
	b.le	LBB0_20
; %bb.19:
	mov	x0, x24
	mov	x1, x21
	mov	x2, x27
	mov	x3, x25
	b	LBB0_21
LBB0_20:
	ldp	w3, w0, [sp, #8]                ; 8-byte Folded Reload
	mov	x1, x26
	ldr	w2, [sp, #4]                    ; 4-byte Folded Reload
LBB0_21:
	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
	b	_ui_invalidate
LBB0_22:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_error
	mov	w0, #1
	bl	_exit
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_g_width,4,2                    ; @g_width
	.comm	_MIX_OPAQUE,4,2                 ; @MIX_OPAQUE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"this shouldn't be happening\n"

	.comm	_TEXT2_IMPLICIT_X,4,2           ; @TEXT2_IMPLICIT_X
	.comm	_TEXT2_VERTICAL,4,2             ; @TEXT2_VERTICAL
.subsections_via_symbols
