	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smacker_decode_tree
_smacker_decode_tree:                   ## @smacker_decode_tree
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_SMKTREE_DECODE_MAX_RECURSION@GOTPCREL(%rip), %rax
	cmpl	%ecx, (%rax)
	jge	LBB0_1
LBB0_3:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
LBB0_4:
	xorl	%edi, %edi
	callq	_av_log
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	%ecx, %r12d
	movl	%edx, %r13d
	movq	%rsi, %r14
	movq	%rdi, %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_SMKTREE_BITS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	(%rax,%rax,2), %eax
	cmpl	%r12d, %eax
	jl	LBB0_3
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	callq	_get_bits1
	testl	%eax, %eax
	je	LBB0_6
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	leal	1(%r12), %ebx
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	%r13d, %edx
	movl	%ebx, %ecx
	callq	_smacker_decode_tree
	testl	%eax, %eax
	jne	LBB0_10
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	btsl	%r12d, %r13d
	leal	-1(%rbx), %eax
	movl	%ebx, %r12d
	movq	_SMKTREE_DECODE_MAX_RECURSION@GOTPCREL(%rip), %rcx
	cmpl	%eax, (%rcx)
	jg	LBB0_2
	jmp	LBB0_3
LBB0_6:
	movq	(%r14), %rax
	cmpq	8(%r14), %rax
	jae	LBB0_7
## %bb.8:
	testl	%r12d, %r12d
	cmovel	%r12d, %r13d
	movq	16(%r14), %rcx
	movl	%r13d, (%rcx,%rax,4)
	movq	24(%r14), %rcx
	movl	%r12d, (%rcx,%rax,4)
	movq	%r15, %rdi
	movl	$8, %esi
	callq	_get_bits
	movq	(%r14), %rcx
	movq	40(%r14), %rdx
	movl	%eax, (%rdx,%rcx,4)
	incq	%rcx
	movq	%rcx, (%r14)
	xorl	%eax, %eax
	cmpl	%r12d, 32(%r14)
	jge	LBB0_10
## %bb.9:
	movl	%r12d, 32(%r14)
	jmp	LBB0_10
LBB0_7:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_SMKTREE_DECODE_MAX_RECURSION,4,2 ## @SMKTREE_DECODE_MAX_RECURSION
	.comm	_SMKTREE_BITS,4,2               ## @SMKTREE_BITS
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Maximum tree recursion level exceeded.\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
L_.str.1:                               ## @.str.1
	.asciz	"Tree size exceeded!\n"

	.no_dead_strip	_smacker_decode_tree
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smacker_decode_tree
_smacker_decode_tree:                   ; @smacker_decode_tree
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
Lloh0:
	adrp	x24, _SMKTREE_DECODE_MAX_RECURSION@GOTPAGE
Lloh1:
	ldr	x24, [x24, _SMKTREE_DECODE_MAX_RECURSION@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, w3
	b.ge	LBB0_4
LBB0_1:
Lloh2:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x2, l_.str@PAGE
Lloh6:
	add	x2, x2, l_.str@PAGEOFF
LBB0_2:
	mov	x0, #0
	bl	_av_log
Lloh7:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh8:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
LBB0_3:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_4:
	mov	x20, x3
	mov	x22, x2
	mov	x19, x1
	mov	x21, x0
Lloh10:
	adrp	x25, _SMKTREE_BITS@GOTPAGE
Lloh11:
	ldr	x25, [x25, _SMKTREE_BITS@GOTPAGEOFF]
	mov	w26, #1
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x25]
	add	w8, w8, w8, lsl #1
	cmp	w8, w20
	b.lt	LBB0_1
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x21
	bl	_get_bits1
	cbz	w0, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	add	w23, w20, #1
	mov	x0, x21
	mov	x1, x19
	mov	x2, x22
	mov	x3, x23
	bl	_smacker_decode_tree
	cbnz	w0, LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	lsl	w8, w26, w20
	orr	w22, w8, w22
	ldr	w8, [x24]
	sub	w9, w23, #1
	mov	x20, x23
	cmp	w8, w9
	b.gt	LBB0_5
	b	LBB0_1
LBB0_9:
	ldp	x8, x9, [x19]
	cmp	x8, x9
	b.hs	LBB0_12
; %bb.10:
	lsl	x8, x8, #2
	cmp	w20, #0
	csel	w9, wzr, w22, eq
	ldp	x10, x11, [x19, #16]
	str	w9, [x10, x8]
	str	w20, [x11, x8]
	mov	x0, x21
	mov	w1, #8
	bl	_get_bits
	mov	x8, x0
	mov	w0, #0
	ldr	x9, [x19, #40]
	ldr	x10, [x19]
	str	w8, [x9, x10, lsl #2]
	add	x8, x10, #1
	str	x8, [x19]
	ldr	w8, [x19, #32]
	cmp	w8, w20
	b.ge	LBB0_3
; %bb.11:
	mov	w0, #0
	str	w20, [x19, #32]
	b	LBB0_3
LBB0_12:
Lloh12:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x2, l_.str.1@PAGE
Lloh16:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_SMKTREE_DECODE_MAX_RECURSION,4,2 ; @SMKTREE_DECODE_MAX_RECURSION
	.comm	_SMKTREE_BITS,4,2               ; @SMKTREE_BITS
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Maximum tree recursion level exceeded.\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
l_.str.1:                               ; @.str.1
	.asciz	"Tree size exceeded!\n"

	.no_dead_strip	_smacker_decode_tree
.subsections_via_symbols
