	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Q1_MergeBrushes                ## -- Begin function Q1_MergeBrushes
	.p2align	4, 0x90
_Q1_MergeBrushes:                       ## @Q1_MergeBrushes
	.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
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	movq	%rdi, %r12
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	testl	%esi, %esi
	jne	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	xorl	%esi, %esi
	xorl	%eax, %eax
	callq	_qprintf
LBB0_4:
	xorl	%eax, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	%r13, %r12
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_23
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
                                        ##     Child Loop BB0_10 Depth 2
                                        ##       Child Loop BB0_12 Depth 3
                                        ##       Child Loop BB0_15 Depth 3
	movq	%r12, %rax
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rax, %r15
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=2
	movq	8(%r15), %rax
	testq	%rax, %rax
	jne	LBB0_6
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	xorl	%r13d, %r13d
	testq	%r12, %r12
	je	LBB0_23
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_10 Depth=2
	movq	8(%r12), %rbx
	movq	%r13, 8(%r12)
	movq	%r12, %r13
LBB0_21:                                ##   in Loop: Header=BB0_10 Depth=2
	movq	%rbx, %r12
	testq	%rbx, %rbx
	je	LBB0_22
LBB0_10:                                ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_12 Depth 3
                                        ##       Child Loop BB0_15 Depth 3
	movq	8(%r12), %rax
	testq	%rax, %rax
	je	LBB0_20
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=2
	movq	%r12, %rbx
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_12 Depth=3
	movq	8(%r14), %rax
	movq	%r14, %rbx
	testq	%rax, %rax
	je	LBB0_20
LBB0_12:                                ##   Parent Loop BB0_5 Depth=1
                                        ##     Parent Loop BB0_10 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	%rax, %r14
	movq	(%r12), %rax
	cmpq	(%r14), %rax
	jne	LBB0_19
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=3
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_TryMergeBrushes
	testq	%rax, %rax
	je	LBB0_19
## %bb.14:                              ##   in Loop: Header=BB0_10 Depth=2
	movq	(%r12), %rcx
	movq	%rcx, (%rax)
	movq	%rax, 8(%r15)
	movq	8(%r14), %rax
	movq	%rax, 8(%rbx)
	movq	8(%r12), %rbx
	movq	%r12, %rdi
	callq	_FreeBrush
	movq	%r14, %rdi
	callq	_FreeBrush
	movq	%rbx, %rax
	.p2align	4, 0x90
LBB0_15:                                ##   Parent Loop BB0_5 Depth=1
                                        ##     Parent Loop BB0_10 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	%rax, %r15
	testq	%rax, %rax
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=3
	movq	8(%r15), %rax
	testq	%rax, %rax
	jne	LBB0_15
LBB0_17:                                ##   in Loop: Header=BB0_10 Depth=2
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	incl	%eax
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	jne	LBB0_21
## %bb.18:                              ##   in Loop: Header=BB0_10 Depth=2
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	leal	1(%rsi), %r14d
	leaq	L_.str.1(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	_qprintf
	movl	%r14d, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_21
LBB0_23:
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_25
## %bb.24:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_qprintf
	jmp	LBB0_25
LBB0_1:
	xorl	%r13d, %r13d
LBB0_25:
	movq	%r13, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%5d brushes merged"

L_.str.1:                               ## @.str.1
	.asciz	"\r%5d"

L_.str.2:                               ## @.str.2
	.asciz	"\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Q1_MergeBrushes                ; -- Begin function Q1_MergeBrushes
	.p2align	2
_Q1_MergeBrushes:                       ; @Q1_MergeBrushes
	.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
	cbz	x0, LBB0_24
; %bb.1:
	mov	x19, x1
	mov	x22, x0
	cbnz	w1, LBB0_3
; %bb.2:
	str	xzr, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_qprintf
LBB0_3:
	mov	w24, #0
Lloh2:
	adrp	x20, l_.str.1@PAGE
Lloh3:
	add	x20, x20, l_.str.1@PAGEOFF
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x22, x21
	cbz	w25, LBB0_22
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
                                        ;     Child Loop BB0_12 Depth 2
                                        ;       Child Loop BB0_15 Depth 3
                                        ;       Child Loop BB0_18 Depth 3
	mov	x8, x22
LBB0_6:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x26, x8
	cbz	x8, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	ldr	x8, [x26, #8]
	cbnz	x8, LBB0_6
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x21, #0
	cbz	x22, LBB0_22
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w25, #0
	b	LBB0_12
LBB0_10:                                ;   in Loop: Header=BB0_12 Depth=2
	ldr	x27, [x22, #8]
	str	x21, [x22, #8]
	mov	x21, x22
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=2
	mov	x22, x27
	cbz	x27, LBB0_4
LBB0_12:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_15 Depth 3
                                        ;       Child Loop BB0_18 Depth 3
	ldr	x8, [x22, #8]
	cbz	x8, LBB0_10
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=2
	mov	x27, x22
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=3
	ldr	x8, [x23, #8]
	mov	x27, x23
	cbz	x8, LBB0_10
LBB0_15:                                ;   Parent Loop BB0_5 Depth=1
                                        ;     Parent Loop BB0_12 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	mov	x23, x8
	ldr	x8, [x22]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=3
	mov	x0, x22
	mov	x1, x23
	bl	_TryMergeBrushes
	cbz	x0, LBB0_14
; %bb.17:                               ;   in Loop: Header=BB0_12 Depth=2
	str	x0, [x26, #8]
	ldr	x8, [x23, #8]
	str	x8, [x27, #8]
	ldp	x8, x27, [x22]
	str	x8, [x0]
	mov	x0, x22
	bl	_FreeBrush
	mov	x0, x23
	bl	_FreeBrush
	mov	x8, x27
LBB0_18:                                ;   Parent Loop BB0_5 Depth=1
                                        ;     Parent Loop BB0_12 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	mov	x26, x8
	cbz	x8, LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=3
	ldr	x8, [x26, #8]
	cbnz	x8, LBB0_18
LBB0_20:                                ;   in Loop: Header=BB0_12 Depth=2
	add	w25, w25, #1
	cbnz	w19, LBB0_11
; %bb.21:                               ;   in Loop: Header=BB0_12 Depth=2
	add	w22, w24, #1
	str	x24, [sp]
	mov	x0, x20
	bl	_qprintf
	mov	x24, x22
	b	LBB0_11
LBB0_22:
	cbnz	w19, LBB0_25
; %bb.23:
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_qprintf
	b	LBB0_25
LBB0_24:
	mov	x21, #0
LBB0_25:
	mov	x0, x21
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%5d brushes merged"

l_.str.1:                               ; @.str.1
	.asciz	"\r%5d"

l_.str.2:                               ; @.str.2
	.asciz	"\n"

.subsections_via_symbols
