	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ADPCM_StreamOpen
_ADPCM_StreamOpen:                      ## @ADPCM_StreamOpen
	.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
	movq	%rdi, %r12
	movq	_ACM_STREAMOPENF_ASYNC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%edi, %edi
	andl	(%r12), %eax
	sete	%dil
	callq	_assert
	movq	16(%r12), %rdi
	callq	_ADPCM_GetFormatIndex
	movq	_ACMERR_NOTPOSSIBLE@GOTPCREL(%rip), %rbx
	cmpl	$-1, %eax
	je	LBB0_27
## %bb.1:
	movq	24(%r12), %rdi
	callq	_ADPCM_GetFormatIndex
	cmpl	$-1, %eax
	je	LBB0_27
## %bb.2:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_HeapAlloc
	testq	%rax, %rax
	je	LBB0_18
## %bb.3:
	movq	%rax, %r14
	movq	%rax, 8(%r12)
	movq	16(%r12), %rax
	movq	(%rax), %r15
	movq	_WAVE_FORMAT_PCM@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, %r15
	jne	LBB0_5
## %bb.4:
	movq	24(%r12), %rdx
	cmpq	%r15, (%rdx)
	je	LBB0_26
LBB0_5:
	movq	_WAVE_FORMAT_IMA_ADPCM@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	cmpq	%rdx, %r15
	jne	LBB0_19
## %bb.6:
	movq	24(%r12), %rsi
	cmpq	%rcx, (%rsi)
	jne	LBB0_19
## %bb.7:
	movq	8(%rax), %rcx
	cmpq	8(%rsi), %rcx
	jne	LBB0_26
## %bb.8:
	movl	16(%rax), %eax
	cmpl	16(%rsi), %eax
	jne	LBB0_26
## %bb.9:
	movl	20(%rsi), %eax
	cmpl	$16, %eax
	je	LBB0_11
## %bb.10:
	cmpl	$8, %eax
	jne	LBB0_26
LBB0_11:
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	callq	_TRACE
	decl	%r15d
	testb	$3, %r15b
	jne	LBB0_26
## %bb.12:
	shrl	%r15d
	addl	$4, %r15d
	movq	16(%r12), %rax
	imull	16(%rax), %r15d
	cmpl	24(%rax), %r15d
	jb	LBB0_26
## %bb.13:
	movq	24(%r12), %rax
	movl	20(%rax), %ecx
	cmpl	$8, %ecx
	je	LBB0_32
## %bb.14:
	cmpl	$16, %ecx
	jne	LBB0_38
## %bb.15:
	movl	16(%rax), %eax
	cmpl	$2, %eax
	je	LBB0_34
## %bb.16:
	cmpl	$1, %eax
	je	LBB0_17
	jmp	LBB0_38
LBB0_18:
	movq	_MMSYSERR_NOMEM@GOTPCREL(%rip), %rbx
	jmp	LBB0_27
LBB0_19:
	cmpq	%rcx, %r15
	jne	LBB0_26
## %bb.20:
	movq	24(%r12), %rcx
	movq	(%rcx), %r15
	cmpq	%rdx, %r15
	jne	LBB0_26
## %bb.21:
	movq	8(%rax), %rdx
	cmpq	8(%rcx), %rdx
	jne	LBB0_26
## %bb.22:
	movl	16(%rax), %edx
	cmpl	16(%rcx), %edx
	jne	LBB0_26
## %bb.23:
	cmpl	$16, 20(%rax)
	jne	LBB0_26
## %bb.24:
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	callq	_TRACE
	decl	%r15d
	testb	$3, %r15b
	jne	LBB0_26
## %bb.25:
	shrl	%r15d
	addl	$4, %r15d
	movq	24(%r12), %rax
	imull	16(%rax), %r15d
	cmpl	24(%rax), %r15d
	jae	LBB0_28
LBB0_26:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movq	%r14, %rdx
	callq	_HeapFree
	movq	$0, 8(%r12)
	movq	_MMSYSERR_NOTSUPPORTED@GOTPCREL(%rip), %rbx
LBB0_27:
	movl	(%rbx), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_28:
	movq	16(%r12), %rax
	cmpl	$16, 20(%rax)
	jne	LBB0_38
## %bb.29:
	movl	16(%rax), %eax
	cmpl	$2, %eax
	je	LBB0_36
## %bb.30:
	cmpl	$1, %eax
	jne	LBB0_38
## %bb.31:
	movq	_cvtMM16imaK@GOTPCREL(%rip), %rax
	jmp	LBB0_37
LBB0_32:
	movl	16(%rax), %eax
	cmpl	$1, %eax
	je	LBB0_17
## %bb.33:
	cmpl	$2, %eax
	je	LBB0_26
	jmp	LBB0_38
LBB0_17:
	movq	_cvtMMimaK@GOTPCREL(%rip), %rax
	jmp	LBB0_37
LBB0_34:
	movq	_cvtSSima16K@GOTPCREL(%rip), %rax
	jmp	LBB0_37
LBB0_36:
	movq	_cvtSS16imaK@GOTPCREL(%rip), %rax
LBB0_37:
	movq	(%rax), %rax
	movq	%rax, (%r14)
LBB0_38:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_ADPCM_Reset
	movq	_MMSYSERR_NOERROR@GOTPCREL(%rip), %rbx
	jmp	LBB0_27
	.cfi_endproc
                                        ## -- End function
	.comm	_ACM_STREAMOPENF_ASYNC,4,2      ## @ACM_STREAMOPENF_ASYNC
	.comm	_ACMERR_NOTPOSSIBLE,4,2         ## @ACMERR_NOTPOSSIBLE
	.comm	_MMSYSERR_NOMEM,4,2             ## @MMSYSERR_NOMEM
	.comm	_WAVE_FORMAT_PCM,8,3            ## @WAVE_FORMAT_PCM
	.comm	_WAVE_FORMAT_IMA_ADPCM,8,3      ## @WAVE_FORMAT_IMA_ADPCM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"spb=%u\n"

	.comm	_cvtSSima16K,8,3                ## @cvtSSima16K
	.comm	_cvtMMimaK,8,3                  ## @cvtMMimaK
	.comm	_cvtSS16imaK,8,3                ## @cvtSS16imaK
	.comm	_cvtMM16imaK,8,3                ## @cvtMM16imaK
	.comm	_MMSYSERR_NOERROR,4,2           ## @MMSYSERR_NOERROR
	.comm	_MMSYSERR_NOTSUPPORTED,4,2      ## @MMSYSERR_NOTSUPPORTED
	.no_dead_strip	_ADPCM_StreamOpen
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ADPCM_StreamOpen
_ADPCM_StreamOpen:                      ; @ADPCM_StreamOpen
	.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
	mov	x19, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _ACM_STREAMOPENF_ASYNC@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ACM_STREAMOPENF_ASYNC@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w0, eq
	bl	_assert
	ldr	x0, [x19, #16]
	bl	_ADPCM_GetFormatIndex
	cmn	w0, #1
	b.eq	LBB0_17
; %bb.1:
	ldr	x0, [x19, #24]
	bl	_ADPCM_GetFormatIndex
	cmn	w0, #1
	b.eq	LBB0_17
; %bb.2:
	bl	_GetProcessHeap
	mov	w1, #0
	mov	w2, #8
	bl	_HeapAlloc
	cbz	x0, LBB0_18
; %bb.3:
	mov	x20, x0
	str	x0, [x19, #8]
	ldr	x8, [x19, #16]
	ldr	x21, [x8]
Lloh3:
	adrp	x9, _WAVE_FORMAT_PCM@GOTPAGE
Lloh4:
	ldr	x9, [x9, _WAVE_FORMAT_PCM@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x21, x9
	b.ne	LBB0_5
; %bb.4:
	ldr	x10, [x19, #24]
	ldr	x10, [x10]
	cmp	x10, x21
	b.eq	LBB0_26
LBB0_5:
Lloh6:
	adrp	x10, _WAVE_FORMAT_IMA_ADPCM@GOTPAGE
Lloh7:
	ldr	x10, [x10, _WAVE_FORMAT_IMA_ADPCM@GOTPAGEOFF]
Lloh8:
	ldr	x11, [x10]
	cmp	x21, x11
	b.ne	LBB0_19
; %bb.6:
	ldr	x10, [x19, #24]
	ldr	x12, [x10]
	cmp	x12, x9
	b.ne	LBB0_19
; %bb.7:
	ldr	x9, [x8, #8]
	ldr	x11, [x10, #8]
	cmp	x9, x11
	b.ne	LBB0_26
; %bb.8:
	ldr	w8, [x8, #16]
	ldr	w9, [x10, #16]
	cmp	w8, w9
	b.ne	LBB0_26
; %bb.9:
	ldr	w8, [x10, #20]
	cmp	w8, #16
	b.eq	LBB0_11
; %bb.10:
	cmp	w8, #8
	b.ne	LBB0_26
LBB0_11:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_TRACE
	sub	w8, w21, #1
	tst	w8, #0x3
	b.ne	LBB0_26
; %bb.12:
	lsr	w8, w8, #1
	add	w8, w8, #4
	ldr	x9, [x19, #16]
	ldr	w10, [x9, #16]
	mul	w8, w10, w8
	ldr	w9, [x9, #24]
	cmp	w8, w9
	b.lo	LBB0_26
; %bb.13:
	ldr	x8, [x19, #24]
	ldr	w9, [x8, #20]
	cmp	w9, #8
	b.eq	LBB0_32
; %bb.14:
	cmp	w9, #16
	b.ne	LBB0_38
; %bb.15:
	ldr	w8, [x8, #16]
	cmp	w8, #2
	b.eq	LBB0_35
; %bb.16:
	cmp	w8, #1
	b.eq	LBB0_34
	b	LBB0_38
LBB0_17:
Lloh11:
	adrp	x8, _ACMERR_NOTPOSSIBLE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ACMERR_NOTPOSSIBLE@GOTPAGEOFF]
	b	LBB0_27
LBB0_18:
Lloh13:
	adrp	x8, _MMSYSERR_NOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MMSYSERR_NOMEM@GOTPAGEOFF]
	b	LBB0_27
LBB0_19:
	cmp	x21, x9
	b.ne	LBB0_26
; %bb.20:
	ldr	x9, [x19, #24]
	ldr	x21, [x9]
	cmp	x21, x11
	b.ne	LBB0_26
; %bb.21:
	ldr	x10, [x8, #8]
	ldr	x11, [x9, #8]
	cmp	x10, x11
	b.ne	LBB0_26
; %bb.22:
	ldr	w10, [x8, #16]
	ldr	w9, [x9, #16]
	cmp	w10, w9
	b.ne	LBB0_26
; %bb.23:
	ldr	w8, [x8, #20]
	cmp	w8, #16
	b.ne	LBB0_26
; %bb.24:
Lloh15:
	adrp	x0, l_.str@PAGE
Lloh16:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_TRACE
	sub	w8, w21, #1
	tst	w8, #0x3
	b.ne	LBB0_26
; %bb.25:
	lsr	w8, w8, #1
	add	w8, w8, #4
	ldr	x9, [x19, #24]
	ldr	w10, [x9, #16]
	mul	w8, w10, w8
	ldr	w9, [x9, #24]
	cmp	w8, w9
	b.hs	LBB0_28
LBB0_26:
	bl	_GetProcessHeap
	mov	w1, #0
	mov	x2, x20
	bl	_HeapFree
	str	xzr, [x19, #8]
Lloh17:
	adrp	x8, _MMSYSERR_NOTSUPPORTED@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MMSYSERR_NOTSUPPORTED@GOTPAGEOFF]
LBB0_27:
	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
	ret
LBB0_28:
	ldr	x8, [x19, #16]
	ldr	w9, [x8, #20]
	cmp	w9, #16
	b.ne	LBB0_38
; %bb.29:
	ldr	w8, [x8, #16]
	cmp	w8, #2
	b.eq	LBB0_36
; %bb.30:
	cmp	w8, #1
	b.ne	LBB0_38
; %bb.31:
Lloh19:
	adrp	x8, _cvtMM16imaK@GOTPAGE
Lloh20:
	ldr	x8, [x8, _cvtMM16imaK@GOTPAGEOFF]
	b	LBB0_37
LBB0_32:
	ldr	w8, [x8, #16]
	cmp	w8, #1
	b.eq	LBB0_34
; %bb.33:
	cmp	w8, #2
	b.eq	LBB0_26
	b	LBB0_38
LBB0_34:
Lloh21:
	adrp	x8, _cvtMMimaK@GOTPAGE
Lloh22:
	ldr	x8, [x8, _cvtMMimaK@GOTPAGEOFF]
	b	LBB0_37
LBB0_35:
Lloh23:
	adrp	x8, _cvtSSima16K@GOTPAGE
Lloh24:
	ldr	x8, [x8, _cvtSSima16K@GOTPAGEOFF]
	b	LBB0_37
LBB0_36:
Lloh25:
	adrp	x8, _cvtSS16imaK@GOTPAGE
Lloh26:
	ldr	x8, [x8, _cvtSS16imaK@GOTPAGEOFF]
LBB0_37:
	ldr	x8, [x8]
	str	x8, [x20]
LBB0_38:
	mov	x0, x19
	mov	x1, x20
	bl	_ADPCM_Reset
Lloh27:
	adrp	x8, _MMSYSERR_NOERROR@GOTPAGE
Lloh28:
	ldr	x8, [x8, _MMSYSERR_NOERROR@GOTPAGEOFF]
	b	LBB0_27
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_ACM_STREAMOPENF_ASYNC,4,2      ; @ACM_STREAMOPENF_ASYNC
	.comm	_ACMERR_NOTPOSSIBLE,4,2         ; @ACMERR_NOTPOSSIBLE
	.comm	_MMSYSERR_NOMEM,4,2             ; @MMSYSERR_NOMEM
	.comm	_WAVE_FORMAT_PCM,8,3            ; @WAVE_FORMAT_PCM
	.comm	_WAVE_FORMAT_IMA_ADPCM,8,3      ; @WAVE_FORMAT_IMA_ADPCM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"spb=%u\n"

	.comm	_cvtSSima16K,8,3                ; @cvtSSima16K
	.comm	_cvtMMimaK,8,3                  ; @cvtMMimaK
	.comm	_cvtSS16imaK,8,3                ; @cvtSS16imaK
	.comm	_cvtMM16imaK,8,3                ; @cvtMM16imaK
	.comm	_MMSYSERR_NOERROR,4,2           ; @MMSYSERR_NOERROR
	.comm	_MMSYSERR_NOTSUPPORTED,4,2      ; @MMSYSERR_NOTSUPPORTED
	.no_dead_strip	_ADPCM_StreamOpen
.subsections_via_symbols
