	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function restore_median_planar_il
_restore_median_planar_il:              ## @restore_median_planar_il
	.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	$152, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, -84(%rbp)                 ## 4-byte Spill
                                        ## kill: def $ecx killed $ecx def $rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, -96(%rbp)                 ## 8-byte Spill
	movq	%rdi, -112(%rbp)                ## 8-byte Spill
	cmpl	$0, 16(%rbp)
	sete	%al
	testl	%r9d, %r9d
	jle	LBB0_13
## %bb.1:
	xorl	%ecx, %ecx
	movb	%al, %cl
	addl	%ecx, %ecx
	orl	$-4, %ecx
	movl	%ecx, -76(%rbp)                 ## 4-byte Spill
	movslq	%edx, %rcx
	addl	%edx, %edx
	movslq	%edx, %rdx
	movl	%edx, %eax
	negl	%eax
	cltq
	movq	%rax, -152(%rbp)                ## 8-byte Spill
	movq	%rdx, %rax
	negq	%rax
	movq	%rax, -136(%rbp)                ## 8-byte Spill
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addl	$-16, %eax
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	movq	%rcx, %rax
	negq	%rax
	movq	%rax, -144(%rbp)                ## 8-byte Spill
	leaq	(,%rdx,4), %rdi
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movq	%rdx, -160(%rbp)                ## 8-byte Spill
	leaq	(%rax,%rdx,8), %rax
	movq	%rax, -128(%rbp)                ## 8-byte Spill
	movq	%rcx, -104(%rbp)                ## 8-byte Spill
	leaq	(,%rcx,4), %rax
	movq	%rax, -184(%rbp)                ## 8-byte Spill
	negq	%rax
	movq	%rax, -176(%rbp)                ## 8-byte Spill
	xorl	%ebx, %ebx
	movl	%r9d, -80(%rbp)                 ## 4-byte Spill
	movq	%rdi, -120(%rbp)                ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	-88(%rbp), %ebx                 ## 4-byte Reload
	movl	-80(%rbp), %r9d                 ## 4-byte Reload
	cmpl	%r9d, %ebx
	je	LBB0_13
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
                                        ##     Child Loop BB0_11 Depth 2
	movl	%ebx, %eax
	movl	-84(%rbp), %r8d                 ## 4-byte Reload
	imull	%r8d, %eax
	cltd
	idivl	%r9d
	movl	%eax, %ecx
	movl	-76(%rbp), %esi                 ## 4-byte Reload
	andl	%esi, %ecx
	incl	%ebx
	movl	%ebx, -88(%rbp)                 ## 4-byte Spill
	movl	%ebx, %eax
	imull	%r8d, %eax
	cltd
	idivl	%r9d
	movl	%eax, %ebx
	andl	%esi, %ebx
	movl	%ebx, %r12d
	subl	%ecx, %r12d
	subl	%ecx, %ebx
	movq	-112(%rbp), %r15                ## 8-byte Reload
	je	LBB0_12
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-104(%rbp), %r14                ## 8-byte Reload
	imull	%r14d, %ecx
	movslq	%ecx, %rcx
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%rcx,4), %r13
	movq	%rcx, -168(%rbp)                ## 8-byte Spill
	subl	$-128, (%rax,%rcx,4)
	movq	%r13, %rdi
	movq	%r13, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%ecx, %ecx
	callq	*(%r15)
	movl	%eax, -48(%rbp)
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	leaq	(,%r14,4), %rdi
	addq	%r13, %rdi
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%rdi, %rsi
	movl	%r14d, %edx
	movl	%eax, %ecx
	callq	*(%r15)
	cmpl	$4, %ebx
	jl	LBB0_12
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, -72(%rbp)                 ## 4-byte Spill
	movq	-160(%rbp), %rax                ## 8-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax,4), %r15
	movq	-152(%rbp), %rax                ## 8-byte Reload
	movl	(%r15,%rax,4), %ebx
	movl	(%r15), %eax
	addl	%ebx, %eax
	movl	%eax, (%r15)
	movl	%eax, -48(%rbp)
	movl	%r14d, %edi
	movl	$16, %esi
	callq	_FFMIN
	cmpl	$2, %eax
	jl	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-120(%rbp), %rax                ## 8-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax), %r13
	movl	$1, %r14d
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax,%r14,4), %esi
	movl	%esi, -44(%rbp)
	movl	-48(%rbp), %edi
	movl	%esi, %edx
	subl	%ebx, %edx
	addl	%edi, %edx
	callq	_mid_pred
	addl	(%r13,%r14,4), %eax
	movl	%eax, (%r13,%r14,4)
	movl	-44(%rbp), %ebx
	movl	%eax, -48(%rbp)
	incq	%r14
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $edi killed $edi killed $rdi
	movl	$16, %esi
	callq	_FFMIN
	cltq
	cmpq	%rax, %r14
	jl	LBB0_6
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	cmpl	$17, %r13d
	movq	-112(%rbp), %r14                ## 8-byte Reload
	leaq	-48(%rbp), %rbx
	jl	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	64(%r15), %rdi
	movq	-136(%rbp), %rax                ## 8-byte Reload
	leaq	(%r15,%rax,4), %rsi
	addq	$64, %rsi
	movq	%rdi, %rdx
	movl	-68(%rbp), %ecx                 ## 4-byte Reload
	movq	%rbx, %r8
	leaq	-44(%rbp), %r9
	callq	*8(%r14)
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-104(%rbp), %rax                ## 8-byte Reload
	leaq	(%r15,%rax,4), %rdi
	movq	-144(%rbp), %rax                ## 8-byte Reload
	leaq	(%r15,%rax,4), %rsi
	movq	%rdi, %rdx
	movl	%r13d, %ecx
	movq	%rbx, %r8
	leaq	-44(%rbp), %r9
	callq	*8(%r14)
	cmpl	$5, -72(%rbp)                   ## 4-byte Folded Reload
	jl	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, %r8
	movq	%rbx, %r13
	sarl	%r12d
	cmpl	$4, %r12d
	movl	$3, %eax
	cmovll	%eax, %r12d
	addl	$-2, %r12d
	movq	-128(%rbp), %rax                ## 8-byte Reload
	movq	-168(%rbp), %rcx                ## 8-byte Reload
	leaq	(%rax,%rcx,4), %rbx
	.p2align	4, 0x90
LBB0_11:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	movl	%r8d, %ecx
	movl	%r12d, %r15d
	movq	%r8, %r12
	movq	%r13, %r8
	leaq	-44(%rbp), %r9
	callq	*8(%r14)
	movq	-184(%rbp), %rax                ## 8-byte Reload
	leaq	(%rbx,%rax), %rdi
	movq	-176(%rbp), %rax                ## 8-byte Reload
	leaq	(%rbx,%rax), %rsi
	movq	%rdi, %rdx
	movl	%r12d, %ecx
	movq	%r13, %r8
	leaq	-44(%rbp), %r9
	callq	*8(%r14)
	movq	%r12, %r8
	movl	%r15d, %r12d
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	-120(%rbp), %rdi                ## 8-byte Reload
	addq	%rdi, %rbx
	addq	%rdi, %r15
	decl	%r12d
	jne	LBB0_11
	jmp	LBB0_12
LBB0_13:
	addq	$152, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_restore_median_planar_il
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function restore_median_planar_il
_restore_median_planar_il:              ; @restore_median_planar_il
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #224
	.cfi_def_cfa_offset 224
	stp	x28, x27, [sp, #128]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #144]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #160]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #176]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #192]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #208]            ; 16-byte Folded Spill
	add	x29, sp, #208
	.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
	stur	w4, [x29, #-92]                 ; 4-byte Folded Spill
	stp	x1, x2, [sp, #88]               ; 16-byte Folded Spill
	mov	w8, #-4
	mov	w9, #-2
	cmp	w6, #0
	csel	w8, w9, w8, eq
	stur	w8, [x29, #-96]                 ; 4-byte Folded Spill
	cmp	w5, #1
	b.lt	LBB0_13
; %bb.1:
	mov	x20, x5
	mov	x21, x3
	mov	x24, x0
	mov	w25, #0
	ldr	x11, [sp, #96]                  ; 8-byte Folded Reload
	lsl	w8, w11, #1
	sxtw	x9, w11
	sxtw	x10, w8
	str	x10, [sp, #48]                  ; 8-byte Folded Spill
	neg	x10, x10
	str	x10, [sp, #64]                  ; 8-byte Folded Spill
	sub	w10, w3, #16
	str	w10, [sp, #20]                  ; 4-byte Folded Spill
	str	x9, [sp, #104]                  ; 8-byte Folded Spill
	neg	x9, x9
	str	x9, [sp, #40]                   ; 8-byte Folded Spill
	ldr	x9, [sp, #88]                   ; 8-byte Folded Reload
	add	x10, x9, #4
	str	x10, [sp, #8]                   ; 8-byte Folded Spill
	sbfiz	x22, x8, #2, #32
	sbfiz	x10, x11, #2, #32
	str	x10, [sp, #32]                  ; 8-byte Folded Spill
	neg	x10, x10
	str	x10, [sp, #24]                  ; 8-byte Folded Spill
	add	x8, x9, w8, sxtw #3
	str	x8, [sp]                        ; 8-byte Folded Spill
	str	w5, [sp, #60]                   ; 4-byte Folded Spill
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	cmp	w25, w20
	b.eq	LBB0_13
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
                                        ;     Child Loop BB0_12 Depth 2
	ldp	w10, w9, [x29, #-96]            ; 8-byte Folded Reload
	mul	w8, w25, w9
	sdiv	w8, w8, w20
	and	w8, w8, w10
	add	w25, w25, #1
	mul	w9, w25, w9
	sdiv	w9, w9, w20
	and	w9, w9, w10
	subs	w23, w9, w8
	b.eq	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x9, [sp, #96]                   ; 8-byte Folded Reload
	mul	w19, w8, w9
	ldr	x8, [sp, #88]                   ; 8-byte Folded Reload
	add	x26, x8, w19, sxtw #2
	ldr	w8, [x26]
	add	w8, w8, #128
	str	w8, [x26]
	ldr	x8, [x24]
	mov	x0, x26
	mov	x1, x26
	mov	x2, x21
	mov	w3, #0
	blr	x8
	mov	x3, x0
	stur	w0, [x29, #-84]
	ldr	x8, [x24]
	ldr	x9, [sp, #104]                  ; 8-byte Folded Reload
	add	x0, x26, x9, lsl #2
	mov	x1, x0
	mov	x2, x21
	blr	x8
	cmp	w23, #4
	b.lt	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	str	w23, [sp, #84]                  ; 4-byte Folded Spill
	sxtw	x8, w19
	str	x8, [sp, #72]                   ; 8-byte Folded Spill
	ldr	x8, [sp, #48]                   ; 8-byte Folded Reload
	add	x26, x26, x8, lsl #2
	ldr	x8, [sp, #64]                   ; 8-byte Folded Reload
	ldr	w28, [x26, x8, lsl #2]
	ldr	w8, [x26]
	add	w8, w8, w28
	str	w8, [x26]
	stur	w8, [x29, #-84]
	mov	x0, x21
	mov	w1, #16
	bl	_FFMIN
	cmp	w0, #2
	b.lt	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x19, #0
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	ldr	x9, [sp, #72]                   ; 8-byte Folded Reload
	add	x27, x8, x9, lsl #2
	add	x20, x27, x22
LBB0_7:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	lsl	x23, x19, #2
	ldr	w1, [x27, x23]
	stur	w1, [x29, #-88]
	ldur	w0, [x29, #-84]
	sub	w8, w1, w28
	add	w2, w8, w0
	bl	_mid_pred
	ldr	w8, [x20, x23]
	add	w8, w8, w0
	str	w8, [x20, x23]
	ldur	w28, [x29, #-88]
	stur	w8, [x29, #-84]
	mov	x0, x21
	mov	w1, #16
	bl	_FFMIN
	add	x8, x19, #2
	add	x19, x19, #1
	cmp	x8, w0, sxtw
	b.lt	LBB0_7
LBB0_8:                                 ;   in Loop: Header=BB0_3 Depth=1
	cmp	w21, #17
	b.lt	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x24, #8]
	add	x0, x26, #64
	ldr	x9, [sp, #64]                   ; 8-byte Folded Reload
	add	x9, x26, x9, lsl #2
	add	x1, x9, #64
	sub	x4, x29, #84
	sub	x5, x29, #88
	mov	x2, x0
	ldr	w3, [sp, #20]                   ; 4-byte Folded Reload
	blr	x8
LBB0_10:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x24, #8]
	ldr	x9, [sp, #104]                  ; 8-byte Folded Reload
	add	x0, x26, x9, lsl #2
	ldr	x9, [sp, #40]                   ; 8-byte Folded Reload
	add	x1, x26, x9, lsl #2
	sub	x4, x29, #84
	sub	x5, x29, #88
	mov	x2, x0
	mov	x3, x21
	blr	x8
	ldr	w8, [sp, #84]                   ; 4-byte Folded Reload
	cmp	w8, #5
	ldr	w20, [sp, #60]                  ; 4-byte Folded Reload
	ldp	x23, x28, [sp, #24]             ; 16-byte Folded Reload
	b.lt	LBB0_2
; %bb.11:                               ;   in Loop: Header=BB0_3 Depth=1
	asr	w8, w8, #1
	cmp	w8, #3
	mov	w9, #3
	csel	w8, w8, w9, gt
	sub	w19, w8, #2
	ldr	x8, [sp]                        ; 8-byte Folded Reload
	ldr	x9, [sp, #72]                   ; 8-byte Folded Reload
	add	x27, x8, x9, lsl #2
LBB0_12:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x24, #8]
	sub	x4, x29, #84
	sub	x5, x29, #88
	mov	x0, x27
	mov	x1, x26
	mov	x2, x27
	mov	x3, x21
	blr	x8
	ldr	x8, [x24, #8]
	add	x0, x27, x28
	add	x1, x27, x23
	sub	x4, x29, #84
	sub	x5, x29, #88
	mov	x2, x0
	mov	x3, x21
	blr	x8
	add	x27, x27, x22
	add	x26, x26, x22
	subs	w19, w19, #1
	b.ne	LBB0_12
	b	LBB0_2
LBB0_13:
	ldp	x29, x30, [sp, #208]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #192]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #176]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #160]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #144]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #128]            ; 16-byte Folded Reload
	add	sp, sp, #224
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_restore_median_planar_il
.subsections_via_symbols
