	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ljpeg_encode_frame
_ljpeg_encode_frame:                    ## @ljpeg_encode_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r12
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	16(%rdi), %r13
	movl	(%rdi), %r9d
	movl	4(%rdi), %ecx
	movq	(%r13), %rax
	movq	8(%r13), %rsi
	movl	(%rax), %edi
	leal	(%r9,%rdi), %eax
	decl	%eax
	cltd
	idivl	%edi
	movl	%eax, %r8d
	movl	(%rsi), %esi
	leal	(%rcx,%rsi), %eax
	decl	%eax
	cltd
	idivl	%esi
	movq	_AV_INPUT_BUFFER_MIN_SIZE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r10d
	movq	8(%r15), %rdx
	movq	_AV_PIX_FMT_BGR0@GOTPCREL(%rip), %rbx
	movq	_AV_PIX_FMT_BGR24@GOTPCREL(%rip), %r11
	cmpq	(%rbx), %rdx
	je	LBB0_2
## %bb.1:
	cmpq	(%r11), %rdx
	je	LBB0_2
## %bb.3:
	movq	_AV_PIX_FMT_BGRA@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rdx
	jne	LBB0_5
## %bb.4:
	imull	%r9d, %ecx
	shll	$4, %ecx
	jmp	LBB0_6
LBB0_2:
	imull	%r9d, %ecx
	shll	$2, %ecx
	leal	(%rcx,%rcx,2), %ecx
	jmp	LBB0_6
LBB0_5:
	imull	%r8d, %edi
	imull	%esi, %edi
	imull	%eax, %edi
	shll	$2, %edi
	leal	(%rdi,%rdi,2), %ecx
LBB0_6:
	addl	%r10d, %ecx
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	%ecx, %edx
	xorl	%ecx, %ecx
	callq	_ff_alloc_packet2
	testl	%eax, %eax
	js	LBB0_7
## %bb.8:
	movl	16(%r14), %esi
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	8(%r14), %rdx
	leaq	-48(%rbp), %r14
	movq	%r14, %rdi
	callq	_init_put_bits
	leaq	24(%r13), %rdx
	movl	16(%r13), %r8d
	movl	20(%r13), %ecx
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	%r8d, %r9d
	callq	_ff_mjpeg_encode_picture_header
	movq	%r14, %rdi
	callq	_put_bits_count
	movl	%eax, %r13d
	movq	8(%r15), %rax
	movq	_AV_PIX_FMT_BGR0@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_11
## %bb.9:
	movq	_AV_PIX_FMT_BGRA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_11
## %bb.10:
	movq	_AV_PIX_FMT_BGR24@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_11
## %bb.12:
	leaq	-48(%rbp), %rsi
	movq	%r15, %rdi
	movq	%r12, %rdx
	callq	_ljpeg_encode_yuv
	jmp	LBB0_13
LBB0_7:
	movl	%eax, %r14d
	jmp	LBB0_15
LBB0_11:
	leaq	-48(%rbp), %rsi
	movq	%r15, %rdi
	movq	%r12, %rdx
	callq	_ljpeg_encode_bgr
LBB0_13:
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_15
## %bb.14:
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_emms_c
	movl	%r13d, %esi
	sarl	$3, %esi
	leaq	-48(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_ff_mjpeg_escape_FF
	movq	%rbx, %rdi
	movl	%r13d, %esi
	callq	_ff_mjpeg_encode_picture_trailer
	movq	%rbx, %rdi
	callq	_flush_put_bits
	movq	%rbx, %rdi
	callq	_put_bits_ptr
	subq	-48(%rbp), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, 8(%rcx)
	movq	_AV_PKT_FLAG_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%rcx)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
LBB0_15:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_INPUT_BUFFER_MIN_SIZE,4,2   ## @AV_INPUT_BUFFER_MIN_SIZE
	.comm	_AV_PIX_FMT_BGR0,8,3            ## @AV_PIX_FMT_BGR0
	.comm	_AV_PIX_FMT_BGR24,8,3           ## @AV_PIX_FMT_BGR24
	.comm	_AV_PIX_FMT_BGRA,8,3            ## @AV_PIX_FMT_BGRA
	.comm	_AV_PKT_FLAG_KEY,4,2            ## @AV_PKT_FLAG_KEY
	.no_dead_strip	_ljpeg_encode_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ljpeg_encode_frame
_ljpeg_encode_frame:                    ; @ljpeg_encode_frame
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x19, x3
	mov	x21, x2
	mov	x20, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _AV_INPUT_BUFFER_MIN_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_INPUT_BUFFER_MIN_SIZE@GOTPAGEOFF]
	ldp	w10, w9, [x0]
Lloh2:
	ldr	w8, [x8]
	ldp	x11, x23, [x0, #8]
Lloh3:
	adrp	x26, _AV_PIX_FMT_BGR0@GOTPAGE
Lloh4:
	ldr	x26, [x26, _AV_PIX_FMT_BGR0@GOTPAGEOFF]
	ldr	x12, [x26]
Lloh5:
	adrp	x24, _AV_PIX_FMT_BGR24@GOTPAGE
Lloh6:
	ldr	x24, [x24, _AV_PIX_FMT_BGR24@GOTPAGEOFF]
Lloh7:
	adrp	x25, _AV_PIX_FMT_BGRA@GOTPAGE
Lloh8:
	ldr	x25, [x25, _AV_PIX_FMT_BGRA@GOTPAGEOFF]
	cmp	x11, x12
	b.eq	LBB0_4
; %bb.1:
	ldr	x12, [x24]
	cmp	x11, x12
	b.eq	LBB0_4
; %bb.2:
	ldr	x12, [x25]
	cmp	x11, x12
	b.ne	LBB0_5
; %bb.3:
	mul	w9, w9, w10
	lsl	w9, w9, #4
	b	LBB0_7
LBB0_4:
	mul	w9, w9, w10
	b	LBB0_6
LBB0_5:
	ldp	x11, x12, [x23]
	ldr	w11, [x11]
	add	w10, w10, w11
	sub	w10, w10, #1
	sdiv	w10, w10, w11
	ldr	w12, [x12]
	add	w9, w9, w12
	sub	w9, w9, #1
	sdiv	w9, w9, w12
	mul	w10, w11, w10
	mul	w10, w10, w12
	mul	w9, w10, w9
LBB0_6:
	add	w9, w9, w9, lsl #1
	lsl	w9, w9, #2
LBB0_7:
	add	w2, w9, w8
	mov	x0, x22
	mov	x1, x20
	mov	w3, #0
	bl	_ff_alloc_packet2
	tbnz	w0, #31, LBB0_14
; %bb.8:
	ldr	w1, [x20, #16]
	ldr	x2, [x20, #8]
	add	x0, sp, #8
	bl	_init_put_bits
	add	x2, x23, #24
	ldp	w4, w3, [x23, #16]
	add	x1, sp, #8
	mov	x0, x22
	mov	x5, x4
	bl	_ff_mjpeg_encode_picture_header
	add	x0, sp, #8
	bl	_put_bits_count
	mov	x23, x0
	ldr	x8, [x22, #8]
	ldr	x9, [x26]
	cmp	x8, x9
	b.eq	LBB0_12
; %bb.9:
	ldr	x9, [x25]
	cmp	x8, x9
	b.eq	LBB0_12
; %bb.10:
	ldr	x9, [x24]
	cmp	x8, x9
	b.eq	LBB0_12
; %bb.11:
	add	x1, sp, #8
	mov	x0, x22
	mov	x2, x21
	bl	_ljpeg_encode_yuv
	tbz	w0, #31, LBB0_13
	b	LBB0_14
LBB0_12:
	add	x1, sp, #8
	mov	x0, x22
	mov	x2, x21
	bl	_ljpeg_encode_bgr
	tbnz	w0, #31, LBB0_14
LBB0_13:
	bl	_emms_c
	asr	w1, w23, #3
	add	x0, sp, #8
	bl	_ff_mjpeg_escape_FF
	add	x0, sp, #8
	mov	x1, x23
	bl	_ff_mjpeg_encode_picture_trailer
	add	x0, sp, #8
	bl	_flush_put_bits
	add	x0, sp, #8
	bl	_put_bits_ptr
	mov	x8, x0
	mov	w0, #0
	ldr	x9, [sp, #8]
	sub	x8, x8, x9
	str	x8, [x20, #8]
Lloh9:
	adrp	x8, _AV_PKT_FLAG_KEY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AV_PKT_FLAG_KEY@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	ldr	w9, [x20]
	orr	w8, w9, w8
	str	w8, [x20]
	mov	w8, #1
	str	w8, [x19]
LBB0_14:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_INPUT_BUFFER_MIN_SIZE,4,2   ; @AV_INPUT_BUFFER_MIN_SIZE
	.comm	_AV_PIX_FMT_BGR0,8,3            ; @AV_PIX_FMT_BGR0
	.comm	_AV_PIX_FMT_BGR24,8,3           ; @AV_PIX_FMT_BGR24
	.comm	_AV_PIX_FMT_BGRA,8,3            ; @AV_PIX_FMT_BGRA
	.comm	_AV_PKT_FLAG_KEY,4,2            ; @AV_PKT_FLAG_KEY
	.no_dead_strip	_ljpeg_encode_frame
.subsections_via_symbols
