	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ff_mjpeg_build_optimal_huffman
_ff_mjpeg_build_optimal_huffman:        ## @ff_mjpeg_build_optimal_huffman
	.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
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	-96(%rbp), %rdi
	movq	%rdi, -80(%rbp)
	leaq	-92(%rbp), %r14
	movq	%r14, -72(%rbp)
	leaq	-88(%rbp), %r15
	movq	%r15, -64(%rbp)
	leaq	-84(%rbp), %r12
	movq	%r12, -56(%rbp)
	callq	_ff_mjpeg_encode_huffman_init
	movq	%r14, %rdi
	callq	_ff_mjpeg_encode_huffman_init
	movq	%r15, %rdi
	callq	_ff_mjpeg_encode_huffman_init
	movq	%r12, %rdi
	callq	_ff_mjpeg_encode_huffman_init
	cmpl	$0, (%r13)
	jle	LBB0_3
## %bb.1:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	72(%r13), %rax
	movslq	(%rax,%rbx,8), %rcx
	movl	4(%rax,%rbx,8), %esi
	movq	-80(%rbp,%rcx,8), %rdi
	callq	_ff_mjpeg_encode_huffman_increment
	incq	%rbx
	movslq	(%r13), %rax
	cmpq	%rax, %rbx
	jl	LBB0_2
LBB0_3:
	movl	52(%r13), %edx
	movl	56(%r13), %esi
	leaq	-96(%rbp), %rdi
	movl	$12, %ecx
	callq	_ff_mjpeg_encode_huffman_close
	movl	36(%r13), %edx
	movl	40(%r13), %esi
	leaq	-92(%rbp), %rdi
	movl	$12, %ecx
	callq	_ff_mjpeg_encode_huffman_close
	movl	20(%r13), %edx
	movl	24(%r13), %esi
	leaq	-88(%rbp), %rdi
	movl	$256, %ecx                      ## imm = 0x100
	callq	_ff_mjpeg_encode_huffman_close
	movl	4(%r13), %edx
	movl	8(%r13), %esi
	leaq	-84(%rbp), %rdi
	movl	$256, %ecx                      ## imm = 0x100
	callq	_ff_mjpeg_encode_huffman_close
	movl	64(%r13), %edi
	movl	60(%r13), %esi
	movl	52(%r13), %ecx
	movl	56(%r13), %edx
	callq	_ff_mjpeg_build_huffman_codes
	movl	48(%r13), %edi
	movl	44(%r13), %esi
	movl	36(%r13), %ecx
	movl	40(%r13), %edx
	callq	_ff_mjpeg_build_huffman_codes
	movl	32(%r13), %edi
	movl	28(%r13), %esi
	movl	20(%r13), %ecx
	movl	24(%r13), %edx
	callq	_ff_mjpeg_build_huffman_codes
	movl	16(%r13), %edi
	movl	12(%r13), %esi
	movl	4(%r13), %ecx
	movl	8(%r13), %edx
	callq	_ff_mjpeg_build_huffman_codes
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_5
## %bb.4:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_ff_mjpeg_build_optimal_huffman
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ff_mjpeg_build_optimal_huffman
_ff_mjpeg_build_optimal_huffman:        ; @ff_mjpeg_build_optimal_huffman
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	add	x8, sp, #20
	add	x9, sp, #16
	stp	x8, x9, [sp, #24]
	add	x8, sp, #12
	add	x9, sp, #8
	stp	x8, x9, [sp, #40]
	add	x0, sp, #20
	bl	_ff_mjpeg_encode_huffman_init
	add	x0, sp, #16
	bl	_ff_mjpeg_encode_huffman_init
	add	x0, sp, #12
	bl	_ff_mjpeg_encode_huffman_init
	add	x0, sp, #8
	bl	_ff_mjpeg_encode_huffman_init
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x20, #0
	mov	x21, #0
	add	x22, sp, #24
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #72]
	add	x8, x8, x20
	ldp	w9, w1, [x8]
                                        ; kill: def $w9 killed $w9 def $x9
	sxtw	x9, w9
	ldr	x0, [x22, x9, lsl #3]
	bl	_ff_mjpeg_encode_huffman_increment
	add	x21, x21, #1
	ldrsw	x8, [x19]
	add	x20, x20, #8
	cmp	x21, x8
	b.lt	LBB0_2
LBB0_3:
	ldp	w2, w1, [x19, #52]
	add	x0, sp, #20
	mov	w3, #12
	bl	_ff_mjpeg_encode_huffman_close
	ldp	w2, w1, [x19, #36]
	add	x0, sp, #16
	mov	w3, #12
	bl	_ff_mjpeg_encode_huffman_close
	ldp	w2, w1, [x19, #20]
	add	x0, sp, #12
	mov	w3, #256
	bl	_ff_mjpeg_encode_huffman_close
	ldp	w2, w1, [x19, #4]
	add	x0, sp, #8
	mov	w3, #256
	bl	_ff_mjpeg_encode_huffman_close
	ldp	w1, w0, [x19, #60]
	ldp	w3, w2, [x19, #52]
	bl	_ff_mjpeg_build_huffman_codes
	ldp	w1, w0, [x19, #44]
	ldp	w3, w2, [x19, #36]
	bl	_ff_mjpeg_build_huffman_codes
	ldp	w1, w0, [x19, #28]
	ldp	w3, w2, [x19, #20]
	bl	_ff_mjpeg_build_huffman_codes
	ldp	w1, w0, [x19, #12]
	ldp	w3, w2, [x19, #4]
	bl	_ff_mjpeg_build_huffman_codes
	ldur	x8, [x29, #-40]
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_5
; %bb.4:
	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
	add	sp, sp, #112
	ret
LBB0_5:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_ff_mjpeg_build_optimal_huffman
.subsections_via_symbols
