	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_S_AdpcmEncode                  ## -- Begin function S_AdpcmEncode
	.p2align	4, 0x90
_S_AdpcmEncode:                         ## @S_AdpcmEncode
	.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
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rcx), %r9d
	movl	4(%rcx), %eax
	testl	%edx, %edx
	jle	LBB0_10
## %bb.1:
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movslq	%eax, %rbx
	movq	_stepsizeTable@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movl	(%rcx,%rbx,4), %r8d
	movl	$1, %r10d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movl	$0, %edx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	movswl	(%rdi), %r12d
	subl	%r9d, %r12d
	movl	%r12d, %r14d
	shrl	$31, %r14d
	movl	%r12d, %r15d
	negl	%r15d
	cmovsl	%r12d, %r15d
	movl	%r8d, %ebx
	sarl	$3, %ebx
	xorl	%ecx, %ecx
	cmpl	%r8d, %r15d
	setge	%cl
	movl	%r9d, %edi
	movl	%r8d, %r9d
	cmovll	%edx, %r9d
	leal	(,%rcx,4), %r11d
	subl	%r9d, %r15d
	addl	%ebx, %r9d
	movl	%r8d, %ebx
	sarl	%ebx
	cmpl	%ebx, %r15d
	leal	2(,%rcx,4), %r13d
	cmovll	%r11d, %r13d
	cmovll	%edx, %ebx
	subl	%ebx, %r15d
	addl	%r9d, %ebx
	sarl	$2, %r8d
	xorl	%ecx, %ecx
	cmpl	%r8d, %r15d
	setge	%cl
	cmovll	%edx, %r8d
	addl	%ebx, %r8d
	movl	%r8d, %esi
	negl	%esi
	testl	%r12d, %r12d
	cmovnsl	%r8d, %esi
	addl	%edi, %esi
	cmpl	$-32767, %esi                   ## imm = 0x8001
	movl	$-32768, %edi                   ## imm = 0x8000
	cmovll	%edi, %esi
	leal	(%r13,%r14,8), %ebx
	cmpl	$32767, %esi                    ## imm = 0x7FFF
	movl	%esi, %r9d
	movl	$32767, %esi                    ## imm = 0x7FFF
	cmovgel	%esi, %r9d
	orl	%ecx, %ebx
	movq	_indexTable@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	addl	(%rcx,%rbx,8), %eax
	testl	%eax, %eax
	cmovlel	%edx, %eax
	cmpl	$88, %eax
	movl	$88, %ecx
	cmovael	%ecx, %eax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx,%rax,4), %r8d
	testl	%r10d, %r10d
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	shll	$4, %ebx
	movzbl	%bl, %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	orl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movb	%bl, (%rcx)
	incq	%rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	xorl	$1, %r10d
	cmpl	$2, %ecx
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	jl	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	addq	$2, %rdi
	decl	%ecx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movq	_stepsizeTable@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
LBB0_7:
	testl	%r10d, %r10d
	jne	LBB0_9
## %bb.8:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movb	%dl, (%rcx)
LBB0_9:
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
LBB0_10:
	movl	%r9d, (%rcx)
	movl	%eax, 4(%rcx)
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_stepsizeTable,8,3              ## @stepsizeTable
	.comm	_indexTable,8,3                 ## @indexTable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_S_AdpcmEncode                  ; -- Begin function S_AdpcmEncode
	.p2align	2
_S_AdpcmEncode:                         ; @S_AdpcmEncode
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	.cfi_offset w19, -8
	.cfi_offset w20, -16
	.cfi_offset w21, -24
	.cfi_offset w22, -32
	ldp	w8, w9, [x3]
	cmp	w2, #1
	b.lt	LBB0_9
; %bb.1:
	mov	w10, #0
	sxtw	x12, w9
Lloh0:
	adrp	x11, _stepsizeTable@GOTPAGE
Lloh1:
	ldr	x11, [x11, _stepsizeTable@GOTPAGEOFF]
	ldr	x4, [x11]
	ldr	w17, [x4, x12, lsl #2]
	mov	w12, #1
	mov	w13, #-32768
	mov	w14, #32767
Lloh2:
	adrp	x15, _indexTable@GOTPAGE
Lloh3:
	ldr	x15, [x15, _indexTable@GOTPAGEOFF]
	mov	w16, #88
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldrsh	w5, [x0], #2
	subs	w5, w5, w8
	cneg	w6, w5, mi
	cmp	w6, w17
	csel	w7, wzr, w17, lt
	cset	w19, ge
	lsl	w20, w19, #2
	asr	w21, w17, #1
	mov	w22, #2
	bfi	w22, w19, #2, #1
	sub	w6, w6, w7
	cmp	w6, w21
	csel	w19, w20, w22, lt
	csel	w20, wzr, w21, lt
	asr	w21, w17, #2
	sub	w6, w6, w20
	cmp	w6, w21
	cset	w6, ge
	csel	w21, wzr, w21, lt
	cmp	w5, #0
	lsr	w5, w5, #28
	and	w5, w5, #0x8
	add	w17, w7, w17, asr #3
	add	w17, w17, w20
	add	w17, w17, w21
	cneg	w17, w17, lt
	add	w8, w17, w8
	cmn	w8, #8, lsl #12                 ; =32768
	csel	w8, w8, w13, gt
	cmp	w8, w14
	csel	w8, w8, w14, lt
	orr	w17, w19, w5
	orr	w5, w17, w6
	ldr	x17, [x15]
	ldr	x17, [x17, w5, uxtw #3]
	add	w9, w9, w17
	cmp	w9, #0
	csel	w9, w9, wzr, gt
	cmp	w9, #88
	csel	w9, w9, w16, lo
	ldr	w17, [x4, w9, uxtw #2]
	cbz	w12, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	lsl	w10, w5, #4
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_2 Depth=1
	orr	w4, w5, w10
	strb	w4, [x1], #1
LBB0_5:                                 ;   in Loop: Header=BB0_2 Depth=1
	eor	w12, w12, #0x1
	cmp	w2, #2
	b.lt	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	sub	w2, w2, #1
	ldr	x4, [x11]
	b	LBB0_2
LBB0_7:
	cbnz	w12, LBB0_9
; %bb.8:
	strb	w10, [x1]
LBB0_9:
	stp	w8, w9, [x3]
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_stepsizeTable,8,3              ; @stepsizeTable
	.comm	_indexTable,8,3                 ; @indexTable
.subsections_via_symbols
