	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ff_mjpeg_encode_picture_frame  ## -- Begin function ff_mjpeg_encode_picture_frame
	.p2align	4, 0x90
_ff_mjpeg_encode_picture_frame:         ## @ff_mjpeg_encode_picture_frame
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	24(%rdi), %r12
	movdqu	64(%r12), %xmm0
	pshufd	$78, %xmm0, %xmm0               ## xmm0 = xmm0[2,3,0,1]
	movdqa	%xmm0, -80(%rbp)
	movdqu	48(%r12), %xmm0
	pshufd	$78, %xmm0, %xmm0               ## xmm0 = xmm0[2,3,0,1]
	movdqa	%xmm0, -64(%rbp)
	movdqu	32(%r12), %xmm0
	pshufd	$78, %xmm0, %xmm0               ## xmm0 = xmm0[2,3,0,1]
	movdqa	%xmm0, -112(%rbp)
	movdqu	16(%r12), %xmm0
	pshufd	$78, %xmm0, %xmm0               ## xmm0 = xmm0[2,3,0,1]
	movdqa	%xmm0, -96(%rbp)
	callq	_get_bits_diff
	movq	%rax, 16(%r14)
	movl	(%r12), %r9d
	testl	%r9d, %r9d
	jle	LBB0_1
## %bb.2:
	movq	8(%r12), %r8
	cmpl	$1, %r9d
	jne	LBB0_4
## %bb.3:
	xorl	%esi, %esi
	xorl	%edx, %edx
	jmp	LBB0_6
LBB0_1:
	xorl	%edx, %edx
	jmp	LBB0_9
LBB0_4:
	movl	%r9d, %r10d
	andl	$-2, %r10d
	leaq	16(%r8), %rbx
	xorl	%esi, %esi
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movslq	-16(%rbx), %rcx
	movslq	-12(%rbx), %rdi
	movl	%edi, %eax
	andl	$15, %eax
	addq	%rdx, %rax
	movq	-80(%rbp,%rcx,8), %rcx
	addq	(%rcx,%rdi,8), %rax
	movslq	-4(%rbx), %rcx
	movslq	(%rbx), %rdi
	movl	%edi, %edx
	andl	$15, %edx
	addq	%rax, %rdx
	movq	-80(%rbp,%rcx,8), %rax
	addq	(%rax,%rdi,8), %rdx
	addq	$2, %rsi
	addq	$24, %rbx
	cmpq	%rsi, %r10
	jne	LBB0_5
LBB0_6:
	testb	$1, %r9b
	je	LBB0_8
## %bb.7:
	leaq	(%rsi,%rsi,2), %rax
	movslq	(%r8,%rax,4), %rcx
	movslq	4(%r8,%rax,4), %rax
	movl	%eax, %esi
	andl	$15, %esi
	addq	%rsi, %rdx
	movq	-80(%rbp,%rcx,8), %rcx
	addq	(%rcx,%rax,8), %rdx
LBB0_8:
	addq	$7, %rdx
	shrq	$3, %rdx
LBB0_9:
	movq	%r14, -120(%rbp)                ## 8-byte Spill
	movq	%r14, %rdi
	movq	%rdx, %rsi
	callq	_ff_mpv_reallocate_putbitbuffer
	cmpl	$0, (%r12)
	jle	LBB0_14
## %bb.10:
	movq	-120(%rbp), %rax                ## 8-byte Reload
	leaq	8(%rax), %r15
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_11 Depth=1
	incq	%r14
	movslq	(%r12), %rax
	addq	$12, %rbx
	cmpq	%rax, %r14
	jge	LBB0_14
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rax
	movslq	(%rax,%rbx), %rcx
	movslq	4(%rax,%rbx), %r13
	movq	-80(%rbp,%rcx,8), %rax
	movq	(%rax,%r13,8), %rsi
	movq	-112(%rbp,%rcx,8), %rax
	movl	(%rax,%r13,4), %edx
	movq	%r15, %rdi
	callq	_put_bits
	andl	$15, %r13d
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	8(%r12), %rax
	movl	8(%rax,%rbx), %edx
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_put_sbits
	jmp	LBB0_13
LBB0_14:
	movl	$0, (%r12)
	movq	-120(%rbp), %rbx                ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_get_bits_diff
	movq	%rax, (%rbx)
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_16
## %bb.15:
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ff_mjpeg_encode_picture_frame  ; -- Begin function ff_mjpeg_encode_picture_frame
	.p2align	2
_ff_mjpeg_encode_picture_frame:         ; @ff_mjpeg_encode_picture_frame
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #72]
	ldr	x22, [x0, #24]
	ldp	x9, x8, [x22, #64]
	stp	x8, x9, [sp, #40]
	ldp	x9, x8, [x22, #48]
	stp	x8, x9, [sp, #56]
	ldp	x9, x8, [x22, #32]
	stp	x8, x9, [sp, #8]
	ldp	x9, x8, [x22, #16]
	stp	x8, x9, [sp, #24]
	bl	_get_bits_diff
	str	x0, [x19, #16]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	ldr	x9, [x22, #8]
	cmp	w8, #4
	b.hs	LBB0_4
; %bb.2:
	mov	x10, #0
	mov	x11, #0
	b	LBB0_7
LBB0_3:
	mov	x1, #0
	b	LBB0_10
LBB0_4:
	mov	x15, #0
	mov	x13, #0
	mov	x12, #0
	mov	x11, #0
	and	x10, x8, #0xfffffffc
	add	x14, x9, #24
	add	x16, sp, #40
	mov	x17, x10
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldpsw	x0, x1, [x14, #-24]
	and	x2, x1, #0xf
	ldpsw	x3, x4, [x14, #-12]
	and	x5, x4, #0xf
	ldpsw	x6, x7, [x14]
	and	x20, x7, #0xf
	ldpsw	x21, x23, [x14, #12]
	and	x24, x23, #0xf
	ldr	x0, [x16, x0, lsl #3]
	ldr	x3, [x16, x3, lsl #3]
	ldr	x6, [x16, x6, lsl #3]
	ldr	x21, [x16, x21, lsl #3]
	ldr	x0, [x0, x1, lsl #3]
	ldr	x1, [x3, x4, lsl #3]
	ldr	x3, [x6, x7, lsl #3]
	ldr	x4, [x21, x23, lsl #3]
	add	x15, x15, x2
	add	x15, x15, x0
	add	x13, x13, x5
	add	x13, x13, x1
	add	x12, x12, x20
	add	x12, x12, x3
	add	x11, x11, x24
	add	x11, x11, x4
	add	x14, x14, #48
	subs	x17, x17, #4
	b.ne	LBB0_5
; %bb.6:
	add	x13, x13, x15
	add	x12, x12, x13
	add	x11, x11, x12
	cmp	x10, x8
	b.eq	LBB0_9
LBB0_7:
	mov	w12, #12
	madd	x9, x10, x12, x9
	add	x9, x9, #4
	sub	x8, x8, x10
	add	x10, sp, #40
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldpsw	x12, x13, [x9, #-4]
	and	x14, x13, #0xf
	ldr	x12, [x10, x12, lsl #3]
	ldr	x12, [x12, x13, lsl #3]
	add	x11, x11, x14
	add	x11, x11, x12
	add	x9, x9, #12
	subs	x8, x8, #1
	b.ne	LBB0_8
LBB0_9:
	add	x8, x11, #7
	lsr	x1, x8, #3
LBB0_10:
	mov	x0, x19
	mov	x2, x1
	bl	_ff_mpv_reallocate_putbitbuffer
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.11:
	mov	x23, #0
	mov	x24, #0
	add	x20, x19, #8
	add	x25, sp, #40
	add	x26, sp, #8
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x24, x24, #1
	ldrsw	x8, [x22]
	add	x23, x23, #12
	cmp	x24, x8
	b.ge	LBB0_15
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22, #8]
	add	x8, x8, x23
	ldpsw	x9, x8, [x8]
	and	w21, w8, #0xf
	lsl	x9, x9, #3
	ldr	x10, [x25, x9]
	ldr	x1, [x10, x8, lsl #3]
	ldr	x9, [x26, x9]
	ldr	w2, [x9, x8, lsl #2]
	mov	x0, x20
	bl	_put_bits
	cbz	w21, LBB0_12
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	x8, [x22, #8]
	add	x8, x8, x23
	ldr	w2, [x8, #8]
	mov	x0, x20
	mov	x1, x21
	bl	_put_sbits
	b	LBB0_12
LBB0_15:
	str	wzr, [x22]
	mov	x0, x19
	bl	_get_bits_diff
	str	x0, [x19]
	ldr	x8, [sp, #72]
Lloh3:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh4:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.16:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_17:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
