	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal4,4byte_literals
	.p2align	2                               ## -- Begin function centre_and_rescale
LCPI0_0:
	.long	0x40400000                      ## float 3
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_centre_and_rescale:                    ## @centre_and_rescale
	.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	%r12
	pushq	%rbx
	subq	$112, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	movsd	(%rdi), %xmm1                   ## xmm1 = mem[0],zero
	movshdup	%xmm1, %xmm2                    ## xmm2 = xmm1[1,1,3,3]
	movss	8(%rdi), %xmm4                  ## xmm4 = mem[0],zero,zero,zero
	movaps	%xmm1, %xmm5
	testl	%esi, %esi
	jle	LBB0_1
## %bb.2:
	leaq	20(%r15), %r12
	leal	-1(%r14), %ebx
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -128(%rbp)               ## 16-byte Spill
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -112(%rbp)               ## 16-byte Spill
	movss	%xmm4, -52(%rbp)                ## 4-byte Spill
	movaps	%xmm2, -80(%rbp)                ## 16-byte Spill
	movss	%xmm2, -44(%rbp)                ## 4-byte Spill
	movss	%xmm5, -48(%rbp)                ## 4-byte Spill
	movss	%xmm4, -40(%rbp)                ## 4-byte Spill
	movss	%xmm4, -36(%rbp)                ## 4-byte Spill
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movaps	%xmm5, %xmm0
	movaps	%xmm1, -96(%rbp)                ## 16-byte Spill
	callq	_vcos_min
	movss	%xmm0, -56(%rbp)                ## 4-byte Spill
	movshdup	-96(%rbp), %xmm1                ## 16-byte Folded Reload
                                        ## xmm1 = mem[1,1,3,3]
	movaps	%xmm1, -144(%rbp)               ## 16-byte Spill
	movaps	-80(%rbp), %xmm0                ## 16-byte Reload
	callq	_vcos_min
	movaps	%xmm0, -80(%rbp)                ## 16-byte Spill
	movss	-40(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	movss	-36(%rbp), %xmm1                ## 4-byte Reload
                                        ## xmm1 = mem[0],zero,zero,zero
	callq	_vcos_min
	movss	%xmm0, -40(%rbp)                ## 4-byte Spill
	movss	-48(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	movaps	-96(%rbp), %xmm1                ## 16-byte Reload
	callq	_vcos_max
	movss	%xmm0, -48(%rbp)                ## 4-byte Spill
	movss	-44(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	movaps	-144(%rbp), %xmm1               ## 16-byte Reload
	callq	_vcos_max
	movss	%xmm0, -44(%rbp)                ## 4-byte Spill
	movss	-52(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	movss	-36(%rbp), %xmm1                ## 4-byte Reload
                                        ## xmm1 = mem[0],zero,zero,zero
	callq	_vcos_max
	movaps	-128(%rbp), %xmm1               ## 16-byte Reload
	addps	-96(%rbp), %xmm1                ## 16-byte Folded Reload
	movaps	-112(%rbp), %xmm3               ## 16-byte Reload
	addss	-36(%rbp), %xmm3                ## 4-byte Folded Reload
	subl	$1, %ebx
	jb	LBB0_4
## %bb.14:                              ##   in Loop: Header=BB0_3 Depth=1
	movss	%xmm0, -52(%rbp)                ## 4-byte Spill
	movaps	%xmm3, -112(%rbp)               ## 16-byte Spill
	movaps	%xmm1, -128(%rbp)               ## 16-byte Spill
	movsd	-8(%r12), %xmm1                 ## xmm1 = mem[0],zero
	movss	(%r12), %xmm0                   ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, -36(%rbp)                ## 4-byte Spill
	addq	$12, %r12
	movss	-56(%rbp), %xmm5                ## 4-byte Reload
                                        ## xmm5 = mem[0],zero,zero,zero
	jmp	LBB0_3
LBB0_4:
	movss	-40(%rbp), %xmm4                ## 4-byte Reload
                                        ## xmm4 = mem[0],zero,zero,zero
	movaps	-80(%rbp), %xmm2                ## 16-byte Reload
	movss	-56(%rbp), %xmm5                ## 4-byte Reload
                                        ## xmm5 = mem[0],zero,zero,zero
	movss	-48(%rbp), %xmm7                ## 4-byte Reload
                                        ## xmm7 = mem[0],zero,zero,zero
	movss	-44(%rbp), %xmm9                ## 4-byte Reload
                                        ## xmm9 = mem[0],zero,zero,zero
	testl	%r14d, %r14d
	jg	LBB0_6
	jmp	LBB0_13
LBB0_1:
	xorps	%xmm1, %xmm1
	xorps	%xmm3, %xmm3
	movaps	%xmm5, %xmm7
	movaps	%xmm2, %xmm9
	movaps	%xmm4, %xmm0
	testl	%r14d, %r14d
	jle	LBB0_13
LBB0_6:
	cvtsi2ss	%r14d, %xmm6
	movshdup	%xmm1, %xmm8                    ## xmm8 = xmm1[1,1,3,3]
	divss	%xmm6, %xmm1
	divss	%xmm6, %xmm8
	divss	%xmm6, %xmm3
	subss	%xmm5, %xmm7
	addss	%xmm9, %xmm7
	subss	%xmm2, %xmm7
	addss	%xmm7, %xmm0
	subss	%xmm4, %xmm0
	movss	LCPI0_0(%rip), %xmm12           ## xmm12 = mem[0],zero,zero,zero
	divss	%xmm0, %xmm12
	leal	-1(%r14), %edx
	xorl	%ecx, %ecx
	cmpl	$3, %edx
	jae	LBB0_8
## %bb.7:
	movq	%r15, %rax
	jmp	LBB0_11
LBB0_8:
	incq	%rdx
	movq	%rdx, %rcx
	andq	$-4, %rcx
	leaq	(%rcx,%rcx,2), %rax
	leaq	(%r15,%rax,4), %rax
	movaps	%xmm1, %xmm9
	shufps	$0, %xmm1, %xmm9                ## xmm9 = xmm9[0,0],xmm1[0,0]
	movaps	%xmm12, %xmm13
	shufps	$0, %xmm12, %xmm13              ## xmm13 = xmm13[0,0],xmm12[0,0]
	movaps	%xmm8, %xmm10
	shufps	$0, %xmm8, %xmm10               ## xmm10 = xmm10[0,0],xmm8[0,0]
	movaps	%xmm3, %xmm11
	shufps	$0, %xmm3, %xmm11               ## xmm11 = xmm11[0,0],xmm3[0,0]
	movq	%rcx, %rsi
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movups	(%r15), %xmm2
	movups	16(%r15), %xmm0
	movups	32(%r15), %xmm4
	movaps	%xmm2, %xmm7
	shufps	$236, %xmm0, %xmm7              ## xmm7 = xmm7[0,3],xmm0[2,3]
	insertps	$112, %xmm4, %xmm7              ## xmm7 = xmm7[0,1,2],xmm4[1]
	subps	%xmm9, %xmm7
	movaps	%xmm0, %xmm6
	blendps	$2, %xmm2, %xmm6                ## xmm6 = xmm6[0],xmm2[1],xmm6[2,3]
	shufps	$241, %xmm6, %xmm6              ## xmm6 = xmm6[1,0,3,3]
	insertps	$176, %xmm4, %xmm6              ## xmm6 = xmm6[0,1,2],xmm4[2]
	subps	%xmm10, %xmm6
	insertps	$140, %xmm2, %xmm0              ## xmm0 = xmm2[2],xmm0[1],zero,zero
	shufps	$196, %xmm4, %xmm0              ## xmm0 = xmm0[0,1],xmm4[0,3]
	subps	%xmm11, %xmm0
	mulps	%xmm13, %xmm7
	mulps	%xmm13, %xmm6
	mulps	%xmm13, %xmm0
	movaps	%xmm7, %xmm2
	shufps	$255, %xmm6, %xmm2              ## xmm2 = xmm2[3,3],xmm6[3,3]
	shufps	$233, %xmm0, %xmm2              ## xmm2 = xmm2[1,2],xmm0[2,3]
	shufps	$210, %xmm2, %xmm2              ## xmm2 = xmm2[2,0,1,3]
	movaps	%xmm7, %xmm4
	unpckhpd	%xmm6, %xmm4                    ## xmm4 = xmm4[1],xmm6[1]
	movaps	%xmm6, %xmm5
	shufps	$133, %xmm4, %xmm5              ## xmm5 = xmm5[1,1],xmm4[0,2]
	blendps	$2, %xmm0, %xmm5                ## xmm5 = xmm5[0],xmm0[1],xmm5[2,3]
	movlhps	%xmm7, %xmm6                    ## xmm6 = xmm6[0],xmm7[0]
	shufps	$98, %xmm7, %xmm6               ## xmm6 = xmm6[2,0],xmm7[2,1]
	insertps	$32, %xmm0, %xmm6               ## xmm6 = xmm6[0,1],xmm0[0],xmm6[3]
	movups	%xmm6, (%r15)
	movups	%xmm5, 16(%r15)
	movups	%xmm2, 32(%r15)
	addq	$48, %r15
	addq	$-4, %rsi
	jne	LBB0_9
## %bb.10:
	cmpq	%rcx, %rdx
	je	LBB0_13
LBB0_11:
	subl	%ecx, %r14d
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movss	(%rax), %xmm0                   ## xmm0 = mem[0],zero,zero,zero
	movss	4(%rax), %xmm2                  ## xmm2 = mem[0],zero,zero,zero
	subss	%xmm1, %xmm0
	mulss	%xmm12, %xmm0
	movss	%xmm0, (%rax)
	subss	%xmm8, %xmm2
	mulss	%xmm12, %xmm2
	movss	%xmm2, 4(%rax)
	movss	8(%rax), %xmm0                  ## xmm0 = mem[0],zero,zero,zero
	subss	%xmm3, %xmm0
	mulss	%xmm12, %xmm0
	movss	%xmm0, 8(%rax)
	addq	$12, %rax
	decl	%r14d
	jne	LBB0_12
LBB0_13:
	addq	$112, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_centre_and_rescale
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function centre_and_rescale
_centre_and_rescale:                    ; @centre_and_rescale
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	d15, d14, [sp, #16]             ; 16-byte Folded Spill
	stp	d13, d12, [sp, #32]             ; 16-byte Folded Spill
	stp	d11, d10, [sp, #48]             ; 16-byte Folded Spill
	stp	d9, d8, [sp, #64]               ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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 b8, -56
	.cfi_offset b9, -64
	.cfi_offset b10, -72
	.cfi_offset b11, -80
	.cfi_offset b12, -88
	.cfi_offset b13, -96
	.cfi_offset b14, -104
	.cfi_offset b15, -112
	mov	x19, x1
	mov	x20, x0
	ldp	s12, s15, [x0]
	ldr	s14, [x0, #8]
	subs	w21, w1, #1
	b.lt	LBB0_5
; %bb.1:
	add	x22, x20, #20
	movi	d8, #0000000000000000
	movi	d11, #0000000000000000
	stp	s14, s14, [sp]                  ; 8-byte Folded Spill
	stp	s12, s15, [sp, #8]              ; 8-byte Folded Spill
	movi	d9, #0000000000000000
	fmov	s13, s15
	fmov	s10, s12
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	fmov	s0, s10
	fmov	s1, s12
	bl	_vcos_min
	fmov	s10, s0
	fmov	s0, s13
	fmov	s1, s15
	bl	_vcos_min
	fmov	s13, s0
	ldr	s0, [sp, #4]                    ; 4-byte Folded Reload
	fmov	s1, s14
	bl	_vcos_min
	str	s0, [sp, #4]                    ; 4-byte Folded Spill
	ldr	s0, [sp, #8]                    ; 4-byte Folded Reload
	fmov	s1, s12
	bl	_vcos_max
	str	s0, [sp, #8]                    ; 4-byte Folded Spill
	ldr	s0, [sp, #12]                   ; 4-byte Folded Reload
	fmov	s1, s15
	bl	_vcos_max
	str	s0, [sp, #12]                   ; 4-byte Folded Spill
	ldr	s0, [sp]                        ; 4-byte Folded Reload
	fmov	s1, s14
	bl	_vcos_max
	fadd	s8, s8, s12
	fadd	s11, s11, s15
	fadd	s9, s9, s14
	cbz	w21, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	str	s0, [sp]                        ; 4-byte Folded Spill
	ldp	s12, s15, [x22, #-8]
	ldr	s14, [x22], #12
	sub	w21, w21, #1
	b	LBB0_2
LBB0_4:
	fmov	s12, s10
	fmov	s15, s13
	ldp	s14, s3, [sp, #4]               ; 8-byte Folded Reload
	ldr	s4, [sp, #12]                   ; 4-byte Folded Reload
	subs	w8, w19, #1
	b.ge	LBB0_6
	b	LBB0_13
LBB0_5:
	movi	d9, #0000000000000000
	fmov	s3, s12
	fmov	s4, s15
	fmov	s0, s14
	movi	d11, #0000000000000000
	movi	d8, #0000000000000000
	subs	w8, w19, #1
	b.lt	LBB0_13
LBB0_6:
	scvtf	s2, w19
	fdiv	s23, s8, s2
	fdiv	s22, s11, s2
	fdiv	s2, s9, s2
	fsub	s3, s3, s12
	fadd	s3, s3, s4
	fsub	s3, s3, s15
	fadd	s3, s0, s3
	fsub	s3, s3, s14
	fmov	s4, #3.00000000
	fdiv	s3, s4, s3
	cmp	w8, #3
	b.hs	LBB0_8
; %bb.7:
	mov	w9, #0
	mov	x8, x20
	b	LBB0_11
LBB0_8:
	add	x10, x8, #1
	and	x9, x10, #0x1fffffffc
	mov	w8, #12
	dup.4s	v4, v23[0]
	madd	x8, x9, x8, x20
	dup.4s	v5, v22[0]
	dup.4s	v6, v2[0]
	mov	x11, x9
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ld3.4s	{ v16, v17, v18 }, [x20]
	fsub.4s	v7, v16, v4
	fmul.4s	v19, v7, v3[0]
	fsub.4s	v7, v17, v5
	fmul.4s	v20, v7, v3[0]
	fsub.4s	v7, v18, v6
	fmul.4s	v21, v7, v3[0]
	st3.4s	{ v19, v20, v21 }, [x20], #48
	subs	x11, x11, #4
	b.ne	LBB0_9
; %bb.10:
	cmp	x10, x9
	b.eq	LBB0_13
LBB0_11:
	sub	w9, w19, w9
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldp	s4, s5, [x8]
	fsub	s4, s4, s23
	fmul	s4, s3, s4
	fsub	s5, s5, s22
	fmul	s5, s3, s5
	stp	s4, s5, [x8]
	ldr	s4, [x8, #8]
	fsub	s4, s4, s2
	fmul	s4, s3, s4
	str	s4, [x8, #8]
	add	x8, x8, #12
	subs	w9, w9, #1
	b.ne	LBB0_12
LBB0_13:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #64]               ; 16-byte Folded Reload
	ldp	d11, d10, [sp, #48]             ; 16-byte Folded Reload
	ldp	d13, d12, [sp, #32]             ; 16-byte Folded Reload
	ldp	d15, d14, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_centre_and_rescale
.subsections_via_symbols
