	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_MergeBrushes                   ## -- Begin function MergeBrushes
	.p2align	4, 0x90
_MergeBrushes:                          ## @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, %r13
	leaq	L_.str(%rip), %rdi
	xorl	%esi, %esi
	xorl	%eax, %eax
	callq	_qprintf
	xorl	%eax, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %r13
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_21
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
                                        ##     Child Loop BB0_8 Depth 2
                                        ##       Child Loop BB0_10 Depth 3
                                        ##       Child Loop BB0_14 Depth 3
	movq	%r13, %rax
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rax, %r14
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	(%r14), %rax
	testq	%rax, %rax
	jne	LBB0_4
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	xorl	%r12d, %r12d
	testq	%r13, %r13
	je	LBB0_21
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_8 Depth=2
	movq	(%r13), %r15
	movq	%r12, (%r13)
	movq	%r13, %r12
LBB0_19:                                ##   in Loop: Header=BB0_8 Depth=2
	movq	%r15, %r13
	testq	%r15, %r15
	je	LBB0_20
LBB0_8:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_10 Depth 3
                                        ##       Child Loop BB0_14 Depth 3
	movq	(%r13), %rax
	testq	%rax, %rax
	je	LBB0_18
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=2
	movq	%r13, %rbx
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_10 Depth=3
	movq	(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_18
LBB0_10:                                ##   Parent Loop BB0_3 Depth=1
                                        ##     Parent Loop BB0_8 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	%rbx, %r15
	movq	%rax, %rbx
	movq	8(%r13), %rax
	movq	(%rax), %rdx
	movq	8(%rbx), %rcx
	cmpq	(%rcx), %rdx
	jne	LBB0_17
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=3
	movq	8(%rax), %rax
	cmpq	8(%rcx), %rax
	jne	LBB0_17
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=3
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_TryMergeBrushes
	testq	%rax, %rax
	je	LBB0_17
## %bb.13:                              ##   in Loop: Header=BB0_8 Depth=2
	movq	%rax, (%r14)
	movq	(%rbx), %rax
	movq	%rax, (%r15)
	movq	(%r13), %r15
	movq	%r13, %rdi
	callq	_FreeBrush
	movq	%rbx, %rdi
	callq	_FreeBrush
	movq	%r15, %rax
	.p2align	4, 0x90
LBB0_14:                                ##   Parent Loop BB0_3 Depth=1
                                        ##     Parent Loop BB0_8 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	%rax, %r14
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=3
	movq	(%r14), %rax
	testq	%rax, %rax
	jne	LBB0_14
LBB0_16:                                ##   in Loop: Header=BB0_8 Depth=2
	incl	-44(%rbp)                       ## 4-byte Folded Spill
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	leal	1(%rsi), %ebx
	leaq	L_.str.1(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	_qprintf
	movl	%ebx, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_19
LBB0_21:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_qprintf
	jmp	LBB0_22
LBB0_1:
	xorl	%r12d, %r12d
LBB0_22:
	movq	%r12, %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	_MergeBrushes                   ; -- Begin function MergeBrushes
	.p2align	2
_MergeBrushes:                          ; @MergeBrushes
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	cbz	x0, LBB0_20
; %bb.1:
	mov	x21, x0
	str	xzr, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_qprintf
	mov	w23, #0
Lloh2:
	adrp	x19, l_.str.1@PAGE
Lloh3:
	add	x19, x19, l_.str.1@PAGEOFF
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x21, x20
	cbz	w24, LBB0_19
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
                                        ;     Child Loop BB0_9 Depth 2
                                        ;       Child Loop BB0_12 Depth 3
                                        ;       Child Loop BB0_16 Depth 3
	mov	x8, x21
LBB0_4:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x25, x8
	cbz	x8, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=2
	ldr	x8, [x25]
	cbnz	x8, LBB0_4
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x20, #0
	cbz	x21, LBB0_19
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w24, #0
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=2
	ldr	x26, [x21]
	str	x20, [x21]
	mov	x20, x21
	mov	x21, x26
	cbz	x26, LBB0_2
LBB0_9:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_12 Depth 3
                                        ;       Child Loop BB0_16 Depth 3
	ldr	x8, [x21]
	cbz	x8, LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	mov	x22, x21
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=3
	ldr	x8, [x22]
	cbz	x8, LBB0_8
LBB0_12:                                ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_9 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	mov	x26, x22
	mov	x22, x8
	ldr	x8, [x21, #8]
	ldr	x10, [x8]
	ldr	x9, [x22, #8]
	ldr	x11, [x9]
	cmp	x10, x11
	b.ne	LBB0_11
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=3
	ldr	x8, [x8, #8]
	ldr	x9, [x9, #8]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=3
	mov	x0, x21
	mov	x1, x22
	bl	_TryMergeBrushes
	cbz	x0, LBB0_11
; %bb.15:                               ;   in Loop: Header=BB0_9 Depth=2
	str	x0, [x25]
	ldr	x8, [x22]
	str	x8, [x26]
	ldr	x26, [x21]
	mov	x0, x21
	bl	_FreeBrush
	mov	x0, x22
	bl	_FreeBrush
	mov	x8, x26
LBB0_16:                                ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_9 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	mov	x25, x8
	cbz	x8, LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=3
	ldr	x8, [x25]
	cbnz	x8, LBB0_16
LBB0_18:                                ;   in Loop: Header=BB0_9 Depth=2
	add	w24, w24, #1
	add	w21, w23, #1
	str	x23, [sp]
	mov	x0, x19
	bl	_qprintf
	mov	x23, x21
	mov	x21, x26
	cbnz	x26, LBB0_9
	b	LBB0_2
LBB0_19:
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_qprintf
	b	LBB0_21
LBB0_20:
	mov	x20, #0
LBB0_21:
	mov	x0, x20
	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
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.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
