	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function apply_mask
_apply_mask:                            ## @apply_mask
	.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
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	callq	_draw_mask_box
	movq	_MODE_FILTER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ecx, %ecx
	testl	%eax, (%rbx)
	setne	%cl
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	8(%rbx,%rcx,8), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	(%rax), %rax
	xorl	%r14d, %r14d
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_1 Depth=1
	incq	%r14
	cmpq	$3, %r14
	je	LBB0_12
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_3 Depth 2
	leaq	(%r14,%r14,2), %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%rax,%rcx,8)
	jle	LBB0_11
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	leaq	(,%r14,8), %rcx
	leaq	(%rcx,%rcx,2), %r15
	movq	16(%rax,%r15), %r12
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	movq	16(%rcx,%r15), %rbx
	xorl	%r13d, %r13d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=2
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movslq	4(%rax,%r15), %rax
	leaq	(%rbx,%rax,4), %rbx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movslq	4(%rax,%r15), %rcx
	leaq	(%r12,%rcx,4), %r12
	incl	%r13d
	cmpl	(%rax,%r15), %r13d
	jge	LBB0_11
LBB0_3:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_MODE_COMPOSITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	andl	(%rdx), %ecx
	jne	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=2
	testq	%r14, %r14
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=2
	movl	8(%rax), %edx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_memcpy
	testq	%r14, %r14
	jne	LBB0_10
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=2
	testl	%ecx, %ecx
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=2
	testq	%r14, %r14
	jne	LBB0_10
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=2
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	8(%rax), %edx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_apply_mask_line
	jmp	LBB0_10
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=2
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	8(%rax,%rcx,8), %edx
	movq	%rbx, %rdi
	movl	$128, %esi
	callq	_memset
	testq	%r14, %r14
	jne	LBB0_10
	jmp	LBB0_9
LBB0_12:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MODE_FILTER,4,2                ## @MODE_FILTER
	.comm	_MODE_COMPOSITE,4,2             ## @MODE_COMPOSITE
	.no_dead_strip	_apply_mask
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function apply_mask
_apply_mask:                            ; @apply_mask
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x1
	mov	x20, x0
	bl	_draw_mask_box
	mov	x23, #0
Lloh0:
	adrp	x8, _MODE_FILTER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MODE_FILTER@GOTPAGEOFF]
	ldr	w9, [x20]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w9
	mov	w8, #16
	mov	w9, #8
	csel	x8, x9, x8, eq
	ldr	x24, [x20, x8]
	ldr	x8, [x24]
	mov	w25, #24
Lloh3:
	adrp	x26, _MODE_COMPOSITE@GOTPAGE
Lloh4:
	ldr	x26, [x26, _MODE_COMPOSITE@GOTPAGEOFF]
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	add	x23, x23, #1
	cmp	x23, #3
	b.eq	LBB0_11
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	mul	x9, x23, x25
	ldr	w9, [x8, x9]
	cmp	w9, #1
	b.lt	LBB0_1
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w27, #0
	add	x9, x23, x23, lsl #1
	lsl	x9, x9, #3
	add	x10, x8, x9
	ldr	x21, [x10, #16]
	ldr	x10, [x19]
	add	x9, x10, x9
	ldr	x22, [x9, #16]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=2
	ldr	x8, [x19]
	add	x9, x23, x23, lsl #1
	lsl	x9, x9, #3
	add	x8, x8, x9
	ldrsw	x8, [x8, #4]
	add	x22, x22, x8, lsl #2
	ldr	x8, [x24]
	add	x9, x8, x9
	ldp	w9, w10, [x9]
                                        ; kill: def $w10 killed $w10 def $x10
	sxtw	x10, w10
	add	x21, x21, x10, lsl #2
	add	w27, w27, #1
	cmp	w27, w9
	b.ge	LBB0_1
LBB0_5:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w9, [x20]
	ldr	w10, [x26]
	and	w9, w10, w9
	cmp	w9, #0
	ccmp	x23, #0, #0, eq
	b.eq	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	cbnz	w9, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=2
	madd	x8, x23, x25, x8
	ldr	w2, [x8, #8]
	mov	x0, x22
	mov	w1, #128
	bl	_memset
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=2
	ldr	w2, [x8, #8]
	mov	x0, x22
	mov	x1, x21
	bl	_memcpy
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=2
	cbnz	x23, LBB0_4
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=2
	ldr	x8, [x24]
	ldr	w2, [x8, #8]
	mov	x0, x22
	mov	x1, x21
	bl	_apply_mask_line
	b	LBB0_4
LBB0_11:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_MODE_FILTER,4,2                ; @MODE_FILTER
	.comm	_MODE_COMPOSITE,4,2             ; @MODE_COMPOSITE
	.no_dead_strip	_apply_mask
.subsections_via_symbols
