	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_S_AdpcmEncodeSound             ## -- Begin function S_AdpcmEncodeSound
	.p2align	4, 0x90
_S_AdpcmEncodeSound:                    ## @S_AdpcmEncodeSound
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movl	(%rdi), %r15d
	movq	$0, -56(%rbp)
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movzwl	(%rsi), %eax
	movw	%ax, -64(%rbp)
	testl	%r15d, %r15d
	je	LBB0_7
## %bb.1:
	addq	$8, -48(%rbp)                   ## 8-byte Folded Spill
	xorl	%r14d, %r14d
	xorl	%r12d, %r12d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, (%rax)
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %rax
	movq	%rax, 16(%r13)
	movzwl	-64(%rbp), %eax
	movw	%ax, 8(%r13)
	movq	(%r13), %rsi
	movslq	%r14d, %r14
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r14,2), %rdi
	movl	%ebx, %edx
	leaq	-64(%rbp), %rcx
	callq	_S_AdpcmEncode
	addl	%ebx, %r14d
	movq	%r13, %r12
	subl	%ebx, %r15d
	je	LBB0_7
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_SND_CHUNK_SIZE_BYTE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	addl	%ebx, %ebx
	cmpl	%ebx, %r15d
	cmovll	%r15d, %ebx
	xorl	%eax, %eax
	callq	_SND_malloc
	movq	%rax, %r13
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, (%rax)
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	testq	%r12, %r12
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	addq	$24, %r12
	movq	%r12, %rax
	jmp	LBB0_5
LBB0_7:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SND_CHUNK_SIZE_BYTE,4,2        ## @SND_CHUNK_SIZE_BYTE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_S_AdpcmEncodeSound             ; -- Begin function S_AdpcmEncodeSound
	.p2align	2
_S_AdpcmEncodeSound:                    ; @S_AdpcmEncodeSound
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	ldr	w22, [x0]
	str	xzr, [sp, #8]
	ldrh	w8, [x1]
	strh	w8, [sp]
	cbz	w22, LBB0_7
; %bb.1:
	mov	x19, x1
	mov	w23, #0
	mov	x26, #0
	add	x24, x0, #8
Lloh0:
	adrp	x25, _SND_CHUNK_SIZE_BYTE@GOTPAGE
Lloh1:
	ldr	x25, [x25, _SND_CHUNK_SIZE_BYTE@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	str	x21, [x8]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [sp, #8]
	str	x8, [x21, #16]
	ldrh	w8, [sp]
	strh	w8, [x21, #8]
	ldr	x1, [x21]
	add	x0, x19, w23, sxtw #1
	mov	x3, sp
	mov	x2, x20
	bl	_S_AdpcmEncode
	add	w23, w20, w23
	mov	x26, x21
	subs	w22, w22, w20
	b.eq	LBB0_7
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x25]
	lsl	w8, w8, #1
	cmp	w22, w8
	csel	w20, w22, w8, lt
	bl	_SND_malloc
	mov	x21, x0
	ldr	x9, [x24]
	mov	x8, x24
	cbz	x9, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	cbz	x26, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x8, x26, #24
	b	LBB0_2
LBB0_7:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_SND_CHUNK_SIZE_BYTE,4,2        ; @SND_CHUNK_SIZE_BYTE
.subsections_via_symbols
