	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ## -- Begin function main
	.p2align	4, 0x90
_main:                                  ## @main
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	l___const.main.val_counts+32(%rip), %rax
	movq	%rax, -64(%rbp)
	movaps	l___const.main.val_counts+16(%rip), %xmm0
	movaps	%xmm0, -80(%rbp)
	movaps	l___const.main.val_counts(%rip), %xmm0
	movaps	%xmm0, -96(%rbp)
	leaq	-144(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_FF_ARRAY_ELEMS
	leaq	-96(%rbp), %rdi
	movq	%rbx, %rsi
	movl	%eax, %edx
	movl	$3, %ecx
	callq	_ff_mjpegenc_huffman_compute_bits
	movq	%rbx, %rdi
	callq	_FF_ARRAY_ELEMS
	testl	%eax, %eax
	jle	LBB0_1
## %bb.2:
	xorl	%ebx, %ebx
	leaq	_main.expected(%rip), %r12
	leaq	-144(%rbp), %r15
	leaq	L_.str(%rip), %r14
	xorl	%r13d, %r13d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	4(%r12,%rbx,8), %ecx
	movl	-140(%rbp,%rbx,8), %eax
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_stderr@GOTPCREL(%rip), %rsi
	movl	(%rsi), %edi
	movslq	%ecx, %rcx
	movslq	%eax, %r9
	movq	%r14, %rsi
	callq	_fprintf
	movl	$1, %r13d
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	movq	%r15, %rdi
	callq	_FF_ARRAY_ELEMS
	cltq
	cmpq	%rax, %rbx
	jge	LBB0_8
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movslq	-144(%rbp,%rbx,8), %r8
	movslq	(%r12,%rbx,8), %rdx
	cmpl	%edx, %r8d
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	-140(%rbp,%rbx,8), %eax
	movl	4(%r12,%rbx,8), %ecx
	cmpl	%ecx, %eax
	jne	LBB0_6
	jmp	LBB0_7
LBB0_1:
	xorl	%r13d, %r13d
LBB0_8:
	movq	_probs_zeroes@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movq	%r14, %rdi
	callq	_FF_ARRAY_ELEMS
	movl	$16, %edi
	movl	$18, %esi
	movq	%r14, %rdx
	movl	%eax, %ecx
	callq	_check_lengths
	movq	%rax, %r14
	movq	_probs_skewed@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	%r15, %rdi
	callq	_FF_ARRAY_ELEMS
	movl	$16, %edi
	movl	$41282, %esi                    ## imm = 0xA142
	movq	%r15, %rdx
	movl	%eax, %ecx
	callq	_check_lengths
	movq	%rax, %r15
	movq	_probs_sat@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	movq	%r12, %rdi
	callq	_FF_ARRAY_ELEMS
	movl	$16, %edi
	movl	$669904, %esi                   ## imm = 0xA38D0
	movq	%r12, %rdx
	movl	%eax, %ecx
	callq	_check_lengths
	orq	%r15, %rax
	orq	%r14, %rax
	movl	$1, %eax
	cmovel	%r13d, %eax
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_10
## %bb.9:
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @__const.main.val_counts
l___const.main.val_counts:
	.long	0                               ## 0x0
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	2                               ## 0x2
	.long	2                               ## 0x2
	.long	5                               ## 0x5
	.long	3                               ## 0x3
	.long	10                              ## 0xa
	.long	4                               ## 0x4
	.long	21                              ## 0x15

	.p2align	4                               ## @main.expected
_main.expected:
	.long	0                               ## 0x0
	.long	3                               ## 0x3
	.long	1                               ## 0x1
	.long	3                               ## 0x3
	.long	2                               ## 0x2
	.long	3                               ## 0x3
	.long	3                               ## 0x3
	.long	3                               ## 0x3
	.long	4                               ## 0x4
	.long	1                               ## 0x1

	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Built huffman does not equal expectations. Expected: code %d probability %d, Actual: code %d probability %d\n"

	.comm	_probs_zeroes,8,3               ## @probs_zeroes
	.comm	_probs_skewed,8,3               ## @probs_skewed
	.comm	_probs_sat,8,3                  ## @probs_sat
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ; -- Begin function main
	.p2align	2
_main:                                  ; @main
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x8, l___const.main.val_counts@PAGE
Lloh4:
	add	x8, x8, l___const.main.val_counts@PAGEOFF
	ldp	q0, q1, [x8]
	stp	q0, q1, [sp, #48]
	ldr	x8, [x8, #32]
	str	x8, [sp, #80]
	add	x19, sp, #8
	add	x0, sp, #8
	bl	_FF_ARRAY_ELEMS
	mov	x2, x0
	add	x0, sp, #48
	add	x1, sp, #8
	mov	w3, #3
	bl	_ff_mjpegenc_huffman_compute_bits
	add	x0, sp, #8
	bl	_FF_ARRAY_ELEMS
	cmp	w0, #1
	b.lt	LBB0_7
; %bb.1:
	mov	x20, #0
	mov	w22, #0
	orr	x21, x19, #0x4
Lloh5:
	adrp	x23, _main.expected@PAGE+4
Lloh6:
	add	x23, x23, _main.expected@PAGEOFF+4
Lloh7:
	adrp	x24, _stderr@GOTPAGE
Lloh8:
	ldr	x24, [x24, _stderr@GOTPAGEOFF]
Lloh9:
	adrp	x19, l_.str@PAGE
Lloh10:
	add	x19, x19, l_.str@PAGEOFF
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w9, [x23]
	ldr	w8, [x21]
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x24]
	sxtw	x3, w9
	sxtw	x5, w8
	mov	x1, x19
	bl	_fprintf
	mov	w22, #1
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x20, x20, #1
	add	x0, sp, #8
	bl	_FF_ARRAY_ELEMS
	add	x21, x21, #8
	add	x23, x23, #8
	cmp	x20, w0, sxtw
	b.ge	LBB0_8
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldursw	x4, [x21, #-4]
	ldursw	x2, [x23, #-4]
	cmp	w4, w2
	b.ne	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x21]
	ldr	w9, [x23]
	cmp	w8, w9
	b.ne	LBB0_3
	b	LBB0_4
LBB0_7:
	mov	w22, #0
LBB0_8:
Lloh11:
	adrp	x8, _probs_zeroes@GOTPAGE
Lloh12:
	ldr	x8, [x8, _probs_zeroes@GOTPAGEOFF]
Lloh13:
	ldr	x19, [x8]
	mov	x0, x19
	bl	_FF_ARRAY_ELEMS
	mov	x3, x0
	mov	w0, #16
	mov	w1, #18
	mov	x2, x19
	bl	_check_lengths
	mov	x19, x0
Lloh14:
	adrp	x8, _probs_skewed@GOTPAGE
Lloh15:
	ldr	x8, [x8, _probs_skewed@GOTPAGEOFF]
Lloh16:
	ldr	x20, [x8]
	mov	x0, x20
	bl	_FF_ARRAY_ELEMS
	mov	x3, x0
	mov	w0, #16
	mov	w1, #41282
	mov	x2, x20
	bl	_check_lengths
	mov	x20, x0
Lloh17:
	adrp	x8, _probs_sat@GOTPAGE
Lloh18:
	ldr	x8, [x8, _probs_sat@GOTPAGEOFF]
Lloh19:
	ldr	x21, [x8]
	mov	x0, x21
	bl	_FF_ARRAY_ELEMS
	mov	x3, x0
	mov	w0, #16
	mov	w1, #14544
	movk	w1, #10, lsl #16
	mov	x2, x21
	bl	_check_lengths
	orr	x8, x0, x20
	orr	x8, x8, x19
	cmp	x8, #0
	csinc	w0, w22, wzr, eq
	ldur	x8, [x29, #-56]
Lloh20:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh21:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.9:
	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
	add	sp, sp, #160
	ret
LBB0_10:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @__const.main.val_counts
l___const.main.val_counts:
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.long	1                               ; 0x1
	.long	2                               ; 0x2
	.long	2                               ; 0x2
	.long	5                               ; 0x5
	.long	3                               ; 0x3
	.long	10                              ; 0xa
	.long	4                               ; 0x4
	.long	21                              ; 0x15

	.p2align	2                               ; @main.expected
_main.expected:
	.long	0                               ; 0x0
	.long	3                               ; 0x3
	.long	1                               ; 0x1
	.long	3                               ; 0x3
	.long	2                               ; 0x2
	.long	3                               ; 0x3
	.long	3                               ; 0x3
	.long	3                               ; 0x3
	.long	4                               ; 0x4
	.long	1                               ; 0x1

	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Built huffman does not equal expectations. Expected: code %d probability %d, Actual: code %d probability %d\n"

	.comm	_probs_zeroes,8,3               ; @probs_zeroes
	.comm	_probs_skewed,8,3               ; @probs_skewed
	.comm	_probs_sat,8,3                  ; @probs_sat
.subsections_via_symbols
