	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function restore_gradient_planar
_restore_gradient_planar:               ## @restore_gradient_planar
	.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	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r14d
	movl	%r8d, -76(%rbp)                 ## 4-byte Spill
                                        ## kill: def $ecx killed $ecx def $rcx
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, -96(%rbp)                 ## 8-byte Spill
	movq	%rdi, -128(%rbp)                ## 8-byte Spill
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movl	%ecx, %edi
	movl	$32, %esi
	callq	_FFMIN
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	testl	%r14d, %r14d
	jle	LBB0_15
## %bb.1:
	movl	16(%rbp), %eax
	notl	%eax
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	movslq	-44(%rbp), %r8                  ## 4-byte Folded Reload
	movl	%r8d, %r9d
	negl	%r9d
	movslq	%r9d, %rax
	movq	%rax, -160(%rbp)                ## 8-byte Spill
	movl	%r8d, %eax
	notl	%eax
	movq	%rax, -144(%rbp)                ## 8-byte Spill
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	addl	$-32, %eax
	movl	%eax, -84(%rbp)                 ## 4-byte Spill
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	decq	%rcx
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r8,4), %rax
	addq	$4, %rax
	movq	%rax, -136(%rbp)                ## 8-byte Spill
	shlq	$2, %r8
	movq	%rcx, -152(%rbp)                ## 8-byte Spill
	movq	%rcx, %rbx
	andq	$-2, %rbx
	negq	%rbx
	xorl	%esi, %esi
	movl	%r14d, -72(%rbp)                ## 4-byte Spill
	movq	%r8, -120(%rbp)                 ## 8-byte Spill
	movq	%r9, -112(%rbp)                 ## 8-byte Spill
	movq	%rbx, -104(%rbp)                ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	-72(%rbp), %r14d                ## 4-byte Reload
	movl	-80(%rbp), %esi                 ## 4-byte Reload
	cmpl	%r14d, %esi
	je	LBB0_15
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
                                        ##       Child Loop BB0_8 Depth 3
	movl	%esi, %eax
	movl	-76(%rbp), %r10d                ## 4-byte Reload
	imull	%r10d, %eax
	cltd
	idivl	%r14d
	movl	%eax, %ecx
	movl	-68(%rbp), %edi                 ## 4-byte Reload
	andl	%edi, %ecx
	incl	%esi
	movl	%esi, -80(%rbp)                 ## 4-byte Spill
	movl	%esi, %eax
	imull	%r10d, %eax
	cltd
	idivl	%r14d
	movl	%eax, %r10d
	andl	%edi, %r10d
	subl	%ecx, %r10d
	je	LBB0_14
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	imull	-44(%rbp), %ecx                 ## 4-byte Folded Reload
	movslq	%ecx, %r14
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r14,4), %r12
	subl	$-128, (%rax,%r14,4)
	movq	%r12, %rdi
	movq	%r12, %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%ecx, %ecx
	movq	-128(%rbp), %rax                ## 8-byte Reload
	movl	%r10d, -48(%rbp)                ## 4-byte Spill
	callq	*8(%rax)
	movl	-48(%rbp), %r10d                ## 4-byte Reload
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	movq	-112(%rbp), %r9                 ## 8-byte Reload
	movq	-120(%rbp), %r8                 ## 8-byte Reload
	cmpl	$2, %r10d
	jl	LBB0_14
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-136(%rbp), %rax                ## 8-byte Reload
	leaq	(%rax,%r14,4), %r15
	movl	$1, %r14d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=2
	incl	%r14d
	addq	%r8, %r15
	movq	%r13, %r12
	cmpl	%r10d, %r14d
	je	LBB0_14
LBB0_5:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_8 Depth 3
	leaq	(%r12,%r8), %r13
	movq	-160(%rbp), %rax                ## 8-byte Reload
	movl	(%r13,%rax,4), %eax
	addl	(%r12,%r8), %eax
	movzbl	%al, %ecx
	movl	%ecx, (%r12,%r8)
	cmpl	$2, -52(%rbp)                   ## 4-byte Folded Reload
	jl	LBB0_11
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=2
	movl	$1, %eax
	je	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=2
	movl	$1, %eax
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_5 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movl	(%r12,%rax,4), %edx
	leaq	(%r9,%rax), %rsi
	leal	-1(%rsi), %edi
	movslq	%edi, %rdi
	subl	(%r13,%rdi,4), %edx
	addl	%ecx, %edx
	addl	-4(%r15,%rax,4), %edx
	movzbl	%dl, %ecx
	movl	%ecx, -4(%r15,%rax,4)
	movl	4(%r12,%rax,4), %ecx
	movslq	%esi, %rsi
	subl	(%r13,%rsi,4), %ecx
	addl	%edx, %ecx
	addl	(%r15,%rax,4), %ecx
	movzbl	%cl, %ecx
	movl	%ecx, (%r15,%rax,4)
	leaq	(%rbx,%rax), %rdx
	addq	$2, %rdx
	addq	$2, %rax
	cmpq	$1, %rdx
	jne	LBB0_8
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=2
	testb	$1, -152(%rbp)                  ## 1-byte Folded Reload
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=2
	movl	(%r12,%rax,4), %edx
	movq	-144(%rbp), %rsi                ## 8-byte Reload
	addl	%eax, %esi
	movslq	%esi, %rsi
	subl	(%r13,%rsi,4), %edx
	addl	%ecx, %edx
	addl	(%r13,%rax,4), %edx
	movzbl	%dl, %ecx
	movl	%ecx, (%r13,%rax,4)
LBB0_11:                                ##   in Loop: Header=BB0_5 Depth=2
	cmpl	$33, -64(%rbp)                  ## 4-byte Folded Reload
	jl	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_5 Depth=2
	leaq	128(%r13), %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	-84(%rbp), %edx                 ## 4-byte Reload
	movq	-128(%rbp), %rax                ## 8-byte Reload
	callq	*(%rax)
	movl	-48(%rbp), %r10d                ## 4-byte Reload
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	movq	-112(%rbp), %r9                 ## 8-byte Reload
	movq	-120(%rbp), %r8                 ## 8-byte Reload
	jmp	LBB0_13
LBB0_15:
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_restore_gradient_planar
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function restore_gradient_planar
_restore_gradient_planar:               ; @restore_gradient_planar
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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	x26, x6
	mov	x22, x5
	str	w4, [sp, #24]                   ; 4-byte Folded Spill
	mov	x21, x3
	stp	x0, x2, [sp, #48]               ; 16-byte Folded Spill
	str	x1, [sp, #8]                    ; 8-byte Folded Spill
	mov	x0, x3
	mov	w1, #32
	bl	_FFMIN
	cmp	w22, #1
	b.lt	LBB0_12
; %bb.1:
	mov	x25, x0
	mov	w10, #0
	mvn	w8, w26
	stp	w8, w22, [sp, #16]              ; 8-byte Folded Spill
	ldr	x9, [sp, #56]                   ; 8-byte Folded Reload
	neg	w20, w9
	mov	x8, x20
	sxtw	x23, w8
	sub	w8, w21, #32
	str	w8, [sp, #44]                   ; 4-byte Folded Spill
	mov	w19, w0
	sbfiz	x26, x9, #2, #32
	add	x8, x26, #4
	str	x8, [sp, #32]                   ; 8-byte Folded Spill
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w22, [sp, #20]                  ; 4-byte Folded Reload
	ldr	w10, [sp, #28]                  ; 4-byte Folded Reload
	cmp	w10, w22
	b.eq	LBB0_12
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
                                        ;       Child Loop BB0_9 Depth 3
	ldr	w9, [sp, #24]                   ; 4-byte Folded Reload
	mul	w8, w10, w9
	sdiv	w8, w8, w22
	ldr	w11, [sp, #16]                  ; 4-byte Folded Reload
	and	w8, w8, w11
	add	w10, w10, #1
	str	w10, [sp, #28]                  ; 4-byte Folded Spill
	mul	w9, w10, w9
	sdiv	w9, w9, w22
	and	w9, w9, w11
	subs	w22, w9, w8
	b.eq	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x9, [sp, #56]                   ; 8-byte Folded Reload
	mul	w8, w8, w9
	ldr	x9, [sp, #8]                    ; 8-byte Folded Reload
	add	x27, x9, w8, sxtw #2
	ldr	w8, [x27]
	add	w8, w8, #128
	str	w8, [x27]
	ldr	x8, [sp, #48]                   ; 8-byte Folded Reload
	ldr	x8, [x8, #8]
	mov	x0, x27
	mov	x1, x27
	mov	x2, x21
	mov	w3, #0
	blr	x8
	cmp	w22, #2
	b.lt	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w24, #1
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=2
	add	w24, w24, #1
	mov	x27, x28
	cmp	w24, w22
	b.eq	LBB0_2
LBB0_7:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_9 Depth 3
	add	x28, x27, x26
	ldr	w8, [x28]
	ldr	w9, [x28, x23, lsl #2]
	add	w8, w9, w8
	and	w8, w8, #0xff
	str	w8, [x28]
	cmp	w25, #2
	b.lt	LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	ldr	x9, [sp, #32]                   ; 8-byte Folded Reload
	mov	w10, #1
LBB0_9:                                 ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_7 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	w11, [x27, x10, lsl #2]
	add	w12, w20, w10
	sub	w12, w12, #1
	ldr	w12, [x28, w12, sxtw #2]
	sub	w11, w11, w12
	add	w8, w11, w8
	ldr	w11, [x27, x9]
	add	w8, w8, w11
	and	w8, w8, #0xff
	str	w8, [x27, x9]
	add	x10, x10, #1
	add	x9, x9, #4
	cmp	x19, x10
	b.ne	LBB0_9
LBB0_10:                                ;   in Loop: Header=BB0_7 Depth=2
	cmp	w21, #33
	b.lt	LBB0_6
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=2
	ldp	x8, x1, [sp, #48]               ; 16-byte Folded Reload
	ldr	x8, [x8]
	add	x0, x28, #128
                                        ; kill: def $w1 killed $w1 killed $x1
	ldr	w2, [sp, #44]                   ; 4-byte Folded Reload
	blr	x8
	b	LBB0_6
LBB0_12:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_restore_gradient_planar
.subsections_via_symbols
