	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function encode_alpha_plane
_encode_alpha_plane:                    ## @encode_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
	movq	%rcx, %r12
	movl	(%rdi), %r13d
	movl	$-1, %r15d
	movl	%r13d, %ecx
	shll	%cl, %r15d
	movl	%edx, %ebx
	movq	%rsi, %r14
	notl	%r15d
	shll	$8, %ebx
	movq	%rsi, %rdi
	callq	_put_bits_count
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movl	(%r12), %r12d
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	movl	%r12d, %esi
	movl	%r15d, %edx
	movl	%r13d, -52(%rbp)                ## 4-byte Spill
	movl	%r13d, %ecx
	callq	_put_alpha_diff
	movl	$1, %r14d
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_2 Depth 2
	movl	%r14d, %r13d
	movl	%r14d, %r14d
	incq	%r14
	xorl	%esi, %esi
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_2:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	-4(%rax,%r14,4), %r15d
	cmpl	%r12d, %r15d
	jne	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=2
	incl	%esi
	incq	%r14
	incl	%r13d
	cmpl	%r13d, %ebx
	jg	LBB0_2
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_1 Depth=1
	incl	%r13d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_put_alpha_run
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %esi
	movl	%r12d, %edx
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	callq	_put_alpha_diff
	movl	%r15d, %r12d
	cmpl	%r13d, %ebx
	jg	LBB0_1
	jmp	LBB0_5
LBB0_4:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_put_alpha_run
LBB0_5:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_flush_put_bits
	movq	%rbx, %rdi
	callq	_put_bits_count
	subl	-56(%rbp), %eax                 ## 4-byte Folded Reload
	sarl	$3, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_encode_alpha_plane
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function encode_alpha_plane
_encode_alpha_plane:                    ; @encode_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	x21, x3
	mov	x19, x1
	ldr	w22, [x0]
	mov	w8, #-1
	lsl	w8, w8, w22
	mvn	w24, w8
	lsl	w26, w2, #8
	mov	x0, x1
	bl	_put_bits_count
	mov	x20, x0
	ldr	w23, [x21]
	mov	x0, x19
	mov	x1, x23
	mov	x2, x24
	mov	x3, x22
	bl	_put_alpha_diff
	mov	w8, #1
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_2 Depth 2
	mov	x24, #0
	and	x27, x8, #0xffffffff
	add	x9, x21, w8, uxtw #2
LBB0_2:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w25, [x9, x24, lsl #2]
	cmp	w25, w23
	b.ne	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=2
	add	x24, x24, #1
	add	w10, w8, w24
	cmp	w26, w10
	b.gt	LBB0_2
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_1 Depth=1
	add	w8, w8, w24
	add	w28, w8, #1
	mov	x0, x19
	mov	x1, x24
	bl	_put_alpha_run
	mov	x0, x19
	mov	x1, x25
	mov	x2, x23
	mov	x3, x22
	bl	_put_alpha_diff
	add	x8, x27, x24
	add	x8, x8, #1
	mov	x23, x25
	cmp	w26, w28
	b.gt	LBB0_1
	b	LBB0_6
LBB0_5:
	mov	x0, x19
	mov	x1, x24
	bl	_put_alpha_run
LBB0_6:
	mov	x0, x19
	bl	_flush_put_bits
	mov	x0, x19
	bl	_put_bits_count
	sub	w8, w0, w20
	asr	w0, w8, #3
	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	_encode_alpha_plane
.subsections_via_symbols
