	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gradient_predict
_gradient_predict:                      ## @gradient_predict
	.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	$48, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -48(%rbp)                 ## 4-byte Spill
	movl	%r8d, %r11d
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	testl	%r8d, %r8d
	jle	LBB0_8
## %bb.1:
	leaq	-1(%r11), %rax
	movl	%r11d, %r8d
	andl	$3, %r8d
	cmpq	$3, %rax
	jae	LBB0_3
## %bb.2:
	xorl	%eax, %eax
	xorl	%edi, %edi
	jmp	LBB0_5
LBB0_3:
	movl	%r11d, %r9d
	andl	$-4, %r9d
	xorl	%eax, %eax
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rsi,%rax,4), %ebx
	subl	%edi, %ebx
	movl	%ebx, (%rdx,%rax,4)
	movl	4(%rsi,%rax,4), %edi
	subl	(%rsi,%rax,4), %edi
	movl	%edi, 4(%rdx,%rax,4)
	movl	8(%rsi,%rax,4), %edi
	subl	4(%rsi,%rax,4), %edi
	movl	%edi, 8(%rdx,%rax,4)
	movl	12(%rsi,%rax,4), %edi
	subl	8(%rsi,%rax,4), %edi
	movl	%edi, 12(%rdx,%rax,4)
	movl	12(%rsi,%rax,4), %edi
	addq	$4, %rax
	cmpq	%rax, %r9
	jne	LBB0_4
LBB0_5:
	testq	%r8, %r8
	je	LBB0_8
## %bb.6:
	leaq	(%rdx,%rax,4), %r9
	leaq	(%rsi,%rax,4), %r10
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r10,%rbx,4), %eax
	subl	%edi, %eax
	movl	%eax, (%r9,%rbx,4)
	movl	(%r10,%rbx,4), %edi
	incq	%rbx
	cmpq	%rbx, %r8
	jne	LBB0_7
LBB0_8:
	movq	%r11, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	cmpl	$2, -48(%rbp)                   ## 4-byte Folded Reload
	jl	LBB0_27
## %bb.9:
	movslq	-44(%rbp), %rdi                 ## 4-byte Folded Reload
	movq	%rcx, %rax
	notq	%rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	leaq	1(%rdi), %rax
	movq	%rax, -184(%rbp)                ## 8-byte Spill
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rdi,%rax), %rdx
	movq	%rdx, -176(%rbp)                ## 8-byte Spill
	leaq	(%rax,%rcx), %rdx
	movq	%rdx, -168(%rbp)                ## 8-byte Spill
	leaq	-1(%rax), %rdx
	leaq	-5(%rax), %rbx
	movq	%rbx, -160(%rbp)                ## 8-byte Spill
	shrq	$2, %rbx
	incq	%rbx
	movq	%rdx, -96(%rbp)                 ## 8-byte Spill
	andq	$-4, %rdx
	movq	%rdx, -144(%rbp)                ## 8-byte Spill
	incq	%rdx
	movq	%rdx, -136(%rbp)                ## 8-byte Spill
	movq	%rbx, %rdx
	movq	%rbx, -152(%rbp)                ## 8-byte Spill
	andq	$-2, %rbx
	movq	%rbx, -128(%rbp)                ## 8-byte Spill
	negq	%rax
	movq	%rax, -192(%rbp)                ## 8-byte Spill
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	leaq	(%rdx,%rdi,4), %r11
	addq	$20, %r11
	leaq	(,%rdi,4), %rax
	movq	%rax, -216(%rbp)                ## 8-byte Spill
	leaq	20(%rsi,%rcx,4), %r15
	leaq	(,%rcx,4), %rbx
	movq	%rdi, -112(%rbp)                ## 8-byte Spill
	leaq	(%rdx,%rdi,4), %rax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movl	$1, %r12d
	xorl	%r10d, %r10d
	movq	%rsi, %r14
	movq	%r15, %rax
	xorl	%r9d, %r9d
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rcx, -120(%rbp)                ## 8-byte Spill
	movq	%rbx, -208(%rbp)                ## 8-byte Spill
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_26:                                ##   in Loop: Header=BB0_10 Depth=1
	incl	%r12d
	incq	%r9
	movq	-216(%rbp), %rdx                ## 8-byte Reload
	addq	%rdx, %r11
	movq	-208(%rbp), %rbx                ## 8-byte Reload
	addq	%rbx, %rax
	movq	-120(%rbp), %rcx                ## 8-byte Reload
	addq	%rcx, %r10
	addq	%rdx, -104(%rbp)                ## 8-byte Folded Spill
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	cmpl	-48(%rbp), %r12d                ## 4-byte Folded Reload
	je	LBB0_27
LBB0_10:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_17 Depth 2
                                        ##     Child Loop BB0_25 Depth 2
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	(%r14,%rcx,4), %edx
	subl	(%r14), %edx
	leaq	(%r14,%rbx), %rcx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	-112(%rbp), %rcx                ## 8-byte Reload
	movl	%edx, (%rdi,%rcx,4)
	leaq	(%rdi,%rcx,4), %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	cmpl	$2, -44(%rbp)                   ## 4-byte Folded Reload
	jl	LBB0_26
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	$1, %r8d
	cmpq	$4, -96(%rbp)                   ## 8-byte Folded Reload
	jae	LBB0_12
LBB0_21:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	%r8, %r13
	testb	$1, -56(%rbp)                   ## 1-byte Folded Reload
	jne	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	(%r14,%r8,4), %ecx
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	addq	%r8, %rdx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	(%rdi,%rdx,4), %edx
	addl	-4(%rdi,%r8,4), %ecx
	subl	%ecx, %edx
	addl	(%rdi,%r8,4), %edx
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	%edx, (%rcx,%r8,4)
	leaq	1(%r8), %r13
LBB0_23:                                ##   in Loop: Header=BB0_10 Depth=1
	notq	%r8
	cmpq	-192(%rbp), %r8                 ## 8-byte Folded Reload
	je	LBB0_26
## %bb.24:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	subq	%r13, %rdi
	movq	-104(%rbp), %rcx                ## 8-byte Reload
	leaq	(%rcx,%r13,4), %rdx
	addq	%r10, %r13
	.p2align	4, 0x90
LBB0_25:                                ##   Parent Loop BB0_10 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rsi,%r13,4), %ecx
	addl	-24(%r15,%r13,4), %ecx
	movl	-4(%rsi,%r13,4), %ebx
	subl	%ecx, %ebx
	addl	-20(%r15,%r13,4), %ebx
	movl	%ebx, (%rdx)
	movl	4(%rsi,%r13,4), %ecx
	addl	-20(%r15,%r13,4), %ecx
	movl	(%rsi,%r13,4), %ebx
	subl	%ecx, %ebx
	addl	-16(%r15,%r13,4), %ebx
	movl	%ebx, 4(%rdx)
	addq	$2, %r13
	addq	$8, %rdx
	addq	$-2, %rdi
	jne	LBB0_25
	jmp	LBB0_26
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	%r9, %rcx
	imulq	-112(%rbp), %rcx                ## 8-byte Folded Reload
	movq	-184(%rbp), %rdx                ## 8-byte Reload
	leaq	(%rdx,%rcx), %r13
	addq	-176(%rbp), %rcx                ## 8-byte Folded Reload
	movq	%r9, %rdi
	movq	-120(%rbp), %rdx                ## 8-byte Reload
	imulq	%rdx, %rdi
	addq	%rdi, %rdx
	movq	%rdx, -200(%rbp)                ## 8-byte Spill
	movq	-168(%rbp), %rdx                ## 8-byte Reload
	addq	%rdi, %rdx
	addq	-56(%rbp), %rdi                 ## 8-byte Folded Reload
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	leaq	(%rbx,%r13,4), %r13
	leaq	(%rsi,%rdx,4), %rdx
	cmpq	%rdx, %r13
	leaq	(%rbx,%rcx,4), %rcx
	movq	-200(%rbp), %rdx                ## 8-byte Reload
	leaq	(%rsi,%rdx,4), %rdx
	setb	%bl
	cmpq	%rcx, %rdx
	leaq	(%rsi,%rdi,4), %rdx
	setb	%dil
	cmpq	%rdx, %r13
	setb	%dl
	cmpq	%rcx, %r14
	setb	%cl
	testb	%dil, %bl
	jne	LBB0_21
## %bb.13:                              ##   in Loop: Header=BB0_10 Depth=1
	andb	%cl, %dl
	jne	LBB0_21
## %bb.14:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpq	$4, -160(%rbp)                  ## 8-byte Folded Reload
	jae	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_10 Depth=1
	xorl	%edi, %edi
	jmp	LBB0_18
LBB0_16:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	-128(%rbp), %rdx                ## 8-byte Reload
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_17:                                ##   Parent Loop BB0_10 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movdqu	(%r14,%rdi,4), %xmm0
	movdqu	4(%r14,%rdi,4), %xmm1
	movdqu	-20(%rax,%rdi,4), %xmm2
	paddd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	movdqu	-16(%rax,%rdi,4), %xmm1
	paddd	%xmm0, %xmm1
	movdqu	%xmm1, -16(%r11,%rdi,4)
	movdqu	16(%r14,%rdi,4), %xmm0
	movdqu	20(%r14,%rdi,4), %xmm1
	movdqu	-4(%rax,%rdi,4), %xmm2
	paddd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	movdqu	(%rax,%rdi,4), %xmm1
	paddd	%xmm0, %xmm1
	movdqu	%xmm1, (%r11,%rdi,4)
	addq	$8, %rdi
	addq	$-2, %rdx
	jne	LBB0_17
LBB0_18:                                ##   in Loop: Header=BB0_10 Depth=1
	testb	$1, -152(%rbp)                  ## 1-byte Folded Reload
	je	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	%rdi, %rcx
	orq	$1, %rcx
	movdqu	(%r14,%rcx,4), %xmm0
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	addq	%rcx, %rdx
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movdqu	(%rbx,%rdx,4), %xmm1
	movdqu	(%rbx,%rdi,4), %xmm2
	paddd	%xmm0, %xmm2
	psubd	%xmm2, %xmm1
	movdqu	(%rbx,%rcx,4), %xmm0
	paddd	%xmm1, %xmm0
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movdqu	%xmm0, (%rdx,%rcx,4)
LBB0_20:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	-136(%rbp), %r8                 ## 8-byte Reload
	movq	-144(%rbp), %rcx                ## 8-byte Reload
	cmpq	%rcx, -96(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_26
	jmp	LBB0_21
LBB0_27:
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_gradient_predict
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gradient_predict
_gradient_predict:                      ; @gradient_predict
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	.cfi_offset w19, -8
	.cfi_offset w20, -16
	.cfi_offset w21, -24
	.cfi_offset w22, -32
	.cfi_offset w23, -40
	.cfi_offset w24, -48
	.cfi_offset w25, -56
	.cfi_offset w26, -64
	.cfi_offset w27, -72
	.cfi_offset w28, -80
                                        ; kill: def $w4 killed $w4 def $x4
	mov	w8, w4
	cmp	w4, #1
	b.lt	LBB0_3
; %bb.1:
	mov	w10, #0
	mov	x9, x8
	mov	x11, x1
	mov	x12, x2
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w13, [x11]
	sub	w10, w13, w10
	str	w10, [x12], #4
	ldr	w10, [x11], #4
	subs	x9, x9, #1
	b.ne	LBB0_2
LBB0_3:
	cmp	w5, #1
	b.le	LBB0_16
; %bb.4:
	mov	x9, #0
	sxtw	x10, w4
	add	x11, x10, #1
	add	x12, x10, x8
	add	x13, x8, x3
	sub	x14, x8, #1
	and	x15, x14, #0xfffffffffffffff0
	orr	x16, x15, #0x1
	lsl	x17, x10, #2
	add	x0, x2, x17
	lsl	x6, x3, #2
	add	x7, x1, x6
	mov	w19, #1
	mov	x20, x1
	mov	x21, x2
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x20, x20, x6
	add	w19, w19, #1
	add	x9, x9, #1
	add	x0, x0, x17
	add	x7, x7, x6
	cmp	w19, w5
	b.eq	LBB0_16
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_14 Depth 2
                                        ;     Child Loop BB0_10 Depth 2
	add	x21, x21, x10, lsl #2
	ldr	w22, [x20]
	ldr	w23, [x20, x3, lsl #2]
	sub	w22, w23, w22
	str	w22, [x21]
	cmp	w4, #2
	b.lt	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	x14, #16
	b.hs	LBB0_11
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	w23, #1
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=1
	lsl	x22, x23, #2
	sub	x23, x8, x23
LBB0_10:                                ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x24, x20, x22
	ldp	w24, w25, [x24, #-4]
	add	x26, x7, x22
	ldp	w27, w26, [x26, #-4]
	add	w25, w25, w27
	sub	w24, w24, w25
	add	w24, w24, w26
	str	w24, [x0, x22]
	add	x22, x22, #4
	subs	x23, x23, #1
	b.ne	LBB0_10
	b	LBB0_5
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=1
	mul	x22, x9, x10
	add	x23, x11, x22
	add	x23, x2, x23, lsl #2
	add	x22, x12, x22
	add	x24, x2, x22, lsl #2
	mul	x22, x9, x3
	add	x25, x22, x3
	add	x25, x1, x25, lsl #2
	add	x26, x13, x22
	add	x26, x1, x26, lsl #2
	add	x22, x22, x8
	add	x22, x1, x22, lsl #2
	cmp	x23, x22
	ccmp	x20, x24, #2, lo
	cset	w22, lo
	cmp	x25, x24
	ccmp	x23, x26, #2, lo
	b.lo	LBB0_8
; %bb.12:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	w23, #1
	tbnz	w22, #0, LBB0_9
; %bb.13:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	w22, #52
	mov	x23, x15
LBB0_14:                                ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x24, x20, x22
	ldp	q0, q1, [x24, #-48]
	ldp	q2, q3, [x24, #-16]
	ldur	q4, [x24, #-52]
	ldur	q5, [x24, #-36]
	ldur	q6, [x24, #-20]
	ldur	q7, [x24, #-4]
	add	x24, x7, x22
	ldur	q16, [x24, #-52]
	ldur	q17, [x24, #-36]
	ldur	q18, [x24, #-20]
	ldur	q19, [x24, #-4]
	ldp	q20, q21, [x24, #-48]
	ldp	q22, q23, [x24, #-16]
	add.4s	v0, v0, v16
	add.4s	v1, v1, v17
	add.4s	v2, v2, v18
	add.4s	v3, v3, v19
	sub.4s	v0, v4, v0
	sub.4s	v1, v5, v1
	sub.4s	v2, v6, v2
	sub.4s	v3, v7, v3
	add.4s	v0, v0, v20
	add.4s	v1, v1, v21
	add.4s	v2, v2, v22
	add.4s	v3, v3, v23
	add	x24, x0, x22
	stp	q0, q1, [x24, #-48]
	stp	q2, q3, [x24, #-16]
	add	x22, x22, #64
	subs	x23, x23, #16
	b.ne	LBB0_14
; %bb.15:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	x23, x16
	cmp	x14, x15
	b.eq	LBB0_5
	b	LBB0_9
LBB0_16:
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #80             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_gradient_predict
.subsections_via_symbols
