	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function w9966_calcscale
_w9966_calcscale:                       ## @w9966_calcscale
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -56(%rbp)                  ## 8-byte Spill
	movq	%r8, %rbx
	movl	%edx, %r15d
	movl	%esi, %r12d
	movl	%edi, %r13d
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	subl	%esi, %r15d
	movl	(%r8), %r14d
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	subl	(%rcx), %r14d
	incl	%r14d
	movl	%r14d, %edi
	movl	%r13d, %esi
	movl	%r15d, %edx
	callq	_w9966_findlen
	movl	%eax, %ecx
	movl	$-1, %eax
	cmpl	%r15d, %ecx
	jg	LBB0_7
## %bb.1:
	cmpl	%r13d, %ecx
	jl	LBB0_7
## %bb.2:
	movl	%ecx, %esi
	subl	%r14d, %esi
	shll	$6, %r13d
	movl	%r13d, %eax
	cltd
	idivl	%ecx
	movl	%eax, %ecx
	movl	%ecx, %edx
	orb	$-128, %dl
	xorl	%eax, %eax
	cmpb	$64, %cl
	movzbl	%dl, %ecx
	cmovel	%eax, %ecx
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movb	%cl, (%rdx)
	movl	%esi, %ecx
	shrl	$31, %ecx
	addl	%esi, %ecx
	sarl	%ecx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	subl	%ecx, (%rdi)
	subl	%ecx, %esi
	addl	(%rbx), %esi
	movl	%esi, (%rbx)
	movl	(%rdi), %ecx
	cmpl	%r12d, %ecx
	jge	LBB0_3
## %bb.4:
	addl	%r12d, %esi
	subl	%ecx, %esi
	movl	%esi, (%rbx)
	movl	%r12d, (%rdi)
	movl	(%rbx), %esi
	jmp	LBB0_5
LBB0_3:
	movl	%ecx, %r12d
LBB0_5:
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	cmpl	%edx, %esi
	jle	LBB0_7
## %bb.6:
	movl	%edx, %ecx
	subl	%esi, %ecx
	addl	%r12d, %ecx
	movl	%ecx, (%rdi)
	movl	%edx, (%rbx)
LBB0_7:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_w9966_calcscale
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function w9966_calcscale
_w9966_calcscale:                       ; @w9966_calcscale
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x23, x5
	mov	x19, x4
	mov	x21, x3
	mov	x20, x2
	mov	x22, x1
	mov	x25, x0
	sub	w26, w2, w1
	ldr	w8, [x4]
	ldr	w9, [x3]
	sub	w8, w8, w9
	add	w24, w8, #1
	mov	x0, x24
	mov	x1, x25
	mov	x2, x26
	bl	_w9966_findlen
	cmp	w0, w26
	ccmp	w0, w25, #8, le
	b.ge	LBB0_2
; %bb.1:
	mov	w0, #-1
	b	LBB0_7
LBB0_2:
	lsl	w8, w25, #6
	sdiv	w8, w8, w0
	and	w9, w8, #0xff
	orr	w8, w8, #0x80
	cmp	w9, #64
	csel	w8, wzr, w8, eq
	strb	w8, [x23]
	sub	w8, w0, w24
	cmp	w8, #0
	cinc	w9, w8, lt
	asr	w9, w9, #1
	ldr	w10, [x21]
	sub	w10, w10, w9
	str	w10, [x21]
	sub	w8, w8, w9
	ldr	w9, [x19]
	add	w8, w9, w8
	str	w8, [x19]
	ldr	w9, [x21]
	cmp	w9, w22
	b.ge	LBB0_5
; %bb.3:
	add	w8, w8, w22
	sub	w8, w8, w9
	str	w8, [x19]
	str	w22, [x21]
	ldr	w8, [x19]
	cmp	w8, w20
	b.gt	LBB0_6
LBB0_4:
	mov	w0, #0
	b	LBB0_7
LBB0_5:
	mov	x22, x9
	cmp	w8, w20
	b.le	LBB0_4
LBB0_6:
	mov	w0, #0
	sub	w8, w20, w8
	add	w8, w8, w22
	str	w8, [x21]
	str	w20, [x19]
LBB0_7:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_w9966_calcscale
.subsections_via_symbols
