	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mpeg4_encode_block
_mpeg4_encode_block:                    ## @mpeg4_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	%r8, %r15
	movq	%rsi, %r12
	movq	16(%rbp), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %rax
	movslq	%edx, %rsi
	movl	(%rax,%rsi,4), %r14d
	cmpq	$0, 8(%rdi)
	je	LBB0_3
## %bb.1:
	movq	%r9, %rdi
	movl	%ecx, %esi
	callq	_mpeg4_encode_dc
	testl	%r14d, %r14d
	jle	LBB0_18
## %bb.2:
	movl	$1, %ebx
	movq	_uni_mpeg4_intra_rl_bits@GOTPCREL(%rip), %rax
	movq	_uni_mpeg4_intra_rl_len@GOTPCREL(%rip), %rcx
	jmp	LBB0_5
LBB0_3:
	testl	%r14d, %r14d
	js	LBB0_18
## %bb.4:
	xorl	%ebx, %ebx
	movq	_uni_mpeg4_inter_rl_bits@GOTPCREL(%rip), %rax
	movq	_uni_mpeg4_inter_rl_len@GOTPCREL(%rip), %rcx
LBB0_5:
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	(%rcx), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leal	-1(%rbx), %esi
	movl	%ebx, %r13d
	cmpl	%r14d, %ebx
	jae	LBB0_14
## %bb.6:
	shll	$14, %ebx
	addl	$31449088, %ebx                 ## imm = 0x1DFE000
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=1
	shll	$14, %esi
	movl	%ebx, %eax
	subl	%esi, %eax
	addl	%edx, %edx
	andl	$8190, %edx                     ## imm = 0x1FFE
	orl	%eax, %edx
	orl	$1, %edx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	$30, %esi
                                        ## kill: def $edx killed $edx killed $rdx
LBB0_11:                                ##   in Loop: Header=BB0_7 Depth=1
	callq	_put_bits
	movl	%r13d, %esi
LBB0_12:                                ##   in Loop: Header=BB0_7 Depth=1
	incq	%r13
	addl	$16384, %ebx                    ## imm = 0x4000
	cmpq	%r13, %r14
	je	LBB0_13
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15,%r13,8), %rax
	movl	(%r12,%rax,4), %edx
	testl	%edx, %edx
	je	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	leal	64(%rdx), %eax
	cmpl	$127, %eax
	ja	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	negl	%esi
	addq	%r13, %rsi
	decq	%rsi
	xorl	%edi, %edi
                                        ## kill: def $esi killed $esi killed $rsi
	movl	%eax, %edx
	callq	_UNI_MPEG4_ENC_INDEX
	cltq
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx,%rax,8), %esi
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx,%rax,4), %edx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_11
LBB0_18:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	%r14, %r13
	movl	%r14d, %ebx
LBB0_14:
	movq	(%r15,%r13,8), %rax
	movl	(%r12,%rax,4), %eax
	notl	%esi
	addl	%ebx, %esi
	leal	64(%rax), %edx
	cmpl	$127, %edx
	ja	LBB0_16
## %bb.15:
	movl	$1, %edi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_UNI_MPEG4_ENC_INDEX
	cltq
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx,%rax,8), %esi
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx,%rax,4), %edx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_17
LBB0_16:
	shll	$14, %esi
	andl	$4095, %eax                     ## imm = 0xFFF
	leal	(%rsi,%rax,2), %edx
	addl	$32514049, %edx                 ## imm = 0x1F02001
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	$30, %esi
LBB0_17:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_put_bits                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_uni_mpeg4_intra_rl_bits,8,3    ## @uni_mpeg4_intra_rl_bits
	.comm	_uni_mpeg4_intra_rl_len,8,3     ## @uni_mpeg4_intra_rl_len
	.comm	_uni_mpeg4_inter_rl_bits,8,3    ## @uni_mpeg4_inter_rl_bits
	.comm	_uni_mpeg4_inter_rl_len,8,3     ## @uni_mpeg4_inter_rl_len
	.no_dead_strip	_mpeg4_encode_block
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mpeg4_encode_block
_mpeg4_encode_block:                    ; @mpeg4_encode_block
	.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, x6
	mov	x20, x4
	mov	x21, x1
	ldp	x8, x9, [x0]
	ldr	w22, [x8, w2, sxtw #2]
	cbz	x9, LBB0_3
; %bb.1:
	mov	x0, x5
	mov	x1, x3
	bl	_mpeg4_encode_dc
	cmp	w22, #1
	b.lt	LBB0_13
; %bb.2:
	mov	w23, #1
Lloh0:
	adrp	x8, _uni_mpeg4_intra_rl_bits@GOTPAGE
Lloh1:
	ldr	x8, [x8, _uni_mpeg4_intra_rl_bits@GOTPAGEOFF]
Lloh2:
	adrp	x9, _uni_mpeg4_intra_rl_len@GOTPAGE
Lloh3:
	ldr	x9, [x9, _uni_mpeg4_intra_rl_len@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:
	tbnz	w22, #31, LBB0_13
; %bb.4:
	mov	w23, #0
Lloh4:
	adrp	x8, _uni_mpeg4_inter_rl_bits@GOTPAGE
Lloh5:
	ldr	x8, [x8, _uni_mpeg4_inter_rl_bits@GOTPAGEOFF]
Lloh6:
	adrp	x9, _uni_mpeg4_inter_rl_len@GOTPAGE
Lloh7:
	ldr	x9, [x9, _uni_mpeg4_inter_rl_len@GOTPAGEOFF]
LBB0_5:
	mov	w10, #57344
	movk	w10, #479, lsl #16
	ldr	x24, [x8]
	ldr	x25, [x9]
	sub	w8, w23, #1
	mov	w9, w23
	cmp	w23, w22
	b.hs	LBB0_15
; %bb.6:
	add	x27, x20, x9, lsl #3
	sub	x28, x22, x9
	mov	w9, #57344
	movk	w9, #479, lsl #16
	add	w26, w9, w23, lsl #14
	b	LBB0_10
LBB0_7:                                 ;   in Loop: Header=BB0_10 Depth=1
	sub	w8, w26, w8, lsl #14
	ubfiz	w9, w9, #1, #12
	orr	w8, w9, w8
	orr	w2, w8, #0x1
	mov	x0, x19
	mov	w1, #30
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=1
	bl	_put_bits
	mov	x8, x23
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x27, x27, #8
	add	w23, w23, #1
	add	w26, w26, #4, lsl #12           ; =16384
	subs	x28, x28, #1
	b.eq	LBB0_14
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x27]
	ldr	w9, [x21, x9, lsl #2]
	cbz	w9, LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	add	w2, w9, #64
	cmp	w2, #127
	b.hi	LBB0_7
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	mvn	w8, w8
	add	w1, w8, w23
	mov	w0, #0
	bl	_UNI_MPEG4_ENC_INDEX
	ldr	x1, [x25, w0, sxtw #3]
	ldr	w2, [x24, w0, sxtw #2]
	mov	x0, x19
                                        ; kill: def $w1 killed $w1 killed $x1
	b	LBB0_8
LBB0_13:
	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
LBB0_14:
	mov	x9, x22
	mov	x23, x22
	mov	w10, #57344
	movk	w10, #479, lsl #16
LBB0_15:
	ldr	x9, [x20, x9, lsl #3]
	ldr	w9, [x21, x9, lsl #2]
	mvn	w8, w8
	add	w1, w23, w8
	add	w2, w9, #64
	cmp	w2, #127
	b.hi	LBB0_17
; %bb.16:
	mov	w0, #1
	bl	_UNI_MPEG4_ENC_INDEX
	ldr	x1, [x25, w0, sxtw #3]
	ldr	w2, [x24, w0, sxtw #2]
	mov	x0, x19
                                        ; kill: def $w1 killed $w1 killed $x1
	b	LBB0_18
LBB0_17:
	add	w8, w10, w1, lsl #14
	add	w8, w8, #260, lsl #12           ; =1064960
	ubfiz	w9, w9, #1, #12
	orr	w8, w9, w8
	orr	w2, w8, #0x1
	mov	x0, x19
	mov	w1, #30
LBB0_18:
	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
	b	_put_bits
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_uni_mpeg4_intra_rl_bits,8,3    ; @uni_mpeg4_intra_rl_bits
	.comm	_uni_mpeg4_intra_rl_len,8,3     ; @uni_mpeg4_intra_rl_len
	.comm	_uni_mpeg4_inter_rl_bits,8,3    ; @uni_mpeg4_inter_rl_bits
	.comm	_uni_mpeg4_inter_rl_len,8,3     ; @uni_mpeg4_inter_rl_len
	.no_dead_strip	_mpeg4_encode_block
.subsections_via_symbols
