	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function parse_tonal_chunk
_parse_tonal_chunk:                     ## @parse_tonal_chunk
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	8(%rsi), %edx
	xorl	%r14d, %r14d
	testl	%edx, %edx
	je	LBB0_18
## %bb.1:
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movl	12(%rsi), %esi
	callq	_init_get_bits8
	testq	%rax, %rax
	js	LBB0_17
## %bb.2:
	movq	(%rbx), %rax
	movq	_LBR_CHUNK_SCF@GOTPCREL(%rip), %rcx
	movq	_LBR_CHUNK_TONAL_SCF@GOTPCREL(%rip), %r12
	cmpq	(%rcx), %rax
	je	LBB0_4
## %bb.3:
	movq	(%r12), %rcx
	cmpq	%rcx, %rax
	jne	LBB0_8
LBB0_4:
	movq	%r15, %rdi
	callq	_get_bits_left
	cmpl	$36, %eax
	jge	LBB0_7
## %bb.5:
	movl	16(%r15), %edi
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	callq	_av_log
	jmp	LBB0_17
LBB0_7:
	movq	%r15, %rdi
	movl	$6, %esi
	callq	_get_bits
	movq	8(%r15), %rcx
	movl	%eax, (%rcx)
	movq	%r15, %rdi
	movl	$6, %esi
	callq	_get_bits
	movq	8(%r15), %rcx
	movl	%eax, 4(%rcx)
	movq	%r15, %rdi
	movl	$6, %esi
	callq	_get_bits
	movq	8(%r15), %rcx
	movl	%eax, 8(%rcx)
	movq	%r15, %rdi
	movl	$6, %esi
	callq	_get_bits
	movq	8(%r15), %rcx
	movl	%eax, 12(%rcx)
	movq	%r15, %rdi
	movl	$6, %esi
	callq	_get_bits
	movq	8(%r15), %rcx
	movl	%eax, 16(%rcx)
	movq	%r15, %rdi
	movl	$6, %esi
	callq	_get_bits
	movq	8(%r15), %rcx
	movl	%eax, 20(%rcx)
	movq	(%rbx), %rax
	movq	(%r12), %rcx
LBB0_8:
	movq	_LBR_CHUNK_TONAL@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	je	LBB0_10
## %bb.9:
	cmpq	%rcx, %rax
	jne	LBB0_18
LBB0_10:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_parse_tonal
	testq	%rax, %rax
	js	LBB0_17
## %bb.11:
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_parse_tonal
	testq	%rax, %rax
	js	LBB0_17
## %bb.12:
	movq	%r15, %rdi
	movl	$2, %esi
	callq	_parse_tonal
	testq	%rax, %rax
	js	LBB0_17
## %bb.13:
	movq	%r15, %rdi
	movl	$3, %esi
	callq	_parse_tonal
	movl	$-1, %r14d
	testq	%rax, %rax
	js	LBB0_18
## %bb.14:
	movq	%r15, %rdi
	movl	$4, %esi
	callq	_parse_tonal
	movq	%rax, %r14
	sarq	$63, %r14
	jmp	LBB0_18
LBB0_17:
	movl	$-1, %r14d
LBB0_18:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LBR_CHUNK_SCF,8,3              ## @LBR_CHUNK_SCF
	.comm	_LBR_CHUNK_TONAL_SCF,8,3        ## @LBR_CHUNK_TONAL_SCF
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Tonal scale factor chunk too short\n"

	.comm	_LBR_CHUNK_TONAL,8,3            ## @LBR_CHUNK_TONAL
	.no_dead_strip	_parse_tonal_chunk
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function parse_tonal_chunk
_parse_tonal_chunk:                     ; @parse_tonal_chunk
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	w2, [x1, #8]
	cbz	w2, LBB0_12
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	ldr	w1, [x1, #12]
	bl	_init_get_bits8
	tbnz	x0, #63, LBB0_13
; %bb.2:
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _LBR_CHUNK_SCF@GOTPAGE
Lloh1:
	ldr	x9, [x9, _LBR_CHUNK_SCF@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x9]
Lloh3:
	adrp	x21, _LBR_CHUNK_TONAL_SCF@GOTPAGE
Lloh4:
	ldr	x21, [x21, _LBR_CHUNK_TONAL_SCF@GOTPAGEOFF]
	ldr	x9, [x21]
	cmp	x8, x10
	ccmp	x8, x9, #4, ne
	b.ne	LBB0_6
; %bb.3:
	mov	x0, x19
	bl	_get_bits_left
	cmp	w0, #36
	b.ge	LBB0_5
; %bb.4:
	ldr	w0, [x19, #16]
Lloh5:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x2, l_.str@PAGE
Lloh9:
	add	x2, x2, l_.str@PAGEOFF
	bl	_av_log
	b	LBB0_13
LBB0_5:
	mov	x0, x19
	mov	w1, #6
	bl	_get_bits
	ldr	x8, [x19, #8]
	str	w0, [x8]
	mov	x0, x19
	mov	w1, #6
	bl	_get_bits
	ldr	x8, [x19, #8]
	str	w0, [x8, #4]
	mov	x0, x19
	mov	w1, #6
	bl	_get_bits
	ldr	x8, [x19, #8]
	str	w0, [x8, #8]
	mov	x0, x19
	mov	w1, #6
	bl	_get_bits
	ldr	x8, [x19, #8]
	str	w0, [x8, #12]
	mov	x0, x19
	mov	w1, #6
	bl	_get_bits
	ldr	x8, [x19, #8]
	str	w0, [x8, #16]
	mov	x0, x19
	mov	w1, #6
	bl	_get_bits
	ldr	x8, [x19, #8]
	str	w0, [x8, #20]
	ldr	x8, [x20]
	ldr	x9, [x21]
LBB0_6:
Lloh10:
	adrp	x10, _LBR_CHUNK_TONAL@GOTPAGE
Lloh11:
	ldr	x10, [x10, _LBR_CHUNK_TONAL@GOTPAGEOFF]
Lloh12:
	ldr	x10, [x10]
	cmp	x8, x10
	ccmp	x8, x9, #4, ne
	b.ne	LBB0_12
; %bb.7:
	mov	x0, x19
	mov	w1, #0
	bl	_parse_tonal
	tbnz	x0, #63, LBB0_13
; %bb.8:
	mov	x0, x19
	mov	w1, #1
	bl	_parse_tonal
	tbnz	x0, #63, LBB0_13
; %bb.9:
	mov	x0, x19
	mov	w1, #2
	bl	_parse_tonal
	tbnz	x0, #63, LBB0_13
; %bb.10:
	mov	x0, x19
	mov	w1, #3
	bl	_parse_tonal
	tbnz	x0, #63, LBB0_13
; %bb.11:
	mov	x0, x19
	mov	w1, #4
	bl	_parse_tonal
	asr	x0, x0, #63
	b	LBB0_14
LBB0_12:
	mov	w0, #0
	b	LBB0_14
LBB0_13:
	mov	w0, #-1
LBB0_14:
                                        ; kill: def $w0 killed $w0 killed $x0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_LBR_CHUNK_SCF,8,3              ; @LBR_CHUNK_SCF
	.comm	_LBR_CHUNK_TONAL_SCF,8,3        ; @LBR_CHUNK_TONAL_SCF
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Tonal scale factor chunk too short\n"

	.comm	_LBR_CHUNK_TONAL,8,3            ; @LBR_CHUNK_TONAL
	.no_dead_strip	_parse_tonal_chunk
.subsections_via_symbols
