	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r12d
	movq	(%rdi), %rax
	movq	32(%rdi), %rbx
	movl	%edx, %ecx
	andl	$1, %ecx
	incl	%ecx
	xorl	%r13d, %r13d
	cmpl	$4, %edx
	cmovgel	%ecx, %r13d
	movq	%rsi, -88(%rbp)                 ## 8-byte Spill
	movl	(%rsi), %edx
	movl	%edx, %esi
	subl	(%rax,%r13,4), %esi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	addq	$16, %rdi
	cmpl	$3, %r12d
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	jg	LBB0_2
## %bb.1:
	movl	40(%rbx), %ecx
	movl	%edx, %r14d
	movl	44(%rbx), %edx
	callq	_ff_mjpeg_encode_dc
	movl	%r14d, %edx
	leaq	32(%rbx), %rax
	addq	$24, %rbx
	jmp	LBB0_3
LBB0_2:
	movl	16(%rbx), %ecx
	movl	%edx, %r14d
	movl	20(%rbx), %edx
	callq	_ff_mjpeg_encode_dc
	movl	%r14d, %edx
	leaq	8(%rbx), %rax
LBB0_3:
	movq	(%rbx), %r14
	movq	(%rax), %r15
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rax
	movl	%edx, (%rax,%r13,4)
	movq	8(%rcx), %rax
	movslq	%r12d, %rcx
	movl	(%rax,%rcx,4), %eax
	testl	%eax, %eax
	jle	LBB0_14
## %bb.4:
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	incq	%rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	xorl	%r13d, %r13d
	movl	$1, %edx
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	%ebx, %edi
	negl	%edi
	cmovsl	%ebx, %edi
	movl	%ebx, %eax
	sarl	$31, %eax
	addl	%ebx, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	callq	_av_log2_16bit
                                        ## kill: def $eax killed $eax def $rax
	leal	1(%rax), %ebx
	shll	$4, %r13d
	orl	%ebx, %r13d
	movslq	%r13d, %rax
	movl	(%r15,%rax,4), %esi
	movl	(%r14,%rax,4), %edx
	movq	%r12, %rdi
	callq	_put_bits
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_put_sbits
	xorl	%r13d, %r13d
	movq	-96(%rbp), %rdx                 ## 8-byte Reload
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	incq	%rdx
	cmpq	-80(%rbp), %rdx                 ## 8-byte Folded Reload
	je	LBB0_10
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	24(%rax), %rax
	movslq	(%rax,%rdx,4), %rax
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx,%rax,4), %ebx
	testl	%ebx, %ebx
	je	LBB0_13
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%rdx, -96(%rbp)                 ## 8-byte Spill
	cmpl	$16, %r13d
	jl	LBB0_8
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	960(%r15), %esi
	movl	960(%r14), %edx
	movq	%r12, %rdi
	callq	_put_bits
	leal	-16(%r13), %eax
	cmpl	$31, %r13d
	movl	%eax, %r13d
	ja	LBB0_7
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=1
	incl	%r13d
	jmp	LBB0_9
LBB0_10:
	cmpl	$63, -72(%rbp)                  ## 4-byte Folded Reload
	jl	LBB0_14
## %bb.11:
	testl	%r13d, %r13d
	jne	LBB0_14
## %bb.12:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movl	(%r15), %esi
	movl	(%r14), %edx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_put_bits                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.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, #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	x22, x2
	mov	x19, x1
	mov	x20, x0
	ldr	x24, [x0, #32]
	and	w8, w2, #0x1
	cmp	w2, #4
	csinc	w23, wzr, w8, lt
	ldr	w26, [x1]
	ldr	x8, [x0]
	ldr	w8, [x8, w23, uxtw #2]
	sub	w1, w26, w8
	add	x21, x0, #16
	cmp	w2, #3
	b.gt	LBB0_2
; %bb.1:
	ldp	w3, w2, [x24, #40]
	mov	x0, x21
	bl	_ff_mjpeg_encode_dc
	add	x8, x24, #32
	add	x24, x24, #24
	b	LBB0_3
LBB0_2:
	ldp	w3, w2, [x24, #16]
	mov	x0, x21
	bl	_ff_mjpeg_encode_dc
	add	x8, x24, #8
LBB0_3:
	ldr	x24, [x24]
	ldr	x25, [x8]
	ldp	x8, x9, [x20]
	str	w26, [x8, x23, lsl #2]
	ldr	w8, [x9, w22, sxtw #2]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.4:
	mov	w26, #0
	str	x8, [sp, #8]                    ; 8-byte Folded Spill
	add	x27, x8, #1
	mov	w28, #1
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	cmp	w22, #0
	cneg	w0, w22, mi
	add	w22, w22, w22, asr #31
	bl	_av_log2_16bit
	add	w23, w0, #1
	orr	w8, w23, w26, lsl #4
	sbfiz	x8, x8, #2, #32
	ldr	w1, [x25, x8]
	ldr	w2, [x24, x8]
	mov	x0, x21
	bl	_put_bits
	mov	x0, x21
	mov	x1, x23
	mov	x2, x22
	bl	_put_sbits
	mov	w26, #0
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x28, x28, #1
	cmp	x28, x27
	b.eq	LBB0_11
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	ldr	x8, [x20, #24]
	ldrsw	x8, [x8, x28, lsl #2]
	ldr	w22, [x19, x8, lsl #2]
	cbz	w22, LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	cmp	w26, #16
	b.lt	LBB0_5
LBB0_9:                                 ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w1, [x25, #960]
	ldr	w2, [x24, #960]
	mov	x0, x21
	bl	_put_bits
	sub	w8, w26, #16
	cmp	w26, #31
	mov	x26, x8
	b.hi	LBB0_9
	b	LBB0_5
LBB0_10:                                ;   in Loop: Header=BB0_7 Depth=1
	add	w26, w26, #1
	b	LBB0_6
LBB0_11:
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	cmp	w8, #63
	b.lt	LBB0_14
; %bb.12:
	cbnz	w26, LBB0_14
; %bb.13:
	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
LBB0_14:
	ldr	w1, [x25]
	ldr	w2, [x24]
	mov	x0, x21
	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
	b	_put_bits
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_encode_block
.subsections_via_symbols
