	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_eedi2_build_edge_mask          ## -- Begin function eedi2_build_edge_mask
	.p2align	4, 0x90
_eedi2_build_edge_mask:                 ## @eedi2_build_edge_mask
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -84(%rbp)                 ## 4-byte Spill
	movl	%r8d, %r12d
	movl	%ecx, %r14d
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movl	%esi, %r15d
	movl	24(%rbp), %ebx
	movl	%ebx, %edx
	shrl	$31, %edx
	addl	%ebx, %edx
	sarl	%edx
	imull	%esi, %edx
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	xorl	%esi, %esi
	callq	_memset
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	cmpl	$3, %ebx
	jl	LBB0_23
## %bb.1:
	movl	32(%rbp), %ecx
	movl	16(%rbp), %eax
	addl	%r12d, %r12d
	leal	(%r12,%r12,4), %edx
	movl	%edx, -88(%rbp)                 ## 4-byte Spill
	leal	(%rax,%rax,8), %eax
	leal	(%rax,%rax,8), %eax
	movl	%eax, -92(%rbp)                 ## 4-byte Spill
	movslq	%r14d, %rdx
	movslq	%r15d, %rax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%rdx), %r14
	leal	-1(%rcx), %eax
	movq	%rax, -128(%rbp)                ## 8-byte Spill
	addl	$-2, -52(%rbp)                  ## 4-byte Folded Spill
	movl	$1, %eax
	movq	%rdx, -112(%rbp)                ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-112(%rbp), %rdx                ## 8-byte Reload
	addq	%rdx, -48(%rbp)                 ## 8-byte Folded Spill
	movq	-120(%rbp), %rcx                ## 8-byte Reload
	leal	1(%rcx), %eax
	movq	%rbx, %r14
	cmpl	-52(%rbp), %ecx                 ## 4-byte Folded Reload
                                        ## kill: def $eax killed $eax def $rax
	je	LBB0_23
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movq	%rax, -120(%rbp)                ## 8-byte Spill
	movq	-104(%rbp), %rax                ## 8-byte Reload
	addq	%rax, -64(%rbp)                 ## 8-byte Folded Spill
	leaq	(%r14,%rdx), %rbx
	movl	32(%rbp), %eax
	cmpl	$3, %eax
	jl	LBB0_22
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, %r13d
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_4 Depth=2
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movb	$-1, (%rax,%r13)
LBB0_20:                                ##   in Loop: Header=BB0_4 Depth=2
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
LBB0_21:                                ##   in Loop: Header=BB0_4 Depth=2
	movq	%rdi, %r13
	cmpq	-128(%rbp), %rdi                ## 8-byte Folded Reload
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_22
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movzbl	(%rax,%r13), %eax
	movzbl	(%r14,%r13), %r8d
	movl	%eax, %ecx
	subl	%r8d, %ecx
	movl	%ecx, %esi
	negl	%esi
	cmovsl	%ecx, %esi
	cmpl	$9, %esi
	ja	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movzbl	(%rbx,%r13), %ecx
	movl	%r8d, %edx
	subl	%ecx, %edx
	movl	%edx, %edi
	negl	%edi
	cmovsl	%edx, %edi
	cmpl	$9, %edi
	ja	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	%eax, %edx
	subl	%ecx, %edx
	movl	%edx, %ecx
	negl	%ecx
	cmovsl	%edx, %ecx
	cmpl	$9, %ecx
	ja	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=2
	incq	%r13
	movq	%r13, %rdi
	jmp	LBB0_21
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=2
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movzbl	-1(%rcx,%r13), %ecx
	movzbl	-1(%r14,%r13), %r11d
	movl	%ecx, %edi
	subl	%r11d, %edi
	movl	%edi, %edx
	negl	%edx
	cmovsl	%edi, %edx
	movzbl	-1(%rbx,%r13), %ebx
	cmpl	$9, %edx
	ja	LBB0_14
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	%r11d, %edx
	subl	%ebx, %edx
	movl	%edx, %edi
	negl	%edi
	cmovsl	%edx, %edi
	cmpl	$9, %edi
	ja	LBB0_14
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=2
	movl	%ecx, %edx
	subl	%ebx, %edx
	movl	%edx, %edi
	negl	%edi
	cmovsl	%edx, %edi
	cmpl	$9, %edi
	ja	LBB0_14
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=2
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movzbl	1(%rdx,%r13), %r9d
	movzbl	1(%r14,%r13), %r12d
	movl	%r9d, %edx
	subl	%r12d, %edx
	movl	%edx, %edi
	negl	%edi
	cmovsl	%edx, %edi
	cmpl	$9, %edi
	ja	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_4 Depth=2
	leaq	1(%r13), %rdi
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movzbl	(%rdx,%rdi), %r10d
	subl	%r10d, %r12d
	movl	%r12d, %edx
	negl	%edx
	cmovsl	%r12d, %edx
	cmpl	$9, %edx
	ja	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_4 Depth=2
	subl	%r10d, %r9d
	movl	%r9d, %edx
	negl	%edx
	cmovsl	%r9d, %edx
	cmpl	$10, %edx
	jb	LBB0_21
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_4 Depth=2
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movzbl	1(%rdx,%r13), %edi
	leal	(%r8,%rax), %edx
	addl	%ecx, %edx
	addl	%r11d, %edx
	addl	%edi, %edx
	movd	%edi, %xmm0
	movzbl	1(%r14,%r13), %r12d
	addl	%r12d, %edx
	pinsrd	$1, %r12d, %xmm0
	addl	%ebx, %edx
	pinsrd	$2, %ebx, %xmm0
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movzbl	(%r15,%r13), %ebx
	movd	%r8d, %xmm1
	movzbl	1(%r15,%r13), %edi
	addl	%ebx, %edx
	addl	%edi, %edx
	pinsrd	$3, %ebx, %xmm0
	pinsrd	$1, %eax, %xmm1
	pinsrd	$2, %ecx, %xmm1
	pinsrd	$3, %r11d, %xmm1
	packusdw	%xmm0, %xmm0
	packusdw	%xmm1, %xmm1
	punpcklwd	%xmm0, %xmm1            ## xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
	imull	%edi, %edi
	pmaddwd	%xmm1, %xmm1
	pshufd	$238, %xmm1, %xmm0              ## xmm0 = xmm1[2,3,2,3]
	paddd	%xmm1, %xmm0
	pshufd	$85, %xmm0, %xmm1               ## xmm1 = xmm0[1,1,1,1]
	paddd	%xmm0, %xmm1
	movd	%xmm1, %ecx
	addl	%edi, %ecx
	leal	(%rcx,%rcx,8), %ecx
	imull	%edx, %edx
	subl	%edx, %ecx
	leaq	1(%r13), %rdi
	cmpl	-92(%rbp), %ecx                 ## 4-byte Folded Reload
	jl	LBB0_21
## %bb.15:                              ##   in Loop: Header=BB0_4 Depth=2
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	subl	%r11d, %r12d
	subl	%ebx, %eax
	movl	%eax, %edi
	negl	%edi
	cmovsl	%eax, %edi
	callq	_MAX
	movzbl	(%r14,%r13), %ecx
	movzbl	(%r15,%r13), %edx
	subl	%edx, %ecx
	movl	%ecx, %esi
	negl	%esi
	cmovsl	%ecx, %esi
	movl	%eax, %edi
	callq	_MAX
	imull	%r12d, %r12d
	imull	%eax, %eax
	addl	%r12d, %eax
	cmpl	-88(%rbp), %eax                 ## 4-byte Folded Reload
	jge	LBB0_16
## %bb.17:                              ##   in Loop: Header=BB0_4 Depth=2
	movzbl	-1(%r14,%r13), %eax
	movzbl	(%r14,%r13), %ecx
	addl	%ecx, %ecx
	subl	%ecx, %eax
	movq	%r14, %rsi
	movzbl	1(%r14,%r13), %edx
	addl	%eax, %edx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movzbl	(%rax,%r13), %eax
	subl	%ecx, %eax
	movzbl	(%r15,%r13), %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	negl	%eax
	cmovsl	%edx, %eax
	movl	%ecx, %edx
	negl	%edx
	cmovsl	%ecx, %edx
	addl	%eax, %edx
	cmpl	-84(%rbp), %edx                 ## 4-byte Folded Reload
	jl	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_4 Depth=2
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movb	$-1, (%rax,%r13)
LBB0_19:                                ##   in Loop: Header=BB0_4 Depth=2
	movq	%rsi, %r14
	jmp	LBB0_20
LBB0_23:
	addq	$88, %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	_eedi2_build_edge_mask          ; -- Begin function eedi2_build_edge_mask
	.p2align	2
_eedi2_build_edge_mask:                 ; @eedi2_build_edge_mask
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	mov	x22, x7
	mov	x23, x6
	str	w5, [sp, #40]                   ; 4-byte Folded Spill
	mov	x19, x4
	mov	x24, x3
	mov	x20, x2
	mov	x25, x1
	cmp	w7, #0
	cinc	w8, w7, lt
	asr	w8, w8, #1
	mul	w2, w8, w1
	mov	x26, x0
	mov	w1, #0
	bl	_memset
	cmp	w22, #3
	b.lt	LBB0_20
; %bb.1:
	add	w8, w19, w19, lsl #2
	lsl	w8, w8, #1
	str	w8, [sp, #44]                   ; 4-byte Folded Spill
	mov	w8, #81
	mul	w23, w23, w8
	sxtw	x9, w24
	sxtw	x8, w25
	str	x8, [sp, #16]                   ; 8-byte Folded Spill
	add	x24, x20, x9
	ldr	w8, [x29, #16]
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	sub	w28, w8, #1
	sub	w8, w22, #2
	str	w8, [sp, #8]                    ; 4-byte Folded Spill
	mov	w8, #1
	str	x9, [sp, #24]                   ; 8-byte Folded Spill
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldp	x9, x11, [sp, #24]              ; 16-byte Folded Reload
	add	x20, x20, x9
	add	w8, w11, #1
	mov	x24, x25
	ldr	w10, [sp, #8]                   ; 4-byte Folded Reload
	cmp	w11, w10
                                        ; kill: def $w8 killed $w8 def $x8
	b.eq	LBB0_20
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	str	x8, [sp, #32]                   ; 8-byte Folded Spill
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	add	x26, x26, x8
	add	x25, x24, x9
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	cmp	w8, #3
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w27, #1
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=2
	mov	w8, #255
	strb	w8, [x26, x27]
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=2
	mov	x27, x19
	cmp	x19, x28
	b.eq	LBB0_2
LBB0_7:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldrb	w8, [x20, x27]
	ldrb	w9, [x24, x27]
	subs	w10, w8, w9
	cneg	w1, w10, mi
	cmp	w1, #9
	b.hi	LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	ldrb	w10, [x25, x27]
	subs	w11, w9, w10
	cneg	w11, w11, mi
	cmp	w11, #9
	b.hi	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=2
	subs	w10, w8, w10
	cneg	w10, w10, mi
	cmp	w10, #9
	b.hi	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=2
	add	x19, x27, #1
	b	LBB0_6
LBB0_11:                                ;   in Loop: Header=BB0_7 Depth=2
	sub	x22, x27, #1
	ldrb	w11, [x20, x22]
	ldrb	w10, [x24, x22]
	subs	w12, w11, w10
	cneg	w13, w12, mi
	ldrb	w12, [x25, x22]
	cmp	w13, #9
	b.hi	LBB0_17
; %bb.12:                               ;   in Loop: Header=BB0_7 Depth=2
	subs	w13, w10, w12
	cneg	w13, w13, mi
	cmp	w13, #9
	b.hi	LBB0_17
; %bb.13:                               ;   in Loop: Header=BB0_7 Depth=2
	subs	w13, w11, w12
	cneg	w13, w13, mi
	cmp	w13, #9
	b.hi	LBB0_17
; %bb.14:                               ;   in Loop: Header=BB0_7 Depth=2
	add	x19, x27, #1
	ldrb	w13, [x20, x19]
	ldrb	w14, [x24, x19]
	subs	w15, w13, w14
	cneg	w15, w15, mi
	cmp	w15, #9
	b.hi	LBB0_17
; %bb.15:                               ;   in Loop: Header=BB0_7 Depth=2
	ldrb	w15, [x25, x19]
	subs	w14, w14, w15
	cneg	w14, w14, mi
	cmp	w14, #9
	b.hi	LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_7 Depth=2
	subs	w13, w13, w15
	cneg	w13, w13, mi
	cmp	w13, #10
	b.lo	LBB0_6
LBB0_17:                                ;   in Loop: Header=BB0_7 Depth=2
	add	x19, x27, #1
	ldrb	w15, [x20, x19]
	ldrb	w13, [x24, x19]
	ldrb	w14, [x25, x27]
	ldrb	w16, [x25, x19]
	add	w17, w9, w8
	add	w17, w17, w11
	add	w17, w17, w10
	add	w17, w17, w15
	add	w17, w17, w13
	add	w17, w17, w12
	add	w17, w17, w14
	add	w17, w17, w16
	mul	w0, w8, w8
	madd	w9, w9, w9, w0
	madd	w9, w11, w11, w9
	madd	w9, w10, w10, w9
	madd	w9, w15, w15, w9
	madd	w9, w13, w13, w9
	madd	w9, w12, w12, w9
	madd	w9, w14, w14, w9
	madd	w9, w16, w16, w9
	add	w9, w9, w9, lsl #3
	msub	w9, w17, w17, w9
	cmp	w9, w23
	b.lt	LBB0_6
; %bb.18:                               ;   in Loop: Header=BB0_7 Depth=2
	sub	w21, w13, w10
	subs	w8, w8, w14
	cneg	w0, w8, mi
	bl	_MAX
	ldrb	w8, [x24, x27]
	ldrb	w9, [x25, x27]
	subs	w8, w8, w9
	cneg	w1, w8, mi
	bl	_MAX
	mul	w8, w21, w21
	madd	w8, w0, w0, w8
	ldr	w9, [sp, #44]                   ; 4-byte Folded Reload
	cmp	w8, w9
	b.ge	LBB0_5
; %bb.19:                               ;   in Loop: Header=BB0_7 Depth=2
	ldrb	w8, [x24, x22]
	ldrb	w9, [x24, x27]
	lsl	w9, w9, #1
	ldrb	w10, [x24, x19]
	sub	w8, w8, w9
	adds	w8, w8, w10
	ldrb	w10, [x20, x27]
	ldrb	w11, [x25, x27]
	sub	w9, w10, w9
	add	w9, w9, w11
	cneg	w8, w8, mi
	cmp	w9, #0
	cneg	w9, w9, mi
	add	w8, w9, w8
	ldr	w9, [sp, #40]                   ; 4-byte Folded Reload
	cmp	w8, w9
	b.ge	LBB0_5
	b	LBB0_6
LBB0_20:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
