	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sq_setup
_sq_setup:                              ## @sq_setup
	.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
	cmpl	$0, (%rdi)
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_9
LBB0_2:
	movq	%rdi, %rbx
	movl	$1, (%rdi)
	movq	_dmasound@GOTPCREL(%rip), %r14
	xorl	%eax, %eax
	callq	*8(%r14)
	movq	8(%rbx), %rcx
	testq	%rcx, %rcx
	jle	LBB0_3
## %bb.4:
	movl	20(%r14), %esi
	movl	32(%r14), %edi
	incl	%esi
	imull	16(%r14), %esi
	movl	48(%rbx), %eax
	imull	%esi, %eax
	incl	%edi
	imull	28(%r14), %edi
	cltd
	idivl	%edi
	imull	24(%r14), %eax
	cltd
	idivl	36(%r14)
                                        ## kill: def $eax killed $eax def $rax
	leal	7(%rsi), %edx
	testl	%esi, %esi
	cmovnsl	%esi, %edx
	sarl	$3, %edx
	addl	%edx, %eax
	decl	%eax
	negl	%edx
	andl	%eax, %edx
	movl	44(%rbx), %eax
	cmpl	%eax, %edx
	movl	%edx, %esi
	cmovgl	%eax, %esi
	testl	%edx, %edx
	cmovlel	%eax, %esi
	movl	%esi, 40(%rbx)
	movq	24(%rbx), %rax
	cmpq	%rax, %rcx
	jle	LBB0_5
## %bb.6:
	movq	%rax, 32(%rbx)
	movq	%rax, 16(%rbx)
	jmp	LBB0_7
LBB0_3:
	movq	24(%rbx), %rcx
	movq	%rcx, 16(%rbx)
	movq	%rcx, 32(%rbx)
	movl	44(%rbx), %eax
	movl	%eax, 40(%rbx)
	movq	%rcx, 8(%rbx)
	movl	20(%r14), %ecx
	movl	32(%r14), %edx
	imull	28(%r14), %eax
	incl	%edx
	incl	%ecx
	imull	16(%r14), %ecx
	imull	%edx, %eax
	cltd
	idivl	%ecx
	movl	%eax, 48(%rbx)
	jmp	LBB0_7
LBB0_5:
	movq	%rcx, 16(%rbx)
	movq	32(%rbx), %rax
	cmpq	%rcx, %rax
	cmovlq	%rax, %rcx
	movq	%rcx, 32(%rbx)
LBB0_7:
	xorl	%eax, %eax
	xorps	%xmm0, %xmm0
	movups	%xmm0, 72(%rbx)
	movups	%xmm0, 56(%rbx)
	movq	$0, 88(%rbx)
	cmpq	_write_sq@GOTPCREL(%rip), %rbx
	je	LBB0_8
LBB0_9:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_8:
	movq	_write_sq@GOTPCREL(%rip), %rcx
	movl	$-1, 52(%rcx)
	movq	(%r14), %rcx
	testq	%rcx, %rcx
	je	LBB0_9
## %bb.10:
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmpq	*%rcx                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_dmasound,40,3                  ## @dmasound
	.comm	_write_sq,96,3                  ## @write_sq
	.no_dead_strip	_sq_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sq_setup
_sq_setup:                              ; @sq_setup
	.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]
	cbz	w8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_2:
	mov	x19, x0
	mov	w8, #1
	str	w8, [x0]
Lloh3:
	adrp	x20, _dmasound@GOTPAGE
Lloh4:
	ldr	x20, [x20, _dmasound@GOTPAGEOFF]
	ldr	x8, [x20, #8]
	blr	x8
	ldr	x8, [x19, #8]
	cmp	x8, #0
	b.le	LBB0_5
; %bb.3:
	ldp	w9, w10, [x20, #16]
	madd	w9, w9, w10, w9
	ldp	w11, w10, [x20, #24]
	ldp	w12, w13, [x20, #32]
	madd	w10, w10, w12, w10
	ldp	w14, w12, [x19, #44]
	mul	w12, w9, w12
	sdiv	w10, w12, w10
	mul	w10, w11, w10
	sdiv	w10, w10, w13
	add	w11, w9, #7
	cmp	w9, #0
	csel	w9, w11, w9, lt
	asr	w9, w9, #3
	add	w10, w9, w10
	sub	w10, w10, #1
	neg	w9, w9
	and	w9, w10, w9
	cmp	w9, w14
	ccmp	w9, #1, #8, le
	csel	w9, w14, w9, lt
	str	w9, [x19, #40]
	ldr	x9, [x19, #24]
	cmp	x8, x9
	b.le	LBB0_6
; %bb.4:
	str	x9, [x19, #32]
	str	x9, [x19, #16]
	b	LBB0_7
LBB0_5:
	ldr	x8, [x19, #24]
	str	x8, [x19, #32]
	ldr	w9, [x19, #44]
	str	w9, [x19, #40]
	stp	x8, x8, [x19, #8]
	ldp	w8, w10, [x20, #28]
	mul	w8, w8, w9
	madd	w8, w8, w10, w8
	ldp	w9, w10, [x20, #16]
	madd	w9, w9, w10, w9
	sdiv	w8, w8, w9
	str	w8, [x19, #48]
	b	LBB0_7
LBB0_6:
	str	x8, [x19, #16]
	ldr	x9, [x19, #32]
	cmp	x9, x8
	csel	x8, x9, x8, lt
	str	x8, [x19, #32]
LBB0_7:
Lloh5:
	adrp	x8, _write_sq@GOTPAGE
Lloh6:
	ldr	x8, [x8, _write_sq@GOTPAGEOFF]
	str	xzr, [x19, #88]
	movi.2d	v0, #0000000000000000
	stur	q0, [x19, #72]
	stur	q0, [x19, #56]
	cmp	x19, x8
	b.eq	LBB0_10
; %bb.8:
	mov	w0, #0
LBB0_9:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_10:
	mov	w9, #-1
	str	w9, [x8, #52]
	ldr	x0, [x20]
	cbz	x0, LBB0_9
; %bb.11:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	br	x0
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_dmasound,40,3                  ; @dmasound
	.comm	_write_sq,96,3                  ; @write_sq
	.no_dead_strip	_sq_setup
.subsections_via_symbols
