	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gdImageBrushApply
_gdImageBrushApply:                     ## @gdImageBrushApply
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	8(%rdi), %rdi
	testq	%rdi, %rdi
	je	LBB0_30
## %bb.1:
	movl	%edx, %ebx
	movl	%esi, %r15d
	callq	_gdImageSY
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	subl	%ecx, %ebx
	movq	8(%r14), %rdi
	callq	_gdImageSY
	movq	%r15, %r12
	movl	%eax, %r15d
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	leal	(%rbx,%r15), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	8(%r14), %rdi
	callq	_gdImageSX
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	subl	%ecx, %r12d
	movq	8(%r14), %rdi
	callq	_gdImageSX
                                        ## kill: def $eax killed $eax def $rax
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	addl	%r12d, %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	cmpq	$0, 16(%r14)
	je	LBB0_2
## %bb.9:
	movq	8(%r14), %rax
	cmpq	$0, (%rax)
	je	LBB0_18
## %bb.10:
	testl	%r15d, %r15d
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	jle	LBB0_30
## %bb.11:
	xorl	%r12d, %r12d
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_12 Depth=1
	incl	%r12d
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	incl	%eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	cmpl	-52(%rbp), %eax                 ## 4-byte Folded Reload
	jge	LBB0_30
LBB0_12:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_14 Depth 2
	cmpl	$0, -72(%rbp)                   ## 4-byte Folded Reload
	jle	LBB0_17
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	xorl	%ebx, %ebx
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_14 Depth=2
	leal	(%r15,%rbx), %eax
	incl	%eax
	movl	%ebx, %ecx
	incl	%ecx
	movl	%ecx, %ebx
	cmpl	-56(%rbp), %eax                 ## 4-byte Folded Reload
	jge	LBB0_17
LBB0_14:                                ##   Parent Loop BB0_12 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%r14), %rdi
	movl	%ebx, %esi
	movl	%r12d, %edx
	callq	_gdImageGetTrueColorPixel
	movl	%eax, %r13d
	movq	8(%r14), %rdi
	callq	_gdImageGetTransparent
	cmpl	%eax, %r13d
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=2
	leal	(%r15,%rbx), %esi
	movq	%r14, %rdi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	movl	%r13d, %ecx
	callq	_gdImageSetPixel
	jmp	LBB0_16
LBB0_2:
	testl	%r15d, %r15d
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	jle	LBB0_30
## %bb.3:
	xorl	%r15d, %r15d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_29:                                ##   in Loop: Header=BB0_4 Depth=1
	incl	%r15d
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	incl	%eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	cmpl	-52(%rbp), %eax                 ## 4-byte Folded Reload
	jge	LBB0_30
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	cmpl	$0, -72(%rbp)                   ## 4-byte Folded Reload
	jle	LBB0_29
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	xorl	%r12d, %r12d
	movl	%r15d, -76(%rbp)                ## 4-byte Spill
	jmp	LBB0_6
LBB0_26:                                ##   in Loop: Header=BB0_6 Depth=2
	movq	(%r14), %rax
	movslq	%r13d, %rcx
	movl	(%rax,%rcx,4), %ecx
LBB0_27:                                ##   in Loop: Header=BB0_6 Depth=2
	movq	%r14, %rdi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_gdImageSetPixel
LBB0_28:                                ##   in Loop: Header=BB0_6 Depth=2
	leal	(%rbx,%r12), %eax
	incl	%eax
	movl	%r12d, %ecx
	incl	%ecx
	movl	%ecx, %r12d
	cmpl	-56(%rbp), %eax                 ## 4-byte Folded Reload
	jge	LBB0_29
LBB0_6:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%r14), %rdi
	movl	%r12d, %esi
	movl	%r15d, %edx
	callq	_gdImageGetPixel
	movl	%eax, %r13d
	movq	8(%r14), %rdi
	callq	_gdImageGetTransparent
	cmpl	%eax, %r13d
	je	LBB0_28
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=2
	leal	(%rbx,%r12), %esi
	movq	8(%r14), %rax
	cmpq	$0, (%rax)
	je	LBB0_26
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=2
	movl	%r13d, %edi
	movl	%esi, -84(%rbp)                 ## 4-byte Spill
	callq	_gdTrueColorGetRed
	movl	%eax, %ebx
	movl	%r13d, %edi
	callq	_gdTrueColorGetGreen
	movl	%eax, -80(%rbp)                 ## 4-byte Spill
	movl	%r13d, %edi
	callq	_gdTrueColorGetBlue
	movl	%eax, %r15d
	movl	%r13d, %edi
	callq	_gdTrueColorGetAlpha
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	-80(%rbp), %edx                 ## 4-byte Reload
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movl	%r15d, %ecx
	movl	-76(%rbp), %r15d                ## 4-byte Reload
	movl	%eax, %r8d
	callq	_gdImageColorResolveAlpha
	movl	-84(%rbp), %esi                 ## 4-byte Reload
	movl	%eax, %ecx
	jmp	LBB0_27
LBB0_18:
	testl	%r15d, %r15d
	jle	LBB0_30
## %bb.19:
	xorl	%r12d, %r12d
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_25:                                ##   in Loop: Header=BB0_20 Depth=1
	incl	%r12d
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	incl	%eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	cmpl	-52(%rbp), %eax                 ## 4-byte Folded Reload
	jge	LBB0_30
LBB0_20:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_22 Depth 2
	cmpl	$0, -72(%rbp)                   ## 4-byte Folded Reload
	jle	LBB0_25
## %bb.21:                              ##   in Loop: Header=BB0_20 Depth=1
	xorl	%ebx, %ebx
	jmp	LBB0_22
	.p2align	4, 0x90
LBB0_24:                                ##   in Loop: Header=BB0_22 Depth=2
	leal	(%r15,%rbx), %eax
	incl	%eax
	movl	%ebx, %ecx
	incl	%ecx
	movl	%ecx, %ebx
	cmpl	-56(%rbp), %eax                 ## 4-byte Folded Reload
	jge	LBB0_25
LBB0_22:                                ##   Parent Loop BB0_20 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%r14), %rdi
	movl	%ebx, %esi
	movl	%r12d, %edx
	callq	_gdImageGetPixel
	movl	%eax, %r15d
	movq	8(%r14), %rdi
	movl	%ebx, %esi
	movl	%r12d, %edx
	callq	_gdImageGetTrueColorPixel
	movl	%eax, %r13d
	movq	8(%r14), %rdi
	callq	_gdImageGetTransparent
	cmpl	%eax, %r15d
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_24
## %bb.23:                              ##   in Loop: Header=BB0_22 Depth=2
	leal	(%r15,%rbx), %esi
	movq	%r14, %rdi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	movl	%r13d, %ecx
	callq	_gdImageSetPixel
	jmp	LBB0_24
LBB0_30:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_gdImageBrushApply
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gdImageBrushApply
_gdImageBrushApply:                     ; @gdImageBrushApply
	.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	x19, x0
	ldr	x0, [x0, #8]
	cbz	x0, LBB0_30
; %bb.1:
	mov	x20, x2
	mov	x21, x1
	bl	_gdImageSY
	cmp	w0, #0
	cinc	w8, w0, lt
	sub	w20, w20, w8, asr #1
	ldr	x0, [x19, #8]
	bl	_gdImageSY
	mov	x22, x0
	add	w8, w20, w0
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	ldr	x0, [x19, #8]
	bl	_gdImageSX
	cmp	w0, #0
	cinc	w8, w0, lt
	sub	w28, w21, w8, asr #1
	ldr	x0, [x19, #8]
	bl	_gdImageSX
	str	w0, [sp, #8]                    ; 4-byte Folded Spill
	add	w21, w28, w0
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_11
; %bb.2:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_22
; %bb.3:
	cmp	w22, #1
	b.lt	LBB0_30
; %bb.4:
	mov	w22, #0
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	w22, w22, #1
	add	w20, w20, #1
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	cmp	w20, w8
	b.ge	LBB0_30
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	ldr	w8, [sp, #8]                    ; 4-byte Folded Reload
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w23, #0
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=2
	add	w23, w23, #1
	add	w8, w28, w23
	cmp	w8, w21
	b.ge	LBB0_5
LBB0_9:                                 ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x0, [x19, #8]
	mov	x1, x23
	mov	x2, x22
	bl	_gdImageGetTrueColorPixel
	mov	x24, x0
	ldr	x0, [x19, #8]
	bl	_gdImageGetTransparent
	cmp	w24, w0
	b.eq	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	add	w1, w28, w23
	mov	x0, x19
	mov	x2, x20
	mov	x3, x24
	bl	_gdImageSetPixel
	b	LBB0_8
LBB0_11:
	cmp	w22, #1
	b.lt	LBB0_30
; %bb.12:
	mov	w22, #0
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	add	w22, w22, #1
	add	w20, w20, #1
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	cmp	w20, w8
	b.ge	LBB0_30
LBB0_14:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_19 Depth 2
	ldr	w8, [sp, #8]                    ; 4-byte Folded Reload
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	mov	w23, #0
	b	LBB0_19
LBB0_16:                                ;   in Loop: Header=BB0_19 Depth=2
	ldr	x8, [x19]
	ldr	w3, [x8, w24, sxtw #2]
LBB0_17:                                ;   in Loop: Header=BB0_19 Depth=2
	add	w1, w28, w23
	mov	x0, x19
	mov	x2, x20
	bl	_gdImageSetPixel
LBB0_18:                                ;   in Loop: Header=BB0_19 Depth=2
	add	w23, w23, #1
	add	w8, w28, w23
	cmp	w8, w21
	b.ge	LBB0_13
LBB0_19:                                ;   Parent Loop BB0_14 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x0, [x19, #8]
	mov	x1, x23
	mov	x2, x22
	bl	_gdImageGetPixel
	mov	x24, x0
	ldr	x0, [x19, #8]
	bl	_gdImageGetTransparent
	cmp	w24, w0
	b.eq	LBB0_18
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=2
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_16
; %bb.21:                               ;   in Loop: Header=BB0_19 Depth=2
	mov	x0, x24
	bl	_gdTrueColorGetRed
	mov	x25, x0
	mov	x0, x24
	bl	_gdTrueColorGetGreen
	mov	x26, x0
	mov	x0, x24
	bl	_gdTrueColorGetBlue
	mov	x27, x0
	mov	x0, x24
	bl	_gdTrueColorGetAlpha
	mov	x4, x0
	mov	x0, x19
	mov	x1, x25
	mov	x2, x26
	mov	x3, x27
	bl	_gdImageColorResolveAlpha
	mov	x3, x0
	b	LBB0_17
LBB0_22:
	cmp	w22, #1
	b.lt	LBB0_30
; %bb.23:
	mov	w22, #0
	b	LBB0_25
LBB0_24:                                ;   in Loop: Header=BB0_25 Depth=1
	add	w22, w22, #1
	add	w20, w20, #1
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	cmp	w20, w8
	b.ge	LBB0_30
LBB0_25:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_28 Depth 2
	ldr	w8, [sp, #8]                    ; 4-byte Folded Reload
	cmp	w8, #1
	b.lt	LBB0_24
; %bb.26:                               ;   in Loop: Header=BB0_25 Depth=1
	mov	w23, #0
	b	LBB0_28
LBB0_27:                                ;   in Loop: Header=BB0_28 Depth=2
	add	w23, w23, #1
	add	w8, w28, w23
	cmp	w8, w21
	b.ge	LBB0_24
LBB0_28:                                ;   Parent Loop BB0_25 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x0, [x19, #8]
	mov	x1, x23
	mov	x2, x22
	bl	_gdImageGetPixel
	mov	x25, x0
	ldr	x0, [x19, #8]
	mov	x1, x23
	mov	x2, x22
	bl	_gdImageGetTrueColorPixel
	mov	x24, x0
	ldr	x0, [x19, #8]
	bl	_gdImageGetTransparent
	cmp	w25, w0
	b.eq	LBB0_27
; %bb.29:                               ;   in Loop: Header=BB0_28 Depth=2
	add	w1, w28, w23
	mov	x0, x19
	mov	x2, x20
	mov	x3, x24
	bl	_gdImageSetPixel
	b	LBB0_27
LBB0_30:
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_gdImageBrushApply
.subsections_via_symbols
