	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_reorganize_buffers             ## -- Begin function reorganize_buffers
	.p2align	4, 0x90
_reorganize_buffers:                    ## @reorganize_buffers
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	_audio_devs@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%edi, %r14
	movq	(%rax,%r14,8), %r13
	movq	8(%r13), %rax
	movl	%r14d, %edi
	xorl	%esi, %esi
	callq	*(%rax)
	movl	%eax, %r12d
	movq	8(%r13), %rax
	movl	%r14d, %edi
	xorl	%esi, %esi
	callq	*8(%rax)
	movl	%eax, %ebx
	movq	8(%r13), %rax
	movl	%r14d, %edi
	xorl	%esi, %esi
	callq	*16(%rax)
	movl	%eax, %edi
	cmpl	$8, %eax
	jne	LBB0_1
## %bb.2:
	movq	_NEUTRAL8@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_NEUTRAL16@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %esi
	movl	%esi, 48(%r15)
	testl	%r12d, %r12d
	sete	%al
	testl	%ebx, %ebx
	sete	%cl
	orb	%al, %cl
	testl	%edi, %edi
	sete	%al
	orb	%cl, %al
	je	LBB0_4
## %bb.5:
	movq	_DSP_DEFAULT_SPEED@GOTPCREL(%rip), %rax
	movl	$8, %edi
	movl	(%rax), %ebx
	jmp	LBB0_6
LBB0_4:
	imull	%r12d, %ebx
LBB0_6:
	imull	%ebx, %edi
	shrl	$3, %edi
	movl	%edi, (%r15)
	cmpq	$0, 64(%r15)
	je	LBB0_18
## %bb.7:
	movq	$0, 64(%r15)
	movl	4(%r15), %eax
	movl	8(%r15), %r8d
	testl	%eax, %eax
	je	LBB0_8
## %bb.13:
	movl	%r8d, %edx
	shrl	%edx
	cmpl	%edx, %eax
	cmovbl	%eax, %edx
	jmp	LBB0_14
LBB0_8:
	movl	%r8d, %ecx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ecx, %eax
	shrl	%ecx
	cmpl	%edi, %eax
	ja	LBB0_9
## %bb.10:
	cmpl	%r8d, %eax
	sete	%cl
	shrl	%cl, %eax
	movl	12(%r15), %ecx
	testl	%ecx, %ecx
	jne	LBB0_12
## %bb.11:
	xorl	%ecx, %ecx
	cmpl	$16388, %eax                    ## imm = 0x4004
	setae	%cl
	leal	4(,%rcx,4), %edx
	orb	$2, %cl
	movl	%eax, %ebx
                                        ## kill: def $cl killed $cl killed $rcx
	shrl	%cl, %ebx
	cmpl	$4096, %ebx                     ## imm = 0x1000
	movl	$1, %ecx
	cmovael	%edx, %ecx
	movl	%ecx, 12(%r15)
LBB0_12:
	xorl	%edx, %edx
	divl	%ecx
	cmpl	$17, %eax
	movl	$16, %edx
	cmovael	%eax, %edx
LBB0_14:
	movq	_audio_devs@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%r14,8), %rbx
	movl	(%rbx), %ecx
	movl	$1, %eax
	shll	%cl, %eax
	cmpl	%eax, %edx
	cmoval	%edx, %eax
	movl	4(%rbx), %r9d
	testl	%ecx, %ecx
	cmovel	%edx, %eax
	movl	$1, %ebx
	movl	%r9d, %ecx
	shll	%cl, %ebx
	cmpl	%ebx, %eax
	cmovbl	%eax, %ebx
	testl	%r9d, %r9d
	cmovel	%eax, %ebx
	andl	$-8, %ebx
	movl	%r8d, %eax
	xorl	%edx, %edx
	divl	%ebx
	movq	_MAX_SUB_BUFFERS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	cmpl	%edx, %eax
	cmovbl	%eax, %edx
	movl	16(%r15), %eax
	cmpl	%eax, %edx
	cmovael	%eax, %edx
	cmpl	$2, %edx
	setb	%cl
	movl	$2, %eax
	cmoval	%edx, %eax
	shrl	%cl, %ebx
	movl	%eax, 20(%r15)
	movl	%ebx, %edx
	imull	%eax, %edx
	movl	%edx, 24(%r15)
	movl	%ebx, 4(%r15)
	imull	$3600, %edi, %ecx               ## imm = 0xE10
	addl	%edx, %ecx
	movl	%ecx, 28(%r15)
	movq	56(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_16
## %bb.15:
	callq	_memset
	movl	20(%r15), %eax
	testl	%eax, %eax
	je	LBB0_17
LBB0_16:
	movq	40(%r15), %rdi
	movl	%eax, %esi
	shlq	$3, %rsi
	callq	___bzero
LBB0_17:
	movq	_DMA_ALLOC_DONE@GOTPCREL(%rip), %rax
	movq	_DMA_EMPTY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	orl	%ecx, 32(%r15)
LBB0_18:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_audio_devs,8,3                 ## @audio_devs
	.comm	_NEUTRAL8,4,2                   ## @NEUTRAL8
	.comm	_NEUTRAL16,4,2                  ## @NEUTRAL16
	.comm	_DSP_DEFAULT_SPEED,4,2          ## @DSP_DEFAULT_SPEED
	.comm	_MAX_SUB_BUFFERS,4,2            ## @MAX_SUB_BUFFERS
	.comm	_DMA_ALLOC_DONE,4,2             ## @DMA_ALLOC_DONE
	.comm	_DMA_EMPTY,4,2                  ## @DMA_EMPTY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_reorganize_buffers             ; -- Begin function reorganize_buffers
	.p2align	2
_reorganize_buffers:                    ; @reorganize_buffers
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x23, _audio_devs@GOTPAGE
Lloh1:
	ldr	x23, [x23, _audio_devs@GOTPAGEOFF]
	ldr	x8, [x23]
	ldr	x24, [x8, w0, sxtw #3]
	ldr	x8, [x24, #8]
	ldr	x8, [x8]
	mov	w1, #0
	blr	x8
	mov	x21, x0
	ldr	x8, [x24, #8]
	ldr	x8, [x8, #8]
	mov	x0, x20
	mov	w1, #0
	blr	x8
	mov	x22, x0
	ldr	x8, [x24, #8]
	ldr	x8, [x8, #16]
	mov	x0, x20
	mov	w1, #0
	blr	x8
Lloh2:
	adrp	x8, _NEUTRAL8@GOTPAGE
Lloh3:
	ldr	x8, [x8, _NEUTRAL8@GOTPAGEOFF]
Lloh4:
	adrp	x9, _NEUTRAL16@GOTPAGE
Lloh5:
	ldr	x9, [x9, _NEUTRAL16@GOTPAGEOFF]
	cmp	w0, #8
	csel	x8, x8, x9, eq
	ldr	w1, [x8]
	str	w1, [x19, #48]
	cmp	w21, #0
	ccmp	w22, #0, #4, ne
	ccmp	w0, #0, #4, ne
Lloh6:
	adrp	x8, _DSP_DEFAULT_SPEED@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DSP_DEFAULT_SPEED@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	mov	w9, #8
	csel	w9, w9, w0, eq
	mul	w10, w22, w21
	csel	w8, w8, w10, eq
	mul	w8, w8, w9
	lsr	w8, w8, #3
	str	w8, [x19]
	ldr	x9, [x19, #64]
	cbz	x9, LBB0_12
; %bb.1:
	sxtw	x10, w20
	str	xzr, [x19, #64]
	ldp	w11, w9, [x19, #4]
	cbz	w11, LBB0_3
; %bb.2:
	lsr	w12, w9, #1
	cmp	w11, w12
	csel	w11, w11, w12, lo
	b	LBB0_8
LBB0_3:
	mov	x12, x9
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x11, x12
	lsr	w12, w12, #1
	cmp	w11, w8
	b.hi	LBB0_4
; %bb.5:
	cmp	w11, w9
	cset	w12, eq
	lsr	w11, w11, w12
	ldr	w12, [x19, #12]
	cbnz	w12, LBB0_7
; %bb.6:
	mov	w12, #16387
	mov	w13, #4
	mov	w14, #8
	cmp	w11, w12
	csel	w12, w14, w13, hi
	mov	w13, #2
	cinc	w13, w13, hi
	lsr	w13, w11, w13
	cmp	w13, #1, lsl #12                ; =4096
	csinc	w12, w12, wzr, hs
	str	w12, [x19, #12]
LBB0_7:
	udiv	w11, w11, w12
	mov	w12, #16
	cmp	w11, #16
	csel	w11, w11, w12, hi
LBB0_8:
	ldr	x12, [x23]
	ldr	x10, [x12, x10, lsl #3]
	mov	w12, #1
	ldp	w13, w10, [x10]
	lsl	w14, w12, w13
	cmp	w11, w14
	csel	w14, w11, w14, hi
	cmp	w13, #0
	csel	w11, w11, w14, eq
	lsl	w12, w12, w10
	cmp	w11, w12
	csel	w12, w11, w12, lo
	cmp	w10, #0
	csel	w10, w11, w12, eq
	and	w10, w10, #0xfffffff8
	udiv	w9, w9, w10
Lloh9:
	adrp	x11, _MAX_SUB_BUFFERS@GOTPAGE
Lloh10:
	ldr	x11, [x11, _MAX_SUB_BUFFERS@GOTPAGEOFF]
Lloh11:
	ldr	w11, [x11]
	cmp	w9, w11
	csel	w9, w9, w11, lo
	ldr	w11, [x19, #16]
	cmp	w9, w11
	csel	w9, w9, w11, lo
	mov	w11, #2
	cmp	w9, #2
	csel	w9, w9, w11, hi
	cset	w11, lo
	lsr	w10, w10, w11
	mul	w2, w10, w9
	stp	w9, w2, [x19, #20]
	str	w10, [x19, #4]
	mov	w10, #3600
	madd	w8, w8, w10, w2
	str	w8, [x19, #28]
	ldr	x0, [x19, #56]
	cbz	x0, LBB0_10
; %bb.9:
	bl	_memset
	ldr	w9, [x19, #20]
	cbz	w9, LBB0_11
LBB0_10:
	ldr	x0, [x19, #40]
	mov	w8, w9
	lsl	x1, x8, #3
	bl	_bzero
LBB0_11:
Lloh12:
	adrp	x8, _DMA_ALLOC_DONE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DMA_ALLOC_DONE@GOTPAGEOFF]
Lloh14:
	adrp	x9, _DMA_EMPTY@GOTPAGE
Lloh15:
	ldr	x9, [x9, _DMA_EMPTY@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x19, #32]
	orr	w8, w8, w9
	str	w8, [x19, #32]
LBB0_12:
	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
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_audio_devs,8,3                 ; @audio_devs
	.comm	_NEUTRAL8,4,2                   ; @NEUTRAL8
	.comm	_NEUTRAL16,4,2                  ; @NEUTRAL16
	.comm	_DSP_DEFAULT_SPEED,4,2          ; @DSP_DEFAULT_SPEED
	.comm	_MAX_SUB_BUFFERS,4,2            ; @MAX_SUB_BUFFERS
	.comm	_DMA_ALLOC_DONE,4,2             ; @DMA_ALLOC_DONE
	.comm	_DMA_EMPTY,4,2                  ; @DMA_EMPTY
.subsections_via_symbols
