	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xa_read_header
_xa_read_header:                        ## @xa_read_header
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rbx
	movq	8(%rdi), %r15
	xorl	%esi, %esi
	callq	_avformat_new_stream
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%rax, %r14
	movq	_AVMEDIA_TYPE_AUDIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	8(%r14), %rcx
	movl	%eax, 24(%rcx)
	movq	_AV_CODEC_ID_ADPCM_EA_MAXIS_XA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rcx)
	movq	%rbx, %rdi
	movl	$4, %esi
	callq	_avio_skip
	movq	%rbx, %rdi
	callq	_avio_rl32
	movq	%rax, (%r15)
	movq	%rbx, %rdi
	movl	$2, %esi
	callq	_avio_skip
	movq	%rbx, %rdi
	callq	_avio_rl16
	movq	8(%r14), %rcx
	movq	%rax, (%rcx)
	movq	%rbx, %rdi
	callq	_avio_rl32
	movq	8(%r14), %rcx
	movq	%rax, 8(%rcx)
	movq	%rbx, %rdi
	movl	$4, %esi
	callq	_avio_skip
	movq	%rbx, %rdi
	movl	$2, %esi
	callq	_avio_skip
	movq	%rbx, %rdi
	movl	$2, %esi
	callq	_avio_skip
	movq	8(%r14), %rcx
	movq	(%rcx), %rax
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	8(%rcx), %rcx
	testq	%rcx, %rcx
	je	LBB0_3
## %bb.4:
	imulq	%rcx, %rax
	imulq	$120, %rax, %rax
	movabsq	$5270498306774157605, %rcx      ## imm = 0x4924924924924925
	imulq	%rcx
	movq	%rdx, %rdi
	shrq	$63, %rdi
	sarq	$3, %rdx
	addq	%rdx, %rdi
	movq	_INT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_av_clip
	movq	8(%r14), %rcx
	movl	%eax, 16(%rcx)
	movq	8(%rcx), %rcx
	movq	%r14, %rdi
	movl	$64, %esi
	movl	$1, %edx
	callq	_avpriv_set_pts_info
	movq	$0, (%r14)
	jmp	LBB0_5
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_3:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AVMEDIA_TYPE_AUDIO,4,2         ## @AVMEDIA_TYPE_AUDIO
	.comm	_AV_CODEC_ID_ADPCM_EA_MAXIS_XA,4,2 ## @AV_CODEC_ID_ADPCM_EA_MAXIS_XA
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_INT_MAX,4,2                    ## @INT_MAX
	.no_dead_strip	_xa_read_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xa_read_header
_xa_read_header:                        ; @xa_read_header
	.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
	ldp	x20, x21, [x0]
	mov	x1, #0
	bl	_avformat_new_stream
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x8, _AVMEDIA_TYPE_AUDIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVMEDIA_TYPE_AUDIO@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	x9, [x0, #8]
Lloh3:
	adrp	x10, _AV_CODEC_ID_ADPCM_EA_MAXIS_XA@GOTPAGE
Lloh4:
	ldr	x10, [x10, _AV_CODEC_ID_ADPCM_EA_MAXIS_XA@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	stp	w10, w8, [x9, #20]
	mov	x0, x20
	mov	w1, #4
	bl	_avio_skip
	mov	x0, x20
	bl	_avio_rl32
	str	x0, [x21]
	mov	x0, x20
	mov	w1, #2
	bl	_avio_skip
	mov	x0, x20
	bl	_avio_rl16
	ldr	x8, [x19, #8]
	str	x0, [x8]
	mov	x0, x20
	bl	_avio_rl32
	ldr	x8, [x19, #8]
	str	x0, [x8, #8]
	mov	x0, x20
	mov	w1, #4
	bl	_avio_skip
	mov	x0, x20
	mov	w1, #2
	bl	_avio_skip
	mov	x0, x20
	mov	w1, #2
	bl	_avio_skip
	ldr	x9, [x19, #8]
	ldr	x8, [x9]
	cbz	x8, LBB0_5
; %bb.2:
	ldr	x9, [x9, #8]
	cbz	x9, LBB0_5
; %bb.3:
	mul	x8, x8, x9
	mov	w9, #120
	mul	x8, x8, x9
	mov	x9, #18725
	movk	x9, #9362, lsl #16
	movk	x9, #37449, lsl #32
	movk	x9, #18724, lsl #48
	smulh	x8, x8, x9
	asr	x9, x8, #3
	add	x0, x9, x8, lsr #63
Lloh6:
	adrp	x8, _INT_MAX@GOTPAGE
Lloh7:
	ldr	x8, [x8, _INT_MAX@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_av_clip
	ldr	x8, [x19, #8]
	str	w0, [x8, #16]
	ldr	x3, [x8, #8]
	mov	x0, x19
	mov	w1, #64
	mov	w2, #1
	bl	_avpriv_set_pts_info
	mov	w0, #0
	str	xzr, [x19]
	b	LBB0_6
LBB0_4:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	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
	b	_AVERROR
LBB0_5:
Lloh12:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh13:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
LBB0_6:
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AVMEDIA_TYPE_AUDIO,4,2         ; @AVMEDIA_TYPE_AUDIO
	.comm	_AV_CODEC_ID_ADPCM_EA_MAXIS_XA,4,2 ; @AV_CODEC_ID_ADPCM_EA_MAXIS_XA
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_INT_MAX,4,2                    ; @INT_MAX
	.no_dead_strip	_xa_read_header
.subsections_via_symbols
