	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ADPCM_FormatSuggest
_ADPCM_FormatSuggest:                   ## @ADPCM_FormatSuggest
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_ACMERR_NOTPOSSIBLE@GOTPCREL(%rip), %r14
	cmpl	$4, (%rdi)
	jb	LBB0_22
## %bb.1:
	movq	%rdi, %rbx
	cmpl	$4, 4(%rdi)
	jb	LBB0_22
## %bb.2:
	movq	16(%rbx), %rax
	movq	24(%rbx), %rdi
	movq	(%rdi), %rcx
	cmpq	(%rax), %rcx
	je	LBB0_22
## %bb.3:
	callq	_ADPCM_GetFormatIndex
	cmpl	$-1, %eax
	je	LBB0_22
## %bb.4:
	movl	8(%rbx), %eax
	movq	_ACM_FORMATSUGGESTF_NCHANNELS@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_6
## %bb.5:
	movq	16(%rbx), %rcx
	movq	24(%rbx), %rdx
	movl	8(%rdx), %edx
	movl	%edx, 8(%rcx)
LBB0_6:
	movq	_ACM_FORMATSUGGESTF_NSAMPLESPERSEC@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_8
## %bb.7:
	movq	16(%rbx), %rcx
	movq	24(%rbx), %rdx
	movl	12(%rdx), %edx
	movl	%edx, 12(%rcx)
LBB0_8:
	movq	_ACM_FORMATSUGGESTF_WBITSPERSAMPLE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_10
## %bb.9:
	movq	16(%rbx), %rcx
	movq	24(%rbx), %rdx
	cmpq	$128, (%rdx)
	movl	$4, %edx
	movl	$16, %esi
	cmovel	%edx, %esi
	movl	%esi, 16(%rcx)
LBB0_10:
	movq	_ACM_FORMATSUGGESTF_WFORMATTAG@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_11
## %bb.15:
	movq	16(%rbx), %rdi
	movq	(%rdi), %rax
	cmpq	$129, %rax
	je	LBB0_13
## %bb.16:
	cmpq	$128, %rax
	je	LBB0_18
	jmp	LBB0_22
LBB0_11:
	movq	16(%rbx), %rdi
	movq	24(%rbx), %rax
	cmpq	$128, (%rax)
	jne	LBB0_17
## %bb.12:
	movq	$129, (%rdi)
LBB0_13:
	cmpl	$4, 4(%rbx)
	jb	LBB0_22
## %bb.14:
	callq	_init_wfx_ima_adpcm
	movq	16(%rbx), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	callq	_TRACE
	movq	16(%rbx), %rdi
	jmp	LBB0_20
LBB0_17:
	movq	$128, (%rdi)
LBB0_18:
	cmpl	$4, (%rbx)
	jb	LBB0_22
## %bb.19:
	movl	16(%rdi), %eax
	imull	8(%rdi), %eax
	leal	7(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$3, %ecx
	movl	%ecx, 20(%rdi)
	imull	12(%rdi), %ecx
	movl	%ecx, 24(%rdi)
LBB0_20:
	callq	_ADPCM_GetFormatIndex
	cmpl	$-1, %eax
	je	LBB0_22
## %bb.21:
	movq	_MMSYSERR_NOERROR@GOTPCREL(%rip), %r14
LBB0_22:
	movl	(%r14), %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ACMERR_NOTPOSSIBLE,4,2         ## @ACMERR_NOTPOSSIBLE
	.comm	_ACM_FORMATSUGGESTF_NCHANNELS,4,2 ## @ACM_FORMATSUGGESTF_NCHANNELS
	.comm	_ACM_FORMATSUGGESTF_NSAMPLESPERSEC,4,2 ## @ACM_FORMATSUGGESTF_NSAMPLESPERSEC
	.comm	_ACM_FORMATSUGGESTF_WBITSPERSAMPLE,4,2 ## @ACM_FORMATSUGGESTF_WBITSPERSAMPLE
	.comm	_ACM_FORMATSUGGESTF_WFORMATTAG,4,2 ## @ACM_FORMATSUGGESTF_WFORMATTAG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"setting spb=%u\n"

	.comm	_MMSYSERR_NOERROR,4,2           ## @MMSYSERR_NOERROR
	.no_dead_strip	_ADPCM_FormatSuggest
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ADPCM_FormatSuggest
_ADPCM_FormatSuggest:                   ; @ADPCM_FormatSuggest
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	w8, [x0]
	cmp	w8, #4
	b.lo	LBB0_22
; %bb.1:
	mov	x19, x0
	ldr	w8, [x0, #4]
	cmp	w8, #4
	b.lo	LBB0_22
; %bb.2:
	ldp	x8, x0, [x19, #16]
	ldr	x9, [x0]
	ldr	x8, [x8]
	cmp	x9, x8
	b.eq	LBB0_22
; %bb.3:
	bl	_ADPCM_GetFormatIndex
	cmn	w0, #1
	b.eq	LBB0_22
; %bb.4:
	ldr	w8, [x19, #8]
Lloh0:
	adrp	x9, _ACM_FORMATSUGGESTF_NCHANNELS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ACM_FORMATSUGGESTF_NCHANNELS@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_6
; %bb.5:
	ldp	x10, x9, [x19, #16]
	ldr	w9, [x9, #8]
	str	w9, [x10, #8]
LBB0_6:
Lloh3:
	adrp	x9, _ACM_FORMATSUGGESTF_NSAMPLESPERSEC@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ACM_FORMATSUGGESTF_NSAMPLESPERSEC@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_8
; %bb.7:
	ldp	x10, x9, [x19, #16]
	ldr	w9, [x9, #12]
	str	w9, [x10, #12]
LBB0_8:
Lloh6:
	adrp	x9, _ACM_FORMATSUGGESTF_WBITSPERSAMPLE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _ACM_FORMATSUGGESTF_WBITSPERSAMPLE@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_10
; %bb.9:
	ldp	x10, x9, [x19, #16]
	ldr	x9, [x9]
	cmp	x9, #128
	mov	w9, #16
	mov	w11, #4
	csel	w9, w11, w9, eq
	str	w9, [x10, #16]
LBB0_10:
Lloh9:
	adrp	x9, _ACM_FORMATSUGGESTF_WFORMATTAG@GOTPAGE
Lloh10:
	ldr	x9, [x9, _ACM_FORMATSUGGESTF_WFORMATTAG@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_13
; %bb.11:
	ldr	x0, [x19, #16]
	ldr	x8, [x0]
	cmp	x8, #129
	b.eq	LBB0_15
; %bb.12:
	cmp	x8, #128
	b.eq	LBB0_18
	b	LBB0_22
LBB0_13:
	ldp	x0, x8, [x19, #16]
	ldr	x8, [x8]
	cmp	x8, #128
	b.ne	LBB0_17
; %bb.14:
	mov	w8, #129
	str	x8, [x0]
LBB0_15:
	ldr	w8, [x19, #4]
	cmp	w8, #4
	b.lo	LBB0_22
; %bb.16:
	bl	_init_wfx_ima_adpcm
	ldr	x8, [x19, #16]
	ldr	w1, [x8]
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	ldr	x0, [x19, #16]
	b	LBB0_20
LBB0_17:
	mov	w8, #128
	str	x8, [x0]
LBB0_18:
	ldr	w8, [x19]
	cmp	w8, #4
	b.lo	LBB0_22
; %bb.19:
	ldp	w10, w8, [x0, #12]
	ldr	w9, [x0, #8]
	mul	w8, w8, w9
	add	w9, w8, #7
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #3
	mul	w9, w10, w8
	stp	w8, w9, [x0, #20]
LBB0_20:
	bl	_ADPCM_GetFormatIndex
	cmn	w0, #1
	b.eq	LBB0_22
; %bb.21:
Lloh14:
	adrp	x8, _MMSYSERR_NOERROR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MMSYSERR_NOERROR@GOTPAGEOFF]
	b	LBB0_23
LBB0_22:
Lloh16:
	adrp	x8, _ACMERR_NOTPOSSIBLE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ACMERR_NOTPOSSIBLE@GOTPAGEOFF]
LBB0_23:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_ACMERR_NOTPOSSIBLE,4,2         ; @ACMERR_NOTPOSSIBLE
	.comm	_ACM_FORMATSUGGESTF_NCHANNELS,4,2 ; @ACM_FORMATSUGGESTF_NCHANNELS
	.comm	_ACM_FORMATSUGGESTF_NSAMPLESPERSEC,4,2 ; @ACM_FORMATSUGGESTF_NSAMPLESPERSEC
	.comm	_ACM_FORMATSUGGESTF_WBITSPERSAMPLE,4,2 ; @ACM_FORMATSUGGESTF_WBITSPERSAMPLE
	.comm	_ACM_FORMATSUGGESTF_WFORMATTAG,4,2 ; @ACM_FORMATSUGGESTF_WFORMATTAG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"setting spb=%u\n"

	.comm	_MMSYSERR_NOERROR,4,2           ; @MMSYSERR_NOERROR
	.no_dead_strip	_ADPCM_FormatSuggest
.subsections_via_symbols
