	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ClipBrushToBox                 ## -- Begin function ClipBrushToBox
	.p2align	4, 0x90
_ClipBrushToBox:                        ## @ClipBrushToBox
	.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	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movq	(%rdi), %rax
	movq	(%rax), %rax
	cmpq	(%rdx), %rax
	jle	LBB0_4
## %bb.1:
	movq	_maxplanenums@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rdx
	leaq	-24(%rbp), %rcx
	callq	_SplitBrush
	movq	-32(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.2:
	callq	_FreeBrush
LBB0_3:
	movq	-24(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_27
LBB0_4:
	movq	8(%rdi), %rax
	movq	(%rax), %rax
	cmpq	(%r14), %rax
	jge	LBB0_8
## %bb.5:
	movq	_minplanenums@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rdx
	leaq	-24(%rbp), %rcx
	callq	_SplitBrush
	movq	-24(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.6:
	callq	_FreeBrush
LBB0_7:
	movq	-32(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_27
LBB0_8:
	movq	(%rdi), %rax
	movq	8(%rax), %rax
	cmpq	8(%rbx), %rax
	jle	LBB0_12
## %bb.9:
	movq	_maxplanenums@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	4(%rax), %esi
	leaq	-32(%rbp), %rdx
	leaq	-24(%rbp), %rcx
	callq	_SplitBrush
	movq	-32(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.10:
	callq	_FreeBrush
LBB0_11:
	movq	-24(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_27
LBB0_12:
	movq	8(%rdi), %rax
	movq	8(%rax), %rax
	cmpq	8(%r14), %rax
	jge	LBB0_16
## %bb.13:
	movq	_minplanenums@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	4(%rax), %esi
	leaq	-32(%rbp), %rdx
	leaq	-24(%rbp), %rcx
	callq	_SplitBrush
	movq	-24(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_15
## %bb.14:
	callq	_FreeBrush
LBB0_15:
	movq	-32(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_27
LBB0_16:
	movl	16(%rdi), %edx
	testl	%edx, %edx
	jle	LBB0_28
## %bb.17:
	movq	24(%rdi), %rax
	movq	_maxplanenums@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_minplanenums@GOTPCREL(%rip), %rsi
	movq	(%rsi), %r8
	shlq	$2, %rdx
	leaq	(%rdx,%rdx,2), %rsi
	xorl	%ebx, %ebx
	movq	_TEXINFO_NODE@GOTPCREL(%rip), %r9
	movq	_SFL_VISIBLE@GOTPCREL(%rip), %r10
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rax,%rbx), %edx
	andl	$-2, %edx
	cmpl	(%rcx), %edx
	je	LBB0_22
## %bb.19:                              ##   in Loop: Header=BB0_18 Depth=1
	cmpl	4(%rcx), %edx
	je	LBB0_22
## %bb.20:                              ##   in Loop: Header=BB0_18 Depth=1
	cmpl	(%r8), %edx
	je	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_18 Depth=1
	cmpl	4(%r8), %edx
	jne	LBB0_23
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_18 Depth=1
	movl	(%r9), %edx
	movl	%edx, 8(%rax,%rbx)
	movl	(%r10), %edx
	notl	%edx
	andl	%edx, 4(%rax,%rbx)
LBB0_23:                                ##   in Loop: Header=BB0_18 Depth=1
	addq	$12, %rbx
	cmpq	%rbx, %rsi
	jne	LBB0_18
	jmp	LBB0_28
LBB0_27:
	xorl	%edi, %edi
LBB0_28:
	movq	%rdi, %rax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_maxplanenums,8,3               ## @maxplanenums
	.comm	_minplanenums,8,3               ## @minplanenums
	.comm	_TEXINFO_NODE,4,2               ## @TEXINFO_NODE
	.comm	_SFL_VISIBLE,4,2                ## @SFL_VISIBLE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ClipBrushToBox                 ; -- Begin function ClipBrushToBox
	.p2align	2
_ClipBrushToBox:                        ; @ClipBrushToBox
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x2
	mov	x19, x1
	ldr	x8, [x0]
	ldr	x8, [x8]
	ldr	x9, [x2]
	cmp	x8, x9
	b.le	LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _maxplanenums@GOTPAGE
Lloh1:
	ldr	x8, [x8, _maxplanenums@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x3, sp
	bl	_SplitBrush
	ldr	x0, [sp, #8]
	cbz	x0, LBB0_3
; %bb.2:
	bl	_FreeBrush
LBB0_3:
	ldr	x0, [sp]
	cbz	x0, LBB0_24
LBB0_4:
	ldr	x8, [x0, #8]
	ldr	x8, [x8]
	ldr	x9, [x19]
Lloh3:
	adrp	x21, _minplanenums@GOTPAGE
Lloh4:
	ldr	x21, [x21, _minplanenums@GOTPAGEOFF]
	cmp	x8, x9
	b.ge	LBB0_8
; %bb.5:
	ldr	x8, [x21]
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x3, sp
	bl	_SplitBrush
	ldr	x0, [sp]
	cbz	x0, LBB0_7
; %bb.6:
	bl	_FreeBrush
LBB0_7:
	ldr	x0, [sp, #8]
	cbz	x0, LBB0_24
LBB0_8:
	ldr	x8, [x0]
	ldr	x8, [x8, #8]
	ldr	x9, [x20, #8]
	cmp	x8, x9
	b.le	LBB0_12
; %bb.9:
Lloh5:
	adrp	x8, _maxplanenums@GOTPAGE
Lloh6:
	ldr	x8, [x8, _maxplanenums@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	ldr	w1, [x8, #4]
	add	x2, sp, #8
	mov	x3, sp
	bl	_SplitBrush
	ldr	x0, [sp, #8]
	cbz	x0, LBB0_11
; %bb.10:
	bl	_FreeBrush
LBB0_11:
	ldr	x0, [sp]
	cbz	x0, LBB0_24
LBB0_12:
	ldr	x8, [x0, #8]
	ldr	x8, [x8, #8]
	ldr	x9, [x19, #8]
	cmp	x8, x9
	b.ge	LBB0_16
; %bb.13:
	ldr	x8, [x21]
	ldr	w1, [x8, #4]
	add	x2, sp, #8
	mov	x3, sp
	bl	_SplitBrush
	ldr	x0, [sp]
	cbz	x0, LBB0_15
; %bb.14:
	bl	_FreeBrush
LBB0_15:
	ldr	x0, [sp, #8]
	cbz	x0, LBB0_24
LBB0_16:
	ldr	w8, [x0, #16]
	cmp	w8, #0
	b.le	LBB0_24
; %bb.17:
	ldr	x11, [x0, #24]
Lloh8:
	adrp	x9, _maxplanenums@GOTPAGE
Lloh9:
	ldr	x9, [x9, _maxplanenums@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	ldr	x10, [x21]
	add	x11, x11, #4
Lloh11:
	adrp	x12, _TEXINFO_NODE@GOTPAGE
Lloh12:
	ldr	x12, [x12, _TEXINFO_NODE@GOTPAGEOFF]
Lloh13:
	adrp	x13, _SFL_VISIBLE@GOTPAGE
Lloh14:
	ldr	x13, [x13, _SFL_VISIBLE@GOTPAGEOFF]
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldur	w14, [x11, #-4]
	and	w14, w14, #0xfffffffe
	ldr	w15, [x9]
	cmp	w14, w15
	b.eq	LBB0_22
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	w15, [x9, #4]
	cmp	w14, w15
	b.eq	LBB0_22
; %bb.20:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	w15, [x10]
	cmp	w14, w15
	b.eq	LBB0_22
; %bb.21:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	w15, [x10, #4]
	cmp	w14, w15
	b.ne	LBB0_23
LBB0_22:                                ;   in Loop: Header=BB0_18 Depth=1
	ldr	w14, [x12]
	str	w14, [x11, #4]
	ldr	w14, [x13]
	ldr	w15, [x11]
	bic	w14, w15, w14
	str	w14, [x11]
LBB0_23:                                ;   in Loop: Header=BB0_18 Depth=1
	add	x11, x11, #12
	subs	x8, x8, #1
	b.ne	LBB0_18
LBB0_24:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_maxplanenums,8,3               ; @maxplanenums
	.comm	_minplanenums,8,3               ; @minplanenums
	.comm	_TEXINFO_NODE,4,2               ; @TEXINFO_NODE
	.comm	_SFL_VISIBLE,4,2                ; @SFL_VISIBLE
.subsections_via_symbols
