	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gdImageCopyResized             ## -- Begin function gdImageCopyResized
	.p2align	4, 0x90
_gdImageCopyResized:                    ## @gdImageCopyResized
	.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	$184, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r12d
                                        ## kill: def $r8d killed $r8d def $r8
	movq	%r8, -96(%rbp)                  ## 8-byte Spill
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	%edx, -156(%rbp)                ## 4-byte Spill
	movq	%rsi, -168(%rbp)                ## 8-byte Spill
	movq	%rdi, %rbx
	movl	40(%rbp), %r15d
	movl	32(%rbp), %r13d
	movl	24(%rbp), %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	16(%rbp), %r14d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_gdMaxColors@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -128(%rbp)                ## 8-byte Spill
	movl	$4, %edi
	movq	%r13, -112(%rbp)                ## 8-byte Spill
	movl	%r13d, %esi
	callq	_overflow2
	testq	%rax, %rax
	jne	LBB0_43
## %bb.1:
	movl	$4, %edi
	movl	%r15d, %esi
	callq	_overflow2
	testq	%rax, %rax
	je	LBB0_2
LBB0_43:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_45
## %bb.44:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	%r12d, -88(%rbp)                ## 4-byte Spill
	movq	%rbx, -200(%rbp)                ## 8-byte Spill
	movq	-112(%rbp), %r13                ## 8-byte Reload
	leal	(,%r13,4), %edi
	callq	_gdMalloc
	movq	%rax, %r12
	leal	(,%r15,4), %edi
	callq	_gdMalloc
	movq	%rax, -120(%rbp)                ## 8-byte Spill
	testl	%r13d, %r13d
	jle	LBB0_5
## %bb.3:
	movl	%r13d, %r8d
	xorl	%ecx, %ecx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	leal	(%r14,%rcx), %esi
	movl	%esi, %eax
	cltd
	idivl	%r13d
	movl	%eax, %edi
	movl	%ecx, %eax
	cltd
	idivl	%r13d
	subl	%eax, %edi
	movl	%edi, (%r12,%rbx,4)
	leaq	1(%rbx), %rax
	movl	%esi, %ecx
	movq	%rax, %rbx
	cmpq	%rax, %r8
	jne	LBB0_4
LBB0_5:
	movq	%r12, %r14
	testl	%r15d, %r15d
	movq	-120(%rbp), %r9                 ## 8-byte Reload
	movq	-64(%rbp), %r10                 ## 8-byte Reload
	jle	LBB0_8
## %bb.6:
	movl	%r15d, %r8d
	xorl	%ecx, %ecx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	leal	(%r10,%rcx), %esi
	movl	%esi, %eax
	cltd
	idivl	%r15d
	movl	%eax, %edi
	movl	%ecx, %eax
	cltd
	idivl	%r15d
	subl	%eax, %edi
	movl	%edi, (%r9,%rbx,4)
	leaq	1(%rbx), %rax
	movl	%esi, %ecx
	movq	%rax, %rbx
	cmpq	%rax, %r8
	jne	LBB0_7
LBB0_8:
	movq	_gdMaxColors@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jle	LBB0_10
## %bb.9:
	shlq	$2, %rdx
	movq	-128(%rbp), %rdi                ## 8-byte Reload
	movl	$255, %esi
	callq	_memset
LBB0_10:
	testl	%r15d, %r15d
	movl	-52(%rbp), %r13d                ## 4-byte Reload
	movq	-168(%rbp), %r12                ## 8-byte Reload
	jle	LBB0_41
## %bb.11:
	movl	-88(%rbp), %edx                 ## 4-byte Reload
	addl	%edx, %r15d
	movq	-112(%rbp), %rax                ## 8-byte Reload
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	addl	%ecx, %eax
	movslq	%ecx, %rcx
	cltq
	movq	%rax, -216(%rbp)                ## 8-byte Spill
	movslq	%edx, %rax
	movslq	%r15d, %rdx
	movq	%rdx, -184(%rbp)                ## 8-byte Spill
	movq	%rcx, %rsi
	movq	%rax, -192(%rbp)                ## 8-byte Spill
	movq	%rax, %r15
	movq	%rcx, -136(%rbp)                ## 8-byte Spill
	movq	%r14, -176(%rbp)                ## 8-byte Spill
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_40:                                ##   in Loop: Header=BB0_12 Depth=1
	incq	%r15
	cmpq	-184(%rbp), %r15                ## 8-byte Folded Reload
	jge	LBB0_41
LBB0_12:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_14 Depth 2
                                        ##       Child Loop BB0_16 Depth 3
                                        ##         Child Loop BB0_31 Depth 4
	movq	%r15, %rcx
	subq	-192(%rbp), %rcx                ## 8-byte Folded Reload
	movq	-120(%rbp), %rax                ## 8-byte Reload
	movq	%rcx, -208(%rbp)                ## 8-byte Spill
	movl	(%rax,%rcx,4), %eax
	testl	%eax, %eax
	jle	LBB0_40
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	$0, -100(%rbp)                  ## 4-byte Folded Spill
	movq	-112(%rbp), %rcx                ## 8-byte Reload
	movq	%r15, -144(%rbp)                ## 8-byte Spill
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_38:                                ##   in Loop: Header=BB0_14 Depth=2
	movq	-120(%rbp), %rax                ## 8-byte Reload
	movq	-208(%rbp), %rcx                ## 8-byte Reload
	movl	(%rax,%rcx,4), %eax
	movl	-52(%rbp), %r13d                ## 4-byte Reload
	movq	-112(%rbp), %rcx                ## 8-byte Reload
LBB0_39:                                ##   in Loop: Header=BB0_14 Depth=2
	incl	%r13d
	movl	-100(%rbp), %edx                ## 4-byte Reload
	incl	%edx
	movl	%edx, -100(%rbp)                ## 4-byte Spill
	cmpl	%eax, %edx
	jge	LBB0_40
LBB0_14:                                ##   Parent Loop BB0_12 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_16 Depth 3
                                        ##         Child Loop BB0_31 Depth 4
	testl	%ecx, %ecx
	jle	LBB0_39
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=2
	movl	%r13d, -52(%rbp)                ## 4-byte Spill
	movq	%rsi, %rbx
	movl	-156(%rbp), %eax                ## 4-byte Reload
                                        ## kill: def $eax killed $eax def $rax
	movq	-200(%rbp), %rcx                ## 8-byte Reload
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_35:                                ##   in Loop: Header=BB0_16 Depth=3
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	addl	(%r14,%rcx,4), %eax
	movq	-144(%rbp), %r15                ## 8-byte Reload
	movq	-136(%rbp), %rsi                ## 8-byte Reload
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
LBB0_36:                                ##   in Loop: Header=BB0_16 Depth=3
	movq	%r13, %rcx
LBB0_37:                                ##   in Loop: Header=BB0_16 Depth=3
	incq	%rbx
	cmpq	-216(%rbp), %rbx                ## 8-byte Folded Reload
	jge	LBB0_38
LBB0_16:                                ##   Parent Loop BB0_12 Depth=1
                                        ##     Parent Loop BB0_14 Depth=2
                                        ## =>    This Loop Header: Depth=3
                                        ##         Child Loop BB0_31 Depth 4
	movq	%rbx, %rdx
	subq	%rsi, %rdx
	cmpl	$0, (%r14,%rdx,4)
	je	LBB0_37
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=3
	movq	%rcx, %r13
	cmpq	$0, (%rcx)
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, -96(%rbp)                 ## 8-byte Spill
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	je	LBB0_20
## %bb.18:                              ##   in Loop: Header=BB0_16 Depth=3
	cmpq	$0, (%r12)
	je	LBB0_19
## %bb.33:                              ##   in Loop: Header=BB0_16 Depth=3
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%r15d, %edx
	callq	_gdImageGetTrueColorPixel
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_gdImageGetTransparent
	cmpl	%ebx, %eax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	je	LBB0_35
	jmp	LBB0_28
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_16 Depth=3
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%r15d, %edx
	callq	_gdImageGetPixel
	movl	%eax, %r15d
	movq	%r12, %rdi
	callq	_gdImageGetTransparent
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	cmpl	%r15d, %eax
	je	LBB0_35
## %bb.21:                              ##   in Loop: Header=BB0_16 Depth=3
	cmpq	$0, (%r12)
	je	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_16 Depth=3
	movl	%r15d, %edi
	callq	_gdTrueColorGetRed
	movl	%eax, -80(%rbp)                 ## 4-byte Spill
	movl	%r15d, %edi
	callq	_gdTrueColorGetGreen
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	movl	%r15d, %edi
	callq	_gdTrueColorGetBlue
	movl	%eax, %ebx
	movl	%r15d, %edi
	callq	_gdTrueColorGetAlpha
	movq	%r13, %rdi
	movl	-80(%rbp), %esi                 ## 4-byte Reload
	movl	-68(%rbp), %edx                 ## 4-byte Reload
	movl	%ebx, %ecx
	movl	%eax, %r8d
	callq	_gdImageColorResolveAlpha
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, %ebx
	cmpl	$0, (%r14,%rcx,4)
	jg	LBB0_30
	jmp	LBB0_29
LBB0_19:                                ##   in Loop: Header=BB0_16 Depth=3
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%r15d, %edx
	callq	_gdImageGetPixel
	movl	%eax, -80(%rbp)                 ## 4-byte Spill
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%r15d, %edx
	callq	_gdImageGetTrueColorPixel
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_gdImageGetTransparent
	cmpl	-80(%rbp), %eax                 ## 4-byte Folded Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	je	LBB0_35
	jmp	LBB0_28
LBB0_23:                                ##   in Loop: Header=BB0_16 Depth=3
	movslq	%r15d, %rsi
	movq	-128(%rbp), %rax                ## 8-byte Reload
	movl	(%rax,%rsi,4), %ebx
	cmpl	$-1, %ebx
	je	LBB0_24
	.p2align	4, 0x90
LBB0_28:                                ##   in Loop: Header=BB0_16 Depth=3
	cmpl	$0, (%r14,%rcx,4)
	jle	LBB0_29
LBB0_30:                                ##   in Loop: Header=BB0_16 Depth=3
	movq	%r13, %r14
	xorl	%r13d, %r13d
	movl	-52(%rbp), %r12d                ## 4-byte Reload
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_31:                                ##   Parent Loop BB0_12 Depth=1
                                        ##     Parent Loop BB0_14 Depth=2
                                        ##       Parent Loop BB0_16 Depth=3
                                        ## =>      This Inner Loop Header: Depth=4
	leal	(%rax,%r13), %esi
	movq	%r14, %rdi
	movl	%r12d, %edx
	movl	%ebx, %ecx
	movq	%rax, %r15
	callq	_gdImageSetPixel
	movq	%r15, %rax
	incl	%r13d
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	-176(%rbp), %rdx                ## 8-byte Reload
	cmpl	(%rdx,%rcx,4), %r13d
	jl	LBB0_31
## %bb.32:                              ##   in Loop: Header=BB0_16 Depth=3
	addl	%r13d, %eax
	movq	-168(%rbp), %r12                ## 8-byte Reload
	movq	%r14, %rcx
	movq	-176(%rbp), %r14                ## 8-byte Reload
	movq	-136(%rbp), %rsi                ## 8-byte Reload
	movq	-144(%rbp), %r15                ## 8-byte Reload
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_37
LBB0_24:                                ##   in Loop: Header=BB0_16 Depth=3
	cmpq	%r12, %r13
	je	LBB0_25
## %bb.26:                              ##   in Loop: Header=BB0_16 Depth=3
	movq	%r13, %rbx
	movq	%r12, %rdi
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	movl	%r15d, %esi
	callq	_gdImageRed
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_gdImageGreen
	movl	%eax, -152(%rbp)                ## 4-byte Spill
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_gdImageBlue
	movl	%eax, -148(%rbp)                ## 4-byte Spill
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_gdImageAlpha
	movq	%r13, %rdi
	movl	-68(%rbp), %esi                 ## 4-byte Reload
	movl	-152(%rbp), %edx                ## 4-byte Reload
	movl	-148(%rbp), %ecx                ## 4-byte Reload
	movl	%eax, %r8d
	callq	_gdImageColorResolveAlpha
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, %ebx
	jmp	LBB0_27
LBB0_25:                                ##   in Loop: Header=BB0_16 Depth=3
	movl	%r15d, %ebx
LBB0_27:                                ##   in Loop: Header=BB0_16 Depth=3
	movq	-128(%rbp), %rax                ## 8-byte Reload
	movl	%ebx, (%rax,%rsi,4)
	cmpl	$0, (%r14,%rcx,4)
	jg	LBB0_30
LBB0_29:                                ##   in Loop: Header=BB0_16 Depth=3
	movq	-144(%rbp), %r15                ## 8-byte Reload
	movq	-136(%rbp), %rsi                ## 8-byte Reload
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	jmp	LBB0_36
LBB0_41:
	movq	%r14, %rdi
	callq	_gdFree
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_45
## %bb.42:
	movq	-120(%rbp), %rdi                ## 8-byte Reload
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gdFree                         ## TAILCALL
LBB0_45:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_gdMaxColors,4,2                ## @gdMaxColors
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gdImageCopyResized             ; -- Begin function gdImageCopyResized
	.p2align	2
_gdImageCopyResized:                    ; @gdImageCopyResized
	.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
	sub	sp, sp, #112
	mov	x25, x7
	mov	x28, x6
	mov	x26, x5
	mov	x24, x4
	mov	x19, x3
	stur	w2, [x29, #-148]                ; 4-byte Folded Spill
	mov	x23, x1
	mov	x22, x0
	ldp	w21, w27, [x29, #16]
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x20, _gdMaxColors@GOTPAGE
Lloh4:
	ldr	x20, [x20, _gdMaxColors@GOTPAGEOFF]
	ldr	w8, [x20]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x8, x9, x8
	stur	x8, [x29, #-136]                ; 8-byte Folded Spill
	mov	sp, x8
	mov	w0, #4
	mov	x1, x21
	bl	_overflow2
	cbnz	x0, LBB0_2
; %bb.1:
	mov	w0, #4
	mov	x1, x27
	bl	_overflow2
	cbz	x0, LBB0_4
LBB0_2:
	ldur	x8, [x29, #-88]
Lloh7:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh8:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_53
; %bb.3:
	sub	sp, x29, #80
	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
LBB0_4:
	stur	x26, [x29, #-104]               ; 8-byte Folded Spill
	lsl	w0, w21, #2
	bl	_gdMalloc
	mov	x26, x0
	lsl	w0, w27, #2
	bl	_gdMalloc
	stur	x0, [x29, #-160]                ; 8-byte Folded Spill
	cmp	w21, #1
	b.lt	LBB0_12
; %bb.5:
	cmp	w21, #4
	b.hs	LBB0_7
; %bb.6:
	mov	x8, #0
	b	LBB0_10
LBB0_7:
	mov	w14, #0
	and	x8, x21, #0xfffffffc
	lsl	w9, w28, #2
	lsl	w10, w28, #1
	add	w11, w10, w28
	add	x12, x26, #8
	mov	x13, x8
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	add	w15, w28, w14
	add	w16, w10, w14
	add	w17, w11, w14
	sdiv	w0, w14, w21
	add	w14, w9, w14
	sdiv	w15, w15, w21
	sdiv	w16, w16, w21
	sdiv	w17, w17, w21
	sub	w0, w15, w0
	sub	w15, w16, w15
	sub	w16, w17, w16
	stp	w0, w15, [x12, #-8]
	sdiv	w15, w14, w21
	sub	w15, w15, w17
	stp	w16, w15, [x12], #16
	subs	x13, x13, #4
	b.ne	LBB0_8
; %bb.9:
	cmp	x8, x21
	b.eq	LBB0_12
LBB0_10:
	mov	w9, #0
	mul	w10, w28, w8
	add	w11, w28, w10
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	add	w12, w11, w9
	sdiv	w12, w12, w21
	add	w13, w10, w9
	sdiv	w13, w13, w21
	sub	w12, w12, w13
	str	w12, [x26, x8, lsl #2]
	add	x12, x8, #1
	add	w9, w9, w28
	mov	x8, x12
	cmp	x21, x12
	b.ne	LBB0_11
LBB0_12:
	mov	x28, x24
	cmp	w27, #1
	ldur	x24, [x29, #-160]               ; 8-byte Folded Reload
	b.lt	LBB0_20
; %bb.13:
	cmp	w27, #4
	b.hs	LBB0_15
; %bb.14:
	mov	x8, #0
	b	LBB0_18
LBB0_15:
	mov	w14, #0
	and	x8, x27, #0xfffffffc
	lsl	w9, w25, #2
	lsl	w10, w25, #1
	add	w11, w10, w25
	add	x12, x24, #8
	mov	x13, x8
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	add	w15, w25, w14
	add	w16, w10, w14
	add	w17, w11, w14
	sdiv	w0, w14, w27
	add	w14, w9, w14
	sdiv	w15, w15, w27
	sdiv	w16, w16, w27
	sdiv	w17, w17, w27
	sub	w0, w15, w0
	sub	w15, w16, w15
	sub	w16, w17, w16
	stp	w0, w15, [x12, #-8]
	sdiv	w15, w14, w27
	sub	w15, w15, w17
	stp	w16, w15, [x12], #16
	subs	x13, x13, #4
	b.ne	LBB0_16
; %bb.17:
	cmp	x8, x27
	b.eq	LBB0_20
LBB0_18:
	mov	w9, #0
	mul	w10, w25, w8
	add	w11, w25, w10
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	add	w12, w11, w9
	sdiv	w12, w12, w27
	add	w13, w10, w9
	sdiv	w13, w13, w27
	sub	w12, w12, w13
	str	w12, [x24, x8, lsl #2]
	add	x12, x8, #1
	add	w9, w9, w25
	mov	x8, x12
	cmp	x27, x12
	b.ne	LBB0_19
LBB0_20:
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_22
; %bb.21:
	lsl	x2, x8, #2
	ldur	x0, [x29, #-136]                ; 8-byte Folded Reload
	mov	w1, #255
	bl	_memset
LBB0_22:
	cmp	w27, #1
	b.lt	LBB0_51
; %bb.23:
	ldur	x11, [x29, #-104]               ; 8-byte Folded Reload
	add	w8, w27, w11
	add	w9, w21, w28
	sxtw	x10, w28
	stp	x23, x10, [x29, #-120]          ; 16-byte Folded Spill
	sxtw	x9, w9
	stur	x9, [x29, #-96]                 ; 8-byte Folded Spill
	sxtw	x25, w11
	sxtw	x8, w8
	stp	x8, x25, [x29, #-184]           ; 16-byte Folded Spill
	stur	x21, [x29, #-168]               ; 8-byte Folded Spill
	b	LBB0_25
LBB0_24:                                ;   in Loop: Header=BB0_25 Depth=1
	add	x25, x25, #1
	ldur	x8, [x29, #-184]                ; 8-byte Folded Reload
	cmp	x25, x8
	b.ge	LBB0_51
LBB0_25:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_29 Depth 2
                                        ;       Child Loop BB0_34 Depth 3
                                        ;         Child Loop BB0_49 Depth 4
	ldur	x8, [x29, #-176]                ; 8-byte Folded Reload
	sub	x8, x25, x8
	stur	x8, [x29, #-144]                ; 8-byte Folded Spill
	ldr	w8, [x24, x8, lsl #2]
	cmp	w8, #1
	b.lt	LBB0_24
; %bb.26:                               ;   in Loop: Header=BB0_25 Depth=1
	mov	w9, #0
	stur	x25, [x29, #-104]               ; 8-byte Folded Spill
	b	LBB0_29
LBB0_27:                                ;   in Loop: Header=BB0_29 Depth=2
	ldp	x21, x24, [x29, #-168]          ; 16-byte Folded Reload
	ldur	x8, [x29, #-144]                ; 8-byte Folded Reload
	ldr	w8, [x24, x8, lsl #2]
	ldur	w9, [x29, #-124]                ; 4-byte Folded Reload
LBB0_28:                                ;   in Loop: Header=BB0_29 Depth=2
	add	w19, w19, #1
	add	w9, w9, #1
	cmp	w9, w8
	b.ge	LBB0_24
LBB0_29:                                ;   Parent Loop BB0_25 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_34 Depth 3
                                        ;         Child Loop BB0_49 Depth 4
	cmp	w21, #1
	b.lt	LBB0_28
; %bb.30:                               ;   in Loop: Header=BB0_29 Depth=2
	stur	w9, [x29, #-124]                ; 4-byte Folded Spill
	ldur	x24, [x29, #-112]               ; 8-byte Folded Reload
	mov	x28, x24
	ldur	w27, [x29, #-148]               ; 4-byte Folded Reload
	b	LBB0_34
LBB0_31:                                ;   in Loop: Header=BB0_34 Depth=3
	ldr	w8, [x26, x21, lsl #2]
	add	w27, w8, w27
LBB0_32:                                ;   in Loop: Header=BB0_34 Depth=3
	ldur	x25, [x29, #-104]               ; 8-byte Folded Reload
LBB0_33:                                ;   in Loop: Header=BB0_34 Depth=3
	add	x28, x28, #1
	ldur	x8, [x29, #-96]                 ; 8-byte Folded Reload
	cmp	x28, x8
	b.ge	LBB0_27
LBB0_34:                                ;   Parent Loop BB0_25 Depth=1
                                        ;     Parent Loop BB0_29 Depth=2
                                        ; =>    This Loop Header: Depth=3
                                        ;         Child Loop BB0_49 Depth 4
	sub	x21, x28, x24
	ldr	w8, [x26, x21, lsl #2]
	cbz	w8, LBB0_33
; %bb.35:                               ;   in Loop: Header=BB0_34 Depth=3
	ldr	x8, [x22]
	cbz	x8, LBB0_38
; %bb.36:                               ;   in Loop: Header=BB0_34 Depth=3
	ldr	x8, [x23]
	cbz	x8, LBB0_41
; %bb.37:                               ;   in Loop: Header=BB0_34 Depth=3
	mov	x0, x23
	mov	x1, x28
	mov	x2, x25
	bl	_gdImageGetTrueColorPixel
	mov	x25, x0
	mov	x0, x23
	bl	_gdImageGetTransparent
	cmp	w0, w25
	b.eq	LBB0_31
	b	LBB0_47
LBB0_38:                                ;   in Loop: Header=BB0_34 Depth=3
	mov	x0, x23
	mov	x1, x28
	mov	x2, x25
	bl	_gdImageGetPixel
	mov	x20, x0
	mov	x0, x23
	bl	_gdImageGetTransparent
	cmp	w0, w20
	b.eq	LBB0_31
; %bb.39:                               ;   in Loop: Header=BB0_34 Depth=3
	ldr	x8, [x23]
	cbz	x8, LBB0_42
; %bb.40:                               ;   in Loop: Header=BB0_34 Depth=3
	mov	x0, x20
	bl	_gdTrueColorGetRed
	mov	x25, x0
	mov	x0, x20
	bl	_gdTrueColorGetGreen
	mov	x24, x0
	mov	x0, x20
	bl	_gdTrueColorGetBlue
	mov	x23, x0
	mov	x0, x20
	bl	_gdTrueColorGetAlpha
	mov	x4, x0
	mov	x0, x22
	mov	x1, x25
	mov	x2, x24
	mov	x3, x23
	ldp	x23, x24, [x29, #-120]          ; 16-byte Folded Reload
	bl	_gdImageColorResolveAlpha
	mov	x25, x0
	b	LBB0_47
LBB0_41:                                ;   in Loop: Header=BB0_34 Depth=3
	mov	x0, x23
	mov	x1, x28
	mov	x2, x25
	bl	_gdImageGetPixel
	mov	x20, x0
	mov	x0, x23
	mov	x1, x28
	mov	x2, x25
	bl	_gdImageGetTrueColorPixel
	mov	x25, x0
	mov	x0, x23
	bl	_gdImageGetTransparent
	cmp	w0, w20
	b.eq	LBB0_31
	b	LBB0_47
LBB0_42:                                ;   in Loop: Header=BB0_34 Depth=3
	ldur	x8, [x29, #-136]                ; 8-byte Folded Reload
	ldr	w25, [x8, w20, sxtw #2]
	cmn	w25, #1
	b.ne	LBB0_47
; %bb.43:                               ;   in Loop: Header=BB0_34 Depth=3
	cmp	x22, x23
	b.eq	LBB0_45
; %bb.44:                               ;   in Loop: Header=BB0_34 Depth=3
	mov	x0, x23
	mov	x1, x20
	bl	_gdImageRed
	mov	x23, x0
	ldur	x0, [x29, #-120]                ; 8-byte Folded Reload
	mov	x1, x20
	bl	_gdImageGreen
	mov	x24, x0
	ldur	x0, [x29, #-120]                ; 8-byte Folded Reload
	mov	x1, x20
	bl	_gdImageBlue
	mov	x25, x0
	ldur	x0, [x29, #-120]                ; 8-byte Folded Reload
	mov	x1, x20
	bl	_gdImageAlpha
	mov	x4, x0
	mov	x0, x22
	mov	x1, x23
	mov	x2, x24
	ldp	x23, x24, [x29, #-120]          ; 16-byte Folded Reload
	mov	x3, x25
	bl	_gdImageColorResolveAlpha
	mov	x25, x0
	b	LBB0_46
LBB0_45:                                ;   in Loop: Header=BB0_34 Depth=3
	mov	x25, x20
LBB0_46:                                ;   in Loop: Header=BB0_34 Depth=3
	sxtw	x8, w20
	ldur	x9, [x29, #-136]                ; 8-byte Folded Reload
	str	w25, [x9, x8, lsl #2]
LBB0_47:                                ;   in Loop: Header=BB0_34 Depth=3
	ldr	w8, [x26, x21, lsl #2]
	cmp	w8, #1
	b.lt	LBB0_32
; %bb.48:                               ;   in Loop: Header=BB0_34 Depth=3
	mov	w20, #0
LBB0_49:                                ;   Parent Loop BB0_25 Depth=1
                                        ;     Parent Loop BB0_29 Depth=2
                                        ;       Parent Loop BB0_34 Depth=3
                                        ; =>      This Inner Loop Header: Depth=4
	add	w1, w27, w20
	mov	x0, x22
	mov	x2, x19
	mov	x3, x25
	bl	_gdImageSetPixel
	add	w20, w20, #1
	ldr	w8, [x26, x21, lsl #2]
	cmp	w20, w8
	b.lt	LBB0_49
; %bb.50:                               ;   in Loop: Header=BB0_34 Depth=3
	add	w27, w27, w20
	b	LBB0_32
LBB0_51:
	mov	x0, x26
	bl	_gdFree
	ldur	x8, [x29, #-88]
Lloh10:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh11:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_53
; %bb.52:
	mov	x0, x24
	sub	sp, x29, #80
	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
	b	_gdFree
LBB0_53:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_gdMaxColors,4,2                ; @gdMaxColors
.subsections_via_symbols
