	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function encode_block
_encode_block:                          ## @encode_block
	.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, %r15
	movq	%rdx, %rbx
	movl	(%rdx), %eax
	imull	4(%rdx), %eax
	addl	%eax, %eax
	leal	(%rax,%rax,2), %r14d
	movl	%r14d, -44(%rbp)
	movq	(%rdi), %r13
	movq	_COLORSPACE_15_7@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rdx)
	je	LBB0_2
## %bb.1:
	movl	24(%rbp), %eax
	movq	%rsi, %rdi
	movq	%rbx, %rsi
	movq	%r8, %rdx
	movl	%r9d, %ecx
	movl	%eax, %r8d
	callq	_encode_15_7
	jmp	LBB0_3
LBB0_2:
	movq	%rbx, %rdi
	movq	%r8, %rsi
	movl	%r9d, %edx
	callq	_encode_bgr
LBB0_3:
	leaq	24(%rbx), %r12
	cmpq	$0, 16(%rbx)
	jle	LBB0_9
## %bb.4:
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movl	16(%rbp), %r13d
	movl	%r14d, 24(%rbx)
	movl	28(%rbx), %esi
	movq	%rbx, %rdi
	movq	%r12, %rdx
	movl	%r13d, %ecx
	callq	_encode_zlib
	testl	%eax, %eax
	jne	LBB0_11
## %bb.5:
	cmpl	$0, 32(%rbp)
	jne	LBB0_10
## %bb.6:
	leaq	-44(%rbp), %rcx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	%r13d, %r8d
	callq	_encode_zlibprime
	testl	%eax, %eax
	jne	LBB0_11
## %bb.7:
	movl	-44(%rbp), %edx
	cmpl	(%r12), %edx
	jae	LBB0_10
## %bb.8:
	movl	%edx, 24(%rbx)
	movl	28(%rbx), %edi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_memcpy
	movq	_ZLIB_PRIME_COMPRESS_PREVIOUS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 8(%rbx)
	jmp	LBB0_10
LBB0_9:
	movl	$0, (%r12)
LBB0_10:
	xorl	%eax, %eax
LBB0_11:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_COLORSPACE_15_7,4,2            ## @COLORSPACE_15_7
	.comm	_ZLIB_PRIME_COMPRESS_PREVIOUS,4,2 ## @ZLIB_PRIME_COMPRESS_PREVIOUS
	.no_dead_strip	_encode_block
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function encode_block
_encode_block:                          ; @encode_block
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x21, x6
	mov	x22, x3
	mov	x19, x2
	ldp	w8, w9, [x2]
	mul	w8, w8, w9
	add	w8, w8, w8, lsl #1
	lsl	w24, w8, #1
	str	w24, [sp, #12]
	ldr	x20, [x0]
	ldr	w8, [x2, #8]
Lloh0:
	adrp	x9, _COLORSPACE_15_7@GOTPAGE
Lloh1:
	ldr	x9, [x9, _COLORSPACE_15_7@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	mov	x0, x1
	mov	x1, x19
	mov	x2, x4
	mov	x3, x5
	mov	x4, x7
	bl	_encode_15_7
	b	LBB0_3
LBB0_2:
	mov	x0, x19
	mov	x1, x4
	mov	x2, x5
	bl	_encode_bgr
LBB0_3:
	ldr	x8, [x19, #16]
	add	x23, x19, #24
	cmp	x8, #1
	b.lt	LBB0_7
; %bb.4:
	str	w24, [x19, #24]
	ldr	w1, [x19, #28]
	mov	x0, x19
	mov	x2, x23
	mov	x3, x21
	bl	_encode_zlib
	cbnz	w0, LBB0_8
; %bb.5:
	ldr	w8, [x29, #16]
	cbz	w8, LBB0_9
LBB0_6:
	mov	w0, #0
	b	LBB0_8
LBB0_7:
	mov	w0, #0
	str	wzr, [x23]
LBB0_8:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_9:
	add	x3, sp, #12
	mov	x0, x19
	mov	x1, x22
	mov	x2, x20
	mov	x4, x21
	bl	_encode_zlibprime
	cbnz	w0, LBB0_8
; %bb.10:
	ldr	w2, [sp, #12]
	ldr	w8, [x23]
	cmp	w2, w8
	b.hs	LBB0_6
; %bb.11:
	str	w2, [x19, #24]
	ldr	w0, [x19, #28]
	mov	x1, x20
	bl	_memcpy
	mov	w0, #0
Lloh3:
	adrp	x8, _ZLIB_PRIME_COMPRESS_PREVIOUS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ZLIB_PRIME_COMPRESS_PREVIOUS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	w9, [x19, #8]
	orr	w8, w9, w8
	str	w8, [x19, #8]
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_COLORSPACE_15_7,4,2            ; @COLORSPACE_15_7
	.comm	_ZLIB_PRIME_COMPRESS_PREVIOUS,4,2 ; @ZLIB_PRIME_COMPRESS_PREVIOUS
	.no_dead_strip	_encode_block
.subsections_via_symbols
