	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wsaud_read_header
_wsaud_read_header:                     ## @wsaud_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %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)
	movq	(%rdi), %r14
	movq	_AUD_HEADER_SIZE@GOTPCREL(%rip), %r12
	movl	(%r12), %r15d
	movq	%r15, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movl	%r15d, %edx
	callq	_avio_read
	cmpl	(%r12), %eax
	jne	LBB0_1
## %bb.3:
	movq	%rbx, %rdi
	callq	_AV_RL16
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movzbl	10(%rbx), %r14d
	movzbl	11(%rbx), %r12d
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_avformat_new_stream
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %r15
	andl	$1, %r14d
	movl	%r14d, %ebx
	incl	%ebx
	cmpb	$99, %r12b
	je	LBB0_10
## %bb.6:
	cmpb	$1, %r12b
	jne	LBB0_11
## %bb.7:
	testb	%r14b, %r14b
	je	LBB0_12
## %bb.8:
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_avpriv_request_sample
	jmp	LBB0_9
LBB0_1:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_2:
	movl	(%rax), %edi
	callq	_AVERROR
LBB0_17:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_19
## %bb.18:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	_AV_CODEC_ID_ADPCM_IMA_WS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%r15), %rcx
	movl	%eax, 24(%rcx)
	movl	$4, (%rcx)
	movl	-52(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %eax
	imull	%ebx, %eax
	shll	$2, %eax
	movl	%eax, 4(%rcx)
	jmp	LBB0_13
LBB0_11:
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_avpriv_request_sample
LBB0_9:
	movq	_AVERROR_PATCHWELCOME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_17
LBB0_12:
	movq	_AV_CODEC_ID_WESTWOOD_SND1@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%r15), %rcx
	movl	%eax, 24(%rcx)
	movl	-52(%rbp), %r12d                ## 4-byte Reload
LBB0_13:
	movq	%r15, %rdi
	movl	$64, %esi
	movl	$1, %edx
	movl	%r12d, %ecx
	callq	_avpriv_set_pts_info
	movq	_AVMEDIA_TYPE_AUDIO@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	(%r15), %rax
	movl	%ecx, 20(%rax)
	movl	%ebx, 8(%rax)
	testb	%r14b, %r14b
	jne	LBB0_14
## %bb.15:
	movq	_AV_CH_LAYOUT_MONO@GOTPCREL(%rip), %rcx
	jmp	LBB0_16
LBB0_14:
	movq	_AV_CH_LAYOUT_STEREO@GOTPCREL(%rip), %rcx
LBB0_16:
	movl	(%rcx), %ecx
	movl	%ecx, 16(%rax)
	movl	%r12d, 12(%rax)
	xorl	%eax, %eax
	jmp	LBB0_17
LBB0_19:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_AUD_HEADER_SIZE,4,2            ## @AUD_HEADER_SIZE
	.comm	_EIO,4,2                        ## @EIO
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Stereo WS-SND1"

	.comm	_AVERROR_PATCHWELCOME,4,2       ## @AVERROR_PATCHWELCOME
	.comm	_AV_CODEC_ID_WESTWOOD_SND1,4,2  ## @AV_CODEC_ID_WESTWOOD_SND1
	.comm	_AV_CODEC_ID_ADPCM_IMA_WS,4,2   ## @AV_CODEC_ID_ADPCM_IMA_WS
L_.str.1:                               ## @.str.1
	.asciz	"Unknown codec: %d"

	.comm	_AVMEDIA_TYPE_AUDIO,4,2         ## @AVMEDIA_TYPE_AUDIO
	.comm	_AV_CH_LAYOUT_MONO,4,2          ## @AV_CH_LAYOUT_MONO
	.comm	_AV_CH_LAYOUT_STEREO,4,2        ## @AV_CH_LAYOUT_STEREO
	.no_dead_strip	_wsaud_read_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wsaud_read_header
_wsaud_read_header:                     ; @wsaud_read_header
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	sub	sp, sp, #16
	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, #-56]
	ldr	x0, [x0]
Lloh3:
	adrp	x20, _AUD_HEADER_SIZE@GOTPAGE
Lloh4:
	ldr	x20, [x20, _AUD_HEADER_SIZE@GOTPAGEOFF]
	ldr	w2, [x20]
	mov	x9, x2
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x2, #15
	and	x9, x9, #0x1fffffff0
	sub	x21, x8, x9
	mov	sp, x21
	mov	x1, x21
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_avio_read
	ldr	w8, [x20]
	cmp	w0, w8
	b.ne	LBB0_6
; %bb.1:
	mov	x0, x21
	bl	_AV_RL16
	mov	x20, x0
	ldrb	w22, [x21, #10]
	ldrb	w24, [x21, #11]
	mov	x0, x19
	mov	x1, #0
	bl	_avformat_new_stream
	cbz	x0, LBB0_7
; %bb.2:
	mov	x21, x0
	and	w22, w22, #0x1
	add	w23, w22, #1
	cmp	w24, #99
	b.eq	LBB0_11
; %bb.3:
	cmp	w24, #1
	b.ne	LBB0_13
; %bb.4:
	cbnz	w22, LBB0_14
; %bb.5:
Lloh7:
	adrp	x8, _AV_CODEC_ID_WESTWOOD_SND1@GOTPAGE
Lloh8:
	ldr	x8, [x8, _AV_CODEC_ID_WESTWOOD_SND1@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	ldr	x9, [x21]
	str	w8, [x9, #24]
	b	LBB0_12
LBB0_6:
Lloh10:
	adrp	x8, _EIO@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_8:
	ldr	w0, [x8]
	bl	_AVERROR
LBB0_9:
	ldur	x8, [x29, #-56]
Lloh14:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh15:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_16
; %bb.10:
	sub	sp, x29, #48
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_11:
Lloh17:
	adrp	x8, _AV_CODEC_ID_ADPCM_IMA_WS@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AV_CODEC_ID_ADPCM_IMA_WS@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	ldr	x9, [x21]
	str	w8, [x9, #24]
	mov	w8, #4
	mul	w10, w20, w23
	lsl	w10, w10, #2
	stp	w8, w10, [x9]
LBB0_12:
	mov	x0, x21
	mov	w1, #64
	mov	w2, #1
	mov	x3, x20
	bl	_avpriv_set_pts_info
	mov	w0, #0
Lloh20:
	adrp	x8, _AVMEDIA_TYPE_AUDIO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _AVMEDIA_TYPE_AUDIO@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	ldr	x9, [x21]
	str	w8, [x9, #20]
Lloh23:
	adrp	x8, _AV_CH_LAYOUT_MONO@GOTPAGE
Lloh24:
	ldr	x8, [x8, _AV_CH_LAYOUT_MONO@GOTPAGEOFF]
Lloh25:
	adrp	x10, _AV_CH_LAYOUT_STEREO@GOTPAGE
Lloh26:
	ldr	x10, [x10, _AV_CH_LAYOUT_STEREO@GOTPAGEOFF]
	str	w23, [x9, #8]
	cmp	w22, #0
	csel	x8, x8, x10, eq
	ldr	w8, [x8]
	stp	w20, w8, [x9, #12]
	b	LBB0_9
LBB0_13:
	str	x24, [sp, #-16]!
Lloh27:
	adrp	x1, l_.str.1@PAGE
Lloh28:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_avpriv_request_sample
	add	sp, sp, #16
	b	LBB0_15
LBB0_14:
Lloh29:
	adrp	x1, l_.str@PAGE
Lloh30:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_avpriv_request_sample
LBB0_15:
Lloh31:
	adrp	x8, _AVERROR_PATCHWELCOME@GOTPAGE
Lloh32:
	ldr	x8, [x8, _AVERROR_PATCHWELCOME@GOTPAGEOFF]
Lloh33:
	ldr	w0, [x8]
	b	LBB0_9
LBB0_16:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_AUD_HEADER_SIZE,4,2            ; @AUD_HEADER_SIZE
	.comm	_EIO,4,2                        ; @EIO
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Stereo WS-SND1"

	.comm	_AVERROR_PATCHWELCOME,4,2       ; @AVERROR_PATCHWELCOME
	.comm	_AV_CODEC_ID_WESTWOOD_SND1,4,2  ; @AV_CODEC_ID_WESTWOOD_SND1
	.comm	_AV_CODEC_ID_ADPCM_IMA_WS,4,2   ; @AV_CODEC_ID_ADPCM_IMA_WS
l_.str.1:                               ; @.str.1
	.asciz	"Unknown codec: %d"

	.comm	_AVMEDIA_TYPE_AUDIO,4,2         ; @AVMEDIA_TYPE_AUDIO
	.comm	_AV_CH_LAYOUT_MONO,4,2          ; @AV_CH_LAYOUT_MONO
	.comm	_AV_CH_LAYOUT_STEREO,4,2        ; @AV_CH_LAYOUT_STEREO
	.no_dead_strip	_wsaud_read_header
.subsections_via_symbols
