	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal4,4byte_literals
	.p2align	2                               ## -- Begin function gdImageCopyMergeGray
LCPI0_0:
	.long	0x42c80000                      ## float 100
LCPI0_2:
	.long	0x3f1645a2                      ## float 0.587000012
LCPI0_3:
	.long	0x3e991687                      ## float 0.298999995
LCPI0_4:
	.long	0x3de978d5                      ## float 0.114
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3
LCPI0_1:
	.quad	0x4059000000000000              ## double 100
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_gdImageCopyMergeGray
	.p2align	4, 0x90
_gdImageCopyMergeGray:                  ## @gdImageCopyMergeGray
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $r8d killed $r8d def $r8
	movq	%r8, -104(%rbp)                 ## 8-byte Spill
	movl	%ecx, -72(%rbp)                 ## 4-byte Spill
	movl	%edx, -84(%rbp)                 ## 4-byte Spill
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movl	24(%rbp), %eax
	movl	%eax, -76(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	jle	LBB0_12
## %bb.1:
	movl	%r9d, %ebx
	movq	%rsi, %r12
	movl	32(%rbp), %eax
	movl	16(%rbp), %edx
	addl	%r9d, -76(%rbp)                 ## 4-byte Folded Spill
	movq	-104(%rbp), %rcx                ## 8-byte Reload
	addl	%edx, %ecx
	movl	%ecx, -96(%rbp)                 ## 4-byte Spill
	cmpq	%rsi, -56(%rbp)                 ## 8-byte Folded Reload
	sete	%cl
	cvtsi2ss	%eax, %xmm0
	subl	$100, %eax
	sete	%dl
	negl	%eax
	divss	LCPI0_0(%rip), %xmm0
	movss	%xmm0, -68(%rbp)                ## 4-byte Spill
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	divsd	LCPI0_1(%rip), %xmm0
	movsd	%xmm0, -112(%rbp)               ## 8-byte Spill
	andb	%cl, %dl
	movb	%dl, -41(%rbp)                  ## 1-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	incl	-72(%rbp)                       ## 4-byte Folded Spill
	incl	%ebx
	cmpl	-76(%rbp), %ebx                 ## 4-byte Folded Reload
	jge	LBB0_12
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movl	16(%rbp), %eax
	testl	%eax, %eax
	jle	LBB0_11
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movl	%eax, %r14d
	movl	-84(%rbp), %r15d                ## 4-byte Reload
	movl	%ebx, -92(%rbp)                 ## 4-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=2
	movl	%r15d, %esi
	movl	-72(%rbp), %edx                 ## 4-byte Reload
	movl	%r13d, %ecx
	callq	_gdImageSetPixel
	movl	-92(%rbp), %ebx                 ## 4-byte Reload
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=2
	incl	%r15d
	incl	%r14d
	cmpl	-96(%rbp), %r14d                ## 4-byte Folded Reload
	jge	LBB0_11
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	%ebx, %edx
	callq	_gdImageGetPixel
	movl	%eax, %r13d
	movq	%r12, %rdi
	callq	_gdImageGetTransparent
	cmpl	%r13d, %eax
	je	LBB0_10
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	cmpb	$0, -41(%rbp)                   ## 1-byte Folded Reload
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	jne	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %esi
	movl	-72(%rbp), %edx                 ## 4-byte Reload
	callq	_gdImageGetPixel
	movl	%eax, %ebx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	callq	_gdImageRed
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	movss	%xmm0, -64(%rbp)                ## 4-byte Spill
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	callq	_gdImageGreen
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	mulss	LCPI0_2(%rip), %xmm0
	movss	-64(%rbp), %xmm1                ## 4-byte Reload
                                        ## xmm1 = mem[0],zero,zero,zero
	mulss	LCPI0_3(%rip), %xmm1
	addss	%xmm0, %xmm1
	movss	%xmm1, -64(%rbp)                ## 4-byte Spill
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	callq	_gdImageBlue
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	mulss	LCPI0_4(%rip), %xmm0
	addss	-64(%rbp), %xmm0                ## 4-byte Folded Reload
	movss	%xmm0, -64(%rbp)                ## 4-byte Spill
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_gdImageRed
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	mulss	-68(%rbp), %xmm0                ## 4-byte Folded Reload
	cvtss2sd	%xmm0, %xmm0
	movss	-64(%rbp), %xmm1                ## 4-byte Reload
                                        ## xmm1 = mem[0],zero,zero,zero
	cvtss2sd	%xmm1, %xmm1
	mulsd	-112(%rbp), %xmm1               ## 8-byte Folded Reload
	movsd	%xmm1, -64(%rbp)                ## 8-byte Spill
	addsd	%xmm1, %xmm0
	cvttsd2si	%xmm0, %ebx
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_gdImageGreen
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	mulss	-68(%rbp), %xmm0                ## 4-byte Folded Reload
	cvtss2sd	%xmm0, %xmm0
	addsd	-64(%rbp), %xmm0                ## 8-byte Folded Reload
	cvttsd2si	%xmm0, %eax
	movl	%eax, -88(%rbp)                 ## 4-byte Spill
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_gdImageBlue
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	mulss	-68(%rbp), %xmm0                ## 4-byte Folded Reload
	cvtss2sd	%xmm0, %xmm0
	addsd	-64(%rbp), %xmm0                ## 8-byte Folded Reload
	cvttsd2si	%xmm0, %ecx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, -64(%rbp)                 ## 4-byte Spill
	movl	%ebx, %esi
	movl	-88(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edx
	movl	%ecx, -80(%rbp)                 ## 4-byte Spill
	callq	_gdImageColorExact
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %r13d
	cmpl	$-1, %eax
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	-64(%rbp), %esi                 ## 4-byte Reload
	movl	%ebx, %edx
	movl	-80(%rbp), %ecx                 ## 4-byte Reload
	callq	_gdImageColorAllocate
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %r13d
	cmpl	$-1, %eax
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	-64(%rbp), %esi                 ## 4-byte Reload
	movl	%ebx, %edx
	movl	-80(%rbp), %ecx                 ## 4-byte Reload
	callq	_gdImageColorClosest
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %r13d
	jmp	LBB0_9
LBB0_12:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gdImageCopyMergeGray           ; -- Begin function gdImageCopyMergeGray
	.p2align	2
_gdImageCopyMergeGray:                  ; @gdImageCopyMergeGray
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	d11, d10, [sp, #32]             ; 16-byte Folded Spill
	stp	d9, d8, [sp, #48]               ; 16-byte Folded Spill
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	.cfi_offset b8, -104
	.cfi_offset b9, -112
	.cfi_offset b10, -120
	.cfi_offset b11, -128
	str	w6, [sp, #20]                   ; 4-byte Folded Spill
	stp	w2, w4, [sp, #8]                ; 8-byte Folded Spill
	cmp	w7, #1
	b.lt	LBB0_12
; %bb.1:
	mov	x20, x5
	mov	x22, x3
	mov	x24, x1
	mov	x25, x0
	ldr	w8, [x29, #16]
	add	w9, w7, w5
	str	w9, [sp, #16]                   ; 4-byte Folded Spill
	ldr	w9, [sp, #20]                   ; 4-byte Folded Reload
	ldr	w10, [sp, #12]                  ; 4-byte Folded Reload
	add	w19, w9, w10
	cmp	x0, x1
	mov	w9, #100
	ccmp	w8, w9, #0, eq
	cset	w10, eq
	stp	w10, w19, [sp, #24]             ; 8-byte Folded Spill
	scvtf	s0, w8
	mov	w10, #1120403456
	fmov	s1, w10
	fdiv	s8, s0, s1
	sub	w8, w9, w8
	scvtf	d0, w8
	mov	x8, #4636737291354636288
	fmov	d1, x8
	fdiv	d9, d0, d1
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w22, w22, #1
	add	w20, w20, #1
	ldr	w8, [sp, #16]                   ; 4-byte Folded Reload
	cmp	w20, w8
	b.ge	LBB0_12
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	ldr	w8, [sp, #20]                   ; 4-byte Folded Reload
	cmp	w8, #1
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldp	w27, w26, [sp, #8]              ; 8-byte Folded Reload
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=2
	mov	x0, x25
	mov	x1, x27
	mov	x2, x22
	mov	x3, x28
	bl	_gdImageSetPixel
	ldr	w19, [sp, #28]                  ; 4-byte Folded Reload
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=2
	add	w27, w27, #1
	add	w26, w26, #1
	cmp	w26, w19
	b.ge	LBB0_2
LBB0_7:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x24
	mov	x1, x26
	mov	x2, x20
	bl	_gdImageGetPixel
	mov	x28, x0
	mov	x0, x24
	bl	_gdImageGetTransparent
	cmp	w0, w28
	b.eq	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	ldr	w8, [sp, #24]                   ; 4-byte Folded Reload
	tbnz	w8, #0, LBB0_5
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=2
	mov	x0, x25
	mov	x1, x27
	mov	x2, x22
	bl	_gdImageGetPixel
	mov	x19, x0
	mov	x0, x25
	mov	x1, x19
	bl	_gdImageRed
	scvtf	s10, w0
	mov	x0, x25
	mov	x1, x19
	bl	_gdImageGreen
	scvtf	s0, w0
	mov	w8, #17826
	movk	w8, #16150, lsl #16
	fmov	s1, w8
	fmul	s0, s0, s1
	mov	w8, #5767
	movk	w8, #16025, lsl #16
	fmov	s1, w8
	fmadd	s10, s10, s1, s0
	mov	x0, x25
	mov	x1, x19
	bl	_gdImageBlue
	scvtf	s0, w0
	mov	w8, #30933
	movk	w8, #15849, lsl #16
	fmov	s1, w8
	fmadd	s10, s0, s1, s10
	mov	x0, x24
	mov	x1, x28
	bl	_gdImageRed
	scvtf	s0, w0
	fmul	s0, s8, s0
	fcvt	d0, s0
	fcvt	d10, s10
	fmadd	d0, d10, d9, d0
	fcvtzs	w23, d0
	mov	x0, x24
	mov	x1, x28
	bl	_gdImageGreen
	scvtf	s0, w0
	fmul	s0, s8, s0
	fcvt	d0, s0
	fmadd	d0, d10, d9, d0
	fcvtzs	w21, d0
	mov	x0, x24
	mov	x1, x28
	bl	_gdImageBlue
	scvtf	s0, w0
	fmul	s0, s8, s0
	fcvt	d0, s0
	fmadd	d0, d10, d9, d0
	fcvtzs	w19, d0
	mov	x0, x25
	mov	x1, x23
	mov	x2, x21
	mov	x3, x19
	bl	_gdImageColorExact
	mov	x28, x0
	cmn	w0, #1
	b.ne	LBB0_5
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=2
	mov	x0, x25
	mov	x1, x23
	mov	x2, x21
	mov	x3, x19
	bl	_gdImageColorAllocate
	mov	x28, x0
	cmn	w0, #1
	b.ne	LBB0_5
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=2
	mov	x0, x25
	mov	x1, x23
	mov	x2, x21
	mov	x3, x19
	bl	_gdImageColorClosest
	mov	x28, x0
	b	LBB0_5
LBB0_12:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #48]               ; 16-byte Folded Reload
	ldp	d11, d10, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
