	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function encode_all_blocks
LCPI0_0:
	.space	16
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_encode_all_blocks:                     ## @encode_all_blocks
	.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	%rdi, %rbx
	movl	(%rdi), %ecx
	testl	%ecx, %ecx
	jle	LBB0_1
## %bb.2:
	movl	%esi, %r11d
	leaq	52(%rbx), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	4(%rbx), %eax
	xorl	%edi, %edi
	movl	%eax, %edx
	movq	%r11, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	(%rbx), %ecx
	movl	%eax, %edx
LBB0_20:                                ##   in Loop: Header=BB0_3 Depth=1
	incl	%edi
	cmpl	%ecx, %edi
	jge	LBB0_21
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	testl	%edx, %edx
	jle	LBB0_20
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	xorl	%r13d, %r13d
	xorl	%r15d, %r15d
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_5
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=2
	movq	$0, 32(%r12,%r14)
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rdx)
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_5 Depth=2
	incq	%r15
	addl	$3, %r13d
	movl	%eax, %edx
	cmpl	%eax, %r15d
	jge	LBB0_19
LBB0_5:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	imull	%edi, %edx
	movslq	%edx, %rcx
	addq	%r15, %rcx
	imulq	$56, %rcx, %r14
	cmpq	$0, 64(%rbx)
	movl	$0, %esi
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=2
	movq	_COLORSPACE_15_7@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=2
	movq	80(%rbx), %r12
	leaq	(%r12,%r14), %rdx
	movq	72(%rbx), %rcx
	addq	%r14, %rcx
	movl	%esi, 48(%r12,%r14)
	testl	%r11d, %r11d
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=2
	movq	$0, (%rdx)
	movq	16(%r12,%r14), %rax
	movq	%rax, 8(%r12,%r14)
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=2
	cmpq	$0, 40(%r12,%r14)
	je	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=2
	cmpq	$0, (%rdx)
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_5 Depth=2
	movq	8(%r12,%r14), %rax
	cmpq	16(%r12,%r14), %rax
	je	LBB0_14
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=2
	leaq	(%r12,%r14), %r8
	addq	$48, %r8
	movq	_HAS_DIFF_BLOCKS@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movl	%esi, (%r8)
LBB0_14:                                ##   in Loop: Header=BB0_5 Depth=2
	movl	8(%rbx), %esi
	movl	44(%rbx), %r10d
	leal	(%rsi,%rsi,2), %r9d
	movl	12(%rbx), %esi
	imull	%edi, %esi
	imull	%r9d, %esi
	movslq	%esi, %rsi
	shlq	$2, %rsi
	addq	56(%rbx), %rsi
	movl	16(%rbx), %edi
	imull	%r13d, %edi
	movslq	%edi, %rdi
	leaq	(%rsi,%rdi,4), %r8
	movl	48(%rbx), %eax
	subq	$8, %rsp
	movq	%rbx, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	pushq	%r11
	pushq	%r10
	pushq	%rax
	callq	_encode_block
	addq	$32, %rsp
	cmpq	$0, 40(%r12,%r14)
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_5 Depth=2
	incl	40(%rbx)
LBB0_16:                                ##   in Loop: Header=BB0_5 Depth=2
	movl	32(%r12,%r14), %ecx
	addl	%ecx, 36(%rbx)
	movl	24(%r12,%r14), %ecx
	addl	%ecx, 32(%rbx)
	testl	%eax, %eax
	jne	LBB0_22
## %bb.17:                              ##   in Loop: Header=BB0_5 Depth=2
	movl	4(%rbx), %eax
	movq	-56(%rbp), %r11                 ## 8-byte Reload
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	jmp	LBB0_18
LBB0_1:
	movl	4(%rbx), %eax
LBB0_21:
	imull	%ecx, %eax
	movl	8(%rbx), %ecx
	imull	24(%rbx), %ecx
	leal	(%rcx,%rcx,2), %ecx
	addl	%ecx, 20(%rbx)
	addl	%eax, 28(%rbx)
	xorl	%eax, %eax
LBB0_22:
	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	_HAS_DIFF_BLOCKS,4,2            ## @HAS_DIFF_BLOCKS
	.no_dead_strip	_encode_all_blocks
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function encode_all_blocks
_encode_all_blocks:                     ; @encode_all_blocks
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x0
	ldr	w9, [x0]
	cmp	w9, #0
	b.le	LBB0_18
; %bb.1:
	mov	x20, x1
	mov	w22, #0
	add	x21, x19, #52
	ldr	w8, [x19, #4]
	mov	w23, #56
Lloh0:
	adrp	x24, _COLORSPACE_15_7@GOTPAGE
Lloh1:
	ldr	x24, [x24, _COLORSPACE_15_7@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w9, [x19]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w22, w22, #1
	cmp	w22, w9
	b.ge	LBB0_19
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w26, #0
	mov	x27, #0
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=2
	madd	x9, x25, x23, x28
	str	xzr, [x9, #32]
	stp	xzr, xzr, [x2]
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=2
	add	x27, x27, #1
	add	w26, w26, #3
	cmp	w27, w8
	b.ge	LBB0_2
LBB0_8:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldp	x10, x28, [x19, #72]
	mul	w9, w22, w8
	add	x25, x27, w9, sxtw
	mul	x9, x25, x23
	add	x2, x28, x9
	ldr	x11, [x19, #64]
	ldr	w12, [x24]
	cmp	x11, #0
	csel	w11, wzr, w12, eq
	mov	x12, x2
	str	w11, [x12, #48]!
	cbz	w20, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	str	xzr, [x2]
	madd	x8, x25, x23, x28
	ldr	x11, [x8, #16]
	str	x11, [x8, #8]
	b	LBB0_14
LBB0_10:                                ;   in Loop: Header=BB0_8 Depth=2
	madd	x13, x25, x23, x28
	ldr	x13, [x13, #40]
	cbz	x13, LBB0_6
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=2
	ldr	x8, [x2]
	cbnz	x8, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=2
	madd	x8, x25, x23, x28
	ldp	x13, x8, [x8, #8]
	cmp	x13, x8
	b.eq	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_8 Depth=2
Lloh2:
	adrp	x8, _HAS_DIFF_BLOCKS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HAS_DIFF_BLOCKS@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	orr	w8, w8, w11
	str	w8, [x12]
LBB0_14:                                ;   in Loop: Header=BB0_8 Depth=2
	add	x3, x10, x9
	ldr	x8, [x19, #56]
	ldp	w9, w10, [x19, #8]
	add	w5, w9, w9, lsl #1
	mul	w9, w10, w22
	mul	w9, w9, w5
	add	x8, x8, w9, sxtw #2
	ldr	w9, [x19, #16]
	mul	w9, w26, w9
	add	x4, x8, w9, sxtw #2
	ldp	w7, w6, [x19, #44]
	str	w20, [sp]
	mov	x0, x19
	mov	x1, x21
	bl	_encode_block
	madd	x8, x25, x23, x28
	ldr	x8, [x8, #40]
	cbz	x8, LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_8 Depth=2
	ldr	w8, [x19, #40]
	add	w8, w8, #1
	str	w8, [x19, #40]
LBB0_16:                                ;   in Loop: Header=BB0_8 Depth=2
	madd	x8, x25, x23, x28
	ldur	q0, [x8, #24]
	ldr	d1, [x19, #32]
	xtn.2s	v0, v0
	add.2s	v0, v1, v0
	str	d0, [x19, #32]
	cbnz	w0, LBB0_20
; %bb.17:                               ;   in Loop: Header=BB0_8 Depth=2
	ldr	w8, [x19, #4]
	b	LBB0_7
LBB0_18:
	ldr	w8, [x19, #4]
LBB0_19:
	mov	w0, #0
	ldr	w10, [x19, #8]
	ldp	w12, w11, [x19, #20]
	mul	w10, w10, w11
	add	w10, w10, w10, lsl #1
	add	w10, w12, w10
	str	w10, [x19, #20]
	ldr	w10, [x19, #28]
	madd	w8, w8, w9, w10
	str	w8, [x19, #28]
LBB0_20:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_COLORSPACE_15_7,4,2            ; @COLORSPACE_15_7
	.comm	_HAS_DIFF_BLOCKS,4,2            ; @HAS_DIFF_BLOCKS
	.no_dead_strip	_encode_all_blocks
.subsections_via_symbols
