	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal4,4byte_literals
	.p2align	2                               ## -- Begin function scale_internal
LCPI0_0:
	.long	0x3f000000                      ## float 0.5
LCPI0_2:
	.long	0xbf000000                      ## float -0.5
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4
LCPI0_1:
	.long	0x80000000                      ## float -0
	.long	0x80000000                      ## float -0
	.long	0x80000000                      ## float -0
	.long	0x80000000                      ## float -0
LCPI0_4:
	.quad	0x3fe0000000000000              ## double 0.5
	.quad	0x3fe0000000000000              ## double 0.5
LCPI0_5:
	.space	16
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3
LCPI0_3:
	.quad	0x3fe0000000000000              ## double 0.5
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_scale_internal:                        ## @scale_internal
	.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	$312, %rsp                      ## imm = 0x138
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $r9d killed $r9d def $r9
                                        ## kill: def $r8d killed $r8d def $r8
	movq	%rcx, %r14
	movl	%esi, %r13d
	movl	%edi, %r12d
	movq	16(%rbp), %rax
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%r8, -104(%rbp)                 ## 8-byte Spill
	leal	(%r8,%r8), %eax
	cmpl	%esi, %eax
	jne	LBB0_4
## %bb.1:
	leal	(%r9,%r9), %eax
	cmpl	%edx, %eax
	jne	LBB0_4
## %bb.2:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_50
## %bb.3:
	movl	%r12d, %edi
	movl	%r13d, %esi
	movq	%r14, %rcx
	movq	-112(%rbp), %r8                 ## 8-byte Reload
	addq	$312, %rsp                      ## imm = 0x138
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_halveImage                     ## TAILCALL
LBB0_4:
	movl	%edx, -88(%rbp)                 ## 4-byte Spill
	testl	%r9d, %r9d
	jle	LBB0_48
## %bb.5:
	movl	-88(%rbp), %eax                 ## 4-byte Reload
	cvtsi2ss	%eax, %xmm0
	cvtsi2ss	%r9d, %xmm1
	divss	%xmm1, %xmm0
	movss	LCPI0_0(%rip), %xmm2            ## xmm2 = mem[0],zero,zero,zero
	movaps	%xmm0, %xmm4
	mulss	%xmm2, %xmm4
	xorps	%xmm1, %xmm1
	cvtsi2ss	%r13d, %xmm1
	cvtsi2ssl	-104(%rbp), %xmm3       ## 4-byte Folded Reload
	movaps	%xmm4, -176(%rbp)               ## 16-byte Spill
	movss	%xmm4, -76(%rbp)                ## 4-byte Spill
	cmpl	%r9d, %eax
	jg	LBB0_7
## %bb.6:
	movss	%xmm2, -76(%rbp)                ## 4-byte Spill
LBB0_7:
	divss	%xmm3, %xmm1
	movaps	LCPI0_1(%rip), %xmm3            ## xmm3 = [-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0]
	movss	LCPI0_2(%rip), %xmm4            ## xmm4 = mem[0],zero,zero,zero
	movss	%xmm4, -84(%rbp)                ## 4-byte Spill
	jle	LBB0_9
## %bb.8:
	movaps	-176(%rbp), %xmm4               ## 16-byte Reload
	xorps	%xmm3, %xmm4
LBB0_9:
	movaps	%xmm4, -176(%rbp)               ## 16-byte Spill
	movaps	%xmm1, %xmm4
	mulss	%xmm2, %xmm4
	movss	%xmm4, -80(%rbp)                ## 4-byte Spill
	cmpl	-104(%rbp), %r13d               ## 4-byte Folded Reload
	jg	LBB0_11
## %bb.10:
	movss	%xmm2, -80(%rbp)                ## 4-byte Spill
LBB0_11:
	jle	LBB0_13
## %bb.12:
	xorps	%xmm3, %xmm4
	movss	%xmm4, -84(%rbp)                ## 4-byte Spill
LBB0_13:
	cvtss2sd	%xmm0, %xmm0
	movsd	%xmm0, -192(%rbp)               ## 8-byte Spill
	xorps	%xmm0, %xmm0
	cvtss2sd	%xmm1, %xmm0
	movsd	%xmm0, -264(%rbp)               ## 8-byte Spill
	movslq	%r12d, %rbx
	movq	-104(%rbp), %rdx                ## 8-byte Reload
	movslq	%edx, %r10
	movl	%r9d, %esi
	movq	%rsi, -208(%rbp)                ## 8-byte Spill
	movl	%ebx, %r15d
	movl	%r15d, %r9d
	andl	$-8, %r9d
	leaq	-8(%r9), %r11
	movq	%r11, %r8
	shrq	$3, %r8
	incq	%r8
	movl	%r15d, %eax
	andl	$-4, %eax
	movq	%rax, -256(%rbp)                ## 8-byte Spill
	addq	$-4, %rax
	movq	%rax, -248(%rbp)                ## 8-byte Spill
	movq	%rax, %rcx
	shrq	$2, %rcx
	incq	%rcx
	movq	%r8, %rdi
	andq	$-2, %rdi
	movq	%rcx, %rax
	movq	%rcx, -240(%rbp)                ## 8-byte Spill
	andq	$-2, %rcx
	movq	%rcx, -232(%rbp)                ## 8-byte Spill
	movq	%r10, -184(%rbp)                ## 8-byte Spill
	imulq	%rbx, %r10
	shlq	$2, %r10
	movq	%r10, -200(%rbp)                ## 8-byte Spill
	movsd	LCPI0_3(%rip), %xmm4            ## xmm4 = mem[0],zero
	movl	%edx, %eax
	movq	%rax, -280(%rbp)                ## 8-byte Spill
	leaq	48(%r14), %rax
	movq	%rax, -352(%rbp)                ## 8-byte Spill
	movq	-112(%rbp), %rax                ## 8-byte Reload
	leaq	16(%rax), %rcx
	movq	%rcx, -144(%rbp)                ## 8-byte Spill
	movq	%rbx, -216(%rbp)                ## 8-byte Spill
	leaq	(,%rbx,4), %rcx
	movq	%rcx, -272(%rbp)                ## 8-byte Spill
	movq	%rax, -136(%rbp)                ## 8-byte Spill
	xorl	%eax, %eax
	movq	%r9, -344(%rbp)                 ## 8-byte Spill
	movq	%r11, -336(%rbp)                ## 8-byte Spill
	movq	%r8, -328(%rbp)                 ## 8-byte Spill
	movq	%rdi, -320(%rbp)                ## 8-byte Spill
	movq	%r14, -312(%rbp)                ## 8-byte Spill
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_47:                                ##   in Loop: Header=BB0_14 Depth=1
	movq	-152(%rbp), %rcx                ## 8-byte Reload
	incq	%rcx
	movq	-200(%rbp), %rax                ## 8-byte Reload
	addq	%rax, -144(%rbp)                ## 8-byte Folded Spill
	addq	%rax, -136(%rbp)                ## 8-byte Folded Spill
	movq	%rcx, %rax
	cmpq	-208(%rbp), %rcx                ## 8-byte Folded Reload
	je	LBB0_48
LBB0_14:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_16 Depth 2
                                        ##       Child Loop BB0_19 Depth 3
                                        ##         Child Loop BB0_23 Depth 4
                                        ##           Child Loop BB0_29 Depth 5
                                        ##           Child Loop BB0_34 Depth 5
                                        ##       Child Loop BB0_41 Depth 3
                                        ##       Child Loop BB0_45 Depth 3
	movq	%rax, -152(%rbp)                ## 8-byte Spill
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	addsd	%xmm4, %xmm0
	cmpl	$0, -104(%rbp)                  ## 4-byte Folded Reload
	jle	LBB0_47
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	mulsd	-192(%rbp), %xmm0               ## 8-byte Folded Reload
	xorps	%xmm1, %xmm1
	cvtsd2ss	%xmm0, %xmm1
	movaps	-176(%rbp), %xmm0               ## 16-byte Reload
	addss	%xmm1, %xmm0
	movss	%xmm0, -68(%rbp)                ## 4-byte Spill
	addss	-76(%rbp), %xmm1                ## 4-byte Folded Reload
	movss	%xmm1, -72(%rbp)                ## 4-byte Spill
	movq	-152(%rbp), %rax                ## 8-byte Reload
	imulq	-184(%rbp), %rax                ## 8-byte Folded Reload
	movq	%rax, -224(%rbp)                ## 8-byte Spill
	movq	-136(%rbp), %rsi                ## 8-byte Reload
	movq	-144(%rbp), %rdx                ## 8-byte Reload
	xorl	%ebx, %ebx
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_46:                                ##   in Loop: Header=BB0_16 Depth=2
	incq	%rbx
	movq	-272(%rbp), %rax                ## 8-byte Reload
	addq	%rax, %rdx
	addq	%rax, %rsi
	cmpq	-280(%rbp), %rbx                ## 8-byte Folded Reload
	je	LBB0_47
LBB0_16:                                ##   Parent Loop BB0_14 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_19 Depth 3
                                        ##         Child Loop BB0_23 Depth 4
                                        ##           Child Loop BB0_29 Depth 5
                                        ##           Child Loop BB0_34 Depth 5
                                        ##       Child Loop BB0_41 Depth 3
                                        ##       Child Loop BB0_45 Depth 3
	movq	%rdx, -296(%rbp)                ## 8-byte Spill
	movq	%rsi, -304(%rbp)                ## 8-byte Spill
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -64(%rbp)
	movss	-68(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	callq	_floor
	movss	-72(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	ucomiss	-68(%rbp), %xmm0                ## 4-byte Folded Reload
	movq	%rbx, -288(%rbp)                ## 8-byte Spill
	xorps	%xmm0, %xmm0
	cvtsi2sd	%ebx, %xmm0
	addsd	LCPI0_3(%rip), %xmm0
	xorps	%xmm7, %xmm7
	jbe	LBB0_35
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=2
	mulsd	-264(%rbp), %xmm0               ## 8-byte Folded Reload
	xorps	%xmm9, %xmm9
	cvtsd2ss	%xmm0, %xmm9
	movss	-84(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	addss	%xmm9, %xmm0
	addss	-80(%rbp), %xmm9                ## 4-byte Folded Reload
	xorps	%xmm7, %xmm7
	movss	-68(%rbp), %xmm8                ## 4-byte Reload
                                        ## xmm8 = mem[0],zero,zero,zero
	movss	%xmm9, -120(%rbp)               ## 4-byte Spill
	movss	%xmm0, -116(%rbp)               ## 4-byte Spill
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_19 Depth=3
	movss	-92(%rbp), %xmm7                ## 4-byte Reload
                                        ## xmm7 = mem[0],zero,zero,zero
LBB0_18:                                ##   in Loop: Header=BB0_19 Depth=3
	movss	-72(%rbp), %xmm1                ## 4-byte Reload
                                        ## xmm1 = mem[0],zero,zero,zero
	ucomiss	%xmm8, %xmm1
	movl	-128(%rbp), %eax                ## 4-byte Reload
	jbe	LBB0_35
LBB0_19:                                ##   Parent Loop BB0_14 Depth=1
                                        ##     Parent Loop BB0_16 Depth=2
                                        ## =>    This Loop Header: Depth=3
                                        ##         Child Loop BB0_23 Depth 4
                                        ##           Child Loop BB0_29 Depth 5
                                        ##           Child Loop BB0_34 Depth 5
	movss	%xmm7, -92(%rbp)                ## 4-byte Spill
	movss	%xmm8, -124(%rbp)               ## 4-byte Spill
	movl	%eax, %r14d
	leal	1(%r14), %ebx
	callq	_floor
	movss	-116(%rbp), %xmm0               ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	movss	-120(%rbp), %xmm9               ## 4-byte Reload
                                        ## xmm9 = mem[0],zero,zero,zero
	ucomiss	%xmm0, %xmm9
	movl	%ebx, -128(%rbp)                ## 4-byte Spill
	xorps	%xmm8, %xmm8
	cvtsi2ss	%ebx, %xmm8
	jbe	LBB0_20
## %bb.21:                              ##   in Loop: Header=BB0_19 Depth=3
	movl	%eax, %ecx
	movss	-72(%rbp), %xmm1                ## 4-byte Reload
                                        ## xmm1 = mem[0],zero,zero,zero
	minss	%xmm8, %xmm1
	subss	-124(%rbp), %xmm1               ## 4-byte Folded Reload
	movl	-88(%rbp), %esi                 ## 4-byte Reload
	addl	%esi, %r14d
	movl	%r14d, %eax
	cltd
	idivl	%esi
	movl	%edx, %esi
	imull	%r13d, %esi
	movaps	%xmm0, %xmm2
	movq	-312(%rbp), %r14                ## 8-byte Reload
	movq	-344(%rbp), %r8                 ## 8-byte Reload
	movq	-336(%rbp), %r9                 ## 8-byte Reload
	movq	-328(%rbp), %r10                ## 8-byte Reload
	movq	-320(%rbp), %r11                ## 8-byte Reload
	movss	-92(%rbp), %xmm7                ## 4-byte Reload
                                        ## xmm7 = mem[0],zero,zero,zero
	jmp	LBB0_23
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_23 Depth=4
	addss	%xmm3, %xmm7
	ucomiss	%xmm2, %xmm9
	jbe	LBB0_18
LBB0_23:                                ##   Parent Loop BB0_14 Depth=1
                                        ##     Parent Loop BB0_16 Depth=2
                                        ##       Parent Loop BB0_19 Depth=3
                                        ## =>      This Loop Header: Depth=4
                                        ##           Child Loop BB0_29 Depth 5
                                        ##           Child Loop BB0_34 Depth 5
	movl	%ecx, %eax
	movaps	%xmm2, %xmm4
	leal	1(%rax), %ecx
	xorps	%xmm2, %xmm2
	cvtsi2ss	%ecx, %xmm2
	movaps	%xmm9, %xmm3
	minss	%xmm2, %xmm3
	subss	%xmm4, %xmm3
	mulss	%xmm1, %xmm3
	testl	%r12d, %r12d
	jle	LBB0_22
## %bb.24:                              ##   in Loop: Header=BB0_23 Depth=4
	addl	%r13d, %eax
                                        ## kill: def $eax killed $eax killed $rax
	cltd
	idivl	%r13d
	addl	%esi, %edx
	imull	%r12d, %edx
	movslq	%edx, %rax
	cmpl	$8, %r12d
	jae	LBB0_26
## %bb.25:                              ##   in Loop: Header=BB0_23 Depth=4
	xorl	%edx, %edx
	jmp	LBB0_33
	.p2align	4, 0x90
LBB0_26:                                ##   in Loop: Header=BB0_23 Depth=4
	movaps	%xmm3, %xmm4
	shufps	$0, %xmm3, %xmm4                ## xmm4 = xmm4[0,0],xmm3[0,0]
	testq	%r9, %r9
	je	LBB0_27
## %bb.28:                              ##   in Loop: Header=BB0_23 Depth=4
	movq	-352(%rbp), %rdx                ## 8-byte Reload
	leaq	(%rdx,%rax,4), %rdi
	movq	%r11, %rbx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_29:                                ##   Parent Loop BB0_14 Depth=1
                                        ##     Parent Loop BB0_16 Depth=2
                                        ##       Parent Loop BB0_19 Depth=3
                                        ##         Parent Loop BB0_23 Depth=4
                                        ## =>        This Inner Loop Header: Depth=5
	movups	-48(%rdi,%rdx,4), %xmm5
	movups	-32(%rdi,%rdx,4), %xmm6
	mulps	%xmm4, %xmm5
	addps	-64(%rbp,%rdx,4), %xmm5
	mulps	%xmm4, %xmm6
	addps	-48(%rbp,%rdx,4), %xmm6
	movaps	%xmm5, -64(%rbp,%rdx,4)
	movaps	%xmm6, -48(%rbp,%rdx,4)
	movups	-16(%rdi,%rdx,4), %xmm5
	mulps	%xmm4, %xmm5
	addps	-32(%rbp,%rdx,4), %xmm5
	movups	(%rdi,%rdx,4), %xmm6
	mulps	%xmm4, %xmm6
	addps	-16(%rbp,%rdx,4), %xmm6
	movaps	%xmm5, -32(%rbp,%rdx,4)
	movaps	%xmm6, -16(%rbp,%rdx,4)
	addq	$16, %rdx
	addq	$-2, %rbx
	jne	LBB0_29
## %bb.30:                              ##   in Loop: Header=BB0_23 Depth=4
	testb	$1, %r10b
	je	LBB0_32
LBB0_31:                                ##   in Loop: Header=BB0_23 Depth=4
	leaq	(%rdx,%rax), %rdi
	movups	(%r14,%rdi,4), %xmm5
	movups	16(%r14,%rdi,4), %xmm6
	mulps	%xmm4, %xmm5
	addps	-64(%rbp,%rdx,4), %xmm5
	mulps	%xmm4, %xmm6
	addps	-48(%rbp,%rdx,4), %xmm6
	movaps	%xmm5, -64(%rbp,%rdx,4)
	movaps	%xmm6, -48(%rbp,%rdx,4)
LBB0_32:                                ##   in Loop: Header=BB0_23 Depth=4
	movq	%r8, %rdx
	cmpq	%r15, %r8
	je	LBB0_22
LBB0_33:                                ##   in Loop: Header=BB0_23 Depth=4
	leaq	(%r14,%rax,4), %rax
	.p2align	4, 0x90
LBB0_34:                                ##   Parent Loop BB0_14 Depth=1
                                        ##     Parent Loop BB0_16 Depth=2
                                        ##       Parent Loop BB0_19 Depth=3
                                        ##         Parent Loop BB0_23 Depth=4
                                        ## =>        This Inner Loop Header: Depth=5
	movss	(%rax,%rdx,4), %xmm4            ## xmm4 = mem[0],zero,zero,zero
	mulss	%xmm3, %xmm4
	addss	-64(%rbp,%rdx,4), %xmm4
	movss	%xmm4, -64(%rbp,%rdx,4)
	incq	%rdx
	cmpq	%rdx, %r15
	jne	LBB0_34
	jmp	LBB0_22
LBB0_27:                                ##   in Loop: Header=BB0_23 Depth=4
	xorl	%edx, %edx
	testb	$1, %r10b
	jne	LBB0_31
	jmp	LBB0_32
	.p2align	4, 0x90
LBB0_35:                                ##   in Loop: Header=BB0_16 Depth=2
	testl	%r12d, %r12d
	movsd	LCPI0_3(%rip), %xmm4            ## xmm4 = mem[0],zero
	movapd	LCPI0_4(%rip), %xmm5            ## xmm5 = [5.0E-1,5.0E-1]
	movq	-304(%rbp), %rsi                ## 8-byte Reload
	movq	-296(%rbp), %rdx                ## 8-byte Reload
	movq	-288(%rbp), %rbx                ## 8-byte Reload
	jle	LBB0_46
## %bb.36:                              ##   in Loop: Header=BB0_16 Depth=2
	xorps	%xmm0, %xmm0
	cvtss2sd	%xmm7, %xmm0
	cmpl	$4, %r12d
	jae	LBB0_38
## %bb.37:                              ##   in Loop: Header=BB0_16 Depth=2
	xorl	%eax, %eax
	jmp	LBB0_45
	.p2align	4, 0x90
LBB0_38:                                ##   in Loop: Header=BB0_16 Depth=2
	movddup	%xmm0, %xmm1                    ## xmm1 = xmm0[0,0]
	cmpq	$0, -248(%rbp)                  ## 8-byte Folded Reload
	je	LBB0_39
## %bb.40:                              ##   in Loop: Header=BB0_16 Depth=2
	movq	-232(%rbp), %rcx                ## 8-byte Reload
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_41:                                ##   Parent Loop BB0_14 Depth=1
                                        ##     Parent Loop BB0_16 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	cvtps2pd	-64(%rbp,%rax,4), %xmm2
	cvtps2pd	-56(%rbp,%rax,4), %xmm3
	addpd	%xmm5, %xmm3
	addpd	%xmm5, %xmm2
	divpd	%xmm1, %xmm2
	divpd	%xmm1, %xmm3
	cvtpd2ps	%xmm3, %xmm3
	cvtpd2ps	%xmm2, %xmm2
	unpcklpd	%xmm3, %xmm2                    ## xmm2 = xmm2[0],xmm3[0]
	movupd	%xmm2, -16(%rdx,%rax,4)
	cvtps2pd	-48(%rbp,%rax,4), %xmm2
	cvtps2pd	-40(%rbp,%rax,4), %xmm3
	addpd	%xmm5, %xmm3
	addpd	%xmm5, %xmm2
	divpd	%xmm1, %xmm2
	divpd	%xmm1, %xmm3
	cvtpd2ps	%xmm3, %xmm3
	cvtpd2ps	%xmm2, %xmm2
	unpcklpd	%xmm3, %xmm2                    ## xmm2 = xmm2[0],xmm3[0]
	movupd	%xmm2, (%rdx,%rax,4)
	addq	$8, %rax
	addq	$-2, %rcx
	jne	LBB0_41
## %bb.42:                              ##   in Loop: Header=BB0_16 Depth=2
	testb	$1, -240(%rbp)                  ## 1-byte Folded Reload
	je	LBB0_44
LBB0_43:                                ##   in Loop: Header=BB0_16 Depth=2
	movq	-224(%rbp), %rcx                ## 8-byte Reload
	addq	%rbx, %rcx
	cvtps2pd	-64(%rbp,%rax,4), %xmm2
	cvtps2pd	-56(%rbp,%rax,4), %xmm3
	addpd	%xmm5, %xmm3
	addpd	%xmm5, %xmm2
	divpd	%xmm1, %xmm2
	divpd	%xmm1, %xmm3
	cvtpd2ps	%xmm3, %xmm1
	cvtpd2ps	%xmm2, %xmm2
	imulq	-216(%rbp), %rcx                ## 8-byte Folded Reload
	unpcklpd	%xmm1, %xmm2                    ## xmm2 = xmm2[0],xmm1[0]
	addq	%rax, %rcx
	movq	-112(%rbp), %rax                ## 8-byte Reload
	movupd	%xmm2, (%rax,%rcx,4)
LBB0_44:                                ##   in Loop: Header=BB0_16 Depth=2
	movq	-256(%rbp), %rcx                ## 8-byte Reload
	movq	%rcx, %rax
	cmpq	%r15, %rcx
	je	LBB0_46
	.p2align	4, 0x90
LBB0_45:                                ##   Parent Loop BB0_14 Depth=1
                                        ##     Parent Loop BB0_16 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movss	-64(%rbp,%rax,4), %xmm1         ## xmm1 = mem[0],zero,zero,zero
	cvtss2sd	%xmm1, %xmm1
	addsd	%xmm4, %xmm1
	divsd	%xmm0, %xmm1
	cvtsd2ss	%xmm1, %xmm1
	movss	%xmm1, (%rsi,%rax,4)
	incq	%rax
	cmpq	%rax, %r15
	jne	LBB0_45
	jmp	LBB0_46
LBB0_39:                                ##   in Loop: Header=BB0_16 Depth=2
	xorl	%eax, %eax
	testb	$1, -240(%rbp)                  ## 1-byte Folded Reload
	jne	LBB0_43
	jmp	LBB0_44
LBB0_48:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_50
## %bb.49:
	addq	$312, %rsp                      ## imm = 0x138
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_50:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_scale_internal
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function scale_internal
_scale_internal:                        ; @scale_internal
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #384
	.cfi_def_cfa_offset 384
	stp	d15, d14, [sp, #224]            ; 16-byte Folded Spill
	stp	d13, d12, [sp, #240]            ; 16-byte Folded Spill
	stp	d11, d10, [sp, #256]            ; 16-byte Folded Spill
	stp	d9, d8, [sp, #272]              ; 16-byte Folded Spill
	stp	x28, x27, [sp, #288]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #304]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #320]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #336]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #352]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #368]            ; 16-byte Folded Spill
	add	x29, sp, #368
	.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
	.cfi_offset b12, -136
	.cfi_offset b13, -144
	.cfi_offset b14, -152
	.cfi_offset b15, -160
	str	x6, [sp, #104]                  ; 8-byte Folded Spill
	mov	x20, x3
	mov	x22, x1
	mov	x23, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-160]
	str	w4, [sp, #52]                   ; 4-byte Folded Spill
	cmp	w1, w4, lsl #1
	b.ne	LBB0_4
; %bb.1:
	lsl	w8, w5, #1
	cmp	w8, w2
	b.ne	LBB0_4
; %bb.2:
	ldur	x8, [x29, #-160]
Lloh3:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh4:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_34
; %bb.3:
	mov	x0, x23
	mov	x1, x22
	mov	x3, x20
	ldr	x4, [sp, #104]                  ; 8-byte Folded Reload
	ldp	x29, x30, [sp, #368]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #352]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #336]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #320]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #304]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #288]            ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #272]              ; 16-byte Folded Reload
	ldp	d11, d10, [sp, #256]            ; 16-byte Folded Reload
	ldp	d13, d12, [sp, #240]            ; 16-byte Folded Reload
	ldp	d15, d14, [sp, #224]            ; 16-byte Folded Reload
	add	sp, sp, #384
	b	_halveImage
LBB0_4:
	stur	w2, [x29, #-180]                ; 4-byte Folded Spill
	cmp	w5, #1
	b.lt	LBB0_32
; %bb.5:
	stp	xzr, xzr, [sp, #64]             ; 16-byte Folded Spill
	ldur	w8, [x29, #-180]                ; 4-byte Folded Reload
	scvtf	s0, w8
	scvtf	s1, w5
	fdiv	s0, s0, s1
	fmov	s1, #0.50000000
	scvtf	s2, w22
	fmul	s3, s0, s1
	ldr	w9, [sp, #52]                   ; 4-byte Folded Reload
	scvtf	s4, w9
	fdiv	s2, s2, s4
	fmul	s4, s2, s1
	fcvt	d5, s0
	str	d5, [sp, #16]                   ; 8-byte Folded Spill
	cmp	w8, w5
	fcsel	s5, s3, s1, gt
	fnmul	s0, s0, s1
	fmov	s3, #-0.50000000
	fcsel	s0, s0, s3, gt
	stp	s0, s5, [sp, #8]                ; 8-byte Folded Spill
	fcvt	d0, s2
	str	d0, [sp, #120]                  ; 8-byte Folded Spill
	cmp	w22, w9
	fcsel	s5, s4, s1, gt
	fnmul	s0, s2, s1
	fcsel	s0, s0, s3, gt
	stp	s0, s5, [sp, #112]              ; 8-byte Folded Spill
	sxtw	x10, w23
	mov	w11, w5
	mov	w8, w9
	stp	x8, x10, [sp, #136]             ; 16-byte Folded Spill
	mov	w26, w23
	and	x27, x26, #0xfffffff0
	sub	x19, x29, #176
	add	x28, x19, #32
	add	x24, x20, #32
	ldr	x8, [sp, #104]                  ; 8-byte Folded Reload
	add	x8, x8, #32
	str	x8, [sp, #56]                   ; 8-byte Folded Spill
	smull	x8, w9, w23
	stp	x8, x11, [sp, #32]              ; 16-byte Folded Spill
	lsl	x8, x8, #2
	str	x8, [sp, #24]                   ; 8-byte Folded Spill
	sbfiz	x8, x23, #2, #32
	str	x8, [sp, #128]                  ; 8-byte Folded Spill
	fmov	d10, #0.50000000
	fmov.2d	v0, #0.50000000
	str	q0, [sp, #80]                   ; 16-byte Folded Spill
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldp	x8, x9, [sp, #56]               ; 16-byte Folded Reload
	add	x9, x9, #1
	ldr	x10, [sp, #24]                  ; 8-byte Folded Reload
	add	x8, x8, x10
	stp	x8, x9, [sp, #56]               ; 16-byte Folded Spill
	ldr	x8, [sp, #72]                   ; 8-byte Folded Reload
	ldr	x10, [sp, #32]                  ; 8-byte Folded Reload
	add	x8, x8, x10
	str	x8, [sp, #72]                   ; 8-byte Folded Spill
	ldr	x8, [sp, #40]                   ; 8-byte Folded Reload
	cmp	x9, x8
	b.eq	LBB0_32
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
                                        ;       Child Loop BB0_13 Depth 3
                                        ;         Child Loop BB0_16 Depth 4
                                        ;           Child Loop BB0_20 Depth 5
                                        ;           Child Loop BB0_23 Depth 5
                                        ;       Child Loop BB0_28 Depth 3
                                        ;       Child Loop BB0_31 Depth 3
	ldr	w8, [sp, #52]                   ; 4-byte Folded Reload
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	str	xzr, [sp, #176]                 ; 8-byte Folded Spill
	ldp	x8, x11, [sp, #64]              ; 16-byte Folded Reload
	scvtf	d0, w8
	fadd	d0, d0, d10
	ldr	d1, [sp, #16]                   ; 8-byte Folded Reload
	fmul	d0, d0, d1
	fcvt	s0, d0
	ldr	s1, [sp, #8]                    ; 4-byte Folded Reload
	fadd	s1, s1, s0
	str	s1, [sp, #156]                  ; 4-byte Folded Spill
	ldr	s1, [sp, #12]                   ; 4-byte Folded Reload
	fadd	s11, s1, s0
	ldr	x12, [sp, #56]                  ; 8-byte Folded Reload
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=2
	ldr	x9, [sp, #176]                  ; 8-byte Folded Reload
	add	x9, x9, #1
	ldr	x8, [sp, #128]                  ; 8-byte Folded Reload
	add	x12, x12, x8
	ldr	x8, [sp, #144]                  ; 8-byte Folded Reload
	add	x11, x11, x8
	ldr	x8, [sp, #136]                  ; 8-byte Folded Reload
	str	x9, [sp, #176]                  ; 8-byte Folded Spill
	cmp	x9, x8
	b.eq	LBB0_6
LBB0_10:                                ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_13 Depth 3
                                        ;         Child Loop BB0_16 Depth 4
                                        ;           Child Loop BB0_20 Depth 5
                                        ;           Child Loop BB0_23 Depth 5
                                        ;       Child Loop BB0_28 Depth 3
                                        ;       Child Loop BB0_31 Depth 3
	stp	x12, x11, [sp, #160]            ; 16-byte Folded Spill
	stp	xzr, xzr, [x29, #-176]
	ldr	s8, [sp, #156]                  ; 4-byte Folded Reload
	fmov	s0, s8
	bl	_floor
	movi	d12, #0000000000000000
	fcmp	s8, s11
	b.pl	LBB0_24
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	mov	x25, x0
	ldr	x8, [sp, #176]                  ; 8-byte Folded Reload
	scvtf	d0, w8
	fadd	d0, d0, d10
	ldr	d1, [sp, #120]                  ; 8-byte Folded Reload
	fmul	d0, d0, d1
	fcvt	s0, d0
	ldr	s1, [sp, #112]                  ; 4-byte Folded Reload
	fadd	s9, s1, s0
	ldr	s1, [sp, #116]                  ; 4-byte Folded Reload
	fadd	s13, s1, s0
	movi	d12, #0000000000000000
	ldr	s14, [sp, #156]                 ; 4-byte Folded Reload
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=3
	fcmp	s11, s14
	mov	x25, x21
	b.le	LBB0_24
LBB0_13:                                ;   Parent Loop BB0_7 Depth=1
                                        ;     Parent Loop BB0_10 Depth=2
                                        ; =>    This Loop Header: Depth=3
                                        ;         Child Loop BB0_16 Depth 4
                                        ;           Child Loop BB0_20 Depth 5
                                        ;           Child Loop BB0_23 Depth 5
	fmov	s8, s14
	add	w21, w25, #1
	scvtf	s14, w21
	fcmp	s11, s14
	fcsel	s15, s11, s14, mi
	fmov	s0, s9
	bl	_floor
	fcmp	s9, s13
	b.pl	LBB0_12
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=3
	fsub	s0, s15, s8
	ldur	w10, [x29, #-180]               ; 4-byte Folded Reload
	add	w8, w25, w10
	sdiv	w9, w8, w10
	msub	w8, w9, w10, w8
	mul	w8, w8, w22
	fmov	s1, s9
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=4
	fadd	s12, s12, s2
	fcmp	s13, s1
	mov	x0, x9
	b.le	LBB0_12
LBB0_16:                                ;   Parent Loop BB0_7 Depth=1
                                        ;     Parent Loop BB0_10 Depth=2
                                        ;       Parent Loop BB0_13 Depth=3
                                        ; =>      This Loop Header: Depth=4
                                        ;           Child Loop BB0_20 Depth 5
                                        ;           Child Loop BB0_23 Depth 5
	fmov	s2, s1
	add	w9, w0, #1
	scvtf	s1, w9
	fcmp	s13, s1
	fcsel	s3, s13, s1, mi
	fsub	s2, s3, s2
	fmul	s2, s0, s2
	cmp	w23, #1
	b.lt	LBB0_15
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=4
	add	w10, w0, w22
	sdiv	w11, w10, w22
	msub	w10, w11, w22, w10
	add	w10, w10, w8
	mul	w10, w10, w23
	sxtw	x10, w10
	cmp	w23, #16
	b.hs	LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_16 Depth=4
	mov	x12, #0
	b	LBB0_22
LBB0_19:                                ;   in Loop: Header=BB0_16 Depth=4
	dup.4s	v3, v2[0]
	add	x11, x24, x10, lsl #2
	mov	x12, x28
	mov	x13, x27
LBB0_20:                                ;   Parent Loop BB0_7 Depth=1
                                        ;     Parent Loop BB0_10 Depth=2
                                        ;       Parent Loop BB0_13 Depth=3
                                        ;         Parent Loop BB0_16 Depth=4
                                        ; =>        This Inner Loop Header: Depth=5
	ldp	q4, q5, [x11, #-32]
	ldp	q6, q7, [x11], #64
	ldp	q16, q17, [x12, #-32]
	ldp	q18, q19, [x12]
	fmla.4s	v16, v3, v4
	fmla.4s	v17, v3, v5
	fmla.4s	v18, v3, v6
	fmla.4s	v19, v3, v7
	stp	q16, q17, [x12, #-32]
	stp	q18, q19, [x12], #64
	subs	x13, x13, #16
	b.ne	LBB0_20
; %bb.21:                               ;   in Loop: Header=BB0_16 Depth=4
	mov	x12, x27
	cmp	x27, x26
	b.eq	LBB0_15
LBB0_22:                                ;   in Loop: Header=BB0_16 Depth=4
	add	x10, x12, x10
	add	x10, x20, x10, lsl #2
	add	x11, x19, x12, lsl #2
	sub	x12, x26, x12
LBB0_23:                                ;   Parent Loop BB0_7 Depth=1
                                        ;     Parent Loop BB0_10 Depth=2
                                        ;       Parent Loop BB0_13 Depth=3
                                        ;         Parent Loop BB0_16 Depth=4
                                        ; =>        This Inner Loop Header: Depth=5
	ldr	s3, [x10], #4
	ldr	s4, [x11]
	fmadd	s3, s3, s2, s4
	str	s3, [x11], #4
	subs	x12, x12, #1
	b.ne	LBB0_23
	b	LBB0_15
LBB0_24:                                ;   in Loop: Header=BB0_10 Depth=2
	cmp	w23, #1
	ldp	x12, x11, [sp, #160]            ; 16-byte Folded Reload
	b.lt	LBB0_9
; %bb.25:                               ;   in Loop: Header=BB0_10 Depth=2
	fcvt	d0, s12
	cmp	w23, #16
	b.hs	LBB0_27
; %bb.26:                               ;   in Loop: Header=BB0_10 Depth=2
	mov	x10, #0
	b	LBB0_30
LBB0_27:                                ;   in Loop: Header=BB0_10 Depth=2
	dup.2d	v1, v0[0]
	mov	x8, x28
	mov	x9, x12
	mov	x10, x27
	ldr	q18, [sp, #80]                  ; 16-byte Folded Reload
LBB0_28:                                ;   Parent Loop BB0_7 Depth=1
                                        ;     Parent Loop BB0_10 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldp	q2, q3, [x8, #-32]
	ldp	q4, q5, [x8], #64
	fcvtl2	v6.2d, v2.4s
	fcvtl	v2.2d, v2.2s
	fcvtl2	v7.2d, v3.4s
	fcvtl	v3.2d, v3.2s
	fcvtl2	v16.2d, v4.4s
	fcvtl	v4.2d, v4.2s
	fcvtl2	v17.2d, v5.4s
	fcvtl	v5.2d, v5.2s
	fadd.2d	v2, v2, v18
	fadd.2d	v6, v6, v18
	fadd.2d	v3, v3, v18
	fadd.2d	v7, v7, v18
	fadd.2d	v4, v4, v18
	fadd.2d	v16, v16, v18
	fadd.2d	v5, v5, v18
	fadd.2d	v17, v17, v18
	fdiv.2d	v6, v6, v1
	fdiv.2d	v2, v2, v1
	fdiv.2d	v7, v7, v1
	fdiv.2d	v3, v3, v1
	fdiv.2d	v16, v16, v1
	fdiv.2d	v4, v4, v1
	fdiv.2d	v17, v17, v1
	fdiv.2d	v5, v5, v1
	fcvtn	v2.2s, v2.2d
	fcvtn2	v2.4s, v6.2d
	fcvtn	v3.2s, v3.2d
	fcvtn2	v3.4s, v7.2d
	fcvtn	v4.2s, v4.2d
	fcvtn2	v4.4s, v16.2d
	fcvtn	v5.2s, v5.2d
	stp	q2, q3, [x9, #-32]
	fcvtn2	v5.4s, v17.2d
	stp	q4, q5, [x9], #64
	subs	x10, x10, #16
	b.ne	LBB0_28
; %bb.29:                               ;   in Loop: Header=BB0_10 Depth=2
	mov	x10, x27
	cmp	x27, x26
	b.eq	LBB0_9
LBB0_30:                                ;   in Loop: Header=BB0_10 Depth=2
	add	x8, x10, x11
	ldr	x9, [sp, #104]                  ; 8-byte Folded Reload
	add	x8, x9, x8, lsl #2
	add	x9, x19, x10, lsl #2
	sub	x10, x26, x10
LBB0_31:                                ;   Parent Loop BB0_7 Depth=1
                                        ;     Parent Loop BB0_10 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	s1, [x9], #4
	fcvt	d1, s1
	fadd	d1, d1, d10
	fdiv	d1, d1, d0
	fcvt	s1, d1
	str	s1, [x8], #4
	subs	x10, x10, #1
	b.ne	LBB0_31
	b	LBB0_9
LBB0_32:
	ldur	x8, [x29, #-160]
Lloh6:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh7:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_34
; %bb.33:
	ldp	x29, x30, [sp, #368]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #352]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #336]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #320]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #304]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #288]            ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #272]              ; 16-byte Folded Reload
	ldp	d11, d10, [sp, #256]            ; 16-byte Folded Reload
	ldp	d13, d12, [sp, #240]            ; 16-byte Folded Reload
	ldp	d15, d14, [sp, #224]            ; 16-byte Folded Reload
	add	sp, sp, #384
	ret
LBB0_34:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_scale_internal
.subsections_via_symbols
