	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal4,4byte_literals
	.p2align	2                               ## -- Begin function gdGuessBackgroundColorFromCorners
LCPI0_0:
	.long	0x3f000000                      ## float 0.5
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_gdGuessBackgroundColorFromCorners:     ## @gdGuessBackgroundColorFromCorners
	.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
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movl	%edi, %r14d
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_gdImageGetPixel
	movl	%eax, %r12d
	movl	%r14d, %edi
	callq	_gdImageSX
	leaq	-1(%rax), %rsi
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_gdImageGetPixel
	movl	%eax, %r15d
	movl	%r14d, %edi
	callq	_gdImageSY
	leaq	-1(%rax), %rdx
	movl	%r14d, %edi
	xorl	%esi, %esi
	callq	_gdImageGetPixel
	movl	%eax, %r13d
	movl	%r14d, %edi
	callq	_gdImageSX
	leaq	-1(%rax), %rbx
	movl	%r14d, %edi
	callq	_gdImageSY
	leaq	-1(%rax), %rdx
	movl	%r14d, %edi
	movq	%rbx, %rsi
	callq	_gdImageGetPixel
	movl	%eax, %esi
	movl	$3, %eax
	cmpl	%r13d, %r15d
	jne	LBB0_2
## %bb.1:
	cmpl	%esi, %r15d
	je	LBB0_15
LBB0_2:
	cmpl	%r13d, %r12d
	jne	LBB0_5
## %bb.3:
	cmpl	%esi, %r12d
	je	LBB0_4
LBB0_5:
	cmpl	%esi, %r12d
	sete	%bl
	cmpl	%r13d, %r12d
	sete	%cl
	cmpl	%r15d, %r12d
	sete	%dl
	testb	%bl, %dl
	jne	LBB0_4
## %bb.6:
	andb	%cl, %dl
	jne	LBB0_4
## %bb.7:
	movl	$2, %eax
	cmpl	%r15d, %r12d
	je	LBB0_4
## %bb.8:
	cmpl	%r13d, %r12d
	je	LBB0_4
## %bb.9:
	cmpl	%esi, %r12d
	je	LBB0_4
## %bb.10:
	cmpl	%r13d, %r15d
	je	LBB0_15
## %bb.11:
	cmpl	%esi, %r15d
	je	LBB0_15
## %bb.12:
	cmpl	%r13d, %esi
	jne	LBB0_14
## %bb.13:
	movl	%r13d, %r15d
	jmp	LBB0_15
LBB0_4:
	movl	%r12d, %r15d
LBB0_15:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%r15d, (%rcx)
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movl	%r14d, %edi
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movl	%r12d, %esi
	callq	_gdImageRed
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movl	%r14d, %edi
	movl	%r15d, %esi
	callq	_gdImageRed
	movl	%eax, %ebx
	addl	-64(%rbp), %ebx                 ## 4-byte Folded Reload
	movl	%r14d, %edi
	movl	%r13d, %esi
	callq	_gdImageRed
                                        ## kill: def $eax killed $eax def $rax
	addl	%ebx, %eax
	movq	%rax, %rbx
	movl	%r14d, %edi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_gdImageRed
                                        ## kill: def $eax killed $eax def $rax
	movl	%ebx, %ecx
	addl	%eax, %ecx
	leal	3(%rax,%rbx), %eax
	cmovnsl	%ecx, %eax
	sarl	$2, %eax
	cvtsi2ss	%eax, %xmm0
	addss	LCPI0_0(%rip), %xmm0
	cvttss2si	%xmm0, %eax
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movl	%r14d, %edi
	movl	%r12d, %esi
	callq	_gdImageGreen
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	%r14d, %edi
	movl	%r15d, %esi
	callq	_gdImageGreen
	movl	%eax, %ebx
	addl	-60(%rbp), %ebx                 ## 4-byte Folded Reload
	movl	%r14d, %edi
	movl	%r13d, %esi
	callq	_gdImageGreen
                                        ## kill: def $eax killed $eax def $rax
	addl	%ebx, %eax
	movq	%rax, %rbx
	movl	%r14d, %edi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_gdImageGreen
                                        ## kill: def $eax killed $eax def $rax
	movl	%ebx, %ecx
	addl	%eax, %ecx
	leal	3(%rax,%rbx), %eax
	cmovnsl	%ecx, %eax
	sarl	$2, %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	addss	LCPI0_0(%rip), %xmm0
	cvttss2si	%xmm0, %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	%r14d, %edi
	movl	%r12d, %esi
	callq	_gdImageBlue
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movl	%r14d, %edi
	movl	%r15d, %esi
	callq	_gdImageBlue
	movl	%eax, %ebx
	addl	-56(%rbp), %ebx                 ## 4-byte Folded Reload
	movl	%r14d, %edi
	movl	%r13d, %esi
	callq	_gdImageBlue
                                        ## kill: def $eax killed $eax def $rax
	addl	%ebx, %eax
	movq	%rax, %rbx
	movl	%r14d, %edi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_gdImageBlue
                                        ## kill: def $eax killed $eax def $rax
	movl	%ebx, %ecx
	addl	%eax, %ecx
	leal	3(%rax,%rbx), %eax
	cmovnsl	%ecx, %eax
	sarl	$2, %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	addss	LCPI0_0(%rip), %xmm0
	cvttss2si	%xmm0, %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movl	%r14d, %edi
	movl	%r12d, %esi
	callq	_gdImageAlpha
	movl	%eax, %r12d
	movl	%r14d, %edi
	movl	%r15d, %esi
	callq	_gdImageAlpha
	movl	%eax, %r15d
	addl	%r12d, %r15d
	movl	%r14d, %edi
	movl	%r13d, %esi
	callq	_gdImageAlpha
	movl	%eax, %r12d
	addl	%r15d, %r12d
	movl	%r14d, %edi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_gdImageAlpha
                                        ## kill: def $eax killed $eax def $rax
	movl	%r12d, %ecx
	addl	%eax, %ecx
	leal	3(%rax,%r12), %eax
	cmovnsl	%ecx, %eax
	sarl	$2, %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	addss	LCPI0_0(%rip), %xmm0
	cvttss2si	%xmm0, %r8d
	movl	%r14d, %edi
	movl	-64(%rbp), %esi                 ## 4-byte Reload
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	movl	-56(%rbp), %ecx                 ## 4-byte Reload
	callq	_gdImageColorClosestAlpha
	movl	%eax, %r15d
	xorl	%eax, %eax
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_gdGuessBackgroundColorFromCorners
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gdGuessBackgroundColorFromCorners
_gdGuessBackgroundColorFromCorners:     ; @gdGuessBackgroundColorFromCorners
	.cfi_startproc
; %bb.0:
	stp	d9, d8, [sp, #-112]!            ; 16-byte Folded Spill
	.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
	.cfi_offset b8, -104
	.cfi_offset b9, -112
	mov	x19, x1
	mov	x20, x0
	mov	x1, #0
	mov	x2, #0
	bl	_gdImageGetPixel
	mov	x22, x0
	mov	x0, x20
	bl	_gdImageSX
	sub	x1, x0, #1
	mov	x0, x20
	mov	x2, #0
	bl	_gdImageGetPixel
	mov	x21, x0
	mov	x0, x20
	bl	_gdImageSY
	sub	x2, x0, #1
	mov	x0, x20
	mov	x1, #0
	bl	_gdImageGetPixel
	mov	x23, x0
	mov	x0, x20
	bl	_gdImageSX
	sub	x24, x0, #1
	mov	x0, x20
	bl	_gdImageSY
	sub	x2, x0, #1
	mov	x0, x20
	mov	x1, x24
	bl	_gdImageGetPixel
	mov	x24, x0
	cmp	w21, w23
	b.ne	LBB0_3
; %bb.1:
	cmp	w21, w24
	b.ne	LBB0_3
; %bb.2:
	mov	w0, #3
	b	LBB0_16
LBB0_3:
	cmp	w22, w23
	b.ne	LBB0_6
; %bb.4:
	cmp	w22, w24
	b.ne	LBB0_6
; %bb.5:
	mov	w0, #3
	b	LBB0_15
LBB0_6:
	cmp	w22, w24
	cset	w10, eq
	cmp	w22, w23
	cset	w8, eq
	cmp	w22, w21
	cset	w9, eq
	and	w10, w9, w10
	mov	w0, #3
	tbnz	w10, #0, LBB0_15
; %bb.7:
	and	w8, w9, w8
	tbnz	w8, #0, LBB0_15
; %bb.8:
	mov	w0, #2
	cmp	w22, w21
	b.eq	LBB0_15
; %bb.9:
	cmp	w22, w23
	b.eq	LBB0_15
; %bb.10:
	cmp	w22, w24
	b.eq	LBB0_15
; %bb.11:
	mov	w0, #2
	cmp	w21, w23
	b.eq	LBB0_16
; %bb.12:
	cmp	w21, w24
	b.eq	LBB0_16
; %bb.13:
	cmp	w24, w23
	b.ne	LBB0_17
; %bb.14:
	mov	w0, #2
	mov	x21, x23
	b	LBB0_16
LBB0_15:
	mov	x21, x22
LBB0_16:
	str	w21, [x19]
	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
	ldp	d9, d8, [sp], #112              ; 16-byte Folded Reload
	ret
LBB0_17:
	mov	x0, x20
	mov	x1, x22
	bl	_gdImageRed
	mov	x25, x0
	mov	x0, x20
	mov	x1, x21
	bl	_gdImageRed
	add	w25, w0, w25
	mov	x0, x20
	mov	x1, x23
	bl	_gdImageRed
	add	w25, w25, w0
	mov	x0, x20
	mov	x1, x24
	bl	_gdImageRed
	add	w8, w25, w0
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #2
	scvtf	s0, w8
	fmov	s8, #0.50000000
	fadd	s0, s0, s8
	fcvtzs	w25, s0
	mov	x0, x20
	mov	x1, x22
	bl	_gdImageGreen
	mov	x26, x0
	mov	x0, x20
	mov	x1, x21
	bl	_gdImageGreen
	add	w26, w0, w26
	mov	x0, x20
	mov	x1, x23
	bl	_gdImageGreen
	add	w26, w26, w0
	mov	x0, x20
	mov	x1, x24
	bl	_gdImageGreen
	add	w8, w26, w0
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #2
	scvtf	s0, w8
	fadd	s0, s0, s8
	fcvtzs	w26, s0
	mov	x0, x20
	mov	x1, x22
	bl	_gdImageBlue
	mov	x27, x0
	mov	x0, x20
	mov	x1, x21
	bl	_gdImageBlue
	add	w27, w0, w27
	mov	x0, x20
	mov	x1, x23
	bl	_gdImageBlue
	add	w27, w27, w0
	mov	x0, x20
	mov	x1, x24
	bl	_gdImageBlue
	add	w8, w27, w0
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #2
	scvtf	s0, w8
	fadd	s0, s0, s8
	fcvtzs	w27, s0
	mov	x0, x20
	mov	x1, x22
	bl	_gdImageAlpha
	mov	x22, x0
	mov	x0, x20
	mov	x1, x21
	bl	_gdImageAlpha
	add	w21, w0, w22
	mov	x0, x20
	mov	x1, x23
	bl	_gdImageAlpha
	add	w21, w21, w0
	mov	x0, x20
	mov	x1, x24
	bl	_gdImageAlpha
	add	w8, w21, w0
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #2
	scvtf	s0, w8
	fadd	s0, s0, s8
	fcvtzs	w4, s0
	mov	x0, x20
	mov	x1, x25
	mov	x2, x26
	mov	x3, x27
	bl	_gdImageColorClosestAlpha
	mov	x21, x0
	mov	w0, #0
	b	LBB0_16
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_gdGuessBackgroundColorFromCorners
.subsections_via_symbols
