	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function estimate_alpha_plane
_estimate_alpha_plane:                  ## @estimate_alpha_plane
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r13d
	movl	(%rdi), %ecx
	movl	$-1, %esi
	shll	%cl, %esi
	movq	%r8, %rbx
	notl	%esi
	shll	$8, %r13d
	movl	(%r8), %r15d
	movl	%r15d, %edi
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movl	%ecx, %edx
	callq	_est_alpha_diff
	movl	%eax, %r14d
	movl	$1, %eax
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_2 Depth 2
	movl	%eax, %esi
	leaq	(%rbx,%rsi,4), %rcx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_2:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rcx,%r12,4), %ebx
	cmpl	%r15d, %ebx
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=2
	incq	%r12
	leal	(%r12,%rax), %edx
	cmpl	%edx, %r13d
	jg	LBB0_2
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_1 Depth=1
	addl	%r12d, %eax
	incl	%eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	cmpl	$16, %r12d
	movl	$4, %eax
	movl	$15, %ecx
	cmovael	%ecx, %eax
	testl	%r12d, %r12d
	movl	$1, %ecx
	cmovel	%ecx, %eax
	addl	%eax, %r14d
	movl	%ebx, %edi
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movl	%r15d, %esi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	callq	_est_alpha_diff
	addl	%eax, %r14d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addq	%r12, %rax
	incq	%rax
	movl	%ebx, %r15d
	cmpl	-44(%rbp), %r13d                ## 4-byte Folded Reload
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	jg	LBB0_1
	jmp	LBB0_8
LBB0_5:
	decl	%r12d
	cmpl	$14, %r12d
	ja	LBB0_7
## %bb.6:
	addl	$4, %r14d
	jmp	LBB0_8
LBB0_7:
	addl	$15, %r14d
LBB0_8:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_estimate_alpha_plane
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function estimate_alpha_plane
_estimate_alpha_plane:                  ; @estimate_alpha_plane
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	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
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x4
	ldr	w20, [x0]
	mov	w8, #-1
	lsl	w8, w8, w20
	mvn	w1, w8
	lsl	w23, w3, #8
	ldr	w21, [x4]
	mov	x0, x21
	mov	x2, x20
	bl	_est_alpha_diff
	mov	w8, #1
	mov	w25, #15
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_2 Depth 2
	mov	x26, #0
	and	x27, x8, #0xffffffff
	add	x9, x19, w8, uxtw #2
LBB0_2:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w22, [x9, x26, lsl #2]
	cmp	w22, w21
	b.ne	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=2
	add	x26, x26, #1
	add	w10, w8, w26
	cmp	w23, w10
	b.gt	LBB0_2
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_1 Depth=1
	add	w8, w8, w26
	add	w28, w8, #1
	cmp	w26, #15
	mov	w8, #4
	csel	w8, w25, w8, hi
	cmp	w26, #0
	csinc	w8, w8, wzr, ne
	add	w24, w0, w8
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	bl	_est_alpha_diff
	add	w0, w0, w24
	add	x8, x27, x26
	add	x8, x8, #1
	mov	x21, x22
	cmp	w23, w28
	b.gt	LBB0_1
	b	LBB0_6
LBB0_5:
	sub	w8, w26, #1
	add	w9, w0, #15
	add	w10, w0, #4
	cmp	w8, #14
	csel	w0, w9, w10, hi
LBB0_6:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	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], #96             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_estimate_alpha_plane
.subsections_via_symbols
