	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xcorr_coeff
_xcorr_coeff:                           ## @xcorr_coeff
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r14d
	movl	%edx, %ebx
	movq	%rsi, %r12
	movq	%rdi, -128(%rbp)                ## 8-byte Spill
	movq	_INT16_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movl	%r9d, -68(%rbp)                 ## 4-byte Spill
	cmpl	$1, %r9d
	movl	%r8d, -72(%rbp)                 ## 4-byte Spill
	jne	LBB0_2
## %bb.1:
	leal	(%rbx,%r14), %esi
	decl	%esi
	movq	%r12, %rdi
	callq	_max_abs_value_w16
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movl	%ebx, %r13d
	jmp	LBB0_3
LBB0_2:
	movl	%r14d, %eax
	negl	%eax
	cltq
	leaq	(%r12,%rax,4), %rdi
	leal	-1(%rbx), %r13d
	leal	(%rbx,%r14), %esi
	decl	%esi
	callq	_max_abs_value_w16
	leaq	-4(%r12), %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
LBB0_3:
	xorl	%ecx, %ecx
	cmpl	$5001, %eax                     ## imm = 0x1389
	setge	%cl
	addl	%ecx, %ecx
	movq	%r12, %rdi
	movq	%r12, %rsi
	movq	%rbx, -136(%rbp)                ## 8-byte Spill
	movl	%ebx, %edx
	movl	%ecx, %ebx
	callq	_scale_dot_product
	testl	%r14d, %r14d
	jle	LBB0_14
## %bb.4:
	movq	%rax, %r15
	movq	%r14, -120(%rbp)                ## 8-byte Spill
	movslq	%r13d, %rax
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	movslq	-68(%rbp), %rax                 ## 4-byte Folded Reload
	shlq	$2, %rax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movl	$-500, -60(%rbp)                ## 4-byte Folded Spill
                                        ## imm = 0xFE0C
	xorl	%r14d, %r14d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	movl	%ebx, -76(%rbp)                 ## 4-byte Spill
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_7 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
LBB0_6:                                 ##   in Loop: Header=BB0_7 Depth=1
	movq	-112(%rbp), %rax                ## 8-byte Reload
	movl	(%r12,%rax,4), %eax
	imull	%eax, %eax
	movl	(%rdi), %ecx
	imull	%ecx, %ecx
	subl	%ecx, %eax
	movl	-76(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %ecx
	sarl	%cl, %eax
	imull	-68(%rbp), %eax                 ## 4-byte Folded Reload
	addq	%rax, %r15
	incl	%r14d
	movq	-104(%rbp), %rax                ## 8-byte Reload
	addq	%rax, %r12
	addq	%rax, %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	cmpl	%r14d, -120(%rbp)               ## 4-byte Folded Reload
	je	LBB0_15
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	-128(%rbp), %rdi                ## 8-byte Reload
	movq	%r12, %rsi
	movq	-136(%rbp), %rdx                ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	movl	%ebx, %ecx
	callq	_scale_dot_product
	testq	%r15, %r15
	jle	LBB0_5
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	%rax, %rbx
	testq	%rax, %rax
	jle	LBB0_5
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	%rbx, %rdi
	callq	_norm_w32
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	leal	-16(%rax), %esi
	movq	%rbx, %rdi
	callq	_SPL_SHIFT_W32
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_norm_w32
	movl	%eax, %r13d
	leal	-16(%r13), %esi
	movq	%r15, %rdi
	callq	_SPL_SHIFT_W32
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movl	%ebx, %edi
	movl	%ebx, %esi
	movl	$16, %edx
	callq	_SPL_MUL_16_16_RSFT
	movq	%rax, %rbx
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	addl	%eax, %eax
	addl	$-32, %eax
	negl	%eax
	addl	%eax, %r13d
	addl	$-16, %r13d
	movl	%r13d, %edi
	subl	-60(%rbp), %edi                 ## 4-byte Folded Reload
	movl	$31, %esi
	callq	_FFMIN
	movl	%eax, %edi
	movl	$-31, %esi
	callq	_FFMAX
	movslq	%ebx, %rcx
	movslq	-64(%rbp), %rdx                 ## 4-byte Folded Reload
	imulq	%rcx, %rdx
	testl	%eax, %eax
	js	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movslq	-48(%rbp), %rcx                 ## 4-byte Folded Reload
	movq	-88(%rbp), %r8                  ## 8-byte Reload
	movslq	%r8d, %rsi
	imulq	%rcx, %rsi
	movl	%eax, %ecx
	sarq	%cl, %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r8, %rcx
	cmpq	%rsi, %rdx
	jle	LBB0_6
	jmp	LBB0_13
LBB0_12:                                ##   in Loop: Header=BB0_7 Depth=1
	negb	%al
	movl	%eax, %ecx
	sarq	%cl, %rdx
	movslq	-48(%rbp), %rax                 ## 4-byte Folded Reload
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movslq	%ecx, %rsi
	imulq	%rax, %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	cmpq	%rsi, %rdx
	jle	LBB0_6
LBB0_13:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	%ebx, %eax
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movl	%ecx, %eax
	movl	%ecx, -64(%rbp)                 ## 4-byte Spill
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movl	%r13d, -60(%rbp)                ## 4-byte Spill
	jmp	LBB0_6
LBB0_14:
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_15:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addl	-72(%rbp), %eax                 ## 4-byte Folded Reload
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_INT16_MAX,4,2                  ## @INT16_MAX
	.no_dead_strip	_xcorr_coeff
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xcorr_coeff
_xcorr_coeff:                           ; @xcorr_coeff
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x28, x27, [sp, #80]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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
                                        ; kill: def $w5 killed $w5 def $x5
	stp	w2, w3, [sp, #72]               ; 8-byte Folded Spill
	mov	x24, x1
	str	x0, [sp, #48]                   ; 8-byte Folded Spill
Lloh0:
	adrp	x8, _INT16_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _INT16_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w25, [x8]
	str	x5, [sp, #56]                   ; 8-byte Folded Spill
	cmp	w5, #1
	str	w4, [sp]                        ; 4-byte Folded Spill
	b.ne	LBB0_2
; %bb.1:
	ldp	w19, w8, [sp, #72]              ; 8-byte Folded Reload
	add	w8, w19, w8
	sub	w1, w8, #1
	mov	x0, x24
	bl	_max_abs_value_w16
	str	x24, [sp, #40]                  ; 8-byte Folded Spill
	b	LBB0_3
LBB0_2:
	ldr	w9, [sp, #76]                   ; 4-byte Folded Reload
	neg	w8, w9
	add	x0, x24, w8, sxtw #2
	ldr	w8, [sp, #72]                   ; 4-byte Folded Reload
	sub	w19, w8, #1
	add	w1, w19, w9
	bl	_max_abs_value_w16
	sub	x8, x24, #4
	str	x8, [sp, #40]                   ; 8-byte Folded Spill
LBB0_3:
	mov	w8, #5000
	cmp	w0, w8
	cset	w8, gt
	lsl	w20, w8, #1
	mov	x0, x24
	mov	x1, x24
	ldr	w2, [sp, #72]                   ; 4-byte Folded Reload
	mov	x3, x20
	bl	_scale_dot_product
	ldr	w8, [sp, #76]                   ; 4-byte Folded Reload
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.4:
	mov	x26, x0
	mov	x21, #0
	mov	w23, #0
	str	wzr, [sp, #68]                  ; 4-byte Folded Spill
	str	wzr, [sp, #36]                  ; 4-byte Folded Spill
	ldr	x8, [sp, #56]                   ; 8-byte Folded Reload
	sbfiz	x8, x8, #2, #32
	str	x8, [sp, #24]                   ; 8-byte Folded Spill
	mov	w8, #-500
	str	w8, [sp, #20]                   ; 4-byte Folded Spill
	add	x22, x24, w19, sxtw #2
	str	x24, [sp, #8]                   ; 8-byte Folded Spill
	str	w20, [sp, #4]                   ; 4-byte Folded Spill
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x22, x21]
	mul	w8, w8, w8
	ldr	x9, [sp, #40]                   ; 8-byte Folded Reload
	ldr	w9, [x9, x21]
	msub	w8, w9, w9, w8
	asr	w8, w8, w20
	ldr	x9, [sp, #56]                   ; 8-byte Folded Reload
	mul	w8, w8, w9
	add	x26, x26, x8
	add	w23, w23, #1
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	add	x21, x21, x8
	ldr	w8, [sp, #76]                   ; 4-byte Folded Reload
	cmp	w8, w23
	b.eq	LBB0_10
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, x24, x21
	ldr	x0, [sp, #48]                   ; 8-byte Folded Reload
	ldr	w2, [sp, #72]                   ; 4-byte Folded Reload
	mov	x3, x20
	bl	_scale_dot_product
	cmp	x26, #1
	b.lt	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x27, x0
	cmp	x0, #1
	b.lt	LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x27
	bl	_norm_w32
	sub	w28, w0, #16
	mov	x0, x27
	mov	x1, x28
	bl	_SPL_SHIFT_W32
	mov	x27, x0
	mov	x0, x26
	bl	_norm_w32
	sub	w19, w0, #16
	mov	x0, x26
	mov	x1, x19
	bl	_SPL_SHIFT_W32
	mov	x24, x0
	mov	x0, x27
	mov	x1, x27
	mov	w2, #16
	bl	_SPL_MUL_16_16_RSFT
	mov	x27, x0
	sub	w19, w19, w28, lsl #1
	ldr	w20, [sp, #4]                   ; 4-byte Folded Reload
	ldr	w28, [sp, #20]                  ; 4-byte Folded Reload
	sub	w0, w19, w28
	mov	w1, #31
	bl	_FFMIN
	mov	w1, #-31
	bl	_FFMAX
                                        ; kill: def $w0 killed $w0 def $x0
	smull	x8, w27, w25
	ldr	w12, [sp, #36]                  ; 4-byte Folded Reload
	smull	x9, w24, w12
	asr	x9, x9, x0
	neg	w10, w0
	asr	x10, x8, x10
	smull	x11, w24, w12
	tst	w0, #0x80000000
	csel	x8, x8, x10, eq
	csel	x9, x9, x11, eq
	cmp	x8, x9
	csel	w12, w12, w27, le
	str	w12, [sp, #36]                  ; 4-byte Folded Spill
	csel	w25, w25, w24, le
	ldr	x24, [sp, #8]                   ; 8-byte Folded Reload
	ldr	w8, [sp, #68]                   ; 4-byte Folded Reload
	csel	w8, w8, w23, le
	str	w8, [sp, #68]                   ; 4-byte Folded Spill
	csel	w28, w28, w19, le
	str	w28, [sp, #20]                  ; 4-byte Folded Spill
	b	LBB0_5
LBB0_9:
	str	wzr, [sp, #68]                  ; 4-byte Folded Spill
LBB0_10:
	ldr	w8, [sp]                        ; 4-byte Folded Reload
	ldr	w9, [sp, #68]                   ; 4-byte Folded Reload
	add	w0, w9, w8
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_INT16_MAX,4,2                  ; @INT16_MAX
	.no_dead_strip	_xcorr_coeff
.subsections_via_symbols
